pbbuttonsd-0.8.1a/0002777000175000017500000000000010652456423011063 500000000000000pbbuttonsd-0.8.1a/intl/0002777000175000017500000000000010652456416012033 500000000000000pbbuttonsd-0.8.1a/intl/Makefile.in0000644000175000017500000004553110641705127014014 00000000000000# Makefile for directory with message catalog handling library of GNU gettext # Copyright (C) 1995-1998, 2000-2006 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library General Public License as published # by the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA. PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = .. # The VPATH variables allows builds with $builddir != $srcdir, assuming a # 'make' program that supports VPATH (such as GNU make). This line is removed # by autoconf automatically when "$(srcdir)" = ".". # In this directory, the VPATH handling is particular: # 1. If INTL_LIBTOOL_SUFFIX_PREFIX is 'l' (indicating a build with libtool), # the .c -> .lo rules carefully use $(srcdir), so that VPATH can be omitted. # 2. If PACKAGE = gettext-tools, VPATH _must_ be omitted, because otherwise # 'make' does the wrong thing if GNU gettext was configured with # "./configure --srcdir=`pwd`", namely it gets confused by the .lo and .la # files it finds in srcdir = ../../gettext-runtime/intl. VPATH = $(srcdir) prefix = @prefix@ exec_prefix = @exec_prefix@ transform = @program_transform_name@ libdir = @libdir@ includedir = @includedir@ datarootdir = @datarootdir@ datadir = @datadir@ localedir = $(datadir)/locale gettextsrcdir = $(datadir)/gettext/intl aliaspath = $(localedir) subdir = intl INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, # @install_sh@ does not start with $(SHELL), so we add it. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. mkinstalldirs = $(SHELL) @install_sh@ -d install_sh = $(SHELL) @install_sh@ MKDIR_P = @MKDIR_P@ mkdir_p = @mkdir_p@ l = @INTL_LIBTOOL_SUFFIX_PREFIX@ AR = ar CC = @CC@ LIBTOOL = @LIBTOOL@ RANLIB = @RANLIB@ YACC = @INTLBISON@ -y -d YFLAGS = --name-prefix=__gettext # -DBUILDING_LIBINTL: Change expansion of LIBINTL_DLL_EXPORTED macro. # -DBUILDING_DLL: Change expansion of RELOCATABLE_DLL_EXPORTED macro. DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \ -DLIBDIR=\"$(libdir)\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL \ -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \ -Dset_relocation_prefix=libintl_set_relocation_prefix \ -Drelocate=libintl_relocate \ -DDEPENDS_ON_LIBICONV=1 @DEFS@ CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ @CFLAG_VISIBILITY@ LDFLAGS = @LDFLAGS@ $(LDFLAGS_@WOE32DLL@) LDFLAGS_yes = -Wl,--export-all-symbols LDFLAGS_no = LIBS = @LIBS@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) HEADERS = \ gmo.h \ gettextP.h \ hash-string.h \ loadinfo.h \ plural-exp.h \ eval-plural.h \ localcharset.h \ lock.h \ relocatable.h \ xsize.h \ printf-args.h printf-args.c \ printf-parse.h wprintf-parse.h printf-parse.c \ vasnprintf.h vasnwprintf.h vasnprintf.c \ os2compat.h \ libgnuintl.h.in SOURCES = \ bindtextdom.c \ dcgettext.c \ dgettext.c \ gettext.c \ finddomain.c \ hash-string.c \ loadmsgcat.c \ localealias.c \ textdomain.c \ l10nflist.c \ explodename.c \ dcigettext.c \ dcngettext.c \ dngettext.c \ ngettext.c \ plural.y \ plural-exp.c \ localcharset.c \ lock.c \ relocatable.c \ langprefs.c \ localename.c \ log.c \ printf.c \ version.c \ osdep.c \ os2compat.c \ intl-exports.c \ intl-compat.c OBJECTS = \ bindtextdom.$lo \ dcgettext.$lo \ dgettext.$lo \ gettext.$lo \ finddomain.$lo \ hash-string.$lo \ loadmsgcat.$lo \ localealias.$lo \ textdomain.$lo \ l10nflist.$lo \ explodename.$lo \ dcigettext.$lo \ dcngettext.$lo \ dngettext.$lo \ ngettext.$lo \ plural.$lo \ plural-exp.$lo \ localcharset.$lo \ lock.$lo \ relocatable.$lo \ langprefs.$lo \ localename.$lo \ log.$lo \ printf.$lo \ version.$lo \ osdep.$lo \ intl-compat.$lo DISTFILES.common = Makefile.in \ config.charset locale.alias ref-add.sin ref-del.sin export.h \ $(HEADERS) $(SOURCES) DISTFILES.generated = plural.c DISTFILES.normal = VERSION DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc README.woe32 DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \ COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h \ libgnuintl.h_vms Makefile.vms libgnuintl.h.msvc-static \ libgnuintl.h.msvc-shared Makefile.msvc all: all-@USE_INCLUDED_LIBINTL@ all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed all-no: all-no-@BUILD_INCLUDED_LIBINTL@ all-no-yes: libgnuintl.$la all-no-no: libintl.a libgnuintl.a: $(OBJECTS) rm -f $@ $(AR) cru $@ $(OBJECTS) $(RANLIB) $@ libintl.la libgnuintl.la: $(OBJECTS) $(LIBTOOL) --mode=link \ $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \ $(OBJECTS) @LTLIBICONV@ @INTL_MACOSX_LIBS@ $(LIBS) @LTLIBTHREAD@ -lc \ -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ -rpath $(libdir) \ -no-undefined # Libtool's library version information for libintl. # Before making a gettext release, the gettext maintainer must change this # according to the libtool documentation, section "Library interface versions". # Maintainers of other packages that include the intl directory must *not* # change these values. LTV_CURRENT=8 LTV_REVISION=1 LTV_AGE=0 .SUFFIXES: .SUFFIXES: .c .y .o .lo .sin .sed .c.o: $(COMPILE) $< .y.c: $(YACC) $(YFLAGS) --output $@ $< rm -f $*.h bindtextdom.lo: $(srcdir)/bindtextdom.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c dcgettext.lo: $(srcdir)/dcgettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c dgettext.lo: $(srcdir)/dgettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c gettext.lo: $(srcdir)/gettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c finddomain.lo: $(srcdir)/finddomain.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c hash-string.lo: $(srcdir)/hash-string.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/hash-string.c loadmsgcat.lo: $(srcdir)/loadmsgcat.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c localealias.lo: $(srcdir)/localealias.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c textdomain.lo: $(srcdir)/textdomain.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c l10nflist.lo: $(srcdir)/l10nflist.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c explodename.lo: $(srcdir)/explodename.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c dcigettext.lo: $(srcdir)/dcigettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c dcngettext.lo: $(srcdir)/dcngettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c dngettext.lo: $(srcdir)/dngettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c ngettext.lo: $(srcdir)/ngettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c plural.lo: $(srcdir)/plural.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c plural-exp.lo: $(srcdir)/plural-exp.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c localcharset.lo: $(srcdir)/localcharset.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c lock.lo: $(srcdir)/lock.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/lock.c relocatable.lo: $(srcdir)/relocatable.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c langprefs.lo: $(srcdir)/langprefs.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/langprefs.c localename.lo: $(srcdir)/localename.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c log.lo: $(srcdir)/log.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c printf.lo: $(srcdir)/printf.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/printf.c version.lo: $(srcdir)/version.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/version.c osdep.lo: $(srcdir)/osdep.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c intl-compat.lo: $(srcdir)/intl-compat.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c ref-add.sed: $(srcdir)/ref-add.sin sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed mv t-ref-add.sed ref-add.sed ref-del.sed: $(srcdir)/ref-del.sin sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed mv t-ref-del.sed ref-del.sed INCLUDES = -I. -I$(srcdir) -I.. libgnuintl.h: $(srcdir)/libgnuintl.h.in sed -e '/IN_LIBGLOCALE/d' \ -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \ -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \ -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \ -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \ < $(srcdir)/libgnuintl.h.in \ | if test '@WOE32DLL@' = yes; then \ sed -e 's/extern \([^()]*\);/extern __declspec (dllimport) \1;/'; \ else \ cat; \ fi \ | sed -e 's/extern \([^"]\)/extern LIBINTL_DLL_EXPORTED \1/' \ -e "/#define _LIBINTL_H/r $(srcdir)/export.h" \ | sed -e 's,@''HAVE_VISIBILITY''@,@HAVE_VISIBILITY@,g' \ > libgnuintl.h libintl.h: $(srcdir)/libgnuintl.h.in sed -e '/IN_LIBGLOCALE/d' \ -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \ -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \ -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \ -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \ < $(srcdir)/libgnuintl.h.in > libintl.h charset.alias: $(srcdir)/config.charset $(SHELL) $(srcdir)/config.charset '@host@' > t-$@ mv t-$@ $@ check: all # We must not install the libintl.h/libintl.a files if we are on a # system which has the GNU gettext() function in its C library or in a # separate library. # If you want to use the one which comes with this version of the # package, you have to use `configure --with-included-gettext'. install: install-exec install-data install-exec: all if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ && test '@USE_INCLUDED_LIBINTL@' = yes; then \ $(mkdir_p) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \ $(LIBTOOL) --mode=install \ $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \ if test "@RELOCATABLE@" = yes; then \ dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \ if test -n "$$dependencies"; then \ rm -f $(DESTDIR)$(libdir)/libintl.la; \ fi; \ fi; \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext-tools" \ && test '@USE_INCLUDED_LIBINTL@' = no \ && test @GLIBC2@ != no; then \ $(mkdir_p) $(DESTDIR)$(libdir); \ $(LIBTOOL) --mode=install \ $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \ rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \ $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \ $(LIBTOOL) --mode=uninstall \ rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \ else \ : ; \ fi if test '@USE_INCLUDED_LIBINTL@' = yes; then \ test @GLIBC21@ != no || $(mkdir_p) $(DESTDIR)$(libdir); \ temp=$(DESTDIR)$(libdir)/t-charset.alias; \ dest=$(DESTDIR)$(libdir)/charset.alias; \ if test -f $(DESTDIR)$(libdir)/charset.alias; then \ orig=$(DESTDIR)$(libdir)/charset.alias; \ sed -f ref-add.sed $$orig > $$temp; \ $(INSTALL_DATA) $$temp $$dest; \ rm -f $$temp; \ else \ if test @GLIBC21@ = no; then \ orig=charset.alias; \ sed -f ref-add.sed $$orig > $$temp; \ $(INSTALL_DATA) $$temp $$dest; \ rm -f $$temp; \ fi; \ fi; \ $(mkdir_p) $(DESTDIR)$(localedir); \ test -f $(DESTDIR)$(localedir)/locale.alias \ && orig=$(DESTDIR)$(localedir)/locale.alias \ || orig=$(srcdir)/locale.alias; \ temp=$(DESTDIR)$(localedir)/t-locale.alias; \ dest=$(DESTDIR)$(localedir)/locale.alias; \ sed -f ref-add.sed $$orig > $$temp; \ $(INSTALL_DATA) $$temp $$dest; \ rm -f $$temp; \ else \ : ; \ fi install-data: all if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \ $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \ dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \ for file in $$dists; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \ dists="$(DISTFILES.generated)"; \ for file in $$dists; do \ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ $(INSTALL_DATA) $$dir/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ dists="$(DISTFILES.obsolete)"; \ for file in $$dists; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-strip: install installdirs: if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ && test '@USE_INCLUDED_LIBINTL@' = yes; then \ $(mkdir_p) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext-tools" \ && test '@USE_INCLUDED_LIBINTL@' = no \ && test @GLIBC2@ != no; then \ $(mkdir_p) $(DESTDIR)$(libdir); \ else \ : ; \ fi if test '@USE_INCLUDED_LIBINTL@' = yes; then \ test @GLIBC21@ != no || $(mkdir_p) $(DESTDIR)$(libdir); \ $(mkdir_p) $(DESTDIR)$(localedir); \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi # Define this as empty until I found a useful application. installcheck: uninstall: if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ && test '@USE_INCLUDED_LIBINTL@' = yes; then \ rm -f $(DESTDIR)$(includedir)/libintl.h; \ $(LIBTOOL) --mode=uninstall \ rm -f $(DESTDIR)$(libdir)/libintl.$la; \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext-tools" \ && test '@USE_INCLUDED_LIBINTL@' = no \ && test @GLIBC2@ != no; then \ rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \ else \ : ; \ fi if test '@USE_INCLUDED_LIBINTL@' = yes; then \ if test -f $(DESTDIR)$(libdir)/charset.alias; then \ temp=$(DESTDIR)$(libdir)/t-charset.alias; \ dest=$(DESTDIR)$(libdir)/charset.alias; \ sed -f ref-del.sed $$dest > $$temp; \ if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ rm -f $$dest; \ else \ $(INSTALL_DATA) $$temp $$dest; \ fi; \ rm -f $$temp; \ fi; \ if test -f $(DESTDIR)$(localedir)/locale.alias; then \ temp=$(DESTDIR)$(localedir)/t-locale.alias; \ dest=$(DESTDIR)$(localedir)/locale.alias; \ sed -f ref-del.sed $$dest > $$temp; \ if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ rm -f $$dest; \ else \ $(INSTALL_DATA) $$temp $$dest; \ fi; \ rm -f $$temp; \ fi; \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext-tools"; then \ for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi info dvi ps pdf html: $(OBJECTS): ../config.h libgnuintl.h bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: $(srcdir)/gettextP.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h hash-string.$lo dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h dcigettext.$lo: $(srcdir)/eval-plural.h localcharset.$lo: $(srcdir)/localcharset.h bindtextdom.$lo dcigettext.$lo finddomain.$lo loadmsgcat.$lo localealias.$lo lock.$lo log.$lo: $(srcdir)/lock.h localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h printf.$lo: $(srcdir)/printf-args.h $(srcdir)/printf-args.c $(srcdir)/printf-parse.h $(srcdir)/wprintf-parse.h $(srcdir)/xsize.h $(srcdir)/printf-parse.c $(srcdir)/vasnprintf.h $(srcdir)/vasnwprintf.h $(srcdir)/vasnprintf.c # A bison-2.1 generated plural.c includes if ENABLE_NLS. PLURAL_DEPS_yes = libintl.h PLURAL_DEPS_no = plural.$lo: $(PLURAL_DEPS_@USE_INCLUDED_LIBINTL@) tags: TAGS TAGS: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES) ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES) id: ID ID: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES) mostlyclean: rm -f *.a *.la *.o *.obj *.lo core core.* rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed rm -f -r .libs _libs clean: mostlyclean distclean: clean rm -f Makefile ID TAGS if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \ rm -f ChangeLog.inst $(DISTFILES.normal); \ else \ : ; \ fi maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." # GNU gettext needs not contain the file `VERSION' but contains some # other files which should not be distributed in other packages. distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: Makefile if test "$(PACKAGE)" = "gettext-tools"; then \ : ; \ else \ if test "$(PACKAGE)" = "gettext-runtime"; then \ additional="$(DISTFILES.gettext)"; \ else \ additional="$(DISTFILES.normal)"; \ fi; \ $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \ for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ cp -p $$dir/$$file $(distdir) || test $$file = Makefile.in || exit 1; \ done; \ fi Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status # This would be more efficient, but doesn't work any more with autoconf-2.57, # when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used. # cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pbbuttonsd-0.8.1a/intl/ChangeLog0000644000175000017500000000011110641705126013501 000000000000002006-11-27 GNU * Version 0.16.1 released. pbbuttonsd-0.8.1a/intl/config.charset0000755000175000017500000004702610641705127014573 00000000000000#! /bin/sh # Output a system dependent table of character encoding aliases. # # Copyright (C) 2000-2004, 2006 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library General Public License as published # by the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA. # # The table consists of lines of the form # ALIAS CANONICAL # # ALIAS is the (system dependent) result of "nl_langinfo (CODESET)". # ALIAS is compared in a case sensitive way. # # CANONICAL is the GNU canonical name for this character encoding. # It must be an encoding supported by libiconv. Support by GNU libc is # also desirable. CANONICAL is case insensitive. Usually an upper case # MIME charset name is preferred. # The current list of GNU canonical charset names is as follows. # # name MIME? used by which systems # ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin # ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd darwin # ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd darwin # ISO-8859-3 Y glibc solaris # ISO-8859-4 Y osf solaris freebsd netbsd darwin # ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd darwin # ISO-8859-6 Y glibc aix hpux solaris # ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd darwin # ISO-8859-8 Y glibc aix hpux osf solaris # ISO-8859-9 Y glibc aix hpux irix osf solaris darwin # ISO-8859-13 glibc netbsd darwin # ISO-8859-14 glibc # ISO-8859-15 glibc aix osf solaris freebsd darwin # KOI8-R Y glibc solaris freebsd netbsd darwin # KOI8-U Y glibc freebsd netbsd darwin # KOI8-T glibc # CP437 dos # CP775 dos # CP850 aix osf dos # CP852 dos # CP855 dos # CP856 aix # CP857 dos # CP861 dos # CP862 dos # CP864 dos # CP865 dos # CP866 freebsd netbsd darwin dos # CP869 dos # CP874 woe32 dos # CP922 aix # CP932 aix woe32 dos # CP943 aix # CP949 osf woe32 dos # CP950 woe32 dos # CP1046 aix # CP1124 aix # CP1125 dos # CP1129 aix # CP1250 woe32 # CP1251 glibc solaris netbsd darwin woe32 # CP1252 aix woe32 # CP1253 woe32 # CP1254 woe32 # CP1255 glibc woe32 # CP1256 woe32 # CP1257 woe32 # GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin # EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin # EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin # EUC-TW glibc aix hpux irix osf solaris netbsd # BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin # BIG5-HKSCS glibc solaris # GBK glibc aix osf solaris woe32 dos # GB18030 glibc solaris netbsd # SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin # JOHAB glibc solaris woe32 # TIS-620 glibc aix hpux osf solaris # VISCII Y glibc # TCVN5712-1 glibc # GEORGIAN-PS glibc # HP-ROMAN8 hpux # HP-ARABIC8 hpux # HP-GREEK8 hpux # HP-HEBREW8 hpux # HP-TURKISH8 hpux # HP-KANA8 hpux # DEC-KANJI osf # DEC-HANYU osf # UTF-8 Y glibc aix hpux osf solaris netbsd darwin # # Note: Names which are not marked as being a MIME name should not be used in # Internet protocols for information interchange (mail, news, etc.). # # Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications # must understand both names and treat them as equivalent. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM host="$1" os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'` echo "# This file contains a table of character encoding aliases," echo "# suitable for operating system '${os}'." echo "# It was automatically generated from config.charset." # List of references, updated during installation: echo "# Packages using this file: " case "$os" in linux-gnulibc1*) # Linux libc5 doesn't have nl_langinfo(CODESET); therefore # localcharset.c falls back to using the full locale name # from the environment variables. echo "C ASCII" echo "POSIX ASCII" for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \ en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \ en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \ es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \ et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \ fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \ it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \ sv_FI sv_SE; do echo "$l ISO-8859-1" echo "$l.iso-8859-1 ISO-8859-1" echo "$l.iso-8859-15 ISO-8859-15" echo "$l.iso-8859-15@euro ISO-8859-15" echo "$l@euro ISO-8859-15" echo "$l.cp-437 CP437" echo "$l.cp-850 CP850" echo "$l.cp-1252 CP1252" echo "$l.cp-1252@euro CP1252" #echo "$l.atari-st ATARI-ST" # not a commonly used encoding echo "$l.utf-8 UTF-8" echo "$l.utf-8@euro UTF-8" done for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \ sl_SI sr sr_CS sr_YU; do echo "$l ISO-8859-2" echo "$l.iso-8859-2 ISO-8859-2" echo "$l.cp-852 CP852" echo "$l.cp-1250 CP1250" echo "$l.utf-8 UTF-8" done for l in mk mk_MK ru ru_RU; do echo "$l ISO-8859-5" echo "$l.iso-8859-5 ISO-8859-5" echo "$l.koi8-r KOI8-R" echo "$l.cp-866 CP866" echo "$l.cp-1251 CP1251" echo "$l.utf-8 UTF-8" done for l in ar ar_SA; do echo "$l ISO-8859-6" echo "$l.iso-8859-6 ISO-8859-6" echo "$l.cp-864 CP864" #echo "$l.cp-868 CP868" # not a commonly used encoding echo "$l.cp-1256 CP1256" echo "$l.utf-8 UTF-8" done for l in el el_GR gr gr_GR; do echo "$l ISO-8859-7" echo "$l.iso-8859-7 ISO-8859-7" echo "$l.cp-869 CP869" echo "$l.cp-1253 CP1253" echo "$l.cp-1253@euro CP1253" echo "$l.utf-8 UTF-8" echo "$l.utf-8@euro UTF-8" done for l in he he_IL iw iw_IL; do echo "$l ISO-8859-8" echo "$l.iso-8859-8 ISO-8859-8" echo "$l.cp-862 CP862" echo "$l.cp-1255 CP1255" echo "$l.utf-8 UTF-8" done for l in tr tr_TR; do echo "$l ISO-8859-9" echo "$l.iso-8859-9 ISO-8859-9" echo "$l.cp-857 CP857" echo "$l.cp-1254 CP1254" echo "$l.utf-8 UTF-8" done for l in lt lt_LT lv lv_LV; do #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name echo "$l ISO-8859-13" done for l in ru_UA uk uk_UA; do echo "$l KOI8-U" done for l in zh zh_CN; do #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name echo "$l GB2312" done for l in ja ja_JP ja_JP.EUC; do echo "$l EUC-JP" done for l in ko ko_KR; do echo "$l EUC-KR" done for l in th th_TH; do echo "$l TIS-620" done for l in fa fa_IR; do #echo "$l ISIRI-3342" # a broken encoding echo "$l.utf-8 UTF-8" done ;; linux* | *-gnu*) # With glibc-2.1 or newer, we don't need any canonicalization, # because glibc has iconv and both glibc and libiconv support all # GNU canonical names directly. Therefore, the Makefile does not # need to install the alias file at all. # The following applies only to glibc-2.0.x and older libcs. echo "ISO_646.IRV:1983 ASCII" ;; aix*) echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-6 ISO-8859-6" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-8 ISO-8859-8" echo "ISO8859-9 ISO-8859-9" echo "ISO8859-15 ISO-8859-15" echo "IBM-850 CP850" echo "IBM-856 CP856" echo "IBM-921 ISO-8859-13" echo "IBM-922 CP922" echo "IBM-932 CP932" echo "IBM-943 CP943" echo "IBM-1046 CP1046" echo "IBM-1124 CP1124" echo "IBM-1129 CP1129" echo "IBM-1252 CP1252" echo "IBM-eucCN GB2312" echo "IBM-eucJP EUC-JP" echo "IBM-eucKR EUC-KR" echo "IBM-eucTW EUC-TW" echo "big5 BIG5" echo "GBK GBK" echo "TIS-620 TIS-620" echo "UTF-8 UTF-8" ;; hpux*) echo "iso88591 ISO-8859-1" echo "iso88592 ISO-8859-2" echo "iso88595 ISO-8859-5" echo "iso88596 ISO-8859-6" echo "iso88597 ISO-8859-7" echo "iso88598 ISO-8859-8" echo "iso88599 ISO-8859-9" echo "iso885915 ISO-8859-15" echo "roman8 HP-ROMAN8" echo "arabic8 HP-ARABIC8" echo "greek8 HP-GREEK8" echo "hebrew8 HP-HEBREW8" echo "turkish8 HP-TURKISH8" echo "kana8 HP-KANA8" echo "tis620 TIS-620" echo "big5 BIG5" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" echo "hp15CN GB2312" #echo "ccdc ?" # what is this? echo "SJIS SHIFT_JIS" echo "utf8 UTF-8" ;; irix*) echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-9 ISO-8859-9" echo "eucCN GB2312" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" ;; osf*) echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-4 ISO-8859-4" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-8 ISO-8859-8" echo "ISO8859-9 ISO-8859-9" echo "ISO8859-15 ISO-8859-15" echo "cp850 CP850" echo "big5 BIG5" echo "dechanyu DEC-HANYU" echo "dechanzi GB2312" echo "deckanji DEC-KANJI" echo "deckorean EUC-KR" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" echo "GBK GBK" echo "KSC5601 CP949" echo "sdeckanji EUC-JP" echo "SJIS SHIFT_JIS" echo "TACTIS TIS-620" echo "UTF-8 UTF-8" ;; solaris*) echo "646 ASCII" echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-3 ISO-8859-3" echo "ISO8859-4 ISO-8859-4" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-6 ISO-8859-6" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-8 ISO-8859-8" echo "ISO8859-9 ISO-8859-9" echo "ISO8859-15 ISO-8859-15" echo "koi8-r KOI8-R" echo "ansi-1251 CP1251" echo "BIG5 BIG5" echo "Big5-HKSCS BIG5-HKSCS" echo "gb2312 GB2312" echo "GBK GBK" echo "GB18030 GB18030" echo "cns11643 EUC-TW" echo "5601 EUC-KR" echo "ko_KR.johap92 JOHAB" echo "eucJP EUC-JP" echo "PCK SHIFT_JIS" echo "TIS620.2533 TIS-620" #echo "sun_eu_greek ?" # what is this? echo "UTF-8 UTF-8" ;; freebsd* | os2*) # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore # localcharset.c falls back to using the full locale name # from the environment variables. # Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just # reuse FreeBSD's locale data for OS/2. echo "C ASCII" echo "US-ASCII ASCII" for l in la_LN lt_LN; do echo "$l.ASCII ASCII" done for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \ fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \ lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do echo "$l.ISO_8859-1 ISO-8859-1" echo "$l.DIS_8859-15 ISO-8859-15" done for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do echo "$l.ISO_8859-2 ISO-8859-2" done for l in la_LN lt_LT; do echo "$l.ISO_8859-4 ISO-8859-4" done for l in ru_RU ru_SU; do echo "$l.KOI8-R KOI8-R" echo "$l.ISO_8859-5 ISO-8859-5" echo "$l.CP866 CP866" done echo "uk_UA.KOI8-U KOI8-U" echo "zh_TW.BIG5 BIG5" echo "zh_TW.Big5 BIG5" echo "zh_CN.EUC GB2312" echo "ja_JP.EUC EUC-JP" echo "ja_JP.SJIS SHIFT_JIS" echo "ja_JP.Shift_JIS SHIFT_JIS" echo "ko_KR.EUC EUC-KR" ;; netbsd*) echo "646 ASCII" echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-4 ISO-8859-4" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-13 ISO-8859-13" echo "ISO8859-15 ISO-8859-15" echo "eucCN GB2312" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" echo "BIG5 BIG5" echo "SJIS SHIFT_JIS" ;; darwin[56]*) # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore # localcharset.c falls back to using the full locale name # from the environment variables. echo "C ASCII" for l in en_AU en_CA en_GB en_US la_LN; do echo "$l.US-ASCII ASCII" done for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \ fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \ nl_NL no_NO pt_PT sv_SE; do echo "$l ISO-8859-1" echo "$l.ISO8859-1 ISO-8859-1" echo "$l.ISO8859-15 ISO-8859-15" done for l in la_LN; do echo "$l.ISO8859-1 ISO-8859-1" echo "$l.ISO8859-15 ISO-8859-15" done for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do echo "$l.ISO8859-2 ISO-8859-2" done for l in la_LN lt_LT; do echo "$l.ISO8859-4 ISO-8859-4" done for l in ru_RU; do echo "$l.KOI8-R KOI8-R" echo "$l.ISO8859-5 ISO-8859-5" echo "$l.CP866 CP866" done for l in bg_BG; do echo "$l.CP1251 CP1251" done echo "uk_UA.KOI8-U KOI8-U" echo "zh_TW.BIG5 BIG5" echo "zh_TW.Big5 BIG5" echo "zh_CN.EUC GB2312" echo "ja_JP.EUC EUC-JP" echo "ja_JP.SJIS SHIFT_JIS" echo "ko_KR.EUC EUC-KR" ;; darwin*) # Darwin 7.5 has nl_langinfo(CODESET), but it is useless: # - It returns the empty string when LANG is set to a locale of the # form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8 # LC_CTYPE file. # - The environment variables LANG, LC_CTYPE, LC_ALL are not set by # the system; nl_langinfo(CODESET) returns "US-ASCII" in this case. # - The documentation says: # "... all code that calls BSD system routines should ensure # that the const *char parameters of these routines are in UTF-8 # encoding. All BSD system functions expect their string # parameters to be in UTF-8 encoding and nothing else." # It also says # "An additional caveat is that string parameters for files, # paths, and other file-system entities must be in canonical # UTF-8. In a canonical UTF-8 Unicode string, all decomposable # characters are decomposed ..." # but this is not true: You can pass non-decomposed UTF-8 strings # to file system functions, and it is the OS which will convert # them to decomposed UTF-8 before accessing the file system. # - The Apple Terminal application displays UTF-8 by default. # - However, other applications are free to use different encodings: # - xterm uses ISO-8859-1 by default. # - TextEdit uses MacRoman by default. # We prefer UTF-8 over decomposed UTF-8-MAC because one should # minimize the use of decomposed Unicode. Unfortunately, through the # Darwin file system, decomposed UTF-8 strings are leaked into user # space nevertheless. echo "* UTF-8" ;; beos*) # BeOS has a single locale, and it has UTF-8 encoding. echo "* UTF-8" ;; msdosdjgpp*) # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore # localcharset.c falls back to using the full locale name # from the environment variables. echo "#" echo "# The encodings given here may not all be correct." echo "# If you find that the encoding given for your language and" echo "# country is not the one your DOS machine actually uses, just" echo "# correct it in this file, and send a mail to" echo "# Juan Manuel Guerrero " echo "# and Bruno Haible ." echo "#" echo "C ASCII" # ISO-8859-1 languages echo "ca CP850" echo "ca_ES CP850" echo "da CP865" # not CP850 ?? echo "da_DK CP865" # not CP850 ?? echo "de CP850" echo "de_AT CP850" echo "de_CH CP850" echo "de_DE CP850" echo "en CP850" echo "en_AU CP850" # not CP437 ?? echo "en_CA CP850" echo "en_GB CP850" echo "en_NZ CP437" echo "en_US CP437" echo "en_ZA CP850" # not CP437 ?? echo "es CP850" echo "es_AR CP850" echo "es_BO CP850" echo "es_CL CP850" echo "es_CO CP850" echo "es_CR CP850" echo "es_CU CP850" echo "es_DO CP850" echo "es_EC CP850" echo "es_ES CP850" echo "es_GT CP850" echo "es_HN CP850" echo "es_MX CP850" echo "es_NI CP850" echo "es_PA CP850" echo "es_PY CP850" echo "es_PE CP850" echo "es_SV CP850" echo "es_UY CP850" echo "es_VE CP850" echo "et CP850" echo "et_EE CP850" echo "eu CP850" echo "eu_ES CP850" echo "fi CP850" echo "fi_FI CP850" echo "fr CP850" echo "fr_BE CP850" echo "fr_CA CP850" echo "fr_CH CP850" echo "fr_FR CP850" echo "ga CP850" echo "ga_IE CP850" echo "gd CP850" echo "gd_GB CP850" echo "gl CP850" echo "gl_ES CP850" echo "id CP850" # not CP437 ?? echo "id_ID CP850" # not CP437 ?? echo "is CP861" # not CP850 ?? echo "is_IS CP861" # not CP850 ?? echo "it CP850" echo "it_CH CP850" echo "it_IT CP850" echo "lt CP775" echo "lt_LT CP775" echo "lv CP775" echo "lv_LV CP775" echo "nb CP865" # not CP850 ?? echo "nb_NO CP865" # not CP850 ?? echo "nl CP850" echo "nl_BE CP850" echo "nl_NL CP850" echo "nn CP865" # not CP850 ?? echo "nn_NO CP865" # not CP850 ?? echo "no CP865" # not CP850 ?? echo "no_NO CP865" # not CP850 ?? echo "pt CP850" echo "pt_BR CP850" echo "pt_PT CP850" echo "sv CP850" echo "sv_SE CP850" # ISO-8859-2 languages echo "cs CP852" echo "cs_CZ CP852" echo "hr CP852" echo "hr_HR CP852" echo "hu CP852" echo "hu_HU CP852" echo "pl CP852" echo "pl_PL CP852" echo "ro CP852" echo "ro_RO CP852" echo "sk CP852" echo "sk_SK CP852" echo "sl CP852" echo "sl_SI CP852" echo "sq CP852" echo "sq_AL CP852" echo "sr CP852" # CP852 or CP866 or CP855 ?? echo "sr_CS CP852" # CP852 or CP866 or CP855 ?? echo "sr_YU CP852" # CP852 or CP866 or CP855 ?? # ISO-8859-3 languages echo "mt CP850" echo "mt_MT CP850" # ISO-8859-5 languages echo "be CP866" echo "be_BE CP866" echo "bg CP866" # not CP855 ?? echo "bg_BG CP866" # not CP855 ?? echo "mk CP866" # not CP855 ?? echo "mk_MK CP866" # not CP855 ?? echo "ru CP866" echo "ru_RU CP866" echo "uk CP1125" echo "uk_UA CP1125" # ISO-8859-6 languages echo "ar CP864" echo "ar_AE CP864" echo "ar_DZ CP864" echo "ar_EG CP864" echo "ar_IQ CP864" echo "ar_IR CP864" echo "ar_JO CP864" echo "ar_KW CP864" echo "ar_MA CP864" echo "ar_OM CP864" echo "ar_QA CP864" echo "ar_SA CP864" echo "ar_SY CP864" # ISO-8859-7 languages echo "el CP869" echo "el_GR CP869" # ISO-8859-8 languages echo "he CP862" echo "he_IL CP862" # ISO-8859-9 languages echo "tr CP857" echo "tr_TR CP857" # Japanese echo "ja CP932" echo "ja_JP CP932" # Chinese echo "zh_CN GBK" echo "zh_TW CP950" # not CP938 ?? # Korean echo "kr CP949" # not CP934 ?? echo "kr_KR CP949" # not CP934 ?? # Thai echo "th CP874" echo "th_TH CP874" # Other echo "eo CP850" echo "eo_EO CP850" ;; esac pbbuttonsd-0.8.1a/intl/locale.alias0000644000175000017500000000512610641705131014210 00000000000000# Locale name alias data base. # Copyright (C) 1996-2001,2003 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library General Public License as published # by the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA. # The format of this file is the same as for the corresponding file of # the X Window System, which normally can be found in # /usr/lib/X11/locale/locale.alias # A single line contains two fields: an alias and a substitution value. # All entries are case independent. # Note: This file is far from being complete. If you have a value for # your own site which you think might be useful for others too, share # it with the rest of us. Send it using the `glibcbug' script to # bugs@gnu.org. # Packages using this file: bokmal nb_NO.ISO-8859-1 bokml nb_NO.ISO-8859-1 catalan ca_ES.ISO-8859-1 croatian hr_HR.ISO-8859-2 czech cs_CZ.ISO-8859-2 danish da_DK.ISO-8859-1 dansk da_DK.ISO-8859-1 deutsch de_DE.ISO-8859-1 dutch nl_NL.ISO-8859-1 eesti et_EE.ISO-8859-1 estonian et_EE.ISO-8859-1 finnish fi_FI.ISO-8859-1 franais fr_FR.ISO-8859-1 french fr_FR.ISO-8859-1 galego gl_ES.ISO-8859-1 galician gl_ES.ISO-8859-1 german de_DE.ISO-8859-1 greek el_GR.ISO-8859-7 hebrew he_IL.ISO-8859-8 hrvatski hr_HR.ISO-8859-2 hungarian hu_HU.ISO-8859-2 icelandic is_IS.ISO-8859-1 italian it_IT.ISO-8859-1 japanese ja_JP.eucJP japanese.euc ja_JP.eucJP ja_JP ja_JP.eucJP ja_JP.ujis ja_JP.eucJP japanese.sjis ja_JP.SJIS korean ko_KR.eucKR korean.euc ko_KR.eucKR ko_KR ko_KR.eucKR lithuanian lt_LT.ISO-8859-13 no_NO nb_NO.ISO-8859-1 no_NO.ISO-8859-1 nb_NO.ISO-8859-1 norwegian nb_NO.ISO-8859-1 nynorsk nn_NO.ISO-8859-1 polish pl_PL.ISO-8859-2 portuguese pt_PT.ISO-8859-1 romanian ro_RO.ISO-8859-2 russian ru_RU.ISO-8859-5 slovak sk_SK.ISO-8859-2 slovene sl_SI.ISO-8859-2 slovenian sl_SI.ISO-8859-2 spanish es_ES.ISO-8859-1 swedish sv_SE.ISO-8859-1 thai th_TH.TIS-620 turkish tr_TR.ISO-8859-9 pbbuttonsd-0.8.1a/intl/ref-add.sin0000644000175000017500000000210510641705132013746 00000000000000# Add this package to a list of references stored in a text file. # # Copyright (C) 2000 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library General Public License as published # by the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA. # # Written by Bruno Haible . # /^# Packages using this file: / { s/# Packages using this file:// ta :a s/ @PACKAGE@ / @PACKAGE@ / tb s/ $/ @PACKAGE@ / :b s/^/# Packages using this file:/ } pbbuttonsd-0.8.1a/intl/ref-del.sin0000644000175000017500000000203010641705132013757 00000000000000# Remove this package from a list of references stored in a text file. # # Copyright (C) 2000 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library General Public License as published # by the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA. # # Written by Bruno Haible . # /^# Packages using this file: / { s/# Packages using this file:// s/ @PACKAGE@ / / s/^/# Packages using this file:/ } pbbuttonsd-0.8.1a/intl/export.h0000644000175000017500000000023510641705134013427 00000000000000 #if @HAVE_VISIBILITY@ && BUILDING_LIBINTL #define LIBINTL_DLL_EXPORTED __attribute__((__visibility__("default"))) #else #define LIBINTL_DLL_EXPORTED #endif pbbuttonsd-0.8.1a/intl/gmo.h0000644000175000017500000001135110641705130012665 00000000000000/* Description of GNU message catalog format: general file layout. Copyright (C) 1995, 1997, 2000-2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GETTEXT_H #define _GETTEXT_H 1 #include /* @@ end of prolog @@ */ /* The magic number of the GNU message catalog format. */ #define _MAGIC 0x950412de #define _MAGIC_SWAPPED 0xde120495 /* Revision number of the currently used .mo (binary) file format. */ #define MO_REVISION_NUMBER 0 #define MO_REVISION_NUMBER_WITH_SYSDEP_I 1 /* The following contortions are an attempt to use the C preprocessor to determine an unsigned integral type that is 32 bits wide. An alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work when cross-compiling. */ #if __STDC__ # define UINT_MAX_32_BITS 4294967295U #else # define UINT_MAX_32_BITS 0xFFFFFFFF #endif /* If UINT_MAX isn't defined, assume it's a 32-bit type. This should be valid for all systems GNU cares about because that doesn't include 16-bit systems, and only modern systems (that certainly have ) have 64+-bit integral types. */ #ifndef UINT_MAX # define UINT_MAX UINT_MAX_32_BITS #endif #if UINT_MAX == UINT_MAX_32_BITS typedef unsigned nls_uint32; #else # if USHRT_MAX == UINT_MAX_32_BITS typedef unsigned short nls_uint32; # else # if ULONG_MAX == UINT_MAX_32_BITS typedef unsigned long nls_uint32; # else /* The following line is intended to throw an error. Using #error is not portable enough. */ "Cannot determine unsigned 32-bit data type." # endif # endif #endif /* Header for binary .mo file format. */ struct mo_file_header { /* The magic number. */ nls_uint32 magic; /* The revision number of the file format. */ nls_uint32 revision; /* The following are only used in .mo files with major revision 0 or 1. */ /* The number of strings pairs. */ nls_uint32 nstrings; /* Offset of table with start offsets of original strings. */ nls_uint32 orig_tab_offset; /* Offset of table with start offsets of translated strings. */ nls_uint32 trans_tab_offset; /* Size of hash table. */ nls_uint32 hash_tab_size; /* Offset of first hash table entry. */ nls_uint32 hash_tab_offset; /* The following are only used in .mo files with minor revision >= 1. */ /* The number of system dependent segments. */ nls_uint32 n_sysdep_segments; /* Offset of table describing system dependent segments. */ nls_uint32 sysdep_segments_offset; /* The number of system dependent strings pairs. */ nls_uint32 n_sysdep_strings; /* Offset of table with start offsets of original sysdep strings. */ nls_uint32 orig_sysdep_tab_offset; /* Offset of table with start offsets of translated sysdep strings. */ nls_uint32 trans_sysdep_tab_offset; }; /* Descriptor for static string contained in the binary .mo file. */ struct string_desc { /* Length of addressed string, not including the trailing NUL. */ nls_uint32 length; /* Offset of string in file. */ nls_uint32 offset; }; /* The following are only used in .mo files with minor revision >= 1. */ /* Descriptor for system dependent string segment. */ struct sysdep_segment { /* Length of addressed string, including the trailing NUL. */ nls_uint32 length; /* Offset of string in file. */ nls_uint32 offset; }; /* Descriptor for system dependent string. */ struct sysdep_string { /* Offset of static string segments in file. */ nls_uint32 offset; /* Alternating sequence of static and system dependent segments. The last segment is a static segment, including the trailing NUL. */ struct segment_pair { /* Size of static segment. */ nls_uint32 segsize; /* Reference to system dependent string segment, or ~0 at the end. */ nls_uint32 sysdepref; } segments[1]; }; /* Marker for the end of the segments[] array. This has the value 0xFFFFFFFF, regardless whether 'int' is 16 bit, 32 bit, or 64 bit. */ #define SEGMENTS_END ((nls_uint32) ~0) /* @@ begin of epilog @@ */ #endif /* gettext.h */ pbbuttonsd-0.8.1a/intl/gettextP.h0000644000175000017500000001664310641705130013720 00000000000000/* Header describing internals of libintl library. Copyright (C) 1995-1999, 2000-2005 Free Software Foundation, Inc. Written by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GETTEXTP_H #define _GETTEXTP_H #include /* Get size_t. */ #ifdef _LIBC # include "../iconv/gconv_int.h" #else # if HAVE_ICONV # include # endif #endif #ifdef _LIBC extern char *__gettext (const char *__msgid); extern char *__dgettext (const char *__domainname, const char *__msgid); extern char *__dcgettext (const char *__domainname, const char *__msgid, int __category); extern char *__ngettext (const char *__msgid1, const char *__msgid2, unsigned long int __n); extern char *__dngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int n); extern char *__dcngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category); extern char *__dcigettext (const char *__domainname, const char *__msgid1, const char *__msgid2, int __plural, unsigned long int __n, int __category); extern char *__textdomain (const char *__domainname); extern char *__bindtextdomain (const char *__domainname, const char *__dirname); extern char *__bind_textdomain_codeset (const char *__domainname, const char *__codeset); extern void _nl_finddomain_subfreeres (void) attribute_hidden; extern void _nl_unload_domain (struct loaded_domain *__domain) internal_function attribute_hidden; #else /* Declare the exported libintl_* functions, in a way that allows us to call them under their real name. */ # undef _INTL_REDIRECT_INLINE # undef _INTL_REDIRECT_MACROS # define _INTL_REDIRECT_MACROS # include "libgnuintl.h" # ifdef IN_LIBGLOCALE extern char *gl_dcigettext (const char *__domainname, const char *__msgid1, const char *__msgid2, int __plural, unsigned long int __n, int __category, const char *__localename, const char *__encoding); # else extern char *libintl_dcigettext (const char *__domainname, const char *__msgid1, const char *__msgid2, int __plural, unsigned long int __n, int __category); # endif #endif #include "loadinfo.h" #include "gmo.h" /* Get nls_uint32. */ /* @@ end of prolog @@ */ #ifndef internal_function # define internal_function #endif #ifndef attribute_hidden # define attribute_hidden #endif /* Tell the compiler when a conditional or integer expression is almost always true or almost always false. */ #ifndef HAVE_BUILTIN_EXPECT # define __builtin_expect(expr, val) (expr) #endif #ifndef W # define W(flag, data) ((flag) ? SWAP (data) : (data)) #endif #ifdef _LIBC # include # define SWAP(i) bswap_32 (i) #else static inline nls_uint32 SWAP (i) nls_uint32 i; { return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24); } #endif /* In-memory representation of system dependent string. */ struct sysdep_string_desc { /* Length of addressed string, including the trailing NUL. */ size_t length; /* Pointer to addressed string. */ const char *pointer; }; /* Cache of translated strings after charset conversion. Note: The strings are converted to the target encoding only on an as-needed basis. */ struct converted_domain { /* The target encoding name. */ const char *encoding; /* The descriptor for conversion from the message catalog's encoding to this target encoding. */ #ifdef _LIBC __gconv_t conv; #else # if HAVE_ICONV iconv_t conv; # endif #endif /* The table of translated strings after charset conversion. */ char **conv_tab; }; /* The representation of an opened message catalog. */ struct loaded_domain { /* Pointer to memory containing the .mo file. */ const char *data; /* 1 if the memory is mmap()ed, 0 if the memory is malloc()ed. */ int use_mmap; /* Size of mmap()ed memory. */ size_t mmap_size; /* 1 if the .mo file uses a different endianness than this machine. */ int must_swap; /* Pointer to additional malloc()ed memory. */ void *malloced; /* Number of static strings pairs. */ nls_uint32 nstrings; /* Pointer to descriptors of original strings in the file. */ const struct string_desc *orig_tab; /* Pointer to descriptors of translated strings in the file. */ const struct string_desc *trans_tab; /* Number of system dependent strings pairs. */ nls_uint32 n_sysdep_strings; /* Pointer to descriptors of original sysdep strings. */ const struct sysdep_string_desc *orig_sysdep_tab; /* Pointer to descriptors of translated sysdep strings. */ const struct sysdep_string_desc *trans_sysdep_tab; /* Size of hash table. */ nls_uint32 hash_size; /* Pointer to hash table. */ const nls_uint32 *hash_tab; /* 1 if the hash table uses a different endianness than this machine. */ int must_swap_hash_tab; /* Cache of charset conversions of the translated strings. */ struct converted_domain *conversions; size_t nconversions; struct expression *plural; unsigned long int nplurals; }; /* We want to allocate a string at the end of the struct. But ISO C doesn't allow zero sized arrays. */ #ifdef __GNUC__ # define ZERO 0 #else # define ZERO 1 #endif /* A set of settings bound to a message domain. Used to store settings from bindtextdomain() and bind_textdomain_codeset(). */ struct binding { struct binding *next; char *dirname; char *codeset; char domainname[ZERO]; }; /* A counter which is incremented each time some previous translations become invalid. This variable is part of the external ABI of the GNU libintl. */ #ifdef IN_LIBGLOCALE # include extern LIBGLOCALE_DLL_EXPORTED int _nl_msg_cat_cntr; #else extern LIBINTL_DLL_EXPORTED int _nl_msg_cat_cntr; #endif #ifndef _LIBC const char *_nl_language_preferences_default (void); const char *_nl_locale_name_posix (int category, const char *categoryname); const char *_nl_locale_name_default (void); const char *_nl_locale_name (int category, const char *categoryname); #endif struct loaded_l10nfile *_nl_find_domain (const char *__dirname, char *__locale, const char *__domainname, struct binding *__domainbinding) internal_function; void _nl_load_domain (struct loaded_l10nfile *__domain, struct binding *__domainbinding) internal_function; #ifdef IN_LIBGLOCALE char *_nl_find_msg (struct loaded_l10nfile *domain_file, struct binding *domainbinding, const char *encoding, const char *msgid, size_t *lengthp) internal_function; #else char *_nl_find_msg (struct loaded_l10nfile *domain_file, struct binding *domainbinding, const char *msgid, int convert, size_t *lengthp) internal_function; #endif /* @@ begin of epilog @@ */ #endif /* gettextP.h */ pbbuttonsd-0.8.1a/intl/hash-string.h0000644000175000017500000000256610641705130014342 00000000000000/* Description of GNU message catalog format: string hashing function. Copyright (C) 1995, 1997-1998, 2000-2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* @@ end of prolog @@ */ /* We assume to have `unsigned long int' value with at least 32 bits. */ #define HASHWORDBITS 32 #ifndef _LIBC # ifdef IN_LIBINTL # define __hash_string libintl_hash_string # else # define __hash_string hash_string # endif #endif /* Defines the so called `hashpjw' function by P.J. Weinberger [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, 1986, 1987 Bell Telephone Laboratories, Inc.] */ extern unsigned long int __hash_string (const char *str_param); pbbuttonsd-0.8.1a/intl/loadinfo.h0000644000175000017500000001211310641705130013673 00000000000000/* Copyright (C) 1996-1999, 2000-2003, 2005-2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LOADINFO_H #define _LOADINFO_H 1 /* Declarations of locale dependent catalog lookup functions. Implemented in localealias.c Possibly replace a locale name by another. explodename.c Split a locale name into its various fields. l10nflist.c Generate a list of filenames of possible message catalogs. finddomain.c Find and open the relevant message catalogs. The main function _nl_find_domain() in finddomain.c is declared in gettextP.h. */ #ifndef internal_function # define internal_function #endif #ifndef LIBINTL_DLL_EXPORTED # define LIBINTL_DLL_EXPORTED #endif /* Tell the compiler when a conditional or integer expression is almost always true or almost always false. */ #ifndef HAVE_BUILTIN_EXPECT # define __builtin_expect(expr, val) (expr) #endif /* Separator in PATH like lists of pathnames. */ #if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS */ # define PATH_SEPARATOR ';' #else /* Unix */ # define PATH_SEPARATOR ':' #endif /* Encoding of locale name parts. */ #define XPG_NORM_CODESET 1 #define XPG_CODESET 2 #define XPG_TERRITORY 4 #define XPG_MODIFIER 8 struct loaded_l10nfile { const char *filename; int decided; const void *data; struct loaded_l10nfile *next; struct loaded_l10nfile *successor[1]; }; /* Normalize codeset name. There is no standard for the codeset names. Normalization allows the user to use any of the common names. The return value is dynamically allocated and has to be freed by the caller. */ extern const char *_nl_normalize_codeset (const char *codeset, size_t name_len); /* Lookup a locale dependent file. *L10NFILE_LIST denotes a pool of lookup results of locale dependent files of the same kind, sorted in decreasing order of ->filename. DIRLIST and DIRLIST_LEN are an argz list of directories in which to look, containing at least one directory (i.e. DIRLIST_LEN > 0). MASK, LANGUAGE, TERRITORY, CODESET, NORMALIZED_CODESET, MODIFIER are the pieces of the locale name, as produced by _nl_explode_name(). FILENAME is the filename suffix. The return value is the lookup result, either found in *L10NFILE_LIST, or - if DO_ALLOCATE is nonzero - freshly allocated, or possibly NULL. If the return value is non-NULL, it is added to *L10NFILE_LIST, and its ->next field denotes the chaining inside *L10NFILE_LIST, and furthermore its ->successor[] field contains a list of other lookup results from which this lookup result inherits. */ extern struct loaded_l10nfile * _nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list, const char *dirlist, size_t dirlist_len, int mask, const char *language, const char *territory, const char *codeset, const char *normalized_codeset, const char *modifier, const char *filename, int do_allocate); /* Lookup the real locale name for a locale alias NAME, or NULL if NAME is not a locale alias (but possibly a real locale name). The return value is statically allocated and must not be freed. */ /* Part of the libintl ABI only for the sake of the gettext.m4 macro. */ extern LIBINTL_DLL_EXPORTED const char *_nl_expand_alias (const char *name); /* Split a locale name NAME into its pieces: language, modifier, territory, codeset. NAME gets destructively modified: NUL bytes are inserted here and there. *LANGUAGE gets assigned NAME. Each of *MODIFIER, *TERRITORY, *CODESET gets assigned either a pointer into the old NAME string, or NULL. *NORMALIZED_CODESET gets assigned the expanded *CODESET, if it is different from *CODESET; this one is dynamically allocated and has to be freed by the caller. The return value is a bitmask, where each bit corresponds to one filled-in value: XPG_MODIFIER for *MODIFIER, XPG_TERRITORY for *TERRITORY, XPG_CODESET for *CODESET, XPG_NORM_CODESET for *NORMALIZED_CODESET. */ extern int _nl_explode_name (char *name, const char **language, const char **modifier, const char **territory, const char **codeset, const char **normalized_codeset); #endif /* loadinfo.h */ pbbuttonsd-0.8.1a/intl/plural-exp.h0000644000175000017500000001000110641705132014165 00000000000000/* Expression parsing and evaluation for plural form selection. Copyright (C) 2000-2003, 2005 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PLURAL_EXP_H #define _PLURAL_EXP_H #ifndef internal_function # define internal_function #endif #ifndef attribute_hidden # define attribute_hidden #endif /* This is the representation of the expressions to determine the plural form. */ struct expression { int nargs; /* Number of arguments. */ enum operator { /* Without arguments: */ var, /* The variable "n". */ num, /* Decimal number. */ /* Unary operators: */ lnot, /* Logical NOT. */ /* Binary operators: */ mult, /* Multiplication. */ divide, /* Division. */ module, /* Modulo operation. */ plus, /* Addition. */ minus, /* Subtraction. */ less_than, /* Comparison. */ greater_than, /* Comparison. */ less_or_equal, /* Comparison. */ greater_or_equal, /* Comparison. */ equal, /* Comparison for equality. */ not_equal, /* Comparison for inequality. */ land, /* Logical AND. */ lor, /* Logical OR. */ /* Ternary operators: */ qmop /* Question mark operator. */ } operation; union { unsigned long int num; /* Number value for `num'. */ struct expression *args[3]; /* Up to three arguments. */ } val; }; /* This is the data structure to pass information to the parser and get the result in a thread-safe way. */ struct parse_args { const char *cp; struct expression *res; }; /* Names for the libintl functions are a problem. This source code is used 1. in the GNU C Library library, 2. in the GNU libintl library, 3. in the GNU gettext tools. The function names in each situation must be different, to allow for binary incompatible changes in 'struct expression'. Furthermore, 1. in the GNU C Library library, the names have a __ prefix, 2.+3. in the GNU libintl library and in the GNU gettext tools, the names must follow ANSI C and not start with __. So we have to distinguish the three cases. */ #ifdef _LIBC # define FREE_EXPRESSION __gettext_free_exp # define PLURAL_PARSE __gettextparse # define GERMANIC_PLURAL __gettext_germanic_plural # define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural #elif defined (IN_LIBINTL) # define FREE_EXPRESSION libintl_gettext_free_exp # define PLURAL_PARSE libintl_gettextparse # define GERMANIC_PLURAL libintl_gettext_germanic_plural # define EXTRACT_PLURAL_EXPRESSION libintl_gettext_extract_plural #else # define FREE_EXPRESSION free_plural_expression # define PLURAL_PARSE parse_plural_expression # define GERMANIC_PLURAL germanic_plural # define EXTRACT_PLURAL_EXPRESSION extract_plural_expression #endif extern void FREE_EXPRESSION (struct expression *exp) internal_function; extern int PLURAL_PARSE (void *arg); extern struct expression GERMANIC_PLURAL attribute_hidden; extern void EXTRACT_PLURAL_EXPRESSION (const char *nullentry, struct expression **pluralp, unsigned long int *npluralsp) internal_function; #if !defined (_LIBC) && !defined (IN_LIBINTL) && !defined (IN_LIBGLOCALE) extern unsigned long int plural_eval (struct expression *pexp, unsigned long int n); #endif #endif /* _PLURAL_EXP_H */ pbbuttonsd-0.8.1a/intl/eval-plural.h0000644000175000017500000000532610641705127014342 00000000000000/* Plural expression evaluation. Copyright (C) 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef STATIC #define STATIC static #endif /* Evaluate the plural expression and return an index value. */ STATIC unsigned long int internal_function plural_eval (struct expression *pexp, unsigned long int n) { switch (pexp->nargs) { case 0: switch (pexp->operation) { case var: return n; case num: return pexp->val.num; default: break; } /* NOTREACHED */ break; case 1: { /* pexp->operation must be lnot. */ unsigned long int arg = plural_eval (pexp->val.args[0], n); return ! arg; } case 2: { unsigned long int leftarg = plural_eval (pexp->val.args[0], n); if (pexp->operation == lor) return leftarg || plural_eval (pexp->val.args[1], n); else if (pexp->operation == land) return leftarg && plural_eval (pexp->val.args[1], n); else { unsigned long int rightarg = plural_eval (pexp->val.args[1], n); switch (pexp->operation) { case mult: return leftarg * rightarg; case divide: #if !INTDIV0_RAISES_SIGFPE if (rightarg == 0) raise (SIGFPE); #endif return leftarg / rightarg; case module: #if !INTDIV0_RAISES_SIGFPE if (rightarg == 0) raise (SIGFPE); #endif return leftarg % rightarg; case plus: return leftarg + rightarg; case minus: return leftarg - rightarg; case less_than: return leftarg < rightarg; case greater_than: return leftarg > rightarg; case less_or_equal: return leftarg <= rightarg; case greater_or_equal: return leftarg >= rightarg; case equal: return leftarg == rightarg; case not_equal: return leftarg != rightarg; default: break; } } /* NOTREACHED */ break; } case 3: { /* pexp->operation must be qmop. */ unsigned long int boolarg = plural_eval (pexp->val.args[0], n); return plural_eval (pexp->val.args[boolarg ? 1 : 2], n); } } /* NOTREACHED */ return 0; } pbbuttonsd-0.8.1a/intl/localcharset.h0000644000175000017500000000256310641705131014555 00000000000000/* Determine a canonical name for the current locale's character encoding. Copyright (C) 2000-2003 Free Software Foundation, Inc. This file is part of the GNU CHARSET Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LOCALCHARSET_H #define _LOCALCHARSET_H #ifdef __cplusplus extern "C" { #endif /* Determine the current locale's character encoding, and canonicalize it into one of the canonical names listed in config.charset. The result must not be freed; it is statically allocated. If the canonical name cannot be determined, the result is a non-canonical name. */ extern const char * locale_charset (void); #ifdef __cplusplus } #endif #endif /* _LOCALCHARSET_H */ pbbuttonsd-0.8.1a/intl/lock.h0000644000175000017500000007523310641705135013051 00000000000000/* Locking in multithreaded situations. Copyright (C) 2005-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Bruno Haible , 2005. Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h, gthr-win32.h. */ /* This file contains locking primitives for use with a given thread library. It does not contain primitives for creating threads or for other synchronization primitives. Normal (non-recursive) locks: Type: gl_lock_t Declaration: gl_lock_define(extern, name) Initializer: gl_lock_define_initialized(, name) Initialization: gl_lock_init (name); Taking the lock: gl_lock_lock (name); Releasing the lock: gl_lock_unlock (name); De-initialization: gl_lock_destroy (name); Read-Write (non-recursive) locks: Type: gl_rwlock_t Declaration: gl_rwlock_define(extern, name) Initializer: gl_rwlock_define_initialized(, name) Initialization: gl_rwlock_init (name); Taking the lock: gl_rwlock_rdlock (name); gl_rwlock_wrlock (name); Releasing the lock: gl_rwlock_unlock (name); De-initialization: gl_rwlock_destroy (name); Recursive locks: Type: gl_recursive_lock_t Declaration: gl_recursive_lock_define(extern, name) Initializer: gl_recursive_lock_define_initialized(, name) Initialization: gl_recursive_lock_init (name); Taking the lock: gl_recursive_lock_lock (name); Releasing the lock: gl_recursive_lock_unlock (name); De-initialization: gl_recursive_lock_destroy (name); Once-only execution: Type: gl_once_t Initializer: gl_once_define(extern, name) Execution: gl_once (name, initfunction); */ #ifndef _LOCK_H #define _LOCK_H /* ========================================================================= */ #if USE_POSIX_THREADS /* Use the POSIX threads library. */ # include # include # ifdef __cplusplus extern "C" { # endif # if PTHREAD_IN_USE_DETECTION_HARD /* The pthread_in_use() detection needs to be done at runtime. */ # define pthread_in_use() \ glthread_in_use () extern int glthread_in_use (void); # endif # if USE_POSIX_THREADS_WEAK /* Use weak references to the POSIX threads library. */ /* Weak references avoid dragging in external libraries if the other parts of the program don't use them. Here we use them, because we don't want every program that uses libintl to depend on libpthread. This assumes that libpthread would not be loaded after libintl; i.e. if libintl is loaded first, by an executable that does not depend on libpthread, and then a module is dynamically loaded that depends on libpthread, libintl will not be multithread-safe. */ /* The way to test at runtime whether libpthread is present is to test whether a function pointer's value, such as &pthread_mutex_init, is non-NULL. However, some versions of GCC have a bug through which, in PIC mode, &foo != NULL always evaluates to true if there is a direct call to foo(...) in the same function. To avoid this, we test the address of a function in libpthread that we don't use. */ # pragma weak pthread_mutex_init # pragma weak pthread_mutex_lock # pragma weak pthread_mutex_unlock # pragma weak pthread_mutex_destroy # pragma weak pthread_rwlock_init # pragma weak pthread_rwlock_rdlock # pragma weak pthread_rwlock_wrlock # pragma weak pthread_rwlock_unlock # pragma weak pthread_rwlock_destroy # pragma weak pthread_once # pragma weak pthread_cond_init # pragma weak pthread_cond_wait # pragma weak pthread_cond_signal # pragma weak pthread_cond_broadcast # pragma weak pthread_cond_destroy # pragma weak pthread_mutexattr_init # pragma weak pthread_mutexattr_settype # pragma weak pthread_mutexattr_destroy # ifndef pthread_self # pragma weak pthread_self # endif # if !PTHREAD_IN_USE_DETECTION_HARD # pragma weak pthread_cancel # define pthread_in_use() (pthread_cancel != NULL) # endif # else # if !PTHREAD_IN_USE_DETECTION_HARD # define pthread_in_use() 1 # endif # endif /* -------------------------- gl_lock_t datatype -------------------------- */ typedef pthread_mutex_t gl_lock_t; # define gl_lock_define(STORAGECLASS, NAME) \ STORAGECLASS pthread_mutex_t NAME; # define gl_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS pthread_mutex_t NAME = gl_lock_initializer; # define gl_lock_initializer \ PTHREAD_MUTEX_INITIALIZER # define gl_lock_init(NAME) \ if (pthread_in_use () && pthread_mutex_init (&NAME, NULL) != 0) abort () # define gl_lock_lock(NAME) \ if (pthread_in_use () && pthread_mutex_lock (&NAME) != 0) abort () # define gl_lock_unlock(NAME) \ if (pthread_in_use () && pthread_mutex_unlock (&NAME) != 0) abort () # define gl_lock_destroy(NAME) \ if (pthread_in_use () && pthread_mutex_destroy (&NAME) != 0) abort () /* ------------------------- gl_rwlock_t datatype ------------------------- */ # if HAVE_PTHREAD_RWLOCK # ifdef PTHREAD_RWLOCK_INITIALIZER typedef pthread_rwlock_t gl_rwlock_t; # define gl_rwlock_define(STORAGECLASS, NAME) \ STORAGECLASS pthread_rwlock_t NAME; # define gl_rwlock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS pthread_rwlock_t NAME = gl_rwlock_initializer; # define gl_rwlock_initializer \ PTHREAD_RWLOCK_INITIALIZER # define gl_rwlock_init(NAME) \ if (pthread_in_use () && pthread_rwlock_init (&NAME, NULL) != 0) abort () # define gl_rwlock_rdlock(NAME) \ if (pthread_in_use () && pthread_rwlock_rdlock (&NAME) != 0) abort () # define gl_rwlock_wrlock(NAME) \ if (pthread_in_use () && pthread_rwlock_wrlock (&NAME) != 0) abort () # define gl_rwlock_unlock(NAME) \ if (pthread_in_use () && pthread_rwlock_unlock (&NAME) != 0) abort () # define gl_rwlock_destroy(NAME) \ if (pthread_in_use () && pthread_rwlock_destroy (&NAME) != 0) abort () # else typedef struct { int initialized; pthread_mutex_t guard; /* protects the initialization */ pthread_rwlock_t rwlock; /* read-write lock */ } gl_rwlock_t; # define gl_rwlock_define(STORAGECLASS, NAME) \ STORAGECLASS gl_rwlock_t NAME; # define gl_rwlock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer; # define gl_rwlock_initializer \ { 0, PTHREAD_MUTEX_INITIALIZER } # define gl_rwlock_init(NAME) \ if (pthread_in_use ()) glthread_rwlock_init (&NAME) # define gl_rwlock_rdlock(NAME) \ if (pthread_in_use ()) glthread_rwlock_rdlock (&NAME) # define gl_rwlock_wrlock(NAME) \ if (pthread_in_use ()) glthread_rwlock_wrlock (&NAME) # define gl_rwlock_unlock(NAME) \ if (pthread_in_use ()) glthread_rwlock_unlock (&NAME) # define gl_rwlock_destroy(NAME) \ if (pthread_in_use ()) glthread_rwlock_destroy (&NAME) extern void glthread_rwlock_init (gl_rwlock_t *lock); extern void glthread_rwlock_rdlock (gl_rwlock_t *lock); extern void glthread_rwlock_wrlock (gl_rwlock_t *lock); extern void glthread_rwlock_unlock (gl_rwlock_t *lock); extern void glthread_rwlock_destroy (gl_rwlock_t *lock); # endif # else typedef struct { pthread_mutex_t lock; /* protects the remaining fields */ pthread_cond_t waiting_readers; /* waiting readers */ pthread_cond_t waiting_writers; /* waiting writers */ unsigned int waiting_writers_count; /* number of waiting writers */ int runcount; /* number of readers running, or -1 when a writer runs */ } gl_rwlock_t; # define gl_rwlock_define(STORAGECLASS, NAME) \ STORAGECLASS gl_rwlock_t NAME; # define gl_rwlock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer; # define gl_rwlock_initializer \ { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0 } # define gl_rwlock_init(NAME) \ if (pthread_in_use ()) glthread_rwlock_init (&NAME) # define gl_rwlock_rdlock(NAME) \ if (pthread_in_use ()) glthread_rwlock_rdlock (&NAME) # define gl_rwlock_wrlock(NAME) \ if (pthread_in_use ()) glthread_rwlock_wrlock (&NAME) # define gl_rwlock_unlock(NAME) \ if (pthread_in_use ()) glthread_rwlock_unlock (&NAME) # define gl_rwlock_destroy(NAME) \ if (pthread_in_use ()) glthread_rwlock_destroy (&NAME) extern void glthread_rwlock_init (gl_rwlock_t *lock); extern void glthread_rwlock_rdlock (gl_rwlock_t *lock); extern void glthread_rwlock_wrlock (gl_rwlock_t *lock); extern void glthread_rwlock_unlock (gl_rwlock_t *lock); extern void glthread_rwlock_destroy (gl_rwlock_t *lock); # endif /* --------------------- gl_recursive_lock_t datatype --------------------- */ # if HAVE_PTHREAD_MUTEX_RECURSIVE # if defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP typedef pthread_mutex_t gl_recursive_lock_t; # define gl_recursive_lock_define(STORAGECLASS, NAME) \ STORAGECLASS pthread_mutex_t NAME; # define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS pthread_mutex_t NAME = gl_recursive_lock_initializer; # ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER # define gl_recursive_lock_initializer \ PTHREAD_RECURSIVE_MUTEX_INITIALIZER # else # define gl_recursive_lock_initializer \ PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP # endif # define gl_recursive_lock_init(NAME) \ if (pthread_in_use () && pthread_mutex_init (&NAME, NULL) != 0) abort () # define gl_recursive_lock_lock(NAME) \ if (pthread_in_use () && pthread_mutex_lock (&NAME) != 0) abort () # define gl_recursive_lock_unlock(NAME) \ if (pthread_in_use () && pthread_mutex_unlock (&NAME) != 0) abort () # define gl_recursive_lock_destroy(NAME) \ if (pthread_in_use () && pthread_mutex_destroy (&NAME) != 0) abort () # else typedef struct { pthread_mutex_t recmutex; /* recursive mutex */ pthread_mutex_t guard; /* protects the initialization */ int initialized; } gl_recursive_lock_t; # define gl_recursive_lock_define(STORAGECLASS, NAME) \ STORAGECLASS gl_recursive_lock_t NAME; # define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer; # define gl_recursive_lock_initializer \ { PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, 0 } # define gl_recursive_lock_init(NAME) \ if (pthread_in_use ()) glthread_recursive_lock_init (&NAME) # define gl_recursive_lock_lock(NAME) \ if (pthread_in_use ()) glthread_recursive_lock_lock (&NAME) # define gl_recursive_lock_unlock(NAME) \ if (pthread_in_use ()) glthread_recursive_lock_unlock (&NAME) # define gl_recursive_lock_destroy(NAME) \ if (pthread_in_use ()) glthread_recursive_lock_destroy (&NAME) extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock); # endif # else /* Old versions of POSIX threads on Solaris did not have recursive locks. We have to implement them ourselves. */ typedef struct { pthread_mutex_t mutex; pthread_t owner; unsigned long depth; } gl_recursive_lock_t; # define gl_recursive_lock_define(STORAGECLASS, NAME) \ STORAGECLASS gl_recursive_lock_t NAME; # define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer; # define gl_recursive_lock_initializer \ { PTHREAD_MUTEX_INITIALIZER, (pthread_t) 0, 0 } # define gl_recursive_lock_init(NAME) \ if (pthread_in_use ()) glthread_recursive_lock_init (&NAME) # define gl_recursive_lock_lock(NAME) \ if (pthread_in_use ()) glthread_recursive_lock_lock (&NAME) # define gl_recursive_lock_unlock(NAME) \ if (pthread_in_use ()) glthread_recursive_lock_unlock (&NAME) # define gl_recursive_lock_destroy(NAME) \ if (pthread_in_use ()) glthread_recursive_lock_destroy (&NAME) extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock); # endif /* -------------------------- gl_once_t datatype -------------------------- */ typedef pthread_once_t gl_once_t; # define gl_once_define(STORAGECLASS, NAME) \ STORAGECLASS pthread_once_t NAME = PTHREAD_ONCE_INIT; # define gl_once(NAME, INITFUNCTION) \ do \ { \ if (pthread_in_use ()) \ { \ if (pthread_once (&NAME, INITFUNCTION) != 0) \ abort (); \ } \ else \ { \ if (glthread_once_singlethreaded (&NAME)) \ INITFUNCTION (); \ } \ } \ while (0) extern int glthread_once_singlethreaded (pthread_once_t *once_control); # ifdef __cplusplus } # endif #endif /* ========================================================================= */ #if USE_PTH_THREADS /* Use the GNU Pth threads library. */ # include # include # ifdef __cplusplus extern "C" { # endif # if USE_PTH_THREADS_WEAK /* Use weak references to the GNU Pth threads library. */ # pragma weak pth_mutex_init # pragma weak pth_mutex_acquire # pragma weak pth_mutex_release # pragma weak pth_rwlock_init # pragma weak pth_rwlock_acquire # pragma weak pth_rwlock_release # pragma weak pth_once # pragma weak pth_cancel # define pth_in_use() (pth_cancel != NULL) # else # define pth_in_use() 1 # endif /* -------------------------- gl_lock_t datatype -------------------------- */ typedef pth_mutex_t gl_lock_t; # define gl_lock_define(STORAGECLASS, NAME) \ STORAGECLASS pth_mutex_t NAME; # define gl_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS pth_mutex_t NAME = gl_lock_initializer; # define gl_lock_initializer \ PTH_MUTEX_INIT # define gl_lock_init(NAME) \ if (pth_in_use() && !pth_mutex_init (&NAME)) abort () # define gl_lock_lock(NAME) \ if (pth_in_use() && !pth_mutex_acquire (&NAME, 0, NULL)) abort () # define gl_lock_unlock(NAME) \ if (pth_in_use() && !pth_mutex_release (&NAME)) abort () # define gl_lock_destroy(NAME) \ (void)(&NAME) /* ------------------------- gl_rwlock_t datatype ------------------------- */ typedef pth_rwlock_t gl_rwlock_t; # define gl_rwlock_define(STORAGECLASS, NAME) \ STORAGECLASS pth_rwlock_t NAME; # define gl_rwlock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS pth_rwlock_t NAME = gl_rwlock_initializer; # define gl_rwlock_initializer \ PTH_RWLOCK_INIT # define gl_rwlock_init(NAME) \ if (pth_in_use() && !pth_rwlock_init (&NAME)) abort () # define gl_rwlock_rdlock(NAME) \ if (pth_in_use() && !pth_rwlock_acquire (&NAME, PTH_RWLOCK_RD, 0, NULL)) abort () # define gl_rwlock_wrlock(NAME) \ if (pth_in_use() && !pth_rwlock_acquire (&NAME, PTH_RWLOCK_RW, 0, NULL)) abort () # define gl_rwlock_unlock(NAME) \ if (pth_in_use() && !pth_rwlock_release (&NAME)) abort () # define gl_rwlock_destroy(NAME) \ (void)(&NAME) /* --------------------- gl_recursive_lock_t datatype --------------------- */ /* In Pth, mutexes are recursive by default. */ typedef pth_mutex_t gl_recursive_lock_t; # define gl_recursive_lock_define(STORAGECLASS, NAME) \ STORAGECLASS pth_mutex_t NAME; # define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS pth_mutex_t NAME = gl_recursive_lock_initializer; # define gl_recursive_lock_initializer \ PTH_MUTEX_INIT # define gl_recursive_lock_init(NAME) \ if (pth_in_use() && !pth_mutex_init (&NAME)) abort () # define gl_recursive_lock_lock(NAME) \ if (pth_in_use() && !pth_mutex_acquire (&NAME, 0, NULL)) abort () # define gl_recursive_lock_unlock(NAME) \ if (pth_in_use() && !pth_mutex_release (&NAME)) abort () # define gl_recursive_lock_destroy(NAME) \ (void)(&NAME) /* -------------------------- gl_once_t datatype -------------------------- */ typedef pth_once_t gl_once_t; # define gl_once_define(STORAGECLASS, NAME) \ STORAGECLASS pth_once_t NAME = PTH_ONCE_INIT; # define gl_once(NAME, INITFUNCTION) \ do \ { \ if (pth_in_use ()) \ { \ void (*gl_once_temp) (void) = INITFUNCTION; \ if (!pth_once (&NAME, glthread_once_call, &gl_once_temp)) \ abort (); \ } \ else \ { \ if (glthread_once_singlethreaded (&NAME)) \ INITFUNCTION (); \ } \ } \ while (0) extern void glthread_once_call (void *arg); extern int glthread_once_singlethreaded (pth_once_t *once_control); # ifdef __cplusplus } # endif #endif /* ========================================================================= */ #if USE_SOLARIS_THREADS /* Use the old Solaris threads library. */ # include # include # include # ifdef __cplusplus extern "C" { # endif # if USE_SOLARIS_THREADS_WEAK /* Use weak references to the old Solaris threads library. */ # pragma weak mutex_init # pragma weak mutex_lock # pragma weak mutex_unlock # pragma weak mutex_destroy # pragma weak rwlock_init # pragma weak rw_rdlock # pragma weak rw_wrlock # pragma weak rw_unlock # pragma weak rwlock_destroy # pragma weak thr_self # pragma weak thr_suspend # define thread_in_use() (thr_suspend != NULL) # else # define thread_in_use() 1 # endif /* -------------------------- gl_lock_t datatype -------------------------- */ typedef mutex_t gl_lock_t; # define gl_lock_define(STORAGECLASS, NAME) \ STORAGECLASS mutex_t NAME; # define gl_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS mutex_t NAME = gl_lock_initializer; # define gl_lock_initializer \ DEFAULTMUTEX # define gl_lock_init(NAME) \ if (thread_in_use () && mutex_init (&NAME, USYNC_THREAD, NULL) != 0) abort () # define gl_lock_lock(NAME) \ if (thread_in_use () && mutex_lock (&NAME) != 0) abort () # define gl_lock_unlock(NAME) \ if (thread_in_use () && mutex_unlock (&NAME) != 0) abort () # define gl_lock_destroy(NAME) \ if (thread_in_use () && mutex_destroy (&NAME) != 0) abort () /* ------------------------- gl_rwlock_t datatype ------------------------- */ typedef rwlock_t gl_rwlock_t; # define gl_rwlock_define(STORAGECLASS, NAME) \ STORAGECLASS rwlock_t NAME; # define gl_rwlock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS rwlock_t NAME = gl_rwlock_initializer; # define gl_rwlock_initializer \ DEFAULTRWLOCK # define gl_rwlock_init(NAME) \ if (thread_in_use () && rwlock_init (&NAME, USYNC_THREAD, NULL) != 0) abort () # define gl_rwlock_rdlock(NAME) \ if (thread_in_use () && rw_rdlock (&NAME) != 0) abort () # define gl_rwlock_wrlock(NAME) \ if (thread_in_use () && rw_wrlock (&NAME) != 0) abort () # define gl_rwlock_unlock(NAME) \ if (thread_in_use () && rw_unlock (&NAME) != 0) abort () # define gl_rwlock_destroy(NAME) \ if (thread_in_use () && rwlock_destroy (&NAME) != 0) abort () /* --------------------- gl_recursive_lock_t datatype --------------------- */ /* Old Solaris threads did not have recursive locks. We have to implement them ourselves. */ typedef struct { mutex_t mutex; thread_t owner; unsigned long depth; } gl_recursive_lock_t; # define gl_recursive_lock_define(STORAGECLASS, NAME) \ STORAGECLASS gl_recursive_lock_t NAME; # define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer; # define gl_recursive_lock_initializer \ { DEFAULTMUTEX, (thread_t) 0, 0 } # define gl_recursive_lock_init(NAME) \ if (thread_in_use ()) glthread_recursive_lock_init (&NAME) # define gl_recursive_lock_lock(NAME) \ if (thread_in_use ()) glthread_recursive_lock_lock (&NAME) # define gl_recursive_lock_unlock(NAME) \ if (thread_in_use ()) glthread_recursive_lock_unlock (&NAME) # define gl_recursive_lock_destroy(NAME) \ if (thread_in_use ()) glthread_recursive_lock_destroy (&NAME) extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock); /* -------------------------- gl_once_t datatype -------------------------- */ typedef struct { volatile int inited; mutex_t mutex; } gl_once_t; # define gl_once_define(STORAGECLASS, NAME) \ STORAGECLASS gl_once_t NAME = { 0, DEFAULTMUTEX }; # define gl_once(NAME, INITFUNCTION) \ do \ { \ if (thread_in_use ()) \ { \ glthread_once (&NAME, INITFUNCTION); \ } \ else \ { \ if (glthread_once_singlethreaded (&NAME)) \ INITFUNCTION (); \ } \ } \ while (0) extern void glthread_once (gl_once_t *once_control, void (*initfunction) (void)); extern int glthread_once_singlethreaded (gl_once_t *once_control); # ifdef __cplusplus } # endif #endif /* ========================================================================= */ #if USE_WIN32_THREADS # include # ifdef __cplusplus extern "C" { # endif /* We can use CRITICAL_SECTION directly, rather than the Win32 Event, Mutex, Semaphore types, because - we need only to synchronize inside a single process (address space), not inter-process locking, - we don't need to support trylock operations. (TryEnterCriticalSection does not work on Windows 95/98/ME. Packages that need trylock usually define their own mutex type.) */ /* There is no way to statically initialize a CRITICAL_SECTION. It needs to be done lazily, once only. For this we need spinlocks. */ typedef struct { volatile int done; volatile long started; } gl_spinlock_t; /* -------------------------- gl_lock_t datatype -------------------------- */ typedef struct { gl_spinlock_t guard; /* protects the initialization */ CRITICAL_SECTION lock; } gl_lock_t; # define gl_lock_define(STORAGECLASS, NAME) \ STORAGECLASS gl_lock_t NAME; # define gl_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS gl_lock_t NAME = gl_lock_initializer; # define gl_lock_initializer \ { { 0, -1 } } # define gl_lock_init(NAME) \ glthread_lock_init (&NAME) # define gl_lock_lock(NAME) \ glthread_lock_lock (&NAME) # define gl_lock_unlock(NAME) \ glthread_lock_unlock (&NAME) # define gl_lock_destroy(NAME) \ glthread_lock_destroy (&NAME) extern void glthread_lock_init (gl_lock_t *lock); extern void glthread_lock_lock (gl_lock_t *lock); extern void glthread_lock_unlock (gl_lock_t *lock); extern void glthread_lock_destroy (gl_lock_t *lock); /* ------------------------- gl_rwlock_t datatype ------------------------- */ /* It is impossible to implement read-write locks using plain locks, without introducing an extra thread dedicated to managing read-write locks. Therefore here we need to use the low-level Event type. */ typedef struct { HANDLE *array; /* array of waiting threads, each represented by an event */ unsigned int count; /* number of waiting threads */ unsigned int alloc; /* length of allocated array */ unsigned int offset; /* index of first waiting thread in array */ } gl_waitqueue_t; typedef struct { gl_spinlock_t guard; /* protects the initialization */ CRITICAL_SECTION lock; /* protects the remaining fields */ gl_waitqueue_t waiting_readers; /* waiting readers */ gl_waitqueue_t waiting_writers; /* waiting writers */ int runcount; /* number of readers running, or -1 when a writer runs */ } gl_rwlock_t; # define gl_rwlock_define(STORAGECLASS, NAME) \ STORAGECLASS gl_rwlock_t NAME; # define gl_rwlock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer; # define gl_rwlock_initializer \ { { 0, -1 } } # define gl_rwlock_init(NAME) \ glthread_rwlock_init (&NAME) # define gl_rwlock_rdlock(NAME) \ glthread_rwlock_rdlock (&NAME) # define gl_rwlock_wrlock(NAME) \ glthread_rwlock_wrlock (&NAME) # define gl_rwlock_unlock(NAME) \ glthread_rwlock_unlock (&NAME) # define gl_rwlock_destroy(NAME) \ glthread_rwlock_destroy (&NAME) extern void glthread_rwlock_init (gl_rwlock_t *lock); extern void glthread_rwlock_rdlock (gl_rwlock_t *lock); extern void glthread_rwlock_wrlock (gl_rwlock_t *lock); extern void glthread_rwlock_unlock (gl_rwlock_t *lock); extern void glthread_rwlock_destroy (gl_rwlock_t *lock); /* --------------------- gl_recursive_lock_t datatype --------------------- */ /* The Win32 documentation says that CRITICAL_SECTION already implements a recursive lock. But we need not rely on it: It's easy to implement a recursive lock without this assumption. */ typedef struct { gl_spinlock_t guard; /* protects the initialization */ DWORD owner; unsigned long depth; CRITICAL_SECTION lock; } gl_recursive_lock_t; # define gl_recursive_lock_define(STORAGECLASS, NAME) \ STORAGECLASS gl_recursive_lock_t NAME; # define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer; # define gl_recursive_lock_initializer \ { { 0, -1 }, 0, 0 } # define gl_recursive_lock_init(NAME) \ glthread_recursive_lock_init (&NAME) # define gl_recursive_lock_lock(NAME) \ glthread_recursive_lock_lock (&NAME) # define gl_recursive_lock_unlock(NAME) \ glthread_recursive_lock_unlock (&NAME) # define gl_recursive_lock_destroy(NAME) \ glthread_recursive_lock_destroy (&NAME) extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock); /* -------------------------- gl_once_t datatype -------------------------- */ typedef struct { volatile int inited; volatile long started; CRITICAL_SECTION lock; } gl_once_t; # define gl_once_define(STORAGECLASS, NAME) \ STORAGECLASS gl_once_t NAME = { -1, -1 }; # define gl_once(NAME, INITFUNCTION) \ glthread_once (&NAME, INITFUNCTION) extern void glthread_once (gl_once_t *once_control, void (*initfunction) (void)); # ifdef __cplusplus } # endif #endif /* ========================================================================= */ #if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WIN32_THREADS) /* Provide dummy implementation if threads are not supported. */ /* -------------------------- gl_lock_t datatype -------------------------- */ typedef int gl_lock_t; # define gl_lock_define(STORAGECLASS, NAME) # define gl_lock_define_initialized(STORAGECLASS, NAME) # define gl_lock_init(NAME) # define gl_lock_lock(NAME) # define gl_lock_unlock(NAME) /* ------------------------- gl_rwlock_t datatype ------------------------- */ typedef int gl_rwlock_t; # define gl_rwlock_define(STORAGECLASS, NAME) # define gl_rwlock_define_initialized(STORAGECLASS, NAME) # define gl_rwlock_init(NAME) # define gl_rwlock_rdlock(NAME) # define gl_rwlock_wrlock(NAME) # define gl_rwlock_unlock(NAME) /* --------------------- gl_recursive_lock_t datatype --------------------- */ typedef int gl_recursive_lock_t; # define gl_recursive_lock_define(STORAGECLASS, NAME) # define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) # define gl_recursive_lock_init(NAME) # define gl_recursive_lock_lock(NAME) # define gl_recursive_lock_unlock(NAME) /* -------------------------- gl_once_t datatype -------------------------- */ typedef int gl_once_t; # define gl_once_define(STORAGECLASS, NAME) \ STORAGECLASS gl_once_t NAME = 0; # define gl_once(NAME, INITFUNCTION) \ do \ { \ if (NAME == 0) \ { \ NAME = ~ 0; \ INITFUNCTION (); \ } \ } \ while (0) #endif /* ========================================================================= */ #endif /* _LOCK_H */ pbbuttonsd-0.8.1a/intl/relocatable.h0000644000175000017500000000543210641705132014365 00000000000000/* Provide relocatable packages. Copyright (C) 2003, 2005 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _RELOCATABLE_H #define _RELOCATABLE_H #ifdef __cplusplus extern "C" { #endif /* This can be enabled through the configure --enable-relocatable option. */ #if ENABLE_RELOCATABLE /* When building a DLL, we must export some functions. Note that because this is a private .h file, we don't need to use __declspec(dllimport) in any case. */ #if HAVE_VISIBILITY && BUILDING_DLL # define RELOCATABLE_DLL_EXPORTED __attribute__((__visibility__("default"))) #elif defined _MSC_VER && BUILDING_DLL # define RELOCATABLE_DLL_EXPORTED __declspec(dllexport) #else # define RELOCATABLE_DLL_EXPORTED #endif /* Sets the original and the current installation prefix of the package. Relocation simply replaces a pathname starting with the original prefix by the corresponding pathname with the current prefix instead. Both prefixes should be directory names without trailing slash (i.e. use "" instead of "/"). */ extern RELOCATABLE_DLL_EXPORTED void set_relocation_prefix (const char *orig_prefix, const char *curr_prefix); /* Returns the pathname, relocated according to the current installation directory. */ extern const char * relocate (const char *pathname); /* Memory management: relocate() leaks memory, because it has to construct a fresh pathname. If this is a problem because your program calls relocate() frequently, think about caching the result. */ /* Convenience function: Computes the current installation prefix, based on the original installation prefix, the original installation directory of a particular file, and the current pathname of this file. Returns NULL upon failure. */ extern const char * compute_curr_prefix (const char *orig_installprefix, const char *orig_installdir, const char *curr_pathname); #else /* By default, we use the hardwired pathnames. */ #define relocate(pathname) (pathname) #endif #ifdef __cplusplus } #endif #endif /* _RELOCATABLE_H */ pbbuttonsd-0.8.1a/intl/xsize.h0000644000175000017500000000672610641705133013262 00000000000000/* xsize.h -- Checked size_t computations. Copyright (C) 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _XSIZE_H #define _XSIZE_H /* Get size_t. */ #include /* Get SIZE_MAX. */ #include #if HAVE_STDINT_H # include #endif /* The size of memory objects is often computed through expressions of type size_t. Example: void* p = malloc (header_size + n * element_size). These computations can lead to overflow. When this happens, malloc() returns a piece of memory that is way too small, and the program then crashes while attempting to fill the memory. To avoid this, the functions and macros in this file check for overflow. The convention is that SIZE_MAX represents overflow. malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc implementation that uses mmap --, it's recommended to use size_overflow_p() or size_in_bounds_p() before invoking malloc(). The example thus becomes: size_t size = xsum (header_size, xtimes (n, element_size)); void *p = (size_in_bounds_p (size) ? malloc (size) : NULL); */ /* Convert an arbitrary value >= 0 to type size_t. */ #define xcast_size_t(N) \ ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX) /* Sum of two sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xsum (size_t size1, size_t size2) { size_t sum = size1 + size2; return (sum >= size1 ? sum : SIZE_MAX); } /* Sum of three sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xsum3 (size_t size1, size_t size2, size_t size3) { return xsum (xsum (size1, size2), size3); } /* Sum of four sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xsum4 (size_t size1, size_t size2, size_t size3, size_t size4) { return xsum (xsum (xsum (size1, size2), size3), size4); } /* Maximum of two sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xmax (size_t size1, size_t size2) { /* No explicit check is needed here, because for any n: max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */ return (size1 >= size2 ? size1 : size2); } /* Multiplication of a count with an element size, with overflow check. The count must be >= 0 and the element size must be > 0. This is a macro, not an inline function, so that it works correctly even when N is of a wider tupe and N > SIZE_MAX. */ #define xtimes(N, ELSIZE) \ ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX) /* Check for overflow. */ #define size_overflow_p(SIZE) \ ((SIZE) == SIZE_MAX) /* Check against overflow. */ #define size_in_bounds_p(SIZE) \ ((SIZE) != SIZE_MAX) #endif /* _XSIZE_H */ pbbuttonsd-0.8.1a/intl/printf-args.h0000644000175000017500000000553410641705132014347 00000000000000/* Decomposed printf argument list. Copyright (C) 1999, 2002-2003, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PRINTF_ARGS_H #define _PRINTF_ARGS_H /* Get size_t. */ #include /* Get wchar_t. */ #ifdef HAVE_WCHAR_T # include #endif /* Get wint_t. */ #ifdef HAVE_WINT_T # include #endif /* Get va_list. */ #include /* Argument types */ typedef enum { TYPE_NONE, TYPE_SCHAR, TYPE_UCHAR, TYPE_SHORT, TYPE_USHORT, TYPE_INT, TYPE_UINT, TYPE_LONGINT, TYPE_ULONGINT, #ifdef HAVE_LONG_LONG_INT TYPE_LONGLONGINT, TYPE_ULONGLONGINT, #endif TYPE_DOUBLE, #ifdef HAVE_LONG_DOUBLE TYPE_LONGDOUBLE, #endif TYPE_CHAR, #ifdef HAVE_WINT_T TYPE_WIDE_CHAR, #endif TYPE_STRING, #ifdef HAVE_WCHAR_T TYPE_WIDE_STRING, #endif TYPE_POINTER, TYPE_COUNT_SCHAR_POINTER, TYPE_COUNT_SHORT_POINTER, TYPE_COUNT_INT_POINTER, TYPE_COUNT_LONGINT_POINTER #ifdef HAVE_LONG_LONG_INT , TYPE_COUNT_LONGLONGINT_POINTER #endif } arg_type; /* Polymorphic argument */ typedef struct { arg_type type; union { signed char a_schar; unsigned char a_uchar; short a_short; unsigned short a_ushort; int a_int; unsigned int a_uint; long int a_longint; unsigned long int a_ulongint; #ifdef HAVE_LONG_LONG_INT long long int a_longlongint; unsigned long long int a_ulonglongint; #endif float a_float; double a_double; #ifdef HAVE_LONG_DOUBLE long double a_longdouble; #endif int a_char; #ifdef HAVE_WINT_T wint_t a_wide_char; #endif const char* a_string; #ifdef HAVE_WCHAR_T const wchar_t* a_wide_string; #endif void* a_pointer; signed char * a_count_schar_pointer; short * a_count_short_pointer; int * a_count_int_pointer; long int * a_count_longint_pointer; #ifdef HAVE_LONG_LONG_INT long long int * a_count_longlongint_pointer; #endif } a; } argument; typedef struct { size_t count; argument *arg; } arguments; /* Fetch the arguments, putting them into a. */ #ifdef STATIC STATIC #else extern #endif int printf_fetchargs (va_list args, arguments *a); #endif /* _PRINTF_ARGS_H */ pbbuttonsd-0.8.1a/intl/printf-args.c0000644000175000017500000001011010641705132014324 00000000000000/* Decomposed printf argument list. Copyright (C) 1999, 2002-2003, 2005-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* Specification. */ #include "printf-args.h" #ifdef STATIC STATIC #endif int printf_fetchargs (va_list args, arguments *a) { size_t i; argument *ap; for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++) switch (ap->type) { case TYPE_SCHAR: ap->a.a_schar = va_arg (args, /*signed char*/ int); break; case TYPE_UCHAR: ap->a.a_uchar = va_arg (args, /*unsigned char*/ int); break; case TYPE_SHORT: ap->a.a_short = va_arg (args, /*short*/ int); break; case TYPE_USHORT: ap->a.a_ushort = va_arg (args, /*unsigned short*/ int); break; case TYPE_INT: ap->a.a_int = va_arg (args, int); break; case TYPE_UINT: ap->a.a_uint = va_arg (args, unsigned int); break; case TYPE_LONGINT: ap->a.a_longint = va_arg (args, long int); break; case TYPE_ULONGINT: ap->a.a_ulongint = va_arg (args, unsigned long int); break; #ifdef HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: ap->a.a_longlongint = va_arg (args, long long int); break; case TYPE_ULONGLONGINT: ap->a.a_ulonglongint = va_arg (args, unsigned long long int); break; #endif case TYPE_DOUBLE: ap->a.a_double = va_arg (args, double); break; #ifdef HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: ap->a.a_longdouble = va_arg (args, long double); break; #endif case TYPE_CHAR: ap->a.a_char = va_arg (args, int); break; #ifdef HAVE_WINT_T case TYPE_WIDE_CHAR: /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by default argument promotions", this is not the case in mingw32, where wint_t is 'unsigned short'. */ ap->a.a_wide_char = (sizeof (wint_t) < sizeof (int) ? va_arg (args, int) : va_arg (args, wint_t)); break; #endif case TYPE_STRING: ap->a.a_string = va_arg (args, const char *); /* A null pointer is an invalid argument for "%s", but in practice it occurs quite frequently in printf statements that produce debug output. Use a fallback in this case. */ if (ap->a.a_string == NULL) ap->a.a_string = "(NULL)"; break; #ifdef HAVE_WCHAR_T case TYPE_WIDE_STRING: ap->a.a_wide_string = va_arg (args, const wchar_t *); /* A null pointer is an invalid argument for "%ls", but in practice it occurs quite frequently in printf statements that produce debug output. Use a fallback in this case. */ if (ap->a.a_wide_string == NULL) { static const wchar_t wide_null_string[] = { (wchar_t)'(', (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L', (wchar_t)')', (wchar_t)0 }; ap->a.a_wide_string = wide_null_string; } break; #endif case TYPE_POINTER: ap->a.a_pointer = va_arg (args, void *); break; case TYPE_COUNT_SCHAR_POINTER: ap->a.a_count_schar_pointer = va_arg (args, signed char *); break; case TYPE_COUNT_SHORT_POINTER: ap->a.a_count_short_pointer = va_arg (args, short *); break; case TYPE_COUNT_INT_POINTER: ap->a.a_count_int_pointer = va_arg (args, int *); break; case TYPE_COUNT_LONGINT_POINTER: ap->a.a_count_longint_pointer = va_arg (args, long int *); break; #ifdef HAVE_LONG_LONG_INT case TYPE_COUNT_LONGLONGINT_POINTER: ap->a.a_count_longlongint_pointer = va_arg (args, long long int *); break; #endif default: /* Unknown type. */ return -1; } return 0; } pbbuttonsd-0.8.1a/intl/printf-parse.h0000644000175000017500000000421310641705132014516 00000000000000/* Parse printf format string. Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PRINTF_PARSE_H #define _PRINTF_PARSE_H #include "printf-args.h" /* Flags */ #define FLAG_GROUP 1 /* ' flag */ #define FLAG_LEFT 2 /* - flag */ #define FLAG_SHOWSIGN 4 /* + flag */ #define FLAG_SPACE 8 /* space flag */ #define FLAG_ALT 16 /* # flag */ #define FLAG_ZERO 32 /* arg_index value indicating that no argument is consumed. */ #define ARG_NONE (~(size_t)0) /* A parsed directive. */ typedef struct { const char* dir_start; const char* dir_end; int flags; const char* width_start; const char* width_end; size_t width_arg_index; const char* precision_start; const char* precision_end; size_t precision_arg_index; char conversion; /* d i o u x X f e E g G c s p n U % but not C S */ size_t arg_index; } char_directive; /* A parsed format string. */ typedef struct { size_t count; char_directive *dir; size_t max_width_length; size_t max_precision_length; } char_directives; /* Parses the format string. Fills in the number N of directives, and fills in directives[0], ..., directives[N-1], and sets directives[N].dir_start to the end of the format string. Also fills in the arg_type fields of the arguments and the needed count of arguments. */ #ifdef STATIC STATIC #else extern #endif int printf_parse (const char *format, char_directives *d, arguments *a); #endif /* _PRINTF_PARSE_H */ pbbuttonsd-0.8.1a/intl/wprintf-parse.h0000644000175000017500000000426310641705133014713 00000000000000/* Parse printf format string. Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _WPRINTF_PARSE_H #define _WPRINTF_PARSE_H #include "printf-args.h" /* Flags */ #define FLAG_GROUP 1 /* ' flag */ #define FLAG_LEFT 2 /* - flag */ #define FLAG_SHOWSIGN 4 /* + flag */ #define FLAG_SPACE 8 /* space flag */ #define FLAG_ALT 16 /* # flag */ #define FLAG_ZERO 32 /* arg_index value indicating that no argument is consumed. */ #define ARG_NONE (~(size_t)0) /* A parsed directive. */ typedef struct { const wchar_t* dir_start; const wchar_t* dir_end; int flags; const wchar_t* width_start; const wchar_t* width_end; size_t width_arg_index; const wchar_t* precision_start; const wchar_t* precision_end; size_t precision_arg_index; wchar_t conversion; /* d i o u x X f e E g G c s p n U % but not C S */ size_t arg_index; } wchar_t_directive; /* A parsed format string. */ typedef struct { size_t count; wchar_t_directive *dir; size_t max_width_length; size_t max_precision_length; } wchar_t_directives; /* Parses the format string. Fills in the number N of directives, and fills in directives[0], ..., directives[N-1], and sets directives[N].dir_start to the end of the format string. Also fills in the arg_type fields of the arguments and the needed count of arguments. */ #ifdef STATIC STATIC #else extern #endif int wprintf_parse (const wchar_t *format, wchar_t_directives *d, arguments *a); #endif /* _WPRINTF_PARSE_H */ pbbuttonsd-0.8.1a/intl/printf-parse.c0000644000175000017500000003033010641705132014510 00000000000000/* Formatted output to strings. Copyright (C) 1999-2000, 2002-2003, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* Specification. */ #if WIDE_CHAR_VERSION # include "wprintf-parse.h" #else # include "printf-parse.h" #endif /* Get size_t, NULL. */ #include /* Get intmax_t. */ #if HAVE_STDINT_H_WITH_UINTMAX # include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX # include #endif /* malloc(), realloc(), free(). */ #include /* Checked size_t computations. */ #include "xsize.h" #if WIDE_CHAR_VERSION # define PRINTF_PARSE wprintf_parse # define CHAR_T wchar_t # define DIRECTIVE wchar_t_directive # define DIRECTIVES wchar_t_directives #else # define PRINTF_PARSE printf_parse # define CHAR_T char # define DIRECTIVE char_directive # define DIRECTIVES char_directives #endif #ifdef STATIC STATIC #endif int PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) { const CHAR_T *cp = format; /* pointer into format */ size_t arg_posn = 0; /* number of regular arguments consumed */ size_t d_allocated; /* allocated elements of d->dir */ size_t a_allocated; /* allocated elements of a->arg */ size_t max_width_length = 0; size_t max_precision_length = 0; d->count = 0; d_allocated = 1; d->dir = malloc (d_allocated * sizeof (DIRECTIVE)); if (d->dir == NULL) /* Out of memory. */ return -1; a->count = 0; a_allocated = 0; a->arg = NULL; #define REGISTER_ARG(_index_,_type_) \ { \ size_t n = (_index_); \ if (n >= a_allocated) \ { \ size_t memory_size; \ argument *memory; \ \ a_allocated = xtimes (a_allocated, 2); \ if (a_allocated <= n) \ a_allocated = xsum (n, 1); \ memory_size = xtimes (a_allocated, sizeof (argument)); \ if (size_overflow_p (memory_size)) \ /* Overflow, would lead to out of memory. */ \ goto error; \ memory = (a->arg \ ? realloc (a->arg, memory_size) \ : malloc (memory_size)); \ if (memory == NULL) \ /* Out of memory. */ \ goto error; \ a->arg = memory; \ } \ while (a->count <= n) \ a->arg[a->count++].type = TYPE_NONE; \ if (a->arg[n].type == TYPE_NONE) \ a->arg[n].type = (_type_); \ else if (a->arg[n].type != (_type_)) \ /* Ambiguous type for positional argument. */ \ goto error; \ } while (*cp != '\0') { CHAR_T c = *cp++; if (c == '%') { size_t arg_index = ARG_NONE; DIRECTIVE *dp = &d->dir[d->count];/* pointer to next directive */ /* Initialize the next directive. */ dp->dir_start = cp - 1; dp->flags = 0; dp->width_start = NULL; dp->width_end = NULL; dp->width_arg_index = ARG_NONE; dp->precision_start = NULL; dp->precision_end = NULL; dp->precision_arg_index = ARG_NONE; dp->arg_index = ARG_NONE; /* Test for positional argument. */ if (*cp >= '0' && *cp <= '9') { const CHAR_T *np; for (np = cp; *np >= '0' && *np <= '9'; np++) ; if (*np == '$') { size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; if (size_overflow_p (n)) /* n too large, would lead to out of memory later. */ goto error; arg_index = n - 1; cp = np + 1; } } /* Read the flags. */ for (;;) { if (*cp == '\'') { dp->flags |= FLAG_GROUP; cp++; } else if (*cp == '-') { dp->flags |= FLAG_LEFT; cp++; } else if (*cp == '+') { dp->flags |= FLAG_SHOWSIGN; cp++; } else if (*cp == ' ') { dp->flags |= FLAG_SPACE; cp++; } else if (*cp == '#') { dp->flags |= FLAG_ALT; cp++; } else if (*cp == '0') { dp->flags |= FLAG_ZERO; cp++; } else break; } /* Parse the field width. */ if (*cp == '*') { dp->width_start = cp; cp++; dp->width_end = cp; if (max_width_length < 1) max_width_length = 1; /* Test for positional argument. */ if (*cp >= '0' && *cp <= '9') { const CHAR_T *np; for (np = cp; *np >= '0' && *np <= '9'; np++) ; if (*np == '$') { size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; if (size_overflow_p (n)) /* n too large, would lead to out of memory later. */ goto error; dp->width_arg_index = n - 1; cp = np + 1; } } if (dp->width_arg_index == ARG_NONE) { dp->width_arg_index = arg_posn++; if (dp->width_arg_index == ARG_NONE) /* arg_posn wrapped around. */ goto error; } REGISTER_ARG (dp->width_arg_index, TYPE_INT); } else if (*cp >= '0' && *cp <= '9') { size_t width_length; dp->width_start = cp; for (; *cp >= '0' && *cp <= '9'; cp++) ; dp->width_end = cp; width_length = dp->width_end - dp->width_start; if (max_width_length < width_length) max_width_length = width_length; } /* Parse the precision. */ if (*cp == '.') { cp++; if (*cp == '*') { dp->precision_start = cp - 1; cp++; dp->precision_end = cp; if (max_precision_length < 2) max_precision_length = 2; /* Test for positional argument. */ if (*cp >= '0' && *cp <= '9') { const CHAR_T *np; for (np = cp; *np >= '0' && *np <= '9'; np++) ; if (*np == '$') { size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; if (size_overflow_p (n)) /* n too large, would lead to out of memory later. */ goto error; dp->precision_arg_index = n - 1; cp = np + 1; } } if (dp->precision_arg_index == ARG_NONE) { dp->precision_arg_index = arg_posn++; if (dp->precision_arg_index == ARG_NONE) /* arg_posn wrapped around. */ goto error; } REGISTER_ARG (dp->precision_arg_index, TYPE_INT); } else { size_t precision_length; dp->precision_start = cp - 1; for (; *cp >= '0' && *cp <= '9'; cp++) ; dp->precision_end = cp; precision_length = dp->precision_end - dp->precision_start; if (max_precision_length < precision_length) max_precision_length = precision_length; } } { arg_type type; /* Parse argument type/size specifiers. */ { int flags = 0; for (;;) { if (*cp == 'h') { flags |= (1 << (flags & 1)); cp++; } else if (*cp == 'L') { flags |= 4; cp++; } else if (*cp == 'l') { flags += 8; cp++; } #ifdef HAVE_INTMAX_T else if (*cp == 'j') { if (sizeof (intmax_t) > sizeof (long)) { /* intmax_t = long long */ flags += 16; } else if (sizeof (intmax_t) > sizeof (int)) { /* intmax_t = long */ flags += 8; } cp++; } #endif else if (*cp == 'z' || *cp == 'Z') { /* 'z' is standardized in ISO C 99, but glibc uses 'Z' because the warning facility in gcc-2.95.2 understands only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */ if (sizeof (size_t) > sizeof (long)) { /* size_t = long long */ flags += 16; } else if (sizeof (size_t) > sizeof (int)) { /* size_t = long */ flags += 8; } cp++; } else if (*cp == 't') { if (sizeof (ptrdiff_t) > sizeof (long)) { /* ptrdiff_t = long long */ flags += 16; } else if (sizeof (ptrdiff_t) > sizeof (int)) { /* ptrdiff_t = long */ flags += 8; } cp++; } else break; } /* Read the conversion character. */ c = *cp++; switch (c) { case 'd': case 'i': #ifdef HAVE_LONG_LONG_INT /* If 'long long' exists and is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_LONGLONGINT; else #endif /* If 'long long' exists and is the same as 'long', we parse "lld" into TYPE_LONGINT. */ if (flags >= 8) type = TYPE_LONGINT; else if (flags & 2) type = TYPE_SCHAR; else if (flags & 1) type = TYPE_SHORT; else type = TYPE_INT; break; case 'o': case 'u': case 'x': case 'X': #ifdef HAVE_LONG_LONG_INT /* If 'long long' exists and is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_ULONGLONGINT; else #endif /* If 'unsigned long long' exists and is the same as 'unsigned long', we parse "llu" into TYPE_ULONGINT. */ if (flags >= 8) type = TYPE_ULONGINT; else if (flags & 2) type = TYPE_UCHAR; else if (flags & 1) type = TYPE_USHORT; else type = TYPE_UINT; break; case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': case 'a': case 'A': #ifdef HAVE_LONG_DOUBLE if (flags >= 16 || (flags & 4)) type = TYPE_LONGDOUBLE; else #endif type = TYPE_DOUBLE; break; case 'c': if (flags >= 8) #ifdef HAVE_WINT_T type = TYPE_WIDE_CHAR; #else goto error; #endif else type = TYPE_CHAR; break; #ifdef HAVE_WINT_T case 'C': type = TYPE_WIDE_CHAR; c = 'c'; break; #endif case 's': if (flags >= 8) #ifdef HAVE_WCHAR_T type = TYPE_WIDE_STRING; #else goto error; #endif else type = TYPE_STRING; break; #ifdef HAVE_WCHAR_T case 'S': type = TYPE_WIDE_STRING; c = 's'; break; #endif case 'p': type = TYPE_POINTER; break; case 'n': #ifdef HAVE_LONG_LONG_INT /* If 'long long' exists and is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_COUNT_LONGLONGINT_POINTER; else #endif /* If 'long long' exists and is the same as 'long', we parse "lln" into TYPE_COUNT_LONGINT_POINTER. */ if (flags >= 8) type = TYPE_COUNT_LONGINT_POINTER; else if (flags & 2) type = TYPE_COUNT_SCHAR_POINTER; else if (flags & 1) type = TYPE_COUNT_SHORT_POINTER; else type = TYPE_COUNT_INT_POINTER; break; case '%': type = TYPE_NONE; break; default: /* Unknown conversion character. */ goto error; } } if (type != TYPE_NONE) { dp->arg_index = arg_index; if (dp->arg_index == ARG_NONE) { dp->arg_index = arg_posn++; if (dp->arg_index == ARG_NONE) /* arg_posn wrapped around. */ goto error; } REGISTER_ARG (dp->arg_index, type); } dp->conversion = c; dp->dir_end = cp; } d->count++; if (d->count >= d_allocated) { size_t memory_size; DIRECTIVE *memory; d_allocated = xtimes (d_allocated, 2); memory_size = xtimes (d_allocated, sizeof (DIRECTIVE)); if (size_overflow_p (memory_size)) /* Overflow, would lead to out of memory. */ goto error; memory = realloc (d->dir, memory_size); if (memory == NULL) /* Out of memory. */ goto error; d->dir = memory; } } } d->dir[d->count].dir_start = cp; d->max_width_length = max_width_length; d->max_precision_length = max_precision_length; return 0; error: if (a->arg) free (a->arg); if (d->dir) free (d->dir); return -1; } #undef DIRECTIVES #undef DIRECTIVE #undef CHAR_T #undef PRINTF_PARSE pbbuttonsd-0.8.1a/intl/vasnprintf.h0000644000175000017500000000544310641705133014305 00000000000000/* vsprintf with automatic memory allocation. Copyright (C) 2002-2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _VASNPRINTF_H #define _VASNPRINTF_H /* Get va_list. */ #include /* Get size_t. */ #include #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ # define __attribute__(Spec) /* empty */ # endif /* The __-protected variants of `format' and `printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __format__ format # define __printf__ printf # endif #endif #ifdef __cplusplus extern "C" { #endif /* Write formatted output to a string dynamically allocated with malloc(). You can pass a preallocated buffer for the result in RESULTBUF and its size in *LENGTHP; otherwise you pass RESULTBUF = NULL. If successful, return the address of the string (this may be = RESULTBUF if no dynamic memory allocation was necessary) and set *LENGTHP to the number of resulting bytes, excluding the trailing NUL. Upon error, set errno and return NULL. When dynamic memory allocation occurs, the preallocated buffer is left alone (with possibly modified contents). This makes it possible to use a statically allocated or stack-allocated buffer, like this: char buf[100]; size_t len = sizeof (buf); char *output = vasnprintf (buf, &len, format, args); if (output == NULL) ... error handling ...; else { ... use the output string ...; if (output != buf) free (output); } */ extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) __attribute__ ((__format__ (__printf__, 3, 0))); #ifdef __cplusplus } #endif #endif /* _VASNPRINTF_H */ pbbuttonsd-0.8.1a/intl/vasnwprintf.h0000644000175000017500000000330610641705133014470 00000000000000/* vswprintf with automatic memory allocation. Copyright (C) 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _VASNWPRINTF_H #define _VASNWPRINTF_H /* Get va_list. */ #include /* Get wchar_t, size_t. */ #include #ifdef __cplusplus extern "C" { #endif /* Write formatted output to a string dynamically allocated with malloc(). You can pass a preallocated buffer for the result in RESULTBUF and its size in *LENGTHP; otherwise you pass RESULTBUF = NULL. If successful, return the address of the string (this may be = RESULTBUF if no dynamic memory allocation was necessary) and set *LENGTHP to the number of resulting bytes, excluding the trailing NUL. Upon error, set errno and return NULL. */ extern wchar_t * asnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, ...); extern wchar_t * vasnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, va_list args); #ifdef __cplusplus } #endif #endif /* _VASNWPRINTF_H */ pbbuttonsd-0.8.1a/intl/vasnprintf.c0000644000175000017500000005355010641705133014302 00000000000000/* vsprintf with automatic memory allocation. Copyright (C) 1999, 2002-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Tell glibc's to provide a prototype for snprintf(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #include #ifndef IN_LIBINTL # include #endif /* Specification. */ #if WIDE_CHAR_VERSION # include "vasnwprintf.h" #else # include "vasnprintf.h" #endif #include /* snprintf(), sprintf() */ #include /* abort(), malloc(), realloc(), free() */ #include /* memcpy(), strlen() */ #include /* errno */ #include /* CHAR_BIT */ #include /* DBL_MAX_EXP, LDBL_MAX_EXP */ #if WIDE_CHAR_VERSION # include "wprintf-parse.h" #else # include "printf-parse.h" #endif /* Checked size_t computations. */ #include "xsize.h" #ifdef HAVE_WCHAR_T # ifdef HAVE_WCSLEN # define local_wcslen wcslen # else /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid a dependency towards this library, here is a local substitute. Define this substitute only once, even if this file is included twice in the same compilation unit. */ # ifndef local_wcslen_defined # define local_wcslen_defined 1 static size_t local_wcslen (const wchar_t *s) { const wchar_t *ptr; for (ptr = s; *ptr != (wchar_t) 0; ptr++) ; return ptr - s; } # endif # endif #endif #if WIDE_CHAR_VERSION # define VASNPRINTF vasnwprintf # define CHAR_T wchar_t # define DIRECTIVE wchar_t_directive # define DIRECTIVES wchar_t_directives # define PRINTF_PARSE wprintf_parse # define USE_SNPRINTF 1 # if HAVE_DECL__SNWPRINTF /* On Windows, the function swprintf() has a different signature than on Unix; we use the _snwprintf() function instead. */ # define SNPRINTF _snwprintf # else /* Unix. */ # define SNPRINTF swprintf # endif #else # define VASNPRINTF vasnprintf # define CHAR_T char # define DIRECTIVE char_directive # define DIRECTIVES char_directives # define PRINTF_PARSE printf_parse # define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) # if HAVE_DECL__SNPRINTF /* Windows. */ # define SNPRINTF _snprintf # else /* Unix. */ # define SNPRINTF snprintf # endif #endif CHAR_T * VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list args) { DIRECTIVES d; arguments a; if (PRINTF_PARSE (format, &d, &a) < 0) { errno = EINVAL; return NULL; } #define CLEANUP() \ free (d.dir); \ if (a.arg) \ free (a.arg); if (printf_fetchargs (args, &a) < 0) { CLEANUP (); errno = EINVAL; return NULL; } { size_t buf_neededlength; CHAR_T *buf; CHAR_T *buf_malloced; const CHAR_T *cp; size_t i; DIRECTIVE *dp; /* Output string accumulator. */ CHAR_T *result; size_t allocated; size_t length; /* Allocate a small buffer that will hold a directive passed to sprintf or snprintf. */ buf_neededlength = xsum4 (7, d.max_width_length, d.max_precision_length, 6); #if HAVE_ALLOCA if (buf_neededlength < 4000 / sizeof (CHAR_T)) { buf = (CHAR_T *) alloca (buf_neededlength * sizeof (CHAR_T)); buf_malloced = NULL; } else #endif { size_t buf_memsize = xtimes (buf_neededlength, sizeof (CHAR_T)); if (size_overflow_p (buf_memsize)) goto out_of_memory_1; buf = (CHAR_T *) malloc (buf_memsize); if (buf == NULL) goto out_of_memory_1; buf_malloced = buf; } if (resultbuf != NULL) { result = resultbuf; allocated = *lengthp; } else { result = NULL; allocated = 0; } length = 0; /* Invariants: result is either == resultbuf or == NULL or malloc-allocated. If length > 0, then result != NULL. */ /* Ensures that allocated >= needed. Aborts through a jump to out_of_memory if needed is SIZE_MAX or otherwise too big. */ #define ENSURE_ALLOCATION(needed) \ if ((needed) > allocated) \ { \ size_t memory_size; \ CHAR_T *memory; \ \ allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \ if ((needed) > allocated) \ allocated = (needed); \ memory_size = xtimes (allocated, sizeof (CHAR_T)); \ if (size_overflow_p (memory_size)) \ goto out_of_memory; \ if (result == resultbuf || result == NULL) \ memory = (CHAR_T *) malloc (memory_size); \ else \ memory = (CHAR_T *) realloc (result, memory_size); \ if (memory == NULL) \ goto out_of_memory; \ if (result == resultbuf && length > 0) \ memcpy (memory, result, length * sizeof (CHAR_T)); \ result = memory; \ } for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++) { if (cp != dp->dir_start) { size_t n = dp->dir_start - cp; size_t augmented_length = xsum (length, n); ENSURE_ALLOCATION (augmented_length); memcpy (result + length, cp, n * sizeof (CHAR_T)); length = augmented_length; } if (i == d.count) break; /* Execute a single directive. */ if (dp->conversion == '%') { size_t augmented_length; if (!(dp->arg_index == ARG_NONE)) abort (); augmented_length = xsum (length, 1); ENSURE_ALLOCATION (augmented_length); result[length] = '%'; length = augmented_length; } else { if (!(dp->arg_index != ARG_NONE)) abort (); if (dp->conversion == 'n') { switch (a.arg[dp->arg_index].type) { case TYPE_COUNT_SCHAR_POINTER: *a.arg[dp->arg_index].a.a_count_schar_pointer = length; break; case TYPE_COUNT_SHORT_POINTER: *a.arg[dp->arg_index].a.a_count_short_pointer = length; break; case TYPE_COUNT_INT_POINTER: *a.arg[dp->arg_index].a.a_count_int_pointer = length; break; case TYPE_COUNT_LONGINT_POINTER: *a.arg[dp->arg_index].a.a_count_longint_pointer = length; break; #ifdef HAVE_LONG_LONG_INT case TYPE_COUNT_LONGLONGINT_POINTER: *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length; break; #endif default: abort (); } } else { arg_type type = a.arg[dp->arg_index].type; CHAR_T *p; unsigned int prefix_count; int prefixes[2]; #if !USE_SNPRINTF size_t tmp_length; CHAR_T tmpbuf[700]; CHAR_T *tmp; /* Allocate a temporary buffer of sufficient size for calling sprintf. */ { size_t width; size_t precision; width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { int arg; if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); arg = a.arg[dp->width_arg_index].a.a_int; width = (arg < 0 ? (unsigned int) (-arg) : arg); } else { const CHAR_T *digitp = dp->width_start; do width = xsum (xtimes (width, 10), *digitp++ - '0'); while (digitp != dp->width_end); } } precision = 6; if (dp->precision_start != dp->precision_end) { if (dp->precision_arg_index != ARG_NONE) { int arg; if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); arg = a.arg[dp->precision_arg_index].a.a_int; precision = (arg < 0 ? 0 : arg); } else { const CHAR_T *digitp = dp->precision_start + 1; precision = 0; while (digitp != dp->precision_end) precision = xsum (xtimes (precision, 10), *digitp++ - '0'); } } switch (dp->conversion) { case 'd': case 'i': case 'u': # ifdef HAVE_LONG_LONG_INT if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.30103 /* binary -> decimal */ ) + 1; /* turn floor into ceil */ else # endif if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.30103 /* binary -> decimal */ ) + 1; /* turn floor into ceil */ else tmp_length = (unsigned int) (sizeof (unsigned int) * CHAR_BIT * 0.30103 /* binary -> decimal */ ) + 1; /* turn floor into ceil */ if (tmp_length < precision) tmp_length = precision; /* Multiply by 2, as an estimate for FLAG_GROUP. */ tmp_length = xsum (tmp_length, tmp_length); /* Add 1, to account for a leading sign. */ tmp_length = xsum (tmp_length, 1); break; case 'o': # ifdef HAVE_LONG_LONG_INT if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1; /* turn floor into ceil */ else # endif if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1; /* turn floor into ceil */ else tmp_length = (unsigned int) (sizeof (unsigned int) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1; /* turn floor into ceil */ if (tmp_length < precision) tmp_length = precision; /* Add 1, to account for a leading sign. */ tmp_length = xsum (tmp_length, 1); break; case 'x': case 'X': # ifdef HAVE_LONG_LONG_INT if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1; /* turn floor into ceil */ else # endif if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1; /* turn floor into ceil */ else tmp_length = (unsigned int) (sizeof (unsigned int) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1; /* turn floor into ceil */ if (tmp_length < precision) tmp_length = precision; /* Add 2, to account for a leading sign or alternate form. */ tmp_length = xsum (tmp_length, 2); break; case 'f': case 'F': # ifdef HAVE_LONG_DOUBLE if (type == TYPE_LONGDOUBLE) tmp_length = (unsigned int) (LDBL_MAX_EXP * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 10; /* sign, decimal point etc. */ else # endif tmp_length = (unsigned int) (DBL_MAX_EXP * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 10; /* sign, decimal point etc. */ tmp_length = xsum (tmp_length, precision); break; case 'e': case 'E': case 'g': case 'G': case 'a': case 'A': tmp_length = 12; /* sign, decimal point, exponent etc. */ tmp_length = xsum (tmp_length, precision); break; case 'c': # if defined HAVE_WINT_T && !WIDE_CHAR_VERSION if (type == TYPE_WIDE_CHAR) tmp_length = MB_CUR_MAX; else # endif tmp_length = 1; break; case 's': # ifdef HAVE_WCHAR_T if (type == TYPE_WIDE_STRING) { tmp_length = local_wcslen (a.arg[dp->arg_index].a.a_wide_string); # if !WIDE_CHAR_VERSION tmp_length = xtimes (tmp_length, MB_CUR_MAX); # endif } else # endif tmp_length = strlen (a.arg[dp->arg_index].a.a_string); break; case 'p': tmp_length = (unsigned int) (sizeof (void *) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1 /* turn floor into ceil */ + 2; /* account for leading 0x */ break; default: abort (); } if (tmp_length < width) tmp_length = width; tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ } if (tmp_length <= sizeof (tmpbuf) / sizeof (CHAR_T)) tmp = tmpbuf; else { size_t tmp_memsize = xtimes (tmp_length, sizeof (CHAR_T)); if (size_overflow_p (tmp_memsize)) /* Overflow, would lead to out of memory. */ goto out_of_memory; tmp = (CHAR_T *) malloc (tmp_memsize); if (tmp == NULL) /* Out of memory. */ goto out_of_memory; } #endif /* Construct the format string for calling snprintf or sprintf. */ p = buf; *p++ = '%'; if (dp->flags & FLAG_GROUP) *p++ = '\''; if (dp->flags & FLAG_LEFT) *p++ = '-'; if (dp->flags & FLAG_SHOWSIGN) *p++ = '+'; if (dp->flags & FLAG_SPACE) *p++ = ' '; if (dp->flags & FLAG_ALT) *p++ = '#'; if (dp->flags & FLAG_ZERO) *p++ = '0'; if (dp->width_start != dp->width_end) { size_t n = dp->width_end - dp->width_start; memcpy (p, dp->width_start, n * sizeof (CHAR_T)); p += n; } if (dp->precision_start != dp->precision_end) { size_t n = dp->precision_end - dp->precision_start; memcpy (p, dp->precision_start, n * sizeof (CHAR_T)); p += n; } switch (type) { #ifdef HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: case TYPE_ULONGLONGINT: *p++ = 'l'; /*FALLTHROUGH*/ #endif case TYPE_LONGINT: case TYPE_ULONGINT: #ifdef HAVE_WINT_T case TYPE_WIDE_CHAR: #endif #ifdef HAVE_WCHAR_T case TYPE_WIDE_STRING: #endif *p++ = 'l'; break; #ifdef HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: *p++ = 'L'; break; #endif default: break; } *p = dp->conversion; #if USE_SNPRINTF p[1] = '%'; p[2] = 'n'; p[3] = '\0'; #else p[1] = '\0'; #endif /* Construct the arguments for calling snprintf or sprintf. */ prefix_count = 0; if (dp->width_arg_index != ARG_NONE) { if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int; } if (dp->precision_arg_index != ARG_NONE) { if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int; } #if USE_SNPRINTF /* Prepare checking whether snprintf returns the count via %n. */ ENSURE_ALLOCATION (xsum (length, 1)); result[length] = '\0'; #endif for (;;) { size_t maxlen; int count; int retcount; maxlen = allocated - length; count = -1; retcount = 0; #if USE_SNPRINTF # define SNPRINTF_BUF(arg) \ switch (prefix_count) \ { \ case 0: \ retcount = SNPRINTF (result + length, maxlen, buf, \ arg, &count); \ break; \ case 1: \ retcount = SNPRINTF (result + length, maxlen, buf, \ prefixes[0], arg, &count); \ break; \ case 2: \ retcount = SNPRINTF (result + length, maxlen, buf, \ prefixes[0], prefixes[1], arg, \ &count); \ break; \ default: \ abort (); \ } #else # define SNPRINTF_BUF(arg) \ switch (prefix_count) \ { \ case 0: \ count = sprintf (tmp, buf, arg); \ break; \ case 1: \ count = sprintf (tmp, buf, prefixes[0], arg); \ break; \ case 2: \ count = sprintf (tmp, buf, prefixes[0], prefixes[1],\ arg); \ break; \ default: \ abort (); \ } #endif switch (type) { case TYPE_SCHAR: { int arg = a.arg[dp->arg_index].a.a_schar; SNPRINTF_BUF (arg); } break; case TYPE_UCHAR: { unsigned int arg = a.arg[dp->arg_index].a.a_uchar; SNPRINTF_BUF (arg); } break; case TYPE_SHORT: { int arg = a.arg[dp->arg_index].a.a_short; SNPRINTF_BUF (arg); } break; case TYPE_USHORT: { unsigned int arg = a.arg[dp->arg_index].a.a_ushort; SNPRINTF_BUF (arg); } break; case TYPE_INT: { int arg = a.arg[dp->arg_index].a.a_int; SNPRINTF_BUF (arg); } break; case TYPE_UINT: { unsigned int arg = a.arg[dp->arg_index].a.a_uint; SNPRINTF_BUF (arg); } break; case TYPE_LONGINT: { long int arg = a.arg[dp->arg_index].a.a_longint; SNPRINTF_BUF (arg); } break; case TYPE_ULONGINT: { unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint; SNPRINTF_BUF (arg); } break; #ifdef HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: { long long int arg = a.arg[dp->arg_index].a.a_longlongint; SNPRINTF_BUF (arg); } break; case TYPE_ULONGLONGINT: { unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint; SNPRINTF_BUF (arg); } break; #endif case TYPE_DOUBLE: { double arg = a.arg[dp->arg_index].a.a_double; SNPRINTF_BUF (arg); } break; #ifdef HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: { long double arg = a.arg[dp->arg_index].a.a_longdouble; SNPRINTF_BUF (arg); } break; #endif case TYPE_CHAR: { int arg = a.arg[dp->arg_index].a.a_char; SNPRINTF_BUF (arg); } break; #ifdef HAVE_WINT_T case TYPE_WIDE_CHAR: { wint_t arg = a.arg[dp->arg_index].a.a_wide_char; SNPRINTF_BUF (arg); } break; #endif case TYPE_STRING: { const char *arg = a.arg[dp->arg_index].a.a_string; SNPRINTF_BUF (arg); } break; #ifdef HAVE_WCHAR_T case TYPE_WIDE_STRING: { const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string; SNPRINTF_BUF (arg); } break; #endif case TYPE_POINTER: { void *arg = a.arg[dp->arg_index].a.a_pointer; SNPRINTF_BUF (arg); } break; default: abort (); } #if USE_SNPRINTF /* Portability: Not all implementations of snprintf() are ISO C 99 compliant. Determine the number of bytes that snprintf() has produced or would have produced. */ if (count >= 0) { /* Verify that snprintf() has NUL-terminated its result. */ if (count < maxlen && result[length + count] != '\0') abort (); /* Portability hack. */ if (retcount > count) count = retcount; } else { /* snprintf() doesn't understand the '%n' directive. */ if (p[1] != '\0') { /* Don't use the '%n' directive; instead, look at the snprintf() return value. */ p[1] = '\0'; continue; } else { /* Look at the snprintf() return value. */ if (retcount < 0) { /* HP-UX 10.20 snprintf() is doubly deficient: It doesn't understand the '%n' directive, *and* it returns -1 (rather than the length that would have been required) when the buffer is too small. */ size_t bigger_need = xsum (xtimes (allocated, 2), 12); ENSURE_ALLOCATION (bigger_need); continue; } else count = retcount; } } #endif /* Attempt to handle failure. */ if (count < 0) { if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); errno = EINVAL; return NULL; } #if !USE_SNPRINTF if (count >= tmp_length) /* tmp_length was incorrectly calculated - fix the code above! */ abort (); #endif /* Make room for the result. */ if (count >= maxlen) { /* Need at least count bytes. But allocate proportionally, to avoid looping eternally if snprintf() reports a too small count. */ size_t n = xmax (xsum (length, count), xtimes (allocated, 2)); ENSURE_ALLOCATION (n); #if USE_SNPRINTF continue; #endif } #if USE_SNPRINTF /* The snprintf() result did fit. */ #else /* Append the sprintf() result. */ memcpy (result + length, tmp, count * sizeof (CHAR_T)); if (tmp != tmpbuf) free (tmp); #endif length += count; break; } } } } /* Add the final NUL. */ ENSURE_ALLOCATION (xsum (length, 1)); result[length] = '\0'; if (result != resultbuf && length + 1 < allocated) { /* Shrink the allocated memory if possible. */ CHAR_T *memory; memory = (CHAR_T *) realloc (result, (length + 1) * sizeof (CHAR_T)); if (memory != NULL) result = memory; } if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); *lengthp = length; /* Note that we can produce a big string of a length > INT_MAX. POSIX says that snprintf() fails with errno = EOVERFLOW in this case, but that's only because snprintf() returns an 'int'. This function does not have this limitation. */ return result; out_of_memory: if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); out_of_memory_1: CLEANUP (); errno = ENOMEM; return NULL; } } #undef SNPRINTF #undef USE_SNPRINTF #undef PRINTF_PARSE #undef DIRECTIVES #undef DIRECTIVE #undef CHAR_T #undef VASNPRINTF pbbuttonsd-0.8.1a/intl/os2compat.h0000644000175000017500000000302610641705131014013 00000000000000/* OS/2 compatibility defines. This file is intended to be included from config.h Copyright (C) 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* When included from os2compat.h we need all the original definitions */ #ifndef OS2_AWARE #undef LIBDIR #define LIBDIR _nlos2_libdir extern char *_nlos2_libdir; #undef LOCALEDIR #define LOCALEDIR _nlos2_localedir extern char *_nlos2_localedir; #undef LOCALE_ALIAS_PATH #define LOCALE_ALIAS_PATH _nlos2_localealiaspath extern char *_nlos2_localealiaspath; #endif #undef HAVE_STRCASECMP #define HAVE_STRCASECMP 1 #define strcasecmp stricmp #define strncasecmp strnicmp /* We have our own getenv() which works even if library is compiled as DLL */ #define getenv _nl_getenv /* Older versions of gettext used -1 as the value of LC_MESSAGES */ #define LC_MESSAGES_COMPAT (-1) pbbuttonsd-0.8.1a/intl/libgnuintl.h.in0000644000175000017500000003412710641705130014665 00000000000000/* Message catalogs for internationalization. Copyright (C) 1995-1997, 2000-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LIBINTL_H #define _LIBINTL_H 1 #include /* The LC_MESSAGES locale category is the category used by the functions gettext() and dgettext(). It is specified in POSIX, but not in ANSI C. On systems that don't define it, use an arbitrary value instead. On Solaris, defines __LOCALE_H (or _LOCALE_H in Solaris 2.5) then includes (i.e. this file!) and then only defines LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES in this case. */ #if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun)) # define LC_MESSAGES 1729 #endif /* We define an additional symbol to signal that we use the GNU implementation of gettext. */ #define __USE_GNU_GETTEXT 1 /* Provide information about the supported file formats. Returns the maximum minor revision number supported for a given major revision. */ #define __GNU_GETTEXT_SUPPORTED_REVISION(major) \ ((major) == 0 || (major) == 1 ? 1 : -1) /* Resolve a platform specific conflict on DJGPP. GNU gettext takes precedence over _conio_gettext. */ #ifdef __DJGPP__ # undef gettext #endif #ifdef __cplusplus extern "C" { #endif /* Version number: (major<<16) + (minor<<8) + subminor */ #define LIBINTL_VERSION 0x001000 extern int libintl_version; /* We redirect the functions to those prefixed with "libintl_". This is necessary, because some systems define gettext/textdomain/... in the C library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer). If we used the unprefixed names, there would be cases where the definition in the C library would override the one in the libintl.so shared library. Recall that on ELF systems, the symbols are looked up in the following order: 1. in the executable, 2. in the shared libraries specified on the link command line, in order, 3. in the dependencies of the shared libraries specified on the link command line, 4. in the dlopen()ed shared libraries, in the order in which they were dlopen()ed. The definition in the C library would override the one in libintl.so if either * -lc is given on the link command line and -lintl isn't, or * -lc is given on the link command line before -lintl, or * libintl.so is a dependency of a dlopen()ed shared library but not linked to the executable at link time. Since Solaris gettext() behaves differently than GNU gettext(), this would be unacceptable. The redirection happens by default through macros in C, so that &gettext is independent of the compilation unit, but through inline functions in C++, in order not to interfere with the name mangling of class fields or class methods called 'gettext'. */ /* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS. If he doesn't, we choose the method. A third possible method is _INTL_REDIRECT_ASM, supported only by GCC. */ #if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS) # if __GNUC__ >= 2 && !(__APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus) # define _INTL_REDIRECT_ASM # else # ifdef __cplusplus # define _INTL_REDIRECT_INLINE # else # define _INTL_REDIRECT_MACROS # endif # endif #endif /* Auxiliary macros. */ #ifdef _INTL_REDIRECT_ASM # define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname)) # define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring # define _INTL_STRINGIFY(prefix) #prefix #else # define _INTL_ASM(cname) #endif /* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return its n-th argument literally. This enables GCC to warn for example about printf (gettext ("foo %y")). */ #if __GNUC__ >= 3 && !(__APPLE_CC__ > 1 && defined __cplusplus) # define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n))) #else # define _INTL_MAY_RETURN_STRING_ARG(n) #endif /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_gettext (const char *__msgid) _INTL_MAY_RETURN_STRING_ARG (1); static inline char *gettext (const char *__msgid) { return libintl_gettext (__msgid); } #else #ifdef _INTL_REDIRECT_MACROS # define gettext libintl_gettext #endif extern char *gettext (const char *__msgid) _INTL_ASM (libintl_gettext) _INTL_MAY_RETURN_STRING_ARG (1); #endif /* Look up MSGID in the DOMAINNAME message catalog for the current LC_MESSAGES locale. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_dgettext (const char *__domainname, const char *__msgid) _INTL_MAY_RETURN_STRING_ARG (2); static inline char *dgettext (const char *__domainname, const char *__msgid) { return libintl_dgettext (__domainname, __msgid); } #else #ifdef _INTL_REDIRECT_MACROS # define dgettext libintl_dgettext #endif extern char *dgettext (const char *__domainname, const char *__msgid) _INTL_ASM (libintl_dgettext) _INTL_MAY_RETURN_STRING_ARG (2); #endif /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_dcgettext (const char *__domainname, const char *__msgid, int __category) _INTL_MAY_RETURN_STRING_ARG (2); static inline char *dcgettext (const char *__domainname, const char *__msgid, int __category) { return libintl_dcgettext (__domainname, __msgid, __category); } #else #ifdef _INTL_REDIRECT_MACROS # define dcgettext libintl_dcgettext #endif extern char *dcgettext (const char *__domainname, const char *__msgid, int __category) _INTL_ASM (libintl_dcgettext) _INTL_MAY_RETURN_STRING_ARG (2); #endif /* Similar to `gettext' but select the plural form corresponding to the number N. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2, unsigned long int __n) _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2); static inline char *ngettext (const char *__msgid1, const char *__msgid2, unsigned long int __n) { return libintl_ngettext (__msgid1, __msgid2, __n); } #else #ifdef _INTL_REDIRECT_MACROS # define ngettext libintl_ngettext #endif extern char *ngettext (const char *__msgid1, const char *__msgid2, unsigned long int __n) _INTL_ASM (libintl_ngettext) _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2); #endif /* Similar to `dgettext' but select the plural form corresponding to the number N. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_dngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n) _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); static inline char *dngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n) { return libintl_dngettext (__domainname, __msgid1, __msgid2, __n); } #else #ifdef _INTL_REDIRECT_MACROS # define dngettext libintl_dngettext #endif extern char *dngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n) _INTL_ASM (libintl_dngettext) _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); #endif /* Similar to `dcgettext' but select the plural form corresponding to the number N. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_dcngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category) _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); static inline char *dcngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category) { return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category); } #else #ifdef _INTL_REDIRECT_MACROS # define dcngettext libintl_dcngettext #endif extern char *dcngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category) _INTL_ASM (libintl_dcngettext) _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); #endif #ifndef IN_LIBGLOCALE /* Set the current default message catalog to DOMAINNAME. If DOMAINNAME is null, return the current default. If DOMAINNAME is "", reset to the default of "messages". */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_textdomain (const char *__domainname); static inline char *textdomain (const char *__domainname) { return libintl_textdomain (__domainname); } #else #ifdef _INTL_REDIRECT_MACROS # define textdomain libintl_textdomain #endif extern char *textdomain (const char *__domainname) _INTL_ASM (libintl_textdomain); #endif /* Specify that the DOMAINNAME message catalog will be found in DIRNAME rather than in the system locale data base. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_bindtextdomain (const char *__domainname, const char *__dirname); static inline char *bindtextdomain (const char *__domainname, const char *__dirname) { return libintl_bindtextdomain (__domainname, __dirname); } #else #ifdef _INTL_REDIRECT_MACROS # define bindtextdomain libintl_bindtextdomain #endif extern char *bindtextdomain (const char *__domainname, const char *__dirname) _INTL_ASM (libintl_bindtextdomain); #endif /* Specify the character encoding in which the messages from the DOMAINNAME message catalog will be returned. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_bind_textdomain_codeset (const char *__domainname, const char *__codeset); static inline char *bind_textdomain_codeset (const char *__domainname, const char *__codeset) { return libintl_bind_textdomain_codeset (__domainname, __codeset); } #else #ifdef _INTL_REDIRECT_MACROS # define bind_textdomain_codeset libintl_bind_textdomain_codeset #endif extern char *bind_textdomain_codeset (const char *__domainname, const char *__codeset) _INTL_ASM (libintl_bind_textdomain_codeset); #endif #endif /* IN_LIBGLOCALE */ /* Support for format strings with positions in *printf(), following the POSIX/XSI specification. Note: These replacements for the *printf() functions are visible only in source files that #include or #include "gettext.h". Packages that use *printf() in source files that don't refer to _() or gettext() but for which the format string could be the return value of _() or gettext() need to add this #include. Oh well. */ #if !@HAVE_POSIX_PRINTF@ #include #include /* Get va_list. */ #if __STDC__ || defined __cplusplus || defined _MSC_VER # include #else # include #endif #undef fprintf #define fprintf libintl_fprintf extern int fprintf (FILE *, const char *, ...); #undef vfprintf #define vfprintf libintl_vfprintf extern int vfprintf (FILE *, const char *, va_list); #undef printf #if defined __NetBSD__ || defined __CYGWIN__ || defined __MINGW32__ /* Don't break __attribute__((format(printf,M,N))). This redefinition is only possible because the libc in NetBSD, Cygwin, mingw does not have a function __printf__. */ # define libintl_printf __printf__ #endif #define printf libintl_printf extern int printf (const char *, ...); #undef vprintf #define vprintf libintl_vprintf extern int vprintf (const char *, va_list); #undef sprintf #define sprintf libintl_sprintf extern int sprintf (char *, const char *, ...); #undef vsprintf #define vsprintf libintl_vsprintf extern int vsprintf (char *, const char *, va_list); #if @HAVE_SNPRINTF@ #undef snprintf #define snprintf libintl_snprintf extern int snprintf (char *, size_t, const char *, ...); #undef vsnprintf #define vsnprintf libintl_vsnprintf extern int vsnprintf (char *, size_t, const char *, va_list); #endif #if @HAVE_ASPRINTF@ #undef asprintf #define asprintf libintl_asprintf extern int asprintf (char **, const char *, ...); #undef vasprintf #define vasprintf libintl_vasprintf extern int vasprintf (char **, const char *, va_list); #endif #if @HAVE_WPRINTF@ #undef fwprintf #define fwprintf libintl_fwprintf extern int fwprintf (FILE *, const wchar_t *, ...); #undef vfwprintf #define vfwprintf libintl_vfwprintf extern int vfwprintf (FILE *, const wchar_t *, va_list); #undef wprintf #define wprintf libintl_wprintf extern int wprintf (const wchar_t *, ...); #undef vwprintf #define vwprintf libintl_vwprintf extern int vwprintf (const wchar_t *, va_list); #undef swprintf #define swprintf libintl_swprintf extern int swprintf (wchar_t *, size_t, const wchar_t *, ...); #undef vswprintf #define vswprintf libintl_vswprintf extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list); #endif #endif /* Support for relocatable packages. */ /* Sets the original and the current installation prefix of the package. Relocation simply replaces a pathname starting with the original prefix by the corresponding pathname with the current prefix instead. Both prefixes should be directory names without trailing slash (i.e. use "" instead of "/"). */ #define libintl_set_relocation_prefix libintl_set_relocation_prefix extern void libintl_set_relocation_prefix (const char *orig_prefix, const char *curr_prefix); #ifdef __cplusplus } #endif #endif /* libintl.h */ pbbuttonsd-0.8.1a/intl/bindtextdom.c0000644000175000017500000002251010641705127014424 00000000000000/* Implementation of the bindtextdomain(3) function Copyright (C) 1995-1998, 2000-2003, 2005-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* Handle multi-threaded applications. */ #ifdef _LIBC # include # define gl_rwlock_define __libc_rwlock_define # define gl_rwlock_wrlock __libc_rwlock_wrlock # define gl_rwlock_unlock __libc_rwlock_unlock #else # include "lock.h" #endif /* The internal variables in the standalone libintl.a must have different names than the internal variables in GNU libc, otherwise programs using libintl.a cannot be linked statically. */ #if !defined _LIBC # define _nl_default_dirname libintl_nl_default_dirname # define _nl_domain_bindings libintl_nl_domain_bindings #endif /* Some compilers, like SunOS4 cc, don't have offsetof in . */ #ifndef offsetof # define offsetof(type,ident) ((size_t)&(((type*)0)->ident)) #endif /* @@ end of prolog @@ */ /* Contains the default location of the message catalogs. */ extern const char _nl_default_dirname[]; #ifdef _LIBC libc_hidden_proto (_nl_default_dirname) #endif /* List with bindings of specific domains. */ extern struct binding *_nl_domain_bindings; /* Lock variable to protect the global data in the gettext implementation. */ gl_rwlock_define (extern, _nl_state_lock attribute_hidden) /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define BINDTEXTDOMAIN __bindtextdomain # define BIND_TEXTDOMAIN_CODESET __bind_textdomain_codeset # ifndef strdup # define strdup(str) __strdup (str) # endif #else # define BINDTEXTDOMAIN libintl_bindtextdomain # define BIND_TEXTDOMAIN_CODESET libintl_bind_textdomain_codeset #endif /* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP to be used for the DOMAINNAME message catalog. If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not modified, only the current value is returned. If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither modified nor returned. */ static void set_binding_values (const char *domainname, const char **dirnamep, const char **codesetp) { struct binding *binding; int modified; /* Some sanity checks. */ if (domainname == NULL || domainname[0] == '\0') { if (dirnamep) *dirnamep = NULL; if (codesetp) *codesetp = NULL; return; } gl_rwlock_wrlock (_nl_state_lock); modified = 0; for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) { int compare = strcmp (domainname, binding->domainname); if (compare == 0) /* We found it! */ break; if (compare < 0) { /* It is not in the list. */ binding = NULL; break; } } if (binding != NULL) { if (dirnamep) { const char *dirname = *dirnamep; if (dirname == NULL) /* The current binding has be to returned. */ *dirnamep = binding->dirname; else { /* The domain is already bound. If the new value and the old one are equal we simply do nothing. Otherwise replace the old binding. */ char *result = binding->dirname; if (strcmp (dirname, result) != 0) { if (strcmp (dirname, _nl_default_dirname) == 0) result = (char *) _nl_default_dirname; else { #if defined _LIBC || defined HAVE_STRDUP result = strdup (dirname); #else size_t len = strlen (dirname) + 1; result = (char *) malloc (len); if (__builtin_expect (result != NULL, 1)) memcpy (result, dirname, len); #endif } if (__builtin_expect (result != NULL, 1)) { if (binding->dirname != _nl_default_dirname) free (binding->dirname); binding->dirname = result; modified = 1; } } *dirnamep = result; } } if (codesetp) { const char *codeset = *codesetp; if (codeset == NULL) /* The current binding has be to returned. */ *codesetp = binding->codeset; else { /* The domain is already bound. If the new value and the old one are equal we simply do nothing. Otherwise replace the old binding. */ char *result = binding->codeset; if (result == NULL || strcmp (codeset, result) != 0) { #if defined _LIBC || defined HAVE_STRDUP result = strdup (codeset); #else size_t len = strlen (codeset) + 1; result = (char *) malloc (len); if (__builtin_expect (result != NULL, 1)) memcpy (result, codeset, len); #endif if (__builtin_expect (result != NULL, 1)) { if (binding->codeset != NULL) free (binding->codeset); binding->codeset = result; modified = 1; } } *codesetp = result; } } } else if ((dirnamep == NULL || *dirnamep == NULL) && (codesetp == NULL || *codesetp == NULL)) { /* Simply return the default values. */ if (dirnamep) *dirnamep = _nl_default_dirname; if (codesetp) *codesetp = NULL; } else { /* We have to create a new binding. */ size_t len = strlen (domainname) + 1; struct binding *new_binding = (struct binding *) malloc (offsetof (struct binding, domainname) + len); if (__builtin_expect (new_binding == NULL, 0)) goto failed; memcpy (new_binding->domainname, domainname, len); if (dirnamep) { const char *dirname = *dirnamep; if (dirname == NULL) /* The default value. */ dirname = _nl_default_dirname; else { if (strcmp (dirname, _nl_default_dirname) == 0) dirname = _nl_default_dirname; else { char *result; #if defined _LIBC || defined HAVE_STRDUP result = strdup (dirname); if (__builtin_expect (result == NULL, 0)) goto failed_dirname; #else size_t len = strlen (dirname) + 1; result = (char *) malloc (len); if (__builtin_expect (result == NULL, 0)) goto failed_dirname; memcpy (result, dirname, len); #endif dirname = result; } } *dirnamep = dirname; new_binding->dirname = (char *) dirname; } else /* The default value. */ new_binding->dirname = (char *) _nl_default_dirname; if (codesetp) { const char *codeset = *codesetp; if (codeset != NULL) { char *result; #if defined _LIBC || defined HAVE_STRDUP result = strdup (codeset); if (__builtin_expect (result == NULL, 0)) goto failed_codeset; #else size_t len = strlen (codeset) + 1; result = (char *) malloc (len); if (__builtin_expect (result == NULL, 0)) goto failed_codeset; memcpy (result, codeset, len); #endif codeset = result; } *codesetp = codeset; new_binding->codeset = (char *) codeset; } else new_binding->codeset = NULL; /* Now enqueue it. */ if (_nl_domain_bindings == NULL || strcmp (domainname, _nl_domain_bindings->domainname) < 0) { new_binding->next = _nl_domain_bindings; _nl_domain_bindings = new_binding; } else { binding = _nl_domain_bindings; while (binding->next != NULL && strcmp (domainname, binding->next->domainname) > 0) binding = binding->next; new_binding->next = binding->next; binding->next = new_binding; } modified = 1; /* Here we deal with memory allocation failures. */ if (0) { failed_codeset: if (new_binding->dirname != _nl_default_dirname) free (new_binding->dirname); failed_dirname: free (new_binding); failed: if (dirnamep) *dirnamep = NULL; if (codesetp) *codesetp = NULL; } } /* If we modified any binding, we flush the caches. */ if (modified) ++_nl_msg_cat_cntr; gl_rwlock_unlock (_nl_state_lock); } /* Specify that the DOMAINNAME message catalog will be found in DIRNAME rather than in the system locale data base. */ char * BINDTEXTDOMAIN (const char *domainname, const char *dirname) { set_binding_values (domainname, &dirname, NULL); return (char *) dirname; } /* Specify the character encoding in which the messages from the DOMAINNAME message catalog will be returned. */ char * BIND_TEXTDOMAIN_CODESET (const char *domainname, const char *codeset) { set_binding_values (domainname, NULL, &codeset); return (char *) codeset; } #ifdef _LIBC /* Aliases for function names in GNU C Library. */ weak_alias (__bindtextdomain, bindtextdomain); weak_alias (__bind_textdomain_codeset, bind_textdomain_codeset); #endif pbbuttonsd-0.8.1a/intl/dcgettext.c0000644000175000017500000000342110641705127014076 00000000000000/* Implementation of the dcgettext(3) function. Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DCGETTEXT __dcgettext # define DCIGETTEXT __dcigettext #else # define DCGETTEXT libintl_dcgettext # define DCIGETTEXT libintl_dcigettext #endif /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ char * DCGETTEXT (const char *domainname, const char *msgid, int category) { return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ INTDEF(__dcgettext) weak_alias (__dcgettext, dcgettext); #endif pbbuttonsd-0.8.1a/intl/dgettext.c0000644000175000017500000000337110641705127013737 00000000000000/* Implementation of the dgettext(3) function. Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" #include #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DGETTEXT __dgettext # define DCGETTEXT INTUSE(__dcgettext) #else # define DGETTEXT libintl_dgettext # define DCGETTEXT libintl_dcgettext #endif /* Look up MSGID in the DOMAINNAME message catalog of the current LC_MESSAGES locale. */ char * DGETTEXT (const char *domainname, const char *msgid) { return DCGETTEXT (domainname, msgid, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__dgettext, dgettext); #endif pbbuttonsd-0.8.1a/intl/gettext.c0000644000175000017500000000355410641705130013570 00000000000000/* Implementation of gettext(3) function. Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #ifdef _LIBC # define __need_NULL # include #else # include /* Just for NULL. */ #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define GETTEXT __gettext # define DCGETTEXT INTUSE(__dcgettext) #else # define GETTEXT libintl_gettext # define DCGETTEXT libintl_dcgettext #endif /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ char * GETTEXT (const char *msgid) { return DCGETTEXT (NULL, msgid, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__gettext, gettext); #endif pbbuttonsd-0.8.1a/intl/finddomain.c0000644000175000017500000001355410641705130014215 00000000000000/* Handle list of needed message catalogs Copyright (C) 1995-1999, 2000-2001, 2003-2006 Free Software Foundation, Inc. Written by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #if defined HAVE_UNISTD_H || defined _LIBC # include #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* Handle multi-threaded applications. */ #ifdef _LIBC # include # define gl_rwlock_define_initialized __libc_rwlock_define_initialized # define gl_rwlock_rdlock __libc_rwlock_rdlock # define gl_rwlock_wrlock __libc_rwlock_wrlock # define gl_rwlock_unlock __libc_rwlock_unlock #else # include "lock.h" #endif /* @@ end of prolog @@ */ /* List of already loaded domains. */ static struct loaded_l10nfile *_nl_loaded_domains; /* Return a data structure describing the message catalog described by the DOMAINNAME and CATEGORY parameters with respect to the currently established bindings. */ struct loaded_l10nfile * internal_function _nl_find_domain (const char *dirname, char *locale, const char *domainname, struct binding *domainbinding) { struct loaded_l10nfile *retval; const char *language; const char *modifier; const char *territory; const char *codeset; const char *normalized_codeset; const char *alias_value; int mask; /* LOCALE can consist of up to four recognized parts for the XPG syntax: language[_territory][.codeset][@modifier] Beside the first part all of them are allowed to be missing. If the full specified locale is not found, the less specific one are looked for. The various parts will be stripped off according to the following order: (1) codeset (2) normalized codeset (3) territory (4) modifier */ /* We need to protect modifying the _NL_LOADED_DOMAINS data. */ gl_rwlock_define_initialized (static, lock); gl_rwlock_rdlock (lock); /* If we have already tested for this locale entry there has to be one data set in the list of loaded domains. */ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, strlen (dirname) + 1, 0, locale, NULL, NULL, NULL, NULL, domainname, 0); gl_rwlock_unlock (lock); if (retval != NULL) { /* We know something about this locale. */ int cnt; if (retval->decided <= 0) _nl_load_domain (retval, domainbinding); if (retval->data != NULL) return retval; for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) { if (retval->successor[cnt]->decided <= 0) _nl_load_domain (retval->successor[cnt], domainbinding); if (retval->successor[cnt]->data != NULL) break; } return retval; /* NOTREACHED */ } /* See whether the locale value is an alias. If yes its value *overwrites* the alias name. No test for the original value is done. */ alias_value = _nl_expand_alias (locale); if (alias_value != NULL) { #if defined _LIBC || defined HAVE_STRDUP locale = strdup (alias_value); if (locale == NULL) return NULL; #else size_t len = strlen (alias_value) + 1; locale = (char *) malloc (len); if (locale == NULL) return NULL; memcpy (locale, alias_value, len); #endif } /* Now we determine the single parts of the locale name. First look for the language. Termination symbols are `_', '.', and `@'. */ mask = _nl_explode_name (locale, &language, &modifier, &territory, &codeset, &normalized_codeset); /* We need to protect modifying the _NL_LOADED_DOMAINS data. */ gl_rwlock_wrlock (lock); /* Create all possible locale entries which might be interested in generalization. */ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, strlen (dirname) + 1, mask, language, territory, codeset, normalized_codeset, modifier, domainname, 1); gl_rwlock_unlock (lock); if (retval == NULL) /* This means we are out of core. */ return NULL; if (retval->decided <= 0) _nl_load_domain (retval, domainbinding); if (retval->data == NULL) { int cnt; for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) { if (retval->successor[cnt]->decided <= 0) _nl_load_domain (retval->successor[cnt], domainbinding); if (retval->successor[cnt]->data != NULL) break; } } /* The room for an alias was dynamically allocated. Free it now. */ if (alias_value != NULL) free (locale); /* The space for normalized_codeset is dynamically allocated. Free it. */ if (mask & XPG_NORM_CODESET) free ((void *) normalized_codeset); return retval; } #ifdef _LIBC /* This is called from iconv/gconv_db.c's free_mem, as locales must be freed before freeing gconv steps arrays. */ void __libc_freeres_fn_section _nl_finddomain_subfreeres () { struct loaded_l10nfile *runp = _nl_loaded_domains; while (runp != NULL) { struct loaded_l10nfile *here = runp; if (runp->data != NULL) _nl_unload_domain ((struct loaded_domain *) runp->data); runp = runp->next; free ((char *) here->filename); free (here); } } #endif pbbuttonsd-0.8.1a/intl/hash-string.c0000644000175000017500000000315110641705134014330 00000000000000/* Implements a string hashing function. Copyright (C) 1995, 1997, 1998, 2000, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #include "hash-string.h" /* Defines the so called `hashpjw' function by P.J. Weinberger [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, 1986, 1987 Bell Telephone Laboratories, Inc.] */ unsigned long int __hash_string (const char *str_param) { unsigned long int hval, g; const char *str = str_param; /* Compute the hash value for the given string. */ hval = 0; while (*str != '\0') { hval <<= 4; hval += (unsigned char) *str++; g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4)); if (g != 0) { hval ^= g >> (HASHWORDBITS - 8); hval ^= g; } } return hval; } pbbuttonsd-0.8.1a/intl/loadmsgcat.c0000644000175000017500000010247010641705131014220 00000000000000/* Load needed message catalogs. Copyright (C) 1995-1999, 2000-2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Tell glibc's to provide a prototype for mempcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #ifdef __GNUC__ # undef alloca # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else # ifdef _MSC_VER # include # define alloca _alloca # else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif # endif #endif #include #include #if defined HAVE_UNISTD_H || defined _LIBC # include #endif #ifdef _LIBC # include # include #endif #if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ || (defined _LIBC && defined _POSIX_MAPPED_FILES) # include # undef HAVE_MMAP # define HAVE_MMAP 1 #else # undef HAVE_MMAP #endif #if defined HAVE_STDINT_H_WITH_UINTMAX || defined _LIBC # include #endif #if defined HAVE_INTTYPES_H || defined _LIBC # include #endif #include "gmo.h" #include "gettextP.h" #include "hash-string.h" #include "plural-exp.h" #ifdef _LIBC # include "../locale/localeinfo.h" # include #endif /* Handle multi-threaded applications. */ #ifdef _LIBC # include #else # include "lock.h" #endif /* Provide fallback values for macros that ought to be defined in . Note that our fallback values need not be literal strings, because we don't use them with preprocessor string concatenation. */ #if !defined PRId8 || PRI_MACROS_BROKEN # undef PRId8 # define PRId8 "d" #endif #if !defined PRIi8 || PRI_MACROS_BROKEN # undef PRIi8 # define PRIi8 "i" #endif #if !defined PRIo8 || PRI_MACROS_BROKEN # undef PRIo8 # define PRIo8 "o" #endif #if !defined PRIu8 || PRI_MACROS_BROKEN # undef PRIu8 # define PRIu8 "u" #endif #if !defined PRIx8 || PRI_MACROS_BROKEN # undef PRIx8 # define PRIx8 "x" #endif #if !defined PRIX8 || PRI_MACROS_BROKEN # undef PRIX8 # define PRIX8 "X" #endif #if !defined PRId16 || PRI_MACROS_BROKEN # undef PRId16 # define PRId16 "d" #endif #if !defined PRIi16 || PRI_MACROS_BROKEN # undef PRIi16 # define PRIi16 "i" #endif #if !defined PRIo16 || PRI_MACROS_BROKEN # undef PRIo16 # define PRIo16 "o" #endif #if !defined PRIu16 || PRI_MACROS_BROKEN # undef PRIu16 # define PRIu16 "u" #endif #if !defined PRIx16 || PRI_MACROS_BROKEN # undef PRIx16 # define PRIx16 "x" #endif #if !defined PRIX16 || PRI_MACROS_BROKEN # undef PRIX16 # define PRIX16 "X" #endif #if !defined PRId32 || PRI_MACROS_BROKEN # undef PRId32 # define PRId32 "d" #endif #if !defined PRIi32 || PRI_MACROS_BROKEN # undef PRIi32 # define PRIi32 "i" #endif #if !defined PRIo32 || PRI_MACROS_BROKEN # undef PRIo32 # define PRIo32 "o" #endif #if !defined PRIu32 || PRI_MACROS_BROKEN # undef PRIu32 # define PRIu32 "u" #endif #if !defined PRIx32 || PRI_MACROS_BROKEN # undef PRIx32 # define PRIx32 "x" #endif #if !defined PRIX32 || PRI_MACROS_BROKEN # undef PRIX32 # define PRIX32 "X" #endif #if !defined PRId64 || PRI_MACROS_BROKEN # undef PRId64 # define PRId64 (sizeof (long) == 8 ? "ld" : "lld") #endif #if !defined PRIi64 || PRI_MACROS_BROKEN # undef PRIi64 # define PRIi64 (sizeof (long) == 8 ? "li" : "lli") #endif #if !defined PRIo64 || PRI_MACROS_BROKEN # undef PRIo64 # define PRIo64 (sizeof (long) == 8 ? "lo" : "llo") #endif #if !defined PRIu64 || PRI_MACROS_BROKEN # undef PRIu64 # define PRIu64 (sizeof (long) == 8 ? "lu" : "llu") #endif #if !defined PRIx64 || PRI_MACROS_BROKEN # undef PRIx64 # define PRIx64 (sizeof (long) == 8 ? "lx" : "llx") #endif #if !defined PRIX64 || PRI_MACROS_BROKEN # undef PRIX64 # define PRIX64 (sizeof (long) == 8 ? "lX" : "llX") #endif #if !defined PRIdLEAST8 || PRI_MACROS_BROKEN # undef PRIdLEAST8 # define PRIdLEAST8 "d" #endif #if !defined PRIiLEAST8 || PRI_MACROS_BROKEN # undef PRIiLEAST8 # define PRIiLEAST8 "i" #endif #if !defined PRIoLEAST8 || PRI_MACROS_BROKEN # undef PRIoLEAST8 # define PRIoLEAST8 "o" #endif #if !defined PRIuLEAST8 || PRI_MACROS_BROKEN # undef PRIuLEAST8 # define PRIuLEAST8 "u" #endif #if !defined PRIxLEAST8 || PRI_MACROS_BROKEN # undef PRIxLEAST8 # define PRIxLEAST8 "x" #endif #if !defined PRIXLEAST8 || PRI_MACROS_BROKEN # undef PRIXLEAST8 # define PRIXLEAST8 "X" #endif #if !defined PRIdLEAST16 || PRI_MACROS_BROKEN # undef PRIdLEAST16 # define PRIdLEAST16 "d" #endif #if !defined PRIiLEAST16 || PRI_MACROS_BROKEN # undef PRIiLEAST16 # define PRIiLEAST16 "i" #endif #if !defined PRIoLEAST16 || PRI_MACROS_BROKEN # undef PRIoLEAST16 # define PRIoLEAST16 "o" #endif #if !defined PRIuLEAST16 || PRI_MACROS_BROKEN # undef PRIuLEAST16 # define PRIuLEAST16 "u" #endif #if !defined PRIxLEAST16 || PRI_MACROS_BROKEN # undef PRIxLEAST16 # define PRIxLEAST16 "x" #endif #if !defined PRIXLEAST16 || PRI_MACROS_BROKEN # undef PRIXLEAST16 # define PRIXLEAST16 "X" #endif #if !defined PRIdLEAST32 || PRI_MACROS_BROKEN # undef PRIdLEAST32 # define PRIdLEAST32 "d" #endif #if !defined PRIiLEAST32 || PRI_MACROS_BROKEN # undef PRIiLEAST32 # define PRIiLEAST32 "i" #endif #if !defined PRIoLEAST32 || PRI_MACROS_BROKEN # undef PRIoLEAST32 # define PRIoLEAST32 "o" #endif #if !defined PRIuLEAST32 || PRI_MACROS_BROKEN # undef PRIuLEAST32 # define PRIuLEAST32 "u" #endif #if !defined PRIxLEAST32 || PRI_MACROS_BROKEN # undef PRIxLEAST32 # define PRIxLEAST32 "x" #endif #if !defined PRIXLEAST32 || PRI_MACROS_BROKEN # undef PRIXLEAST32 # define PRIXLEAST32 "X" #endif #if !defined PRIdLEAST64 || PRI_MACROS_BROKEN # undef PRIdLEAST64 # define PRIdLEAST64 PRId64 #endif #if !defined PRIiLEAST64 || PRI_MACROS_BROKEN # undef PRIiLEAST64 # define PRIiLEAST64 PRIi64 #endif #if !defined PRIoLEAST64 || PRI_MACROS_BROKEN # undef PRIoLEAST64 # define PRIoLEAST64 PRIo64 #endif #if !defined PRIuLEAST64 || PRI_MACROS_BROKEN # undef PRIuLEAST64 # define PRIuLEAST64 PRIu64 #endif #if !defined PRIxLEAST64 || PRI_MACROS_BROKEN # undef PRIxLEAST64 # define PRIxLEAST64 PRIx64 #endif #if !defined PRIXLEAST64 || PRI_MACROS_BROKEN # undef PRIXLEAST64 # define PRIXLEAST64 PRIX64 #endif #if !defined PRIdFAST8 || PRI_MACROS_BROKEN # undef PRIdFAST8 # define PRIdFAST8 "d" #endif #if !defined PRIiFAST8 || PRI_MACROS_BROKEN # undef PRIiFAST8 # define PRIiFAST8 "i" #endif #if !defined PRIoFAST8 || PRI_MACROS_BROKEN # undef PRIoFAST8 # define PRIoFAST8 "o" #endif #if !defined PRIuFAST8 || PRI_MACROS_BROKEN # undef PRIuFAST8 # define PRIuFAST8 "u" #endif #if !defined PRIxFAST8 || PRI_MACROS_BROKEN # undef PRIxFAST8 # define PRIxFAST8 "x" #endif #if !defined PRIXFAST8 || PRI_MACROS_BROKEN # undef PRIXFAST8 # define PRIXFAST8 "X" #endif #if !defined PRIdFAST16 || PRI_MACROS_BROKEN # undef PRIdFAST16 # define PRIdFAST16 "d" #endif #if !defined PRIiFAST16 || PRI_MACROS_BROKEN # undef PRIiFAST16 # define PRIiFAST16 "i" #endif #if !defined PRIoFAST16 || PRI_MACROS_BROKEN # undef PRIoFAST16 # define PRIoFAST16 "o" #endif #if !defined PRIuFAST16 || PRI_MACROS_BROKEN # undef PRIuFAST16 # define PRIuFAST16 "u" #endif #if !defined PRIxFAST16 || PRI_MACROS_BROKEN # undef PRIxFAST16 # define PRIxFAST16 "x" #endif #if !defined PRIXFAST16 || PRI_MACROS_BROKEN # undef PRIXFAST16 # define PRIXFAST16 "X" #endif #if !defined PRIdFAST32 || PRI_MACROS_BROKEN # undef PRIdFAST32 # define PRIdFAST32 "d" #endif #if !defined PRIiFAST32 || PRI_MACROS_BROKEN # undef PRIiFAST32 # define PRIiFAST32 "i" #endif #if !defined PRIoFAST32 || PRI_MACROS_BROKEN # undef PRIoFAST32 # define PRIoFAST32 "o" #endif #if !defined PRIuFAST32 || PRI_MACROS_BROKEN # undef PRIuFAST32 # define PRIuFAST32 "u" #endif #if !defined PRIxFAST32 || PRI_MACROS_BROKEN # undef PRIxFAST32 # define PRIxFAST32 "x" #endif #if !defined PRIXFAST32 || PRI_MACROS_BROKEN # undef PRIXFAST32 # define PRIXFAST32 "X" #endif #if !defined PRIdFAST64 || PRI_MACROS_BROKEN # undef PRIdFAST64 # define PRIdFAST64 PRId64 #endif #if !defined PRIiFAST64 || PRI_MACROS_BROKEN # undef PRIiFAST64 # define PRIiFAST64 PRIi64 #endif #if !defined PRIoFAST64 || PRI_MACROS_BROKEN # undef PRIoFAST64 # define PRIoFAST64 PRIo64 #endif #if !defined PRIuFAST64 || PRI_MACROS_BROKEN # undef PRIuFAST64 # define PRIuFAST64 PRIu64 #endif #if !defined PRIxFAST64 || PRI_MACROS_BROKEN # undef PRIxFAST64 # define PRIxFAST64 PRIx64 #endif #if !defined PRIXFAST64 || PRI_MACROS_BROKEN # undef PRIXFAST64 # define PRIXFAST64 PRIX64 #endif #if !defined PRIdMAX || PRI_MACROS_BROKEN # undef PRIdMAX # define PRIdMAX (sizeof (uintmax_t) == sizeof (long) ? "ld" : "lld") #endif #if !defined PRIiMAX || PRI_MACROS_BROKEN # undef PRIiMAX # define PRIiMAX (sizeof (uintmax_t) == sizeof (long) ? "li" : "lli") #endif #if !defined PRIoMAX || PRI_MACROS_BROKEN # undef PRIoMAX # define PRIoMAX (sizeof (uintmax_t) == sizeof (long) ? "lo" : "llo") #endif #if !defined PRIuMAX || PRI_MACROS_BROKEN # undef PRIuMAX # define PRIuMAX (sizeof (uintmax_t) == sizeof (long) ? "lu" : "llu") #endif #if !defined PRIxMAX || PRI_MACROS_BROKEN # undef PRIxMAX # define PRIxMAX (sizeof (uintmax_t) == sizeof (long) ? "lx" : "llx") #endif #if !defined PRIXMAX || PRI_MACROS_BROKEN # undef PRIXMAX # define PRIXMAX (sizeof (uintmax_t) == sizeof (long) ? "lX" : "llX") #endif #if !defined PRIdPTR || PRI_MACROS_BROKEN # undef PRIdPTR # define PRIdPTR \ (sizeof (void *) == sizeof (long) ? "ld" : \ sizeof (void *) == sizeof (int) ? "d" : \ "lld") #endif #if !defined PRIiPTR || PRI_MACROS_BROKEN # undef PRIiPTR # define PRIiPTR \ (sizeof (void *) == sizeof (long) ? "li" : \ sizeof (void *) == sizeof (int) ? "i" : \ "lli") #endif #if !defined PRIoPTR || PRI_MACROS_BROKEN # undef PRIoPTR # define PRIoPTR \ (sizeof (void *) == sizeof (long) ? "lo" : \ sizeof (void *) == sizeof (int) ? "o" : \ "llo") #endif #if !defined PRIuPTR || PRI_MACROS_BROKEN # undef PRIuPTR # define PRIuPTR \ (sizeof (void *) == sizeof (long) ? "lu" : \ sizeof (void *) == sizeof (int) ? "u" : \ "llu") #endif #if !defined PRIxPTR || PRI_MACROS_BROKEN # undef PRIxPTR # define PRIxPTR \ (sizeof (void *) == sizeof (long) ? "lx" : \ sizeof (void *) == sizeof (int) ? "x" : \ "llx") #endif #if !defined PRIXPTR || PRI_MACROS_BROKEN # undef PRIXPTR # define PRIXPTR \ (sizeof (void *) == sizeof (long) ? "lX" : \ sizeof (void *) == sizeof (int) ? "X" : \ "llX") #endif /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ISO C functions. This is required by the standard because some ISO C functions will require linking with this object file and the name space must not be polluted. */ # define open(name, flags) open_not_cancel_2 (name, flags) # define close(fd) close_not_cancel_no_status (fd) # define read(fd, buf, n) read_not_cancel (fd, buf, n) # define mmap(addr, len, prot, flags, fd, offset) \ __mmap (addr, len, prot, flags, fd, offset) # define munmap(addr, len) __munmap (addr, len) #endif /* For those losing systems which don't have `alloca' we have to add some additional code emulating it. */ #ifdef HAVE_ALLOCA # define freea(p) /* nothing */ #else # define alloca(n) malloc (n) # define freea(p) free (p) #endif /* For systems that distinguish between text and binary I/O. O_BINARY is usually declared in . */ #if !defined O_BINARY && defined _O_BINARY /* For MSC-compatible compilers. */ # define O_BINARY _O_BINARY # define O_TEXT _O_TEXT #endif #ifdef __BEOS__ /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ # undef O_BINARY # undef O_TEXT #endif /* On reasonable systems, binary I/O is the default. */ #ifndef O_BINARY # define O_BINARY 0 #endif /* We need a sign, whether a new catalog was loaded, which can be associated with all translations. This is important if the translations are cached by one of GCC's features. */ int _nl_msg_cat_cntr; /* Expand a system dependent string segment. Return NULL if unsupported. */ static const char * get_sysdep_segment_value (const char *name) { /* Test for an ISO C 99 section 7.8.1 format string directive. Syntax: P R I { d | i | o | u | x | X } { { | LEAST | FAST } { 8 | 16 | 32 | 64 } | MAX | PTR } */ /* We don't use a table of 14 times 6 'const char *' strings here, because data relocations cost startup time. */ if (name[0] == 'P' && name[1] == 'R' && name[2] == 'I') { if (name[3] == 'd' || name[3] == 'i' || name[3] == 'o' || name[3] == 'u' || name[3] == 'x' || name[3] == 'X') { if (name[4] == '8' && name[5] == '\0') { if (name[3] == 'd') return PRId8; if (name[3] == 'i') return PRIi8; if (name[3] == 'o') return PRIo8; if (name[3] == 'u') return PRIu8; if (name[3] == 'x') return PRIx8; if (name[3] == 'X') return PRIX8; abort (); } if (name[4] == '1' && name[5] == '6' && name[6] == '\0') { if (name[3] == 'd') return PRId16; if (name[3] == 'i') return PRIi16; if (name[3] == 'o') return PRIo16; if (name[3] == 'u') return PRIu16; if (name[3] == 'x') return PRIx16; if (name[3] == 'X') return PRIX16; abort (); } if (name[4] == '3' && name[5] == '2' && name[6] == '\0') { if (name[3] == 'd') return PRId32; if (name[3] == 'i') return PRIi32; if (name[3] == 'o') return PRIo32; if (name[3] == 'u') return PRIu32; if (name[3] == 'x') return PRIx32; if (name[3] == 'X') return PRIX32; abort (); } if (name[4] == '6' && name[5] == '4' && name[6] == '\0') { if (name[3] == 'd') return PRId64; if (name[3] == 'i') return PRIi64; if (name[3] == 'o') return PRIo64; if (name[3] == 'u') return PRIu64; if (name[3] == 'x') return PRIx64; if (name[3] == 'X') return PRIX64; abort (); } if (name[4] == 'L' && name[5] == 'E' && name[6] == 'A' && name[7] == 'S' && name[8] == 'T') { if (name[9] == '8' && name[10] == '\0') { if (name[3] == 'd') return PRIdLEAST8; if (name[3] == 'i') return PRIiLEAST8; if (name[3] == 'o') return PRIoLEAST8; if (name[3] == 'u') return PRIuLEAST8; if (name[3] == 'x') return PRIxLEAST8; if (name[3] == 'X') return PRIXLEAST8; abort (); } if (name[9] == '1' && name[10] == '6' && name[11] == '\0') { if (name[3] == 'd') return PRIdLEAST16; if (name[3] == 'i') return PRIiLEAST16; if (name[3] == 'o') return PRIoLEAST16; if (name[3] == 'u') return PRIuLEAST16; if (name[3] == 'x') return PRIxLEAST16; if (name[3] == 'X') return PRIXLEAST16; abort (); } if (name[9] == '3' && name[10] == '2' && name[11] == '\0') { if (name[3] == 'd') return PRIdLEAST32; if (name[3] == 'i') return PRIiLEAST32; if (name[3] == 'o') return PRIoLEAST32; if (name[3] == 'u') return PRIuLEAST32; if (name[3] == 'x') return PRIxLEAST32; if (name[3] == 'X') return PRIXLEAST32; abort (); } if (name[9] == '6' && name[10] == '4' && name[11] == '\0') { if (name[3] == 'd') return PRIdLEAST64; if (name[3] == 'i') return PRIiLEAST64; if (name[3] == 'o') return PRIoLEAST64; if (name[3] == 'u') return PRIuLEAST64; if (name[3] == 'x') return PRIxLEAST64; if (name[3] == 'X') return PRIXLEAST64; abort (); } } if (name[4] == 'F' && name[5] == 'A' && name[6] == 'S' && name[7] == 'T') { if (name[8] == '8' && name[9] == '\0') { if (name[3] == 'd') return PRIdFAST8; if (name[3] == 'i') return PRIiFAST8; if (name[3] == 'o') return PRIoFAST8; if (name[3] == 'u') return PRIuFAST8; if (name[3] == 'x') return PRIxFAST8; if (name[3] == 'X') return PRIXFAST8; abort (); } if (name[8] == '1' && name[9] == '6' && name[10] == '\0') { if (name[3] == 'd') return PRIdFAST16; if (name[3] == 'i') return PRIiFAST16; if (name[3] == 'o') return PRIoFAST16; if (name[3] == 'u') return PRIuFAST16; if (name[3] == 'x') return PRIxFAST16; if (name[3] == 'X') return PRIXFAST16; abort (); } if (name[8] == '3' && name[9] == '2' && name[10] == '\0') { if (name[3] == 'd') return PRIdFAST32; if (name[3] == 'i') return PRIiFAST32; if (name[3] == 'o') return PRIoFAST32; if (name[3] == 'u') return PRIuFAST32; if (name[3] == 'x') return PRIxFAST32; if (name[3] == 'X') return PRIXFAST32; abort (); } if (name[8] == '6' && name[9] == '4' && name[10] == '\0') { if (name[3] == 'd') return PRIdFAST64; if (name[3] == 'i') return PRIiFAST64; if (name[3] == 'o') return PRIoFAST64; if (name[3] == 'u') return PRIuFAST64; if (name[3] == 'x') return PRIxFAST64; if (name[3] == 'X') return PRIXFAST64; abort (); } } if (name[4] == 'M' && name[5] == 'A' && name[6] == 'X' && name[7] == '\0') { if (name[3] == 'd') return PRIdMAX; if (name[3] == 'i') return PRIiMAX; if (name[3] == 'o') return PRIoMAX; if (name[3] == 'u') return PRIuMAX; if (name[3] == 'x') return PRIxMAX; if (name[3] == 'X') return PRIXMAX; abort (); } if (name[4] == 'P' && name[5] == 'T' && name[6] == 'R' && name[7] == '\0') { if (name[3] == 'd') return PRIdPTR; if (name[3] == 'i') return PRIiPTR; if (name[3] == 'o') return PRIoPTR; if (name[3] == 'u') return PRIuPTR; if (name[3] == 'x') return PRIxPTR; if (name[3] == 'X') return PRIXPTR; abort (); } } } /* Test for a glibc specific printf() format directive flag. */ if (name[0] == 'I' && name[1] == '\0') { #if defined _LIBC || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) /* The 'I' flag, in numeric format directives, replaces ASCII digits with the 'outdigits' defined in the LC_CTYPE locale facet. This is used for Farsi (Persian) and maybe Arabic. */ return "I"; #else return ""; #endif } /* Other system dependent strings are not valid. */ return NULL; } /* Load the message catalogs specified by FILENAME. If it is no valid message catalog do nothing. */ void internal_function _nl_load_domain (struct loaded_l10nfile *domain_file, struct binding *domainbinding) { __libc_lock_define_initialized_recursive (static, lock) int fd = -1; size_t size; #ifdef _LIBC struct stat64 st; #else struct stat st; #endif struct mo_file_header *data = (struct mo_file_header *) -1; int use_mmap = 0; struct loaded_domain *domain; int revision; const char *nullentry; size_t nullentrylen; __libc_lock_lock_recursive (lock); if (domain_file->decided != 0) { /* There are two possibilities: + this is the same thread calling again during this initialization via _nl_find_msg. We have initialized everything this call needs. + this is another thread which tried to initialize this object. Not necessary anymore since if the lock is available this is finished. */ goto done; } domain_file->decided = -1; domain_file->data = NULL; /* Note that it would be useless to store domainbinding in domain_file because domainbinding might be == NULL now but != NULL later (after a call to bind_textdomain_codeset). */ /* If the record does not represent a valid locale the FILENAME might be NULL. This can happen when according to the given specification the locale file name is different for XPG and CEN syntax. */ if (domain_file->filename == NULL) goto out; /* Try to open the addressed file. */ fd = open (domain_file->filename, O_RDONLY | O_BINARY); if (fd == -1) goto out; /* We must know about the size of the file. */ if ( #ifdef _LIBC __builtin_expect (fstat64 (fd, &st) != 0, 0) #else __builtin_expect (fstat (fd, &st) != 0, 0) #endif || __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0) || __builtin_expect (size < sizeof (struct mo_file_header), 0)) /* Something went wrong. */ goto out; #ifdef HAVE_MMAP /* Now we are ready to load the file. If mmap() is available we try this first. If not available or it failed we try to load it. */ data = (struct mo_file_header *) mmap (NULL, size, PROT_READ, MAP_PRIVATE, fd, 0); if (__builtin_expect (data != (struct mo_file_header *) -1, 1)) { /* mmap() call was successful. */ close (fd); fd = -1; use_mmap = 1; } #endif /* If the data is not yet available (i.e. mmap'ed) we try to load it manually. */ if (data == (struct mo_file_header *) -1) { size_t to_read; char *read_ptr; data = (struct mo_file_header *) malloc (size); if (data == NULL) goto out; to_read = size; read_ptr = (char *) data; do { long int nb = (long int) read (fd, read_ptr, to_read); if (nb <= 0) { #ifdef EINTR if (nb == -1 && errno == EINTR) continue; #endif goto out; } read_ptr += nb; to_read -= nb; } while (to_read > 0); close (fd); fd = -1; } /* Using the magic number we can test whether it really is a message catalog file. */ if (__builtin_expect (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED, 0)) { /* The magic number is wrong: not a message catalog file. */ #ifdef HAVE_MMAP if (use_mmap) munmap ((caddr_t) data, size); else #endif free (data); goto out; } domain = (struct loaded_domain *) malloc (sizeof (struct loaded_domain)); if (domain == NULL) goto out; domain_file->data = domain; domain->data = (char *) data; domain->use_mmap = use_mmap; domain->mmap_size = size; domain->must_swap = data->magic != _MAGIC; domain->malloced = NULL; /* Fill in the information about the available tables. */ revision = W (domain->must_swap, data->revision); /* We support only the major revisions 0 and 1. */ switch (revision >> 16) { case 0: case 1: domain->nstrings = W (domain->must_swap, data->nstrings); domain->orig_tab = (const struct string_desc *) ((char *) data + W (domain->must_swap, data->orig_tab_offset)); domain->trans_tab = (const struct string_desc *) ((char *) data + W (domain->must_swap, data->trans_tab_offset)); domain->hash_size = W (domain->must_swap, data->hash_tab_size); domain->hash_tab = (domain->hash_size > 2 ? (const nls_uint32 *) ((char *) data + W (domain->must_swap, data->hash_tab_offset)) : NULL); domain->must_swap_hash_tab = domain->must_swap; /* Now dispatch on the minor revision. */ switch (revision & 0xffff) { case 0: domain->n_sysdep_strings = 0; domain->orig_sysdep_tab = NULL; domain->trans_sysdep_tab = NULL; break; case 1: default: { nls_uint32 n_sysdep_strings; if (domain->hash_tab == NULL) /* This is invalid. These minor revisions need a hash table. */ goto invalid; n_sysdep_strings = W (domain->must_swap, data->n_sysdep_strings); if (n_sysdep_strings > 0) { nls_uint32 n_sysdep_segments; const struct sysdep_segment *sysdep_segments; const char **sysdep_segment_values; const nls_uint32 *orig_sysdep_tab; const nls_uint32 *trans_sysdep_tab; nls_uint32 n_inmem_sysdep_strings; size_t memneed; char *mem; struct sysdep_string_desc *inmem_orig_sysdep_tab; struct sysdep_string_desc *inmem_trans_sysdep_tab; nls_uint32 *inmem_hash_tab; unsigned int i, j; /* Get the values of the system dependent segments. */ n_sysdep_segments = W (domain->must_swap, data->n_sysdep_segments); sysdep_segments = (const struct sysdep_segment *) ((char *) data + W (domain->must_swap, data->sysdep_segments_offset)); sysdep_segment_values = alloca (n_sysdep_segments * sizeof (const char *)); for (i = 0; i < n_sysdep_segments; i++) { const char *name = (char *) data + W (domain->must_swap, sysdep_segments[i].offset); nls_uint32 namelen = W (domain->must_swap, sysdep_segments[i].length); if (!(namelen > 0 && name[namelen - 1] == '\0')) { freea (sysdep_segment_values); goto invalid; } sysdep_segment_values[i] = get_sysdep_segment_value (name); } orig_sysdep_tab = (const nls_uint32 *) ((char *) data + W (domain->must_swap, data->orig_sysdep_tab_offset)); trans_sysdep_tab = (const nls_uint32 *) ((char *) data + W (domain->must_swap, data->trans_sysdep_tab_offset)); /* Compute the amount of additional memory needed for the system dependent strings and the augmented hash table. At the same time, also drop string pairs which refer to an undefined system dependent segment. */ n_inmem_sysdep_strings = 0; memneed = domain->hash_size * sizeof (nls_uint32); for (i = 0; i < n_sysdep_strings; i++) { int valid = 1; size_t needs[2]; for (j = 0; j < 2; j++) { const struct sysdep_string *sysdep_string = (const struct sysdep_string *) ((char *) data + W (domain->must_swap, j == 0 ? orig_sysdep_tab[i] : trans_sysdep_tab[i])); size_t need = 0; const struct segment_pair *p = sysdep_string->segments; if (W (domain->must_swap, p->sysdepref) != SEGMENTS_END) for (p = sysdep_string->segments;; p++) { nls_uint32 sysdepref; need += W (domain->must_swap, p->segsize); sysdepref = W (domain->must_swap, p->sysdepref); if (sysdepref == SEGMENTS_END) break; if (sysdepref >= n_sysdep_segments) { /* Invalid. */ freea (sysdep_segment_values); goto invalid; } if (sysdep_segment_values[sysdepref] == NULL) { /* This particular string pair is invalid. */ valid = 0; break; } need += strlen (sysdep_segment_values[sysdepref]); } needs[j] = need; if (!valid) break; } if (valid) { n_inmem_sysdep_strings++; memneed += needs[0] + needs[1]; } } memneed += 2 * n_inmem_sysdep_strings * sizeof (struct sysdep_string_desc); if (n_inmem_sysdep_strings > 0) { unsigned int k; /* Allocate additional memory. */ mem = (char *) malloc (memneed); if (mem == NULL) goto invalid; domain->malloced = mem; inmem_orig_sysdep_tab = (struct sysdep_string_desc *) mem; mem += n_inmem_sysdep_strings * sizeof (struct sysdep_string_desc); inmem_trans_sysdep_tab = (struct sysdep_string_desc *) mem; mem += n_inmem_sysdep_strings * sizeof (struct sysdep_string_desc); inmem_hash_tab = (nls_uint32 *) mem; mem += domain->hash_size * sizeof (nls_uint32); /* Compute the system dependent strings. */ k = 0; for (i = 0; i < n_sysdep_strings; i++) { int valid = 1; for (j = 0; j < 2; j++) { const struct sysdep_string *sysdep_string = (const struct sysdep_string *) ((char *) data + W (domain->must_swap, j == 0 ? orig_sysdep_tab[i] : trans_sysdep_tab[i])); const struct segment_pair *p = sysdep_string->segments; if (W (domain->must_swap, p->sysdepref) != SEGMENTS_END) for (p = sysdep_string->segments;; p++) { nls_uint32 sysdepref; sysdepref = W (domain->must_swap, p->sysdepref); if (sysdepref == SEGMENTS_END) break; if (sysdep_segment_values[sysdepref] == NULL) { /* This particular string pair is invalid. */ valid = 0; break; } } if (!valid) break; } if (valid) { for (j = 0; j < 2; j++) { const struct sysdep_string *sysdep_string = (const struct sysdep_string *) ((char *) data + W (domain->must_swap, j == 0 ? orig_sysdep_tab[i] : trans_sysdep_tab[i])); const char *static_segments = (char *) data + W (domain->must_swap, sysdep_string->offset); const struct segment_pair *p = sysdep_string->segments; /* Concatenate the segments, and fill inmem_orig_sysdep_tab[k] (for j == 0) and inmem_trans_sysdep_tab[k] (for j == 1). */ struct sysdep_string_desc *inmem_tab_entry = (j == 0 ? inmem_orig_sysdep_tab : inmem_trans_sysdep_tab) + k; if (W (domain->must_swap, p->sysdepref) == SEGMENTS_END) { /* Only one static segment. */ inmem_tab_entry->length = W (domain->must_swap, p->segsize); inmem_tab_entry->pointer = static_segments; } else { inmem_tab_entry->pointer = mem; for (p = sysdep_string->segments;; p++) { nls_uint32 segsize = W (domain->must_swap, p->segsize); nls_uint32 sysdepref = W (domain->must_swap, p->sysdepref); size_t n; if (segsize > 0) { memcpy (mem, static_segments, segsize); mem += segsize; static_segments += segsize; } if (sysdepref == SEGMENTS_END) break; n = strlen (sysdep_segment_values[sysdepref]); memcpy (mem, sysdep_segment_values[sysdepref], n); mem += n; } inmem_tab_entry->length = mem - inmem_tab_entry->pointer; } } k++; } } if (k != n_inmem_sysdep_strings) abort (); /* Compute the augmented hash table. */ for (i = 0; i < domain->hash_size; i++) inmem_hash_tab[i] = W (domain->must_swap_hash_tab, domain->hash_tab[i]); for (i = 0; i < n_inmem_sysdep_strings; i++) { const char *msgid = inmem_orig_sysdep_tab[i].pointer; nls_uint32 hash_val = __hash_string (msgid); nls_uint32 idx = hash_val % domain->hash_size; nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2)); for (;;) { if (inmem_hash_tab[idx] == 0) { /* Hash table entry is empty. Use it. */ inmem_hash_tab[idx] = 1 + domain->nstrings + i; break; } if (idx >= domain->hash_size - incr) idx -= domain->hash_size - incr; else idx += incr; } } domain->n_sysdep_strings = n_inmem_sysdep_strings; domain->orig_sysdep_tab = inmem_orig_sysdep_tab; domain->trans_sysdep_tab = inmem_trans_sysdep_tab; domain->hash_tab = inmem_hash_tab; domain->must_swap_hash_tab = 0; } else { domain->n_sysdep_strings = 0; domain->orig_sysdep_tab = NULL; domain->trans_sysdep_tab = NULL; } freea (sysdep_segment_values); } else { domain->n_sysdep_strings = 0; domain->orig_sysdep_tab = NULL; domain->trans_sysdep_tab = NULL; } } break; } break; default: /* This is an invalid revision. */ invalid: /* This is an invalid .mo file. */ if (domain->malloced) free (domain->malloced); #ifdef HAVE_MMAP if (use_mmap) munmap ((caddr_t) data, size); else #endif free (data); free (domain); domain_file->data = NULL; goto out; } /* No caches of converted translations so far. */ domain->conversions = NULL; domain->nconversions = 0; /* Get the header entry and look for a plural specification. */ #ifdef IN_LIBGLOCALE nullentry = _nl_find_msg (domain_file, domainbinding, NULL, "", &nullentrylen); #else nullentry = _nl_find_msg (domain_file, domainbinding, "", 0, &nullentrylen); #endif EXTRACT_PLURAL_EXPRESSION (nullentry, &domain->plural, &domain->nplurals); out: if (fd != -1) close (fd); domain_file->decided = 1; done: __libc_lock_unlock_recursive (lock); } #ifdef _LIBC void internal_function __libc_freeres_fn_section _nl_unload_domain (struct loaded_domain *domain) { size_t i; if (domain->plural != &__gettext_germanic_plural) __gettext_free_exp (domain->plural); for (i = 0; i < domain->nconversions; i++) { struct converted_domain *convd = &domain->conversions[i]; free (convd->encoding); if (convd->conv_tab != NULL && convd->conv_tab != (char **) -1) free (convd->conv_tab); if (convd->conv != (__gconv_t) -1) __gconv_close (convd->conv); } if (domain->conversions != NULL) free (domain->conversions); if (domain->malloced) free (domain->malloced); # ifdef _POSIX_MAPPED_FILES if (domain->use_mmap) munmap ((caddr_t) domain->data, domain->mmap_size); else # endif /* _POSIX_MAPPED_FILES */ free ((void *) domain->data); free (domain); } #endif pbbuttonsd-0.8.1a/intl/localealias.c0000644000175000017500000002447110641705131014357 00000000000000/* Handle aliases for locale names. Copyright (C) 1995-1999, 2000-2001, 2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Tell glibc's to provide a prototype for mempcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #if defined _LIBC || defined HAVE___FSETLOCKING # include #endif #include #ifdef __GNUC__ # undef alloca # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else # ifdef _MSC_VER # include # define alloca _alloca # else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif # endif #endif #include #include #include "gettextP.h" #if ENABLE_RELOCATABLE # include "relocatable.h" #else # define relocate(pathname) (pathname) #endif /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ANSI C functions. This is required by the standard because some ANSI C functions will require linking with this object file and the name space must not be polluted. */ # define strcasecmp __strcasecmp # ifndef mempcpy # define mempcpy __mempcpy # endif # define HAVE_MEMPCPY 1 # define HAVE___FSETLOCKING 1 #endif /* Handle multi-threaded applications. */ #ifdef _LIBC # include #else # include "lock.h" #endif #ifndef internal_function # define internal_function #endif /* Some optimizations for glibc. */ #ifdef _LIBC # define FEOF(fp) feof_unlocked (fp) # define FGETS(buf, n, fp) fgets_unlocked (buf, n, fp) #else # define FEOF(fp) feof (fp) # define FGETS(buf, n, fp) fgets (buf, n, fp) #endif /* For those losing systems which don't have `alloca' we have to add some additional code emulating it. */ #ifdef HAVE_ALLOCA # define freea(p) /* nothing */ #else # define alloca(n) malloc (n) # define freea(p) free (p) #endif #if defined _LIBC_REENTRANT || HAVE_DECL_FGETS_UNLOCKED # undef fgets # define fgets(buf, len, s) fgets_unlocked (buf, len, s) #endif #if defined _LIBC_REENTRANT || HAVE_DECL_FEOF_UNLOCKED # undef feof # define feof(s) feof_unlocked (s) #endif __libc_lock_define_initialized (static, lock) struct alias_map { const char *alias; const char *value; }; #ifndef _LIBC # define libc_freeres_ptr(decl) decl #endif libc_freeres_ptr (static char *string_space); static size_t string_space_act; static size_t string_space_max; libc_freeres_ptr (static struct alias_map *map); static size_t nmap; static size_t maxmap; /* Prototypes for local functions. */ static size_t read_alias_file (const char *fname, int fname_len) internal_function; static int extend_alias_table (void); static int alias_compare (const struct alias_map *map1, const struct alias_map *map2); const char * _nl_expand_alias (const char *name) { static const char *locale_alias_path; struct alias_map *retval; const char *result = NULL; size_t added; __libc_lock_lock (lock); if (locale_alias_path == NULL) locale_alias_path = LOCALE_ALIAS_PATH; do { struct alias_map item; item.alias = name; if (nmap > 0) retval = (struct alias_map *) bsearch (&item, map, nmap, sizeof (struct alias_map), (int (*) (const void *, const void *) ) alias_compare); else retval = NULL; /* We really found an alias. Return the value. */ if (retval != NULL) { result = retval->value; break; } /* Perhaps we can find another alias file. */ added = 0; while (added == 0 && locale_alias_path[0] != '\0') { const char *start; while (locale_alias_path[0] == PATH_SEPARATOR) ++locale_alias_path; start = locale_alias_path; while (locale_alias_path[0] != '\0' && locale_alias_path[0] != PATH_SEPARATOR) ++locale_alias_path; if (start < locale_alias_path) added = read_alias_file (start, locale_alias_path - start); } } while (added != 0); __libc_lock_unlock (lock); return result; } static size_t internal_function read_alias_file (const char *fname, int fname_len) { FILE *fp; char *full_fname; size_t added; static const char aliasfile[] = "/locale.alias"; full_fname = (char *) alloca (fname_len + sizeof aliasfile); #ifdef HAVE_MEMPCPY mempcpy (mempcpy (full_fname, fname, fname_len), aliasfile, sizeof aliasfile); #else memcpy (full_fname, fname, fname_len); memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile); #endif #ifdef _LIBC /* Note the file is opened with cancellation in the I/O functions disabled. */ fp = fopen (relocate (full_fname), "rc"); #else fp = fopen (relocate (full_fname), "r"); #endif freea (full_fname); if (fp == NULL) return 0; #ifdef HAVE___FSETLOCKING /* No threads present. */ __fsetlocking (fp, FSETLOCKING_BYCALLER); #endif added = 0; while (!FEOF (fp)) { /* It is a reasonable approach to use a fix buffer here because a) we are only interested in the first two fields b) these fields must be usable as file names and so must not be that long We avoid a multi-kilobyte buffer here since this would use up stack space which we might not have if the program ran out of memory. */ char buf[400]; char *alias; char *value; char *cp; int complete_line; if (FGETS (buf, sizeof buf, fp) == NULL) /* EOF reached. */ break; /* Determine whether the line is complete. */ complete_line = strchr (buf, '\n') != NULL; cp = buf; /* Ignore leading white space. */ while (isspace ((unsigned char) cp[0])) ++cp; /* A leading '#' signals a comment line. */ if (cp[0] != '\0' && cp[0] != '#') { alias = cp++; while (cp[0] != '\0' && !isspace ((unsigned char) cp[0])) ++cp; /* Terminate alias name. */ if (cp[0] != '\0') *cp++ = '\0'; /* Now look for the beginning of the value. */ while (isspace ((unsigned char) cp[0])) ++cp; if (cp[0] != '\0') { value = cp++; while (cp[0] != '\0' && !isspace ((unsigned char) cp[0])) ++cp; /* Terminate value. */ if (cp[0] == '\n') { /* This has to be done to make the following test for the end of line possible. We are looking for the terminating '\n' which do not overwrite here. */ *cp++ = '\0'; *cp = '\n'; } else if (cp[0] != '\0') *cp++ = '\0'; #ifdef IN_LIBGLOCALE /* glibc's locale.alias contains entries for ja_JP and ko_KR that make it impossible to use a Japanese or Korean UTF-8 locale under the name "ja_JP" or "ko_KR". Ignore these entries. */ if (strchr (alias, '_') == NULL) #endif { size_t alias_len; size_t value_len; if (nmap >= maxmap) if (__builtin_expect (extend_alias_table (), 0)) goto out; alias_len = strlen (alias) + 1; value_len = strlen (value) + 1; if (string_space_act + alias_len + value_len > string_space_max) { /* Increase size of memory pool. */ size_t new_size = (string_space_max + (alias_len + value_len > 1024 ? alias_len + value_len : 1024)); char *new_pool = (char *) realloc (string_space, new_size); if (new_pool == NULL) goto out; if (__builtin_expect (string_space != new_pool, 0)) { size_t i; for (i = 0; i < nmap; i++) { map[i].alias += new_pool - string_space; map[i].value += new_pool - string_space; } } string_space = new_pool; string_space_max = new_size; } map[nmap].alias = memcpy (&string_space[string_space_act], alias, alias_len); string_space_act += alias_len; map[nmap].value = memcpy (&string_space[string_space_act], value, value_len); string_space_act += value_len; ++nmap; ++added; } } } /* Possibly not the whole line fits into the buffer. Ignore the rest of the line. */ if (! complete_line) do if (FGETS (buf, sizeof buf, fp) == NULL) /* Make sure the inner loop will be left. The outer loop will exit at the `feof' test. */ break; while (strchr (buf, '\n') == NULL); } out: /* Should we test for ferror()? I think we have to silently ignore errors. --drepper */ fclose (fp); if (added > 0) qsort (map, nmap, sizeof (struct alias_map), (int (*) (const void *, const void *)) alias_compare); return added; } static int extend_alias_table () { size_t new_size; struct alias_map *new_map; new_size = maxmap == 0 ? 100 : 2 * maxmap; new_map = (struct alias_map *) realloc (map, (new_size * sizeof (struct alias_map))); if (new_map == NULL) /* Simply don't extend: we don't have any more core. */ return -1; map = new_map; maxmap = new_size; return 0; } static int alias_compare (const struct alias_map *map1, const struct alias_map *map2) { #if defined _LIBC || defined HAVE_STRCASECMP return strcasecmp (map1->alias, map2->alias); #else const unsigned char *p1 = (const unsigned char *) map1->alias; const unsigned char *p2 = (const unsigned char *) map2->alias; unsigned char c1, c2; if (p1 == p2) return 0; do { /* I know this seems to be odd but the tolower() function in some systems libc cannot handle nonalpha characters. */ c1 = isupper (*p1) ? tolower (*p1) : *p1; c2 = isupper (*p2) ? tolower (*p2) : *p2; if (c1 == '\0') break; ++p1; ++p2; } while (c1 == c2); return c1 - c2; #endif } pbbuttonsd-0.8.1a/intl/textdomain.c0000644000175000017500000001062710641705132014261 00000000000000/* Implementation of the textdomain(3) function. Copyright (C) 1995-1998, 2000-2003, 2005-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* Handle multi-threaded applications. */ #ifdef _LIBC # include # define gl_rwlock_define __libc_rwlock_define # define gl_rwlock_wrlock __libc_rwlock_wrlock # define gl_rwlock_unlock __libc_rwlock_unlock #else # include "lock.h" #endif /* The internal variables in the standalone libintl.a must have different names than the internal variables in GNU libc, otherwise programs using libintl.a cannot be linked statically. */ #if !defined _LIBC # define _nl_default_default_domain libintl_nl_default_default_domain # define _nl_current_default_domain libintl_nl_current_default_domain #endif /* @@ end of prolog @@ */ /* Name of the default text domain. */ extern const char _nl_default_default_domain[] attribute_hidden; /* Default text domain in which entries for gettext(3) are to be found. */ extern const char *_nl_current_default_domain attribute_hidden; /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define TEXTDOMAIN __textdomain # ifndef strdup # define strdup(str) __strdup (str) # endif #else # define TEXTDOMAIN libintl_textdomain #endif /* Lock variable to protect the global data in the gettext implementation. */ gl_rwlock_define (extern, _nl_state_lock attribute_hidden) /* Set the current default message catalog to DOMAINNAME. If DOMAINNAME is null, return the current default. If DOMAINNAME is "", reset to the default of "messages". */ char * TEXTDOMAIN (const char *domainname) { char *new_domain; char *old_domain; /* A NULL pointer requests the current setting. */ if (domainname == NULL) return (char *) _nl_current_default_domain; gl_rwlock_wrlock (_nl_state_lock); old_domain = (char *) _nl_current_default_domain; /* If domain name is the null string set to default domain "messages". */ if (domainname[0] == '\0' || strcmp (domainname, _nl_default_default_domain) == 0) { _nl_current_default_domain = _nl_default_default_domain; new_domain = (char *) _nl_current_default_domain; } else if (strcmp (domainname, old_domain) == 0) /* This can happen and people will use it to signal that some environment variable changed. */ new_domain = old_domain; else { /* If the following malloc fails `_nl_current_default_domain' will be NULL. This value will be returned and so signals we are out of core. */ #if defined _LIBC || defined HAVE_STRDUP new_domain = strdup (domainname); #else size_t len = strlen (domainname) + 1; new_domain = (char *) malloc (len); if (new_domain != NULL) memcpy (new_domain, domainname, len); #endif if (new_domain != NULL) _nl_current_default_domain = new_domain; } /* We use this possibility to signal a change of the loaded catalogs since this is most likely the case and there is no other easy we to do it. Do it only when the call was successful. */ if (new_domain != NULL) { ++_nl_msg_cat_cntr; if (old_domain != new_domain && old_domain != _nl_default_default_domain) free (old_domain); } gl_rwlock_unlock (_nl_state_lock); return new_domain; } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__textdomain, textdomain); #endif pbbuttonsd-0.8.1a/intl/l10nflist.c0000644000175000017500000002557210641705130013724 00000000000000/* Copyright (C) 1995-1999, 2000-2006 Free Software Foundation, Inc. Contributed by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Tell glibc's to provide a prototype for stpcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #if defined _LIBC || defined HAVE_ARGZ_H # include #endif #include #include #include #include "loadinfo.h" /* On some strange systems still no definition of NULL is found. Sigh! */ #ifndef NULL # if defined __STDC__ && __STDC__ # define NULL ((void *) 0) # else # define NULL 0 # endif #endif /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ANSI C functions. This is required by the standard because some ANSI C functions will require linking with this object file and the name space must not be polluted. */ # ifndef stpcpy # define stpcpy(dest, src) __stpcpy(dest, src) # endif #else # ifndef HAVE_STPCPY static char *stpcpy (char *dest, const char *src); # endif #endif /* Pathname support. ISSLASH(C) tests whether C is a directory separator character. IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not, it may be concatenated to a directory pathname. */ #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ /* Win32, Cygwin, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') # define HAS_DEVICE(P) \ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ && (P)[1] == ':') # define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P)) #else /* Unix */ # define ISSLASH(C) ((C) == '/') # define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0]) #endif /* Define function which are usually not available. */ #ifdef _LIBC # define __argz_count(argz, len) INTUSE(__argz_count) (argz, len) #elif defined HAVE_ARGZ_COUNT # undef __argz_count # define __argz_count argz_count #else /* Returns the number of strings in ARGZ. */ static size_t argz_count__ (const char *argz, size_t len) { size_t count = 0; while (len > 0) { size_t part_len = strlen (argz); argz += part_len + 1; len -= part_len + 1; count++; } return count; } # undef __argz_count # define __argz_count(argz, len) argz_count__ (argz, len) #endif /* !_LIBC && !HAVE_ARGZ_COUNT */ #ifdef _LIBC # define __argz_stringify(argz, len, sep) \ INTUSE(__argz_stringify) (argz, len, sep) #elif defined HAVE_ARGZ_STRINGIFY # undef __argz_stringify # define __argz_stringify argz_stringify #else /* Make '\0' separated arg vector ARGZ printable by converting all the '\0's except the last into the character SEP. */ static void argz_stringify__ (char *argz, size_t len, int sep) { while (len > 0) { size_t part_len = strlen (argz); argz += part_len; len -= part_len + 1; if (len > 0) *argz++ = sep; } } # undef __argz_stringify # define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep) #endif /* !_LIBC && !HAVE_ARGZ_STRINGIFY */ #ifdef _LIBC #elif defined HAVE_ARGZ_NEXT # undef __argz_next # define __argz_next argz_next #else static char * argz_next__ (char *argz, size_t argz_len, const char *entry) { if (entry) { if (entry < argz + argz_len) entry = strchr (entry, '\0') + 1; return entry >= argz + argz_len ? NULL : (char *) entry; } else if (argz_len > 0) return argz; else return 0; } # undef __argz_next # define __argz_next(argz, len, entry) argz_next__ (argz, len, entry) #endif /* !_LIBC && !HAVE_ARGZ_NEXT */ /* Return number of bits set in X. */ static inline int pop (int x) { /* We assume that no more than 16 bits are used. */ x = ((x & ~0x5555) >> 1) + (x & 0x5555); x = ((x & ~0x3333) >> 2) + (x & 0x3333); x = ((x >> 4) + x) & 0x0f0f; x = ((x >> 8) + x) & 0xff; return x; } struct loaded_l10nfile * _nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list, const char *dirlist, size_t dirlist_len, int mask, const char *language, const char *territory, const char *codeset, const char *normalized_codeset, const char *modifier, const char *filename, int do_allocate) { char *abs_filename; struct loaded_l10nfile **lastp; struct loaded_l10nfile *retval; char *cp; size_t dirlist_count; size_t entries; int cnt; /* If LANGUAGE contains an absolute directory specification, we ignore DIRLIST. */ if (IS_ABSOLUTE_PATH (language)) dirlist_len = 0; /* Allocate room for the full file name. */ abs_filename = (char *) malloc (dirlist_len + strlen (language) + ((mask & XPG_TERRITORY) != 0 ? strlen (territory) + 1 : 0) + ((mask & XPG_CODESET) != 0 ? strlen (codeset) + 1 : 0) + ((mask & XPG_NORM_CODESET) != 0 ? strlen (normalized_codeset) + 1 : 0) + ((mask & XPG_MODIFIER) != 0 ? strlen (modifier) + 1 : 0) + 1 + strlen (filename) + 1); if (abs_filename == NULL) return NULL; /* Construct file name. */ cp = abs_filename; if (dirlist_len > 0) { memcpy (cp, dirlist, dirlist_len); __argz_stringify (cp, dirlist_len, PATH_SEPARATOR); cp += dirlist_len; cp[-1] = '/'; } cp = stpcpy (cp, language); if ((mask & XPG_TERRITORY) != 0) { *cp++ = '_'; cp = stpcpy (cp, territory); } if ((mask & XPG_CODESET) != 0) { *cp++ = '.'; cp = stpcpy (cp, codeset); } if ((mask & XPG_NORM_CODESET) != 0) { *cp++ = '.'; cp = stpcpy (cp, normalized_codeset); } if ((mask & XPG_MODIFIER) != 0) { *cp++ = '@'; cp = stpcpy (cp, modifier); } *cp++ = '/'; stpcpy (cp, filename); /* Look in list of already loaded domains whether it is already available. */ lastp = l10nfile_list; for (retval = *l10nfile_list; retval != NULL; retval = retval->next) if (retval->filename != NULL) { int compare = strcmp (retval->filename, abs_filename); if (compare == 0) /* We found it! */ break; if (compare < 0) { /* It's not in the list. */ retval = NULL; break; } lastp = &retval->next; } if (retval != NULL || do_allocate == 0) { free (abs_filename); return retval; } dirlist_count = (dirlist_len > 0 ? __argz_count (dirlist, dirlist_len) : 1); /* Allocate a new loaded_l10nfile. */ retval = (struct loaded_l10nfile *) malloc (sizeof (*retval) + (((dirlist_count << pop (mask)) + (dirlist_count > 1 ? 1 : 0)) * sizeof (struct loaded_l10nfile *))); if (retval == NULL) { free (abs_filename); return NULL; } retval->filename = abs_filename; /* We set retval->data to NULL here; it is filled in later. Setting retval->decided to 1 here means that retval does not correspond to a real file (dirlist_count > 1) or is not worth looking up (if an unnormalized codeset was specified). */ retval->decided = (dirlist_count > 1 || ((mask & XPG_CODESET) != 0 && (mask & XPG_NORM_CODESET) != 0)); retval->data = NULL; retval->next = *lastp; *lastp = retval; entries = 0; /* Recurse to fill the inheritance list of RETVAL. If the DIRLIST is a real list (i.e. DIRLIST_COUNT > 1), the RETVAL entry does not correspond to a real file; retval->filename contains colons. In this case we loop across all elements of DIRLIST and across all bit patterns dominated by MASK. If the DIRLIST is a single directory or entirely redundant (i.e. DIRLIST_COUNT == 1), we loop across all bit patterns dominated by MASK, excluding MASK itself. In either case, we loop down from MASK to 0. This has the effect that the extra bits in the locale name are dropped in this order: first the modifier, then the territory, then the codeset, then the normalized_codeset. */ for (cnt = dirlist_count > 1 ? mask : mask - 1; cnt >= 0; --cnt) if ((cnt & ~mask) == 0 && !((cnt & XPG_CODESET) != 0 && (cnt & XPG_NORM_CODESET) != 0)) { if (dirlist_count > 1) { /* Iterate over all elements of the DIRLIST. */ char *dir = NULL; while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir)) != NULL) retval->successor[entries++] = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt, language, territory, codeset, normalized_codeset, modifier, filename, 1); } else retval->successor[entries++] = _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, cnt, language, territory, codeset, normalized_codeset, modifier, filename, 1); } retval->successor[entries] = NULL; return retval; } /* Normalize codeset name. There is no standard for the codeset names. Normalization allows the user to use any of the common names. The return value is dynamically allocated and has to be freed by the caller. */ const char * _nl_normalize_codeset (const char *codeset, size_t name_len) { int len = 0; int only_digit = 1; char *retval; char *wp; size_t cnt; for (cnt = 0; cnt < name_len; ++cnt) if (isalnum ((unsigned char) codeset[cnt])) { ++len; if (isalpha ((unsigned char) codeset[cnt])) only_digit = 0; } retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1); if (retval != NULL) { if (only_digit) wp = stpcpy (retval, "iso"); else wp = retval; for (cnt = 0; cnt < name_len; ++cnt) if (isalpha ((unsigned char) codeset[cnt])) *wp++ = tolower ((unsigned char) codeset[cnt]); else if (isdigit ((unsigned char) codeset[cnt])) *wp++ = codeset[cnt]; *wp = '\0'; } return (const char *) retval; } /* @@ begin of epilog @@ */ /* We don't want libintl.a to depend on any other library. So we avoid the non-standard function stpcpy. In GNU C Library this function is available, though. Also allow the symbol HAVE_STPCPY to be defined. */ #if !_LIBC && !HAVE_STPCPY static char * stpcpy (char *dest, const char *src) { while ((*dest++ = *src++) != '\0') /* Do nothing. */ ; return dest - 1; } #endif pbbuttonsd-0.8.1a/intl/explodename.c0000644000175000017500000000644610641705127014416 00000000000000/* Copyright (C) 1995-1998, 2000-2001, 2003, 2005 Free Software Foundation, Inc. Contributed by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "loadinfo.h" /* On some strange systems still no definition of NULL is found. Sigh! */ #ifndef NULL # if defined __STDC__ && __STDC__ # define NULL ((void *) 0) # else # define NULL 0 # endif #endif /* @@ end of prolog @@ */ /* Split a locale name NAME into a leading language part and all the rest. Return a pointer to the first character after the language, i.e. to the first byte of the rest. */ static char *_nl_find_language (const char *name); static char * _nl_find_language (const char *name) { while (name[0] != '\0' && name[0] != '_' && name[0] != '@' && name[0] != '.') ++name; return (char *) name; } int _nl_explode_name (char *name, const char **language, const char **modifier, const char **territory, const char **codeset, const char **normalized_codeset) { char *cp; int mask; *modifier = NULL; *territory = NULL; *codeset = NULL; *normalized_codeset = NULL; /* Now we determine the single parts of the locale name. First look for the language. Termination symbols are `_', '.', and `@'. */ mask = 0; *language = cp = name; cp = _nl_find_language (*language); if (*language == cp) /* This does not make sense: language has to be specified. Use this entry as it is without exploding. Perhaps it is an alias. */ cp = strchr (*language, '\0'); else { if (cp[0] == '_') { /* Next is the territory. */ cp[0] = '\0'; *territory = ++cp; while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@') ++cp; mask |= XPG_TERRITORY; } if (cp[0] == '.') { /* Next is the codeset. */ cp[0] = '\0'; *codeset = ++cp; while (cp[0] != '\0' && cp[0] != '@') ++cp; mask |= XPG_CODESET; if (*codeset != cp && (*codeset)[0] != '\0') { *normalized_codeset = _nl_normalize_codeset (*codeset, cp - *codeset); if (strcmp (*codeset, *normalized_codeset) == 0) free ((char *) *normalized_codeset); else mask |= XPG_NORM_CODESET; } } } if (cp[0] == '@') { /* Next is the modifier. */ cp[0] = '\0'; *modifier = ++cp; if (cp[0] != '\0') mask |= XPG_MODIFIER; } if (*territory != NULL && (*territory)[0] == '\0') mask &= ~XPG_TERRITORY; if (*codeset != NULL && (*codeset)[0] == '\0') mask &= ~XPG_CODESET; return mask; } pbbuttonsd-0.8.1a/intl/dcigettext.c0000644000175000017500000013232610641705127014256 00000000000000/* Implementation of the internal dcigettext function. Copyright (C) 1995-1999, 2000-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Tell glibc's to provide a prototype for mempcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif /* NL_LOCALE_NAME does not work in glibc-2.4. Ignore it. */ #undef HAVE_NL_LOCALE_NAME #include #ifdef __GNUC__ # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else # ifdef _MSC_VER # include # define alloca _alloca # else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif # endif #endif #include #ifndef errno extern int errno; #endif #ifndef __set_errno # define __set_errno(val) errno = (val) #endif #include #include #include #if defined HAVE_UNISTD_H || defined _LIBC # include #endif #include #ifdef _LIBC /* Guess whether integer division by zero raises signal SIGFPE. Set to 1 only if you know for sure. In case of doubt, set to 0. */ # if defined __alpha__ || defined __arm__ || defined __i386__ \ || defined __m68k__ || defined __s390__ # define INTDIV0_RAISES_SIGFPE 1 # else # define INTDIV0_RAISES_SIGFPE 0 # endif #endif #if !INTDIV0_RAISES_SIGFPE # include #endif #if defined HAVE_SYS_PARAM_H || defined _LIBC # include #endif #if !defined _LIBC && HAVE_NL_LOCALE_NAME # include #endif #include "gettextP.h" #include "plural-exp.h" #ifdef _LIBC # include #else # ifdef IN_LIBGLOCALE # include # endif # include "libgnuintl.h" #endif #include "hash-string.h" /* Handle multi-threaded applications. */ #ifdef _LIBC # include # define gl_rwlock_define_initialized __libc_rwlock_define_initialized # define gl_rwlock_rdlock __libc_rwlock_rdlock # define gl_rwlock_wrlock __libc_rwlock_wrlock # define gl_rwlock_unlock __libc_rwlock_unlock #else # include "lock.h" #endif /* Alignment of types. */ #if defined __GNUC__ && __GNUC__ >= 2 # define alignof(TYPE) __alignof__ (TYPE) #else # define alignof(TYPE) \ ((int) &((struct { char dummy1; TYPE dummy2; } *) 0)->dummy2) #endif /* The internal variables in the standalone libintl.a must have different names than the internal variables in GNU libc, otherwise programs using libintl.a cannot be linked statically. */ #if !defined _LIBC # define _nl_default_default_domain libintl_nl_default_default_domain # define _nl_current_default_domain libintl_nl_current_default_domain # define _nl_default_dirname libintl_nl_default_dirname # define _nl_domain_bindings libintl_nl_domain_bindings #endif /* Some compilers, like SunOS4 cc, don't have offsetof in . */ #ifndef offsetof # define offsetof(type,ident) ((size_t)&(((type*)0)->ident)) #endif /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ANSI C functions. This is required by the standard because some ANSI C functions will require linking with this object file and the name space must not be polluted. */ # define getcwd __getcwd # ifndef stpcpy # define stpcpy __stpcpy # endif # define tfind __tfind #else # if !defined HAVE_GETCWD char *getwd (); # define getcwd(buf, max) getwd (buf) # else # if VMS # define getcwd(buf, max) (getcwd) (buf, max, 0) # else char *getcwd (); # endif # endif # ifndef HAVE_STPCPY static char *stpcpy (char *dest, const char *src); # endif # ifndef HAVE_MEMPCPY static void *mempcpy (void *dest, const void *src, size_t n); # endif #endif /* Amount to increase buffer size by in each try. */ #define PATH_INCR 32 /* The following is from pathmax.h. */ /* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define PATH_MAX but might cause redefinition warnings when sys/param.h is later included (as on MORE/BSD 4.3). */ #if defined _POSIX_VERSION || (defined HAVE_LIMITS_H && !defined __GNUC__) # include #endif #ifndef _POSIX_PATH_MAX # define _POSIX_PATH_MAX 255 #endif #if !defined PATH_MAX && defined _PC_PATH_MAX # define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX)) #endif /* Don't include sys/param.h if it already has been. */ #if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN # include #endif #if !defined PATH_MAX && defined MAXPATHLEN # define PATH_MAX MAXPATHLEN #endif #ifndef PATH_MAX # define PATH_MAX _POSIX_PATH_MAX #endif /* Pathname support. ISSLASH(C) tests whether C is a directory separator character. IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not, it may be concatenated to a directory pathname. IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. */ #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ /* Win32, Cygwin, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') # define HAS_DEVICE(P) \ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ && (P)[1] == ':') # define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P)) # define IS_PATH_WITH_DIR(P) \ (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P)) #else /* Unix */ # define ISSLASH(C) ((C) == '/') # define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0]) # define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) #endif /* Whether to support different locales in different threads. */ #if defined _LIBC || HAVE_NL_LOCALE_NAME || (HAVE_STRUCT___LOCALE_STRUCT___NAMES && defined USE_IN_GETTEXT_TESTS) || defined IN_LIBGLOCALE # define HAVE_PER_THREAD_LOCALE #endif /* This is the type used for the search tree where known translations are stored. */ struct known_translation_t { /* Domain in which to search. */ const char *domainname; /* The category. */ int category; #ifdef HAVE_PER_THREAD_LOCALE /* Name of the relevant locale category, or "" for the global locale. */ const char *localename; #endif #ifdef IN_LIBGLOCALE /* The character encoding. */ const char *encoding; #endif /* State of the catalog counter at the point the string was found. */ int counter; /* Catalog where the string was found. */ struct loaded_l10nfile *domain; /* And finally the translation. */ const char *translation; size_t translation_length; /* Pointer to the string in question. */ char msgid[ZERO]; }; /* Root of the search tree with known translations. We can use this only if the system provides the `tsearch' function family. */ #if defined HAVE_TSEARCH || defined _LIBC # include gl_rwlock_define_initialized (static, tree_lock) static void *root; # ifdef _LIBC # define tsearch __tsearch # endif /* Function to compare two entries in the table of known translations. */ static int transcmp (const void *p1, const void *p2) { const struct known_translation_t *s1; const struct known_translation_t *s2; int result; s1 = (const struct known_translation_t *) p1; s2 = (const struct known_translation_t *) p2; result = strcmp (s1->msgid, s2->msgid); if (result == 0) { result = strcmp (s1->domainname, s2->domainname); if (result == 0) { #ifdef HAVE_PER_THREAD_LOCALE result = strcmp (s1->localename, s2->localename); if (result == 0) #endif { #ifdef IN_LIBGLOCALE result = strcmp (s1->encoding, s2->encoding); if (result == 0) #endif /* We compare the category last (though this is the cheapest operation) since it is hopefully always the same (namely LC_MESSAGES). */ result = s1->category - s2->category; } } } return result; } #endif /* Name of the default domain used for gettext(3) prior any call to textdomain(3). The default value for this is "messages". */ const char _nl_default_default_domain[] attribute_hidden = "messages"; #ifndef IN_LIBGLOCALE /* Value used as the default domain for gettext(3). */ const char *_nl_current_default_domain attribute_hidden = _nl_default_default_domain; #endif /* Contains the default location of the message catalogs. */ #if defined __EMX__ extern const char _nl_default_dirname[]; #else # ifdef _LIBC extern const char _nl_default_dirname[]; libc_hidden_proto (_nl_default_dirname) # endif const char _nl_default_dirname[] = LOCALEDIR; # ifdef _LIBC libc_hidden_data_def (_nl_default_dirname) # endif #endif #ifndef IN_LIBGLOCALE /* List with bindings of specific domains created by bindtextdomain() calls. */ struct binding *_nl_domain_bindings; #endif /* Prototypes for local functions. */ static char *plural_lookup (struct loaded_l10nfile *domain, unsigned long int n, const char *translation, size_t translation_len) internal_function; #ifdef IN_LIBGLOCALE static const char *guess_category_value (int category, const char *categoryname, const char *localename) internal_function; #else static const char *guess_category_value (int category, const char *categoryname) internal_function; #endif #ifdef _LIBC # include "../locale/localeinfo.h" # define category_to_name(category) \ _nl_category_names.str + _nl_category_name_idxs[category] #else static const char *category_to_name (int category) internal_function; #endif #if (defined _LIBC || HAVE_ICONV) && !defined IN_LIBGLOCALE static const char *get_output_charset (struct binding *domainbinding) internal_function; #endif /* For those loosing systems which don't have `alloca' we have to add some additional code emulating it. */ #ifdef HAVE_ALLOCA /* Nothing has to be done. */ # define freea(p) /* nothing */ # define ADD_BLOCK(list, address) /* nothing */ # define FREE_BLOCKS(list) /* nothing */ #else struct block_list { void *address; struct block_list *next; }; # define ADD_BLOCK(list, addr) \ do { \ struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \ /* If we cannot get a free block we cannot add the new element to \ the list. */ \ if (newp != NULL) { \ newp->address = (addr); \ newp->next = (list); \ (list) = newp; \ } \ } while (0) # define FREE_BLOCKS(list) \ do { \ while (list != NULL) { \ struct block_list *old = list; \ list = list->next; \ free (old->address); \ free (old); \ } \ } while (0) # undef alloca # define alloca(size) (malloc (size)) # define freea(p) free (p) #endif /* have alloca */ #ifdef _LIBC /* List of blocks allocated for translations. */ typedef struct transmem_list { struct transmem_list *next; char data[ZERO]; } transmem_block_t; static struct transmem_list *transmem_list; #else typedef unsigned char transmem_block_t; #endif /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DCIGETTEXT __dcigettext #else # define DCIGETTEXT libintl_dcigettext #endif /* Lock variable to protect the global data in the gettext implementation. */ gl_rwlock_define_initialized (, _nl_state_lock attribute_hidden) /* Checking whether the binaries runs SUID must be done and glibc provides easier methods therefore we make a difference here. */ #ifdef _LIBC # define ENABLE_SECURE __libc_enable_secure # define DETERMINE_SECURE #else # ifndef HAVE_GETUID # define getuid() 0 # endif # ifndef HAVE_GETGID # define getgid() 0 # endif # ifndef HAVE_GETEUID # define geteuid() getuid() # endif # ifndef HAVE_GETEGID # define getegid() getgid() # endif static int enable_secure; # define ENABLE_SECURE (enable_secure == 1) # define DETERMINE_SECURE \ if (enable_secure == 0) \ { \ if (getuid () != geteuid () || getgid () != getegid ()) \ enable_secure = 1; \ else \ enable_secure = -1; \ } #endif /* Get the function to evaluate the plural expression. */ #include "eval-plural.h" /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale and, if PLURAL is nonzero, search over string depending on the plural form determined by N. */ #ifdef IN_LIBGLOCALE char * gl_dcigettext (const char *domainname, const char *msgid1, const char *msgid2, int plural, unsigned long int n, int category, const char *localename, const char *encoding) #else char * DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2, int plural, unsigned long int n, int category) #endif { #ifndef HAVE_ALLOCA struct block_list *block_list = NULL; #endif struct loaded_l10nfile *domain; struct binding *binding; const char *categoryname; const char *categoryvalue; const char *dirname; char *xdomainname; char *single_locale; char *retval; size_t retlen; int saved_errno; #if defined HAVE_TSEARCH || defined _LIBC struct known_translation_t *search; struct known_translation_t **foundp = NULL; size_t msgid_len; # if defined HAVE_PER_THREAD_LOCALE && !defined IN_LIBGLOCALE const char *localename; # endif #endif size_t domainname_len; /* If no real MSGID is given return NULL. */ if (msgid1 == NULL) return NULL; #ifdef _LIBC if (category < 0 || category >= __LC_LAST || category == LC_ALL) /* Bogus. */ return (plural == 0 ? (char *) msgid1 /* Use the Germanic plural rule. */ : n == 1 ? (char *) msgid1 : (char *) msgid2); #endif gl_rwlock_rdlock (_nl_state_lock); /* If DOMAINNAME is NULL, we are interested in the default domain. If CATEGORY is not LC_MESSAGES this might not make much sense but the definition left this undefined. */ if (domainname == NULL) domainname = _nl_current_default_domain; /* OS/2 specific: backward compatibility with older libintl versions */ #ifdef LC_MESSAGES_COMPAT if (category == LC_MESSAGES_COMPAT) category = LC_MESSAGES; #endif #if defined HAVE_TSEARCH || defined _LIBC msgid_len = strlen (msgid1) + 1; /* Try to find the translation among those which we found at some time. */ search = (struct known_translation_t *) alloca (offsetof (struct known_translation_t, msgid) + msgid_len); memcpy (search->msgid, msgid1, msgid_len); search->domainname = domainname; search->category = category; # ifdef HAVE_PER_THREAD_LOCALE # ifndef IN_LIBGLOCALE # ifdef _LIBC localename = __current_locale_name (category); # else # if HAVE_NL_LOCALE_NAME /* NL_LOCALE_NAME is public glibc API introduced in glibc-2.4. */ localename = nl_langinfo (NL_LOCALE_NAME (category)); # else # if HAVE_STRUCT___LOCALE_STRUCT___NAMES && defined USE_IN_GETTEXT_TESTS /* The __names field is not public glibc API and must therefore not be used in code that is installed in public locations. */ { locale_t thread_locale = uselocale (NULL); if (thread_locale != LC_GLOBAL_LOCALE) localename = thread_locale->__names[category]; else localename = ""; } # endif # endif # endif # endif search->localename = localename; # ifdef IN_LIBGLOCALE search->encoding = encoding; # endif # endif /* Since tfind/tsearch manage a balanced tree, concurrent tfind and tsearch calls can be fatal. */ gl_rwlock_rdlock (tree_lock); foundp = (struct known_translation_t **) tfind (search, &root, transcmp); gl_rwlock_unlock (tree_lock); freea (search); if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr) { /* Now deal with plural. */ if (plural) retval = plural_lookup ((*foundp)->domain, n, (*foundp)->translation, (*foundp)->translation_length); else retval = (char *) (*foundp)->translation; gl_rwlock_unlock (_nl_state_lock); return retval; } #endif /* Preserve the `errno' value. */ saved_errno = errno; /* See whether this is a SUID binary or not. */ DETERMINE_SECURE; /* First find matching binding. */ #ifdef IN_LIBGLOCALE /* We can use a trivial binding, since _nl_find_msg will ignore it anyway, and _nl_load_domain and _nl_find_domain just pass it through. */ binding = NULL; dirname = bindtextdomain (domainname, NULL); #else for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) { int compare = strcmp (domainname, binding->domainname); if (compare == 0) /* We found it! */ break; if (compare < 0) { /* It is not in the list. */ binding = NULL; break; } } if (binding == NULL) dirname = _nl_default_dirname; else { dirname = binding->dirname; #endif if (!IS_ABSOLUTE_PATH (dirname)) { /* We have a relative path. Make it absolute now. */ size_t dirname_len = strlen (dirname) + 1; size_t path_max; char *resolved_dirname; char *ret; path_max = (unsigned int) PATH_MAX; path_max += 2; /* The getcwd docs say to do this. */ for (;;) { resolved_dirname = (char *) alloca (path_max + dirname_len); ADD_BLOCK (block_list, tmp_dirname); __set_errno (0); ret = getcwd (resolved_dirname, path_max); if (ret != NULL || errno != ERANGE) break; path_max += path_max / 2; path_max += PATH_INCR; } if (ret == NULL) /* We cannot get the current working directory. Don't signal an error but simply return the default string. */ goto return_untranslated; stpcpy (stpcpy (strchr (resolved_dirname, '\0'), "/"), dirname); dirname = resolved_dirname; } #ifndef IN_LIBGLOCALE } #endif /* Now determine the symbolic name of CATEGORY and its value. */ categoryname = category_to_name (category); #ifdef IN_LIBGLOCALE categoryvalue = guess_category_value (category, categoryname, localename); #else categoryvalue = guess_category_value (category, categoryname); #endif domainname_len = strlen (domainname); xdomainname = (char *) alloca (strlen (categoryname) + domainname_len + 5); ADD_BLOCK (block_list, xdomainname); stpcpy (mempcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"), domainname, domainname_len), ".mo"); /* Creating working area. */ single_locale = (char *) alloca (strlen (categoryvalue) + 1); ADD_BLOCK (block_list, single_locale); /* Search for the given string. This is a loop because we perhaps got an ordered list of languages to consider for the translation. */ while (1) { /* Make CATEGORYVALUE point to the next element of the list. */ while (categoryvalue[0] != '\0' && categoryvalue[0] == ':') ++categoryvalue; if (categoryvalue[0] == '\0') { /* The whole contents of CATEGORYVALUE has been searched but no valid entry has been found. We solve this situation by implicitly appending a "C" entry, i.e. no translation will take place. */ single_locale[0] = 'C'; single_locale[1] = '\0'; } else { char *cp = single_locale; while (categoryvalue[0] != '\0' && categoryvalue[0] != ':') *cp++ = *categoryvalue++; *cp = '\0'; /* When this is a SUID binary we must not allow accessing files outside the dedicated directories. */ if (ENABLE_SECURE && IS_PATH_WITH_DIR (single_locale)) /* Ingore this entry. */ continue; } /* If the current locale value is C (or POSIX) we don't load a domain. Return the MSGID. */ if (strcmp (single_locale, "C") == 0 || strcmp (single_locale, "POSIX") == 0) break; /* Find structure describing the message catalog matching the DOMAINNAME and CATEGORY. */ domain = _nl_find_domain (dirname, single_locale, xdomainname, binding); if (domain != NULL) { #if defined IN_LIBGLOCALE retval = _nl_find_msg (domain, binding, encoding, msgid1, &retlen); #else retval = _nl_find_msg (domain, binding, msgid1, 1, &retlen); #endif if (retval == NULL) { int cnt; for (cnt = 0; domain->successor[cnt] != NULL; ++cnt) { #if defined IN_LIBGLOCALE retval = _nl_find_msg (domain->successor[cnt], binding, encoding, msgid1, &retlen); #else retval = _nl_find_msg (domain->successor[cnt], binding, msgid1, 1, &retlen); #endif if (retval != NULL) { domain = domain->successor[cnt]; break; } } } /* Returning -1 means that some resource problem exists (likely memory) and that the strings could not be converted. Return the original strings. */ if (__builtin_expect (retval == (char *) -1, 0)) break; if (retval != NULL) { /* Found the translation of MSGID1 in domain DOMAIN: starting at RETVAL, RETLEN bytes. */ FREE_BLOCKS (block_list); #if defined HAVE_TSEARCH || defined _LIBC if (foundp == NULL) { /* Create a new entry and add it to the search tree. */ size_t size; struct known_translation_t *newp; size = offsetof (struct known_translation_t, msgid) + msgid_len + domainname_len + 1; # ifdef HAVE_PER_THREAD_LOCALE size += strlen (localename) + 1; # endif newp = (struct known_translation_t *) malloc (size); if (newp != NULL) { char *new_domainname; # ifdef HAVE_PER_THREAD_LOCALE char *new_localename; # endif new_domainname = mempcpy (newp->msgid, msgid1, msgid_len); memcpy (new_domainname, domainname, domainname_len + 1); # ifdef HAVE_PER_THREAD_LOCALE new_localename = new_domainname + domainname_len + 1; strcpy (new_localename, localename); # endif newp->domainname = new_domainname; newp->category = category; # ifdef HAVE_PER_THREAD_LOCALE newp->localename = new_localename; # endif # ifdef IN_LIBGLOCALE newp->encoding = encoding; # endif newp->counter = _nl_msg_cat_cntr; newp->domain = domain; newp->translation = retval; newp->translation_length = retlen; gl_rwlock_wrlock (tree_lock); /* Insert the entry in the search tree. */ foundp = (struct known_translation_t **) tsearch (newp, &root, transcmp); gl_rwlock_unlock (tree_lock); if (foundp == NULL || __builtin_expect (*foundp != newp, 0)) /* The insert failed. */ free (newp); } } else { /* We can update the existing entry. */ (*foundp)->counter = _nl_msg_cat_cntr; (*foundp)->domain = domain; (*foundp)->translation = retval; (*foundp)->translation_length = retlen; } #endif __set_errno (saved_errno); /* Now deal with plural. */ if (plural) retval = plural_lookup (domain, n, retval, retlen); gl_rwlock_unlock (_nl_state_lock); return retval; } } } return_untranslated: /* Return the untranslated MSGID. */ FREE_BLOCKS (block_list); gl_rwlock_unlock (_nl_state_lock); #ifndef _LIBC if (!ENABLE_SECURE) { extern void _nl_log_untranslated (const char *logfilename, const char *domainname, const char *msgid1, const char *msgid2, int plural); const char *logfilename = getenv ("GETTEXT_LOG_UNTRANSLATED"); if (logfilename != NULL && logfilename[0] != '\0') _nl_log_untranslated (logfilename, domainname, msgid1, msgid2, plural); } #endif __set_errno (saved_errno); return (plural == 0 ? (char *) msgid1 /* Use the Germanic plural rule. */ : n == 1 ? (char *) msgid1 : (char *) msgid2); } /* Look up the translation of msgid within DOMAIN_FILE and DOMAINBINDING. Return it if found. Return NULL if not found or in case of a conversion failure (problem in the particular message catalog). Return (char *) -1 in case of a memory allocation failure during conversion (only if ENCODING != NULL resp. CONVERT == true). */ char * internal_function #ifdef IN_LIBGLOCALE _nl_find_msg (struct loaded_l10nfile *domain_file, struct binding *domainbinding, const char *encoding, const char *msgid, size_t *lengthp) #else _nl_find_msg (struct loaded_l10nfile *domain_file, struct binding *domainbinding, const char *msgid, int convert, size_t *lengthp) #endif { struct loaded_domain *domain; nls_uint32 nstrings; size_t act; char *result; size_t resultlen; if (domain_file->decided <= 0) _nl_load_domain (domain_file, domainbinding); if (domain_file->data == NULL) return NULL; domain = (struct loaded_domain *) domain_file->data; nstrings = domain->nstrings; /* Locate the MSGID and its translation. */ if (domain->hash_tab != NULL) { /* Use the hashing table. */ nls_uint32 len = strlen (msgid); nls_uint32 hash_val = __hash_string (msgid); nls_uint32 idx = hash_val % domain->hash_size; nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2)); while (1) { nls_uint32 nstr = W (domain->must_swap_hash_tab, domain->hash_tab[idx]); if (nstr == 0) /* Hash table entry is empty. */ return NULL; nstr--; /* Compare msgid with the original string at index nstr. We compare the lengths with >=, not ==, because plural entries are represented by strings with an embedded NUL. */ if (nstr < nstrings ? W (domain->must_swap, domain->orig_tab[nstr].length) >= len && (strcmp (msgid, domain->data + W (domain->must_swap, domain->orig_tab[nstr].offset)) == 0) : domain->orig_sysdep_tab[nstr - nstrings].length > len && (strcmp (msgid, domain->orig_sysdep_tab[nstr - nstrings].pointer) == 0)) { act = nstr; goto found; } if (idx >= domain->hash_size - incr) idx -= domain->hash_size - incr; else idx += incr; } /* NOTREACHED */ } else { /* Try the default method: binary search in the sorted array of messages. */ size_t top, bottom; bottom = 0; top = nstrings; while (bottom < top) { int cmp_val; act = (bottom + top) / 2; cmp_val = strcmp (msgid, (domain->data + W (domain->must_swap, domain->orig_tab[act].offset))); if (cmp_val < 0) top = act; else if (cmp_val > 0) bottom = act + 1; else goto found; } /* No translation was found. */ return NULL; } found: /* The translation was found at index ACT. If we have to convert the string to use a different character set, this is the time. */ if (act < nstrings) { result = (char *) (domain->data + W (domain->must_swap, domain->trans_tab[act].offset)); resultlen = W (domain->must_swap, domain->trans_tab[act].length) + 1; } else { result = (char *) domain->trans_sysdep_tab[act - nstrings].pointer; resultlen = domain->trans_sysdep_tab[act - nstrings].length; } #if defined _LIBC || HAVE_ICONV # ifdef IN_LIBGLOCALE if (encoding != NULL) # else if (convert) # endif { /* We are supposed to do a conversion. */ # ifndef IN_LIBGLOCALE const char *encoding = get_output_charset (domainbinding); # endif /* Search whether a table with converted translations for this encoding has already been allocated. */ size_t nconversions = domain->nconversions; struct converted_domain *convd = NULL; size_t i; for (i = nconversions; i > 0; ) { i--; if (strcmp (domain->conversions[i].encoding, encoding) == 0) { convd = &domain->conversions[i]; break; } } if (convd == NULL) { /* Allocate a table for the converted translations for this encoding. */ struct converted_domain *new_conversions = (struct converted_domain *) (domain->conversions != NULL ? realloc (domain->conversions, (nconversions + 1) * sizeof (struct converted_domain)) : malloc ((nconversions + 1) * sizeof (struct converted_domain))); if (__builtin_expect (new_conversions == NULL, 0)) /* Nothing we can do, no more memory. We cannot use the translation because it might be encoded incorrectly. */ return (char *) -1; domain->conversions = new_conversions; /* Copy the 'encoding' string to permanent storage. */ encoding = strdup (encoding); if (__builtin_expect (encoding == NULL, 0)) /* Nothing we can do, no more memory. We cannot use the translation because it might be encoded incorrectly. */ return (char *) -1; convd = &new_conversions[nconversions]; convd->encoding = encoding; /* Find out about the character set the file is encoded with. This can be found (in textual form) in the entry "". If this entry does not exist or if this does not contain the 'charset=' information, we will assume the charset matches the one the current locale and we don't have to perform any conversion. */ # ifdef _LIBC convd->conv = (__gconv_t) -1; # else # if HAVE_ICONV convd->conv = (iconv_t) -1; # endif # endif { char *nullentry; size_t nullentrylen; /* Get the header entry. This is a recursion, but it doesn't reallocate domain->conversions because we pass encoding = NULL or convert = 0, respectively. */ nullentry = # ifdef IN_LIBGLOCALE _nl_find_msg (domain_file, domainbinding, NULL, "", &nullentrylen); # else _nl_find_msg (domain_file, domainbinding, "", 0, &nullentrylen); # endif if (nullentry != NULL) { const char *charsetstr; charsetstr = strstr (nullentry, "charset="); if (charsetstr != NULL) { size_t len; char *charset; const char *outcharset; charsetstr += strlen ("charset="); len = strcspn (charsetstr, " \t\n"); charset = (char *) alloca (len + 1); # if defined _LIBC || HAVE_MEMPCPY *((char *) mempcpy (charset, charsetstr, len)) = '\0'; # else memcpy (charset, charsetstr, len); charset[len] = '\0'; # endif outcharset = encoding; # ifdef _LIBC /* We always want to use transliteration. */ outcharset = norm_add_slashes (outcharset, "TRANSLIT"); charset = norm_add_slashes (charset, ""); int r = __gconv_open (outcharset, charset, &convd->conv, GCONV_AVOID_NOCONV); if (__builtin_expect (r != __GCONV_OK, 0)) { /* If the output encoding is the same there is nothing to do. Otherwise do not use the translation at all. */ if (__builtin_expect (r != __GCONV_NOCONV, 1)) return NULL; convd->conv = (__gconv_t) -1; } # else # if HAVE_ICONV /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5, we want to use transliteration. */ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \ || _LIBICONV_VERSION >= 0x0105 if (strchr (outcharset, '/') == NULL) { char *tmp; len = strlen (outcharset); tmp = (char *) alloca (len + 10 + 1); memcpy (tmp, outcharset, len); memcpy (tmp + len, "//TRANSLIT", 10 + 1); outcharset = tmp; convd->conv = iconv_open (outcharset, charset); freea (outcharset); } else # endif convd->conv = iconv_open (outcharset, charset); # endif # endif freea (charset); } } } convd->conv_tab = NULL; /* Here domain->conversions is still == new_conversions. */ domain->nconversions++; } if ( # ifdef _LIBC convd->conv != (__gconv_t) -1 # else # if HAVE_ICONV convd->conv != (iconv_t) -1 # endif # endif ) { /* We are supposed to do a conversion. First allocate an appropriate table with the same structure as the table of translations in the file, where we can put the pointers to the converted strings in. There is a slight complication with plural entries. They are represented by consecutive NUL terminated strings. We handle this case by converting RESULTLEN bytes, including NULs. */ if (convd->conv_tab == NULL && ((convd->conv_tab = (char **) calloc (nstrings + domain->n_sysdep_strings, sizeof (char *))) == NULL)) /* Mark that we didn't succeed allocating a table. */ convd->conv_tab = (char **) -1; if (__builtin_expect (convd->conv_tab == (char **) -1, 0)) /* Nothing we can do, no more memory. We cannot use the translation because it might be encoded incorrectly. */ return (char *) -1; if (convd->conv_tab[act] == NULL) { /* We haven't used this string so far, so it is not translated yet. Do this now. */ /* We use a bit more efficient memory handling. We allocate always larger blocks which get used over time. This is faster than many small allocations. */ __libc_lock_define_initialized (static, lock) # define INITIAL_BLOCK_SIZE 4080 static unsigned char *freemem; static size_t freemem_size; const unsigned char *inbuf; unsigned char *outbuf; int malloc_count; # ifndef _LIBC transmem_block_t *transmem_list = NULL; # endif __libc_lock_lock (lock); inbuf = (const unsigned char *) result; outbuf = freemem + sizeof (size_t); malloc_count = 0; while (1) { transmem_block_t *newmem; # ifdef _LIBC size_t non_reversible; int res; if (freemem_size < sizeof (size_t)) goto resize_freemem; res = __gconv (convd->conv, &inbuf, inbuf + resultlen, &outbuf, outbuf + freemem_size - sizeof (size_t), &non_reversible); if (res == __GCONV_OK || res == __GCONV_EMPTY_INPUT) break; if (res != __GCONV_FULL_OUTPUT) { /* We should not use the translation at all, it is incorrectly encoded. */ __libc_lock_unlock (lock); return NULL; } inbuf = (const unsigned char *) result; # else # if HAVE_ICONV const char *inptr = (const char *) inbuf; size_t inleft = resultlen; char *outptr = (char *) outbuf; size_t outleft; if (freemem_size < sizeof (size_t)) goto resize_freemem; outleft = freemem_size - sizeof (size_t); if (iconv (convd->conv, (ICONV_CONST char **) &inptr, &inleft, &outptr, &outleft) != (size_t) (-1)) { outbuf = (unsigned char *) outptr; break; } if (errno != E2BIG) { __libc_lock_unlock (lock); return NULL; } # endif # endif resize_freemem: /* We must allocate a new buffer or resize the old one. */ if (malloc_count > 0) { ++malloc_count; freemem_size = malloc_count * INITIAL_BLOCK_SIZE; newmem = (transmem_block_t *) realloc (transmem_list, freemem_size); # ifdef _LIBC if (newmem != NULL) transmem_list = transmem_list->next; else { struct transmem_list *old = transmem_list; transmem_list = transmem_list->next; free (old); } # endif } else { malloc_count = 1; freemem_size = INITIAL_BLOCK_SIZE; newmem = (transmem_block_t *) malloc (freemem_size); } if (__builtin_expect (newmem == NULL, 0)) { freemem = NULL; freemem_size = 0; __libc_lock_unlock (lock); return (char *) -1; } # ifdef _LIBC /* Add the block to the list of blocks we have to free at some point. */ newmem->next = transmem_list; transmem_list = newmem; freemem = (unsigned char *) newmem->data; freemem_size -= offsetof (struct transmem_list, data); # else transmem_list = newmem; freemem = newmem; # endif outbuf = freemem + sizeof (size_t); } /* We have now in our buffer a converted string. Put this into the table of conversions. */ *(size_t *) freemem = outbuf - freemem - sizeof (size_t); convd->conv_tab[act] = (char *) freemem; /* Shrink freemem, but keep it aligned. */ freemem_size -= outbuf - freemem; freemem = outbuf; freemem += freemem_size & (alignof (size_t) - 1); freemem_size = freemem_size & ~ (alignof (size_t) - 1); __libc_lock_unlock (lock); } /* Now convd->conv_tab[act] contains the translation of all the plural variants. */ result = convd->conv_tab[act] + sizeof (size_t); resultlen = *(size_t *) convd->conv_tab[act]; } } /* The result string is converted. */ #endif /* _LIBC || HAVE_ICONV */ *lengthp = resultlen; return result; } /* Look up a plural variant. */ static char * internal_function plural_lookup (struct loaded_l10nfile *domain, unsigned long int n, const char *translation, size_t translation_len) { struct loaded_domain *domaindata = (struct loaded_domain *) domain->data; unsigned long int index; const char *p; index = plural_eval (domaindata->plural, n); if (index >= domaindata->nplurals) /* This should never happen. It means the plural expression and the given maximum value do not match. */ index = 0; /* Skip INDEX strings at TRANSLATION. */ p = translation; while (index-- > 0) { #ifdef _LIBC p = __rawmemchr (p, '\0'); #else p = strchr (p, '\0'); #endif /* And skip over the NUL byte. */ p++; if (p >= translation + translation_len) /* This should never happen. It means the plural expression evaluated to a value larger than the number of variants available for MSGID1. */ return (char *) translation; } return (char *) p; } #ifndef _LIBC /* Return string representation of locale CATEGORY. */ static const char * internal_function category_to_name (int category) { const char *retval; switch (category) { #ifdef LC_COLLATE case LC_COLLATE: retval = "LC_COLLATE"; break; #endif #ifdef LC_CTYPE case LC_CTYPE: retval = "LC_CTYPE"; break; #endif #ifdef LC_MONETARY case LC_MONETARY: retval = "LC_MONETARY"; break; #endif #ifdef LC_NUMERIC case LC_NUMERIC: retval = "LC_NUMERIC"; break; #endif #ifdef LC_TIME case LC_TIME: retval = "LC_TIME"; break; #endif #ifdef LC_MESSAGES case LC_MESSAGES: retval = "LC_MESSAGES"; break; #endif #ifdef LC_RESPONSE case LC_RESPONSE: retval = "LC_RESPONSE"; break; #endif #ifdef LC_ALL case LC_ALL: /* This might not make sense but is perhaps better than any other value. */ retval = "LC_ALL"; break; #endif default: /* If you have a better idea for a default value let me know. */ retval = "LC_XXX"; } return retval; } #endif /* Guess value of current locale from value of the environment variables or system-dependent defaults. */ static const char * internal_function #ifdef IN_LIBGLOCALE guess_category_value (int category, const char *categoryname, const char *locale) #else guess_category_value (int category, const char *categoryname) #endif { const char *language; #ifndef IN_LIBGLOCALE const char *locale; # ifndef _LIBC const char *language_default; int locale_defaulted; # endif #endif /* We use the settings in the following order: 1. The value of the environment variable 'LANGUAGE'. This is a GNU extension. Its value can be a colon-separated list of locale names. 2. The value of the environment variable 'LC_ALL', 'LC_xxx', or 'LANG'. More precisely, the first among these that is set to a non-empty value. This is how POSIX specifies it. The value is a single locale name. 3. A system-dependent preference list of languages. Its value can be a colon-separated list of locale names. 4. A system-dependent default locale name. This way: - System-dependent settings can be overridden by environment variables. - If the system provides both a list of languages and a default locale, the former is used. */ #ifndef IN_LIBGLOCALE /* Fetch the locale name, through the POSIX method of looking to `LC_ALL', `LC_xxx', and `LANG'. On some systems this can be done by the `setlocale' function itself. */ # ifdef _LIBC locale = __current_locale_name (category); # else # if HAVE_STRUCT___LOCALE_STRUCT___NAMES && defined USE_IN_GETTEXT_TESTS /* The __names field is not public glibc API and must therefore not be used in code that is installed in public locations. */ locale_t thread_locale = uselocale (NULL); if (thread_locale != LC_GLOBAL_LOCALE) { locale = thread_locale->__names[category]; locale_defaulted = 0; } else # endif { locale = _nl_locale_name_posix (category, categoryname); locale_defaulted = 0; if (locale == NULL) { locale = _nl_locale_name_default (); locale_defaulted = 1; } } # endif #endif /* Ignore LANGUAGE and its system-dependent analogon if the locale is set to "C" because 1. "C" locale usually uses the ASCII encoding, and most international messages use non-ASCII characters. These characters get displayed as question marks (if using glibc's iconv()) or as invalid 8-bit characters (because other iconv()s refuse to convert most non-ASCII characters to ASCII). In any case, the output is ugly. 2. The precise output of some programs in the "C" locale is specified by POSIX and should not depend on environment variables like "LANGUAGE" or system-dependent information. We allow such programs to use gettext(). */ if (strcmp (locale, "C") == 0) return locale; /* The highest priority value is the value of the 'LANGUAGE' environment variable. */ language = getenv ("LANGUAGE"); if (language != NULL && language[0] != '\0') return language; #if !defined IN_LIBGLOCALE && !defined _LIBC /* The next priority value is the locale name, if not defaulted. */ if (locale_defaulted) { /* The next priority value is the default language preferences list. */ language_default = _nl_language_preferences_default (); if (language_default != NULL) return language_default; } /* The least priority value is the locale name, if defaulted. */ #endif return locale; } #if (defined _LIBC || HAVE_ICONV) && !defined IN_LIBGLOCALE /* Returns the output charset. */ static const char * internal_function get_output_charset (struct binding *domainbinding) { /* The output charset should normally be determined by the locale. But sometimes the locale is not used or not correctly set up, so we provide a possibility for the user to override this: the OUTPUT_CHARSET environment variable. Moreover, the value specified through bind_textdomain_codeset overrides both. */ if (domainbinding != NULL && domainbinding->codeset != NULL) return domainbinding->codeset; else { /* For speed reasons, we look at the value of OUTPUT_CHARSET only once. This is a user variable that is not supposed to change during a program run. */ static char *output_charset_cache; static int output_charset_cached; if (!output_charset_cached) { const char *value = getenv ("OUTPUT_CHARSET"); if (value != NULL && value[0] != '\0') { size_t len = strlen (value) + 1; char *value_copy = (char *) malloc (len); if (value_copy != NULL) memcpy (value_copy, value, len); output_charset_cache = value_copy; } output_charset_cached = 1; } if (output_charset_cache != NULL) return output_charset_cache; else { # ifdef _LIBC return _NL_CURRENT (LC_CTYPE, CODESET); # else # if HAVE_ICONV extern const char *locale_charset (void); return locale_charset (); # endif # endif } } } #endif /* @@ begin of epilog @@ */ /* We don't want libintl.a to depend on any other library. So we avoid the non-standard function stpcpy. In GNU C Library this function is available, though. Also allow the symbol HAVE_STPCPY to be defined. */ #if !_LIBC && !HAVE_STPCPY static char * stpcpy (char *dest, const char *src) { while ((*dest++ = *src++) != '\0') /* Do nothing. */ ; return dest - 1; } #endif #if !_LIBC && !HAVE_MEMPCPY static void * mempcpy (void *dest, const void *src, size_t n) { return (void *) ((char *) memcpy (dest, src, n) + n); } #endif #ifdef _LIBC /* If we want to free all resources we have to do some work at program's end. */ libc_freeres_fn (free_mem) { void *old; while (_nl_domain_bindings != NULL) { struct binding *oldp = _nl_domain_bindings; _nl_domain_bindings = _nl_domain_bindings->next; if (oldp->dirname != _nl_default_dirname) /* Yes, this is a pointer comparison. */ free (oldp->dirname); free (oldp->codeset); free (oldp); } if (_nl_current_default_domain != _nl_default_default_domain) /* Yes, again a pointer comparison. */ free ((char *) _nl_current_default_domain); /* Remove the search tree with the known translations. */ __tdestroy (root, free); root = NULL; while (transmem_list != NULL) { old = transmem_list; transmem_list = transmem_list->next; free (old); } } #endif pbbuttonsd-0.8.1a/intl/dcngettext.c0000644000175000017500000000347410641705127014264 00000000000000/* Implementation of the dcngettext(3) function. Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DCNGETTEXT __dcngettext # define DCIGETTEXT __dcigettext #else # define DCNGETTEXT libintl_dcngettext # define DCIGETTEXT libintl_dcigettext #endif /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ char * DCNGETTEXT (const char *domainname, const char *msgid1, const char *msgid2, unsigned long int n, int category) { return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__dcngettext, dcngettext); #endif pbbuttonsd-0.8.1a/intl/dngettext.c0000644000175000017500000000354610641705127014121 00000000000000/* Implementation of the dngettext(3) function. Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" #include #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DNGETTEXT __dngettext # define DCNGETTEXT __dcngettext #else # define DNGETTEXT libintl_dngettext # define DCNGETTEXT libintl_dcngettext #endif /* Look up MSGID in the DOMAINNAME message catalog of the current LC_MESSAGES locale and skip message according to the plural form. */ char * DNGETTEXT (const char *domainname, const char *msgid1, const char *msgid2, unsigned long int n) { return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__dngettext, dngettext); #endif pbbuttonsd-0.8.1a/intl/ngettext.c0000644000175000017500000000367410641705131013752 00000000000000/* Implementation of ngettext(3) function. Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #ifdef _LIBC # define __need_NULL # include #else # include /* Just for NULL. */ #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif #include /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define NGETTEXT __ngettext # define DCNGETTEXT __dcngettext #else # define NGETTEXT libintl_ngettext # define DCNGETTEXT libintl_dcngettext #endif /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ char * NGETTEXT (const char *msgid1, const char *msgid2, unsigned long int n) { return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__ngettext, ngettext); #endif pbbuttonsd-0.8.1a/intl/plural.y0000644000175000017500000001646110641705132013434 00000000000000%{ /* Expression parsing for plural form selection. Copyright (C) 2000-2001, 2003, 2005 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* For bison < 2.0, the bison generated parser uses alloca. AIX 3 forces us to put this declaration at the beginning of the file. The declaration in bison's skeleton file comes too late. This must come before because may include arbitrary system headers. This can go away once the AM_INTL_SUBDIR macro requires bison >= 2.0. */ #if defined _AIX && !defined __GNUC__ #pragma alloca #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "plural-exp.h" /* The main function generated by the parser is called __gettextparse, but we want it to be called PLURAL_PARSE. */ #ifndef _LIBC # define __gettextparse PLURAL_PARSE #endif #define YYLEX_PARAM &((struct parse_args *) arg)->cp #define YYPARSE_PARAM arg %} %pure_parser %expect 7 %union { unsigned long int num; enum operator op; struct expression *exp; } %{ /* Prototypes for local functions. */ static int yylex (YYSTYPE *lval, const char **pexp); static void yyerror (const char *str); /* Allocation of expressions. */ static struct expression * new_exp (int nargs, enum operator op, struct expression * const *args) { int i; struct expression *newp; /* If any of the argument could not be malloc'ed, just return NULL. */ for (i = nargs - 1; i >= 0; i--) if (args[i] == NULL) goto fail; /* Allocate a new expression. */ newp = (struct expression *) malloc (sizeof (*newp)); if (newp != NULL) { newp->nargs = nargs; newp->operation = op; for (i = nargs - 1; i >= 0; i--) newp->val.args[i] = args[i]; return newp; } fail: for (i = nargs - 1; i >= 0; i--) FREE_EXPRESSION (args[i]); return NULL; } static inline struct expression * new_exp_0 (enum operator op) { return new_exp (0, op, NULL); } static inline struct expression * new_exp_1 (enum operator op, struct expression *right) { struct expression *args[1]; args[0] = right; return new_exp (1, op, args); } static struct expression * new_exp_2 (enum operator op, struct expression *left, struct expression *right) { struct expression *args[2]; args[0] = left; args[1] = right; return new_exp (2, op, args); } static inline struct expression * new_exp_3 (enum operator op, struct expression *bexp, struct expression *tbranch, struct expression *fbranch) { struct expression *args[3]; args[0] = bexp; args[1] = tbranch; args[2] = fbranch; return new_exp (3, op, args); } %} /* This declares that all operators have the same associativity and the precedence order as in C. See [Harbison, Steele: C, A Reference Manual]. There is no unary minus and no bitwise operators. Operators with the same syntactic behaviour have been merged into a single token, to save space in the array generated by bison. */ %right '?' /* ? */ %left '|' /* || */ %left '&' /* && */ %left EQUOP2 /* == != */ %left CMPOP2 /* < > <= >= */ %left ADDOP2 /* + - */ %left MULOP2 /* * / % */ %right '!' /* ! */ %token EQUOP2 CMPOP2 ADDOP2 MULOP2 %token NUMBER %type exp %% start: exp { if ($1 == NULL) YYABORT; ((struct parse_args *) arg)->res = $1; } ; exp: exp '?' exp ':' exp { $$ = new_exp_3 (qmop, $1, $3, $5); } | exp '|' exp { $$ = new_exp_2 (lor, $1, $3); } | exp '&' exp { $$ = new_exp_2 (land, $1, $3); } | exp EQUOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | exp CMPOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | exp ADDOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | exp MULOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | '!' exp { $$ = new_exp_1 (lnot, $2); } | 'n' { $$ = new_exp_0 (var); } | NUMBER { if (($$ = new_exp_0 (num)) != NULL) $$->val.num = $1; } | '(' exp ')' { $$ = $2; } ; %% void internal_function FREE_EXPRESSION (struct expression *exp) { if (exp == NULL) return; /* Handle the recursive case. */ switch (exp->nargs) { case 3: FREE_EXPRESSION (exp->val.args[2]); /* FALLTHROUGH */ case 2: FREE_EXPRESSION (exp->val.args[1]); /* FALLTHROUGH */ case 1: FREE_EXPRESSION (exp->val.args[0]); /* FALLTHROUGH */ default: break; } free (exp); } static int yylex (YYSTYPE *lval, const char **pexp) { const char *exp = *pexp; int result; while (1) { if (exp[0] == '\0') { *pexp = exp; return YYEOF; } if (exp[0] != ' ' && exp[0] != '\t') break; ++exp; } result = *exp++; switch (result) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { unsigned long int n = result - '0'; while (exp[0] >= '0' && exp[0] <= '9') { n *= 10; n += exp[0] - '0'; ++exp; } lval->num = n; result = NUMBER; } break; case '=': if (exp[0] == '=') { ++exp; lval->op = equal; result = EQUOP2; } else result = YYERRCODE; break; case '!': if (exp[0] == '=') { ++exp; lval->op = not_equal; result = EQUOP2; } break; case '&': case '|': if (exp[0] == result) ++exp; else result = YYERRCODE; break; case '<': if (exp[0] == '=') { ++exp; lval->op = less_or_equal; } else lval->op = less_than; result = CMPOP2; break; case '>': if (exp[0] == '=') { ++exp; lval->op = greater_or_equal; } else lval->op = greater_than; result = CMPOP2; break; case '*': lval->op = mult; result = MULOP2; break; case '/': lval->op = divide; result = MULOP2; break; case '%': lval->op = module; result = MULOP2; break; case '+': lval->op = plus; result = ADDOP2; break; case '-': lval->op = minus; result = ADDOP2; break; case 'n': case '?': case ':': case '(': case ')': /* Nothing, just return the character. */ break; case ';': case '\n': case '\0': /* Be safe and let the user call this function again. */ --exp; result = YYEOF; break; default: result = YYERRCODE; #if YYDEBUG != 0 --exp; #endif break; } *pexp = exp; return result; } static void yyerror (const char *str) { /* Do nothing. We don't print error messages here. */ } pbbuttonsd-0.8.1a/intl/plural-exp.c0000644000175000017500000000766110641705131014201 00000000000000/* Expression parsing for plural form selection. Copyright (C) 2000-2001, 2003, 2005 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "plural-exp.h" #if (defined __GNUC__ && !(__APPLE_CC__ > 1)) \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) /* These structs are the constant expression for the germanic plural form determination. It represents the expression "n != 1". */ static const struct expression plvar = { .nargs = 0, .operation = var, }; static const struct expression plone = { .nargs = 0, .operation = num, .val = { .num = 1 } }; struct expression GERMANIC_PLURAL = { .nargs = 2, .operation = not_equal, .val = { .args = { [0] = (struct expression *) &plvar, [1] = (struct expression *) &plone } } }; # define INIT_GERMANIC_PLURAL() #else /* For compilers without support for ISO C 99 struct/union initializers: Initialization at run-time. */ static struct expression plvar; static struct expression plone; struct expression GERMANIC_PLURAL; static void init_germanic_plural () { if (plone.val.num == 0) { plvar.nargs = 0; plvar.operation = var; plone.nargs = 0; plone.operation = num; plone.val.num = 1; GERMANIC_PLURAL.nargs = 2; GERMANIC_PLURAL.operation = not_equal; GERMANIC_PLURAL.val.args[0] = &plvar; GERMANIC_PLURAL.val.args[1] = &plone; } } # define INIT_GERMANIC_PLURAL() init_germanic_plural () #endif void internal_function EXTRACT_PLURAL_EXPRESSION (const char *nullentry, struct expression **pluralp, unsigned long int *npluralsp) { if (nullentry != NULL) { const char *plural; const char *nplurals; plural = strstr (nullentry, "plural="); nplurals = strstr (nullentry, "nplurals="); if (plural == NULL || nplurals == NULL) goto no_plural; else { char *endp; unsigned long int n; struct parse_args args; /* First get the number. */ nplurals += 9; while (*nplurals != '\0' && isspace ((unsigned char) *nplurals)) ++nplurals; if (!(*nplurals >= '0' && *nplurals <= '9')) goto no_plural; #if defined HAVE_STRTOUL || defined _LIBC n = strtoul (nplurals, &endp, 10); #else for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++) n = n * 10 + (*endp - '0'); #endif if (nplurals == endp) goto no_plural; *npluralsp = n; /* Due to the restrictions bison imposes onto the interface of the scanner function we have to put the input string and the result passed up from the parser into the same structure which address is passed down to the parser. */ plural += 7; args.cp = plural; if (PLURAL_PARSE (&args) != 0) goto no_plural; *pluralp = args.res; } } else { /* By default we are using the Germanic form: singular form only for `one', the plural form otherwise. Yes, this is also what English is using since English is a Germanic language. */ no_plural: INIT_GERMANIC_PLURAL (); *pluralp = &GERMANIC_PLURAL; *npluralsp = 2; } } pbbuttonsd-0.8.1a/intl/localcharset.c0000644000175000017500000003031410641705131014543 00000000000000/* Determine a canonical name for the current locale's character encoding. Copyright (C) 2000-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Bruno Haible . */ #include /* Specification. */ #include "localcharset.h" #include #include #include #include #if defined _WIN32 || defined __WIN32__ # define WIN32_NATIVE #endif #if defined __EMX__ /* Assume EMX program runs on OS/2, even if compiled under DOS. */ # define OS2 #endif #if !defined WIN32_NATIVE # if HAVE_LANGINFO_CODESET # include # else # if 0 /* see comment below */ # include # endif # endif # ifdef __CYGWIN__ # define WIN32_LEAN_AND_MEAN # include # endif #elif defined WIN32_NATIVE # define WIN32_LEAN_AND_MEAN # include #endif #if defined OS2 # define INCL_DOS # include #endif #if ENABLE_RELOCATABLE # include "relocatable.h" #else # define relocate(pathname) (pathname) #endif /* Get LIBDIR. */ #ifndef LIBDIR # include "configmake.h" #endif #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ /* Win32, Cygwin, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') #endif #ifndef DIRECTORY_SEPARATOR # define DIRECTORY_SEPARATOR '/' #endif #ifndef ISSLASH # define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR) #endif #if HAVE_DECL_GETC_UNLOCKED # undef getc # define getc getc_unlocked #endif /* The following static variable is declared 'volatile' to avoid a possible multithread problem in the function get_charset_aliases. If we are running in a threaded environment, and if two threads initialize 'charset_aliases' simultaneously, both will produce the same value, and everything will be ok if the two assignments to 'charset_aliases' are atomic. But I don't know what will happen if the two assignments mix. */ #if __STDC__ != 1 # define volatile /* empty */ #endif /* Pointer to the contents of the charset.alias file, if it has already been read, else NULL. Its format is: ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */ static const char * volatile charset_aliases; /* Return a pointer to the contents of the charset.alias file. */ static const char * get_charset_aliases (void) { const char *cp; cp = charset_aliases; if (cp == NULL) { #if !(defined VMS || defined WIN32_NATIVE || defined __CYGWIN__) FILE *fp; const char *dir; const char *base = "charset.alias"; char *file_name; /* Make it possible to override the charset.alias location. This is necessary for running the testsuite before "make install". */ dir = getenv ("CHARSETALIASDIR"); if (dir == NULL || dir[0] == '\0') dir = relocate (LIBDIR); /* Concatenate dir and base into freshly allocated file_name. */ { size_t dir_len = strlen (dir); size_t base_len = strlen (base); int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1])); file_name = (char *) malloc (dir_len + add_slash + base_len + 1); if (file_name != NULL) { memcpy (file_name, dir, dir_len); if (add_slash) file_name[dir_len] = DIRECTORY_SEPARATOR; memcpy (file_name + dir_len + add_slash, base, base_len + 1); } } if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL) /* Out of memory or file not found, treat it as empty. */ cp = ""; else { /* Parse the file's contents. */ char *res_ptr = NULL; size_t res_size = 0; for (;;) { int c; char buf1[50+1]; char buf2[50+1]; size_t l1, l2; char *old_res_ptr; c = getc (fp); if (c == EOF) break; if (c == '\n' || c == ' ' || c == '\t') continue; if (c == '#') { /* Skip comment, to end of line. */ do c = getc (fp); while (!(c == EOF || c == '\n')); if (c == EOF) break; continue; } ungetc (c, fp); if (fscanf (fp, "%50s %50s", buf1, buf2) < 2) break; l1 = strlen (buf1); l2 = strlen (buf2); old_res_ptr = res_ptr; if (res_size == 0) { res_size = l1 + 1 + l2 + 1; res_ptr = (char *) malloc (res_size + 1); } else { res_size += l1 + 1 + l2 + 1; res_ptr = (char *) realloc (res_ptr, res_size + 1); } if (res_ptr == NULL) { /* Out of memory. */ res_size = 0; if (old_res_ptr != NULL) free (old_res_ptr); break; } strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1); strcpy (res_ptr + res_size - (l2 + 1), buf2); } fclose (fp); if (res_size == 0) cp = ""; else { *(res_ptr + res_size) = '\0'; cp = res_ptr; } } if (file_name != NULL) free (file_name); #else # if defined VMS /* To avoid the troubles of an extra file charset.alias_vms in the sources of many GNU packages, simply inline the aliases here. */ /* The list of encodings is taken from the OpenVMS 7.3-1 documentation "Compaq C Run-Time Library Reference Manual for OpenVMS systems" section 10.7 "Handling Different Character Sets". */ cp = "ISO8859-1" "\0" "ISO-8859-1" "\0" "ISO8859-2" "\0" "ISO-8859-2" "\0" "ISO8859-5" "\0" "ISO-8859-5" "\0" "ISO8859-7" "\0" "ISO-8859-7" "\0" "ISO8859-8" "\0" "ISO-8859-8" "\0" "ISO8859-9" "\0" "ISO-8859-9" "\0" /* Japanese */ "eucJP" "\0" "EUC-JP" "\0" "SJIS" "\0" "SHIFT_JIS" "\0" "DECKANJI" "\0" "DEC-KANJI" "\0" "SDECKANJI" "\0" "EUC-JP" "\0" /* Chinese */ "eucTW" "\0" "EUC-TW" "\0" "DECHANYU" "\0" "DEC-HANYU" "\0" "DECHANZI" "\0" "GB2312" "\0" /* Korean */ "DECKOREAN" "\0" "EUC-KR" "\0"; # endif # if defined WIN32_NATIVE || defined __CYGWIN__ /* To avoid the troubles of installing a separate file in the same directory as the DLL and of retrieving the DLL's directory at runtime, simply inline the aliases here. */ cp = "CP936" "\0" "GBK" "\0" "CP1361" "\0" "JOHAB" "\0" "CP20127" "\0" "ASCII" "\0" "CP20866" "\0" "KOI8-R" "\0" "CP20936" "\0" "GB2312" "\0" "CP21866" "\0" "KOI8-RU" "\0" "CP28591" "\0" "ISO-8859-1" "\0" "CP28592" "\0" "ISO-8859-2" "\0" "CP28593" "\0" "ISO-8859-3" "\0" "CP28594" "\0" "ISO-8859-4" "\0" "CP28595" "\0" "ISO-8859-5" "\0" "CP28596" "\0" "ISO-8859-6" "\0" "CP28597" "\0" "ISO-8859-7" "\0" "CP28598" "\0" "ISO-8859-8" "\0" "CP28599" "\0" "ISO-8859-9" "\0" "CP28605" "\0" "ISO-8859-15" "\0" "CP38598" "\0" "ISO-8859-8" "\0" "CP51932" "\0" "EUC-JP" "\0" "CP51936" "\0" "GB2312" "\0" "CP51949" "\0" "EUC-KR" "\0" "CP51950" "\0" "EUC-TW" "\0" "CP54936" "\0" "GB18030" "\0" "CP65001" "\0" "UTF-8" "\0"; # endif #endif charset_aliases = cp; } return cp; } /* Determine the current locale's character encoding, and canonicalize it into one of the canonical names listed in config.charset. The result must not be freed; it is statically allocated. If the canonical name cannot be determined, the result is a non-canonical name. */ #ifdef STATIC STATIC #endif const char * locale_charset (void) { const char *codeset; const char *aliases; #if !(defined WIN32_NATIVE || defined OS2) # if HAVE_LANGINFO_CODESET /* Most systems support nl_langinfo (CODESET) nowadays. */ codeset = nl_langinfo (CODESET); # ifdef __CYGWIN__ /* Cygwin 2006 does not have locales. nl_langinfo (CODESET) always returns "US-ASCII". As long as this is not fixed, return the suffix of the locale name from the environment variables (if present) or the codepage as a number. */ if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0) { const char *locale; static char buf[2 + 10 + 1]; locale = getenv ("LC_ALL"); if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_CTYPE"); if (locale == NULL || locale[0] == '\0') locale = getenv ("LANG"); } if (locale != NULL && locale[0] != '\0') { /* If the locale name contains an encoding after the dot, return it. */ const char *dot = strchr (locale, '.'); if (dot != NULL) { const char *modifier; dot++; /* Look for the possible @... trailer and remove it, if any. */ modifier = strchr (dot, '@'); if (modifier == NULL) return dot; if (modifier - dot < sizeof (buf)) { memcpy (buf, dot, modifier - dot); buf [modifier - dot] = '\0'; return buf; } } } /* Woe32 has a function returning the locale's codepage as a number. */ sprintf (buf, "CP%u", GetACP ()); codeset = buf; } # endif # else /* On old systems which lack it, use setlocale or getenv. */ const char *locale = NULL; /* But most old systems don't have a complete set of locales. Some (like SunOS 4 or DJGPP) have only the C locale. Therefore we don't use setlocale here; it would return "C" when it doesn't support the locale name the user has set. */ # if 0 locale = setlocale (LC_CTYPE, NULL); # endif if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_ALL"); if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_CTYPE"); if (locale == NULL || locale[0] == '\0') locale = getenv ("LANG"); } } /* On some old systems, one used to set locale = "iso8859_1". On others, you set it to "language_COUNTRY.charset". In any case, we resolve it through the charset.alias file. */ codeset = locale; # endif #elif defined WIN32_NATIVE static char buf[2 + 10 + 1]; /* Woe32 has a function returning the locale's codepage as a number. */ sprintf (buf, "CP%u", GetACP ()); codeset = buf; #elif defined OS2 const char *locale; static char buf[2 + 10 + 1]; ULONG cp[3]; ULONG cplen; /* Allow user to override the codeset, as set in the operating system, with standard language environment variables. */ locale = getenv ("LC_ALL"); if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_CTYPE"); if (locale == NULL || locale[0] == '\0') locale = getenv ("LANG"); } if (locale != NULL && locale[0] != '\0') { /* If the locale name contains an encoding after the dot, return it. */ const char *dot = strchr (locale, '.'); if (dot != NULL) { const char *modifier; dot++; /* Look for the possible @... trailer and remove it, if any. */ modifier = strchr (dot, '@'); if (modifier == NULL) return dot; if (modifier - dot < sizeof (buf)) { memcpy (buf, dot, modifier - dot); buf [modifier - dot] = '\0'; return buf; } } /* Resolve through the charset.alias file. */ codeset = locale; } else { /* OS/2 has a function returning the locale's codepage as a number. */ if (DosQueryCp (sizeof (cp), cp, &cplen)) codeset = ""; else { sprintf (buf, "CP%u", cp[0]); codeset = buf; } } #endif if (codeset == NULL) /* The canonical name cannot be determined. */ codeset = ""; /* Resolve alias. */ for (aliases = get_charset_aliases (); *aliases != '\0'; aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1) if (strcmp (codeset, aliases) == 0 || (aliases[0] == '*' && aliases[1] == '\0')) { codeset = aliases + strlen (aliases) + 1; break; } /* Don't return an empty string. GNU libc and GNU libiconv interpret the empty string as denoting "the locale's character encoding", thus GNU libiconv would call this function a second time. */ if (codeset[0] == '\0') codeset = "ASCII"; return codeset; } pbbuttonsd-0.8.1a/intl/lock.c0000644000175000017500000005413010641705135013035 00000000000000/* Locking in multithreaded situations. Copyright (C) 2005-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Bruno Haible , 2005. Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h, gthr-win32.h. */ #include #include "lock.h" /* ========================================================================= */ #if USE_POSIX_THREADS /* Use the POSIX threads library. */ # if PTHREAD_IN_USE_DETECTION_HARD /* The function to be executed by a dummy thread. */ static void * dummy_thread_func (void *arg) { return arg; } int glthread_in_use (void) { static int tested; static int result; /* 1: linked with -lpthread, 0: only with libc */ if (!tested) { pthread_t thread; if (pthread_create (&thread, NULL, dummy_thread_func, NULL) != 0) /* Thread creation failed. */ result = 0; else { /* Thread creation works. */ void *retval; if (pthread_join (thread, &retval) != 0) abort (); result = 1; } tested = 1; } return result; } # endif /* -------------------------- gl_lock_t datatype -------------------------- */ /* ------------------------- gl_rwlock_t datatype ------------------------- */ # if HAVE_PTHREAD_RWLOCK # if !defined PTHREAD_RWLOCK_INITIALIZER void glthread_rwlock_init (gl_rwlock_t *lock) { if (pthread_rwlock_init (&lock->rwlock, NULL) != 0) abort (); lock->initialized = 1; } void glthread_rwlock_rdlock (gl_rwlock_t *lock) { if (!lock->initialized) { if (pthread_mutex_lock (&lock->guard) != 0) abort (); if (!lock->initialized) glthread_rwlock_init (lock); if (pthread_mutex_unlock (&lock->guard) != 0) abort (); } if (pthread_rwlock_rdlock (&lock->rwlock) != 0) abort (); } void glthread_rwlock_wrlock (gl_rwlock_t *lock) { if (!lock->initialized) { if (pthread_mutex_lock (&lock->guard) != 0) abort (); if (!lock->initialized) glthread_rwlock_init (lock); if (pthread_mutex_unlock (&lock->guard) != 0) abort (); } if (pthread_rwlock_wrlock (&lock->rwlock) != 0) abort (); } void glthread_rwlock_unlock (gl_rwlock_t *lock) { if (!lock->initialized) abort (); if (pthread_rwlock_unlock (&lock->rwlock) != 0) abort (); } void glthread_rwlock_destroy (gl_rwlock_t *lock) { if (!lock->initialized) abort (); if (pthread_rwlock_destroy (&lock->rwlock) != 0) abort (); lock->initialized = 0; } # endif # else void glthread_rwlock_init (gl_rwlock_t *lock) { if (pthread_mutex_init (&lock->lock, NULL) != 0) abort (); if (pthread_cond_init (&lock->waiting_readers, NULL) != 0) abort (); if (pthread_cond_init (&lock->waiting_writers, NULL) != 0) abort (); lock->waiting_writers_count = 0; lock->runcount = 0; } void glthread_rwlock_rdlock (gl_rwlock_t *lock) { if (pthread_mutex_lock (&lock->lock) != 0) abort (); /* Test whether only readers are currently running, and whether the runcount field will not overflow. */ /* POSIX says: "It is implementation-defined whether the calling thread acquires the lock when a writer does not hold the lock and there are writers blocked on the lock." Let's say, no: give the writers a higher priority. */ while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0)) { /* This thread has to wait for a while. Enqueue it among the waiting_readers. */ if (pthread_cond_wait (&lock->waiting_readers, &lock->lock) != 0) abort (); } lock->runcount++; if (pthread_mutex_unlock (&lock->lock) != 0) abort (); } void glthread_rwlock_wrlock (gl_rwlock_t *lock) { if (pthread_mutex_lock (&lock->lock) != 0) abort (); /* Test whether no readers or writers are currently running. */ while (!(lock->runcount == 0)) { /* This thread has to wait for a while. Enqueue it among the waiting_writers. */ lock->waiting_writers_count++; if (pthread_cond_wait (&lock->waiting_writers, &lock->lock) != 0) abort (); lock->waiting_writers_count--; } lock->runcount--; /* runcount becomes -1 */ if (pthread_mutex_unlock (&lock->lock) != 0) abort (); } void glthread_rwlock_unlock (gl_rwlock_t *lock) { if (pthread_mutex_lock (&lock->lock) != 0) abort (); if (lock->runcount < 0) { /* Drop a writer lock. */ if (!(lock->runcount == -1)) abort (); lock->runcount = 0; } else { /* Drop a reader lock. */ if (!(lock->runcount > 0)) abort (); lock->runcount--; } if (lock->runcount == 0) { /* POSIX recommends that "write locks shall take precedence over read locks", to avoid "writer starvation". */ if (lock->waiting_writers_count > 0) { /* Wake up one of the waiting writers. */ if (pthread_cond_signal (&lock->waiting_writers) != 0) abort (); } else { /* Wake up all waiting readers. */ if (pthread_cond_broadcast (&lock->waiting_readers) != 0) abort (); } } if (pthread_mutex_unlock (&lock->lock) != 0) abort (); } void glthread_rwlock_destroy (gl_rwlock_t *lock) { if (pthread_mutex_destroy (&lock->lock) != 0) abort (); if (pthread_cond_destroy (&lock->waiting_readers) != 0) abort (); if (pthread_cond_destroy (&lock->waiting_writers) != 0) abort (); } # endif /* --------------------- gl_recursive_lock_t datatype --------------------- */ # if HAVE_PTHREAD_MUTEX_RECURSIVE # if !(defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) void glthread_recursive_lock_init (gl_recursive_lock_t *lock) { pthread_mutexattr_t attributes; if (pthread_mutexattr_init (&attributes) != 0) abort (); if (pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE) != 0) abort (); if (pthread_mutex_init (&lock->recmutex, &attributes) != 0) abort (); if (pthread_mutexattr_destroy (&attributes) != 0) abort (); lock->initialized = 1; } void glthread_recursive_lock_lock (gl_recursive_lock_t *lock) { if (!lock->initialized) { if (pthread_mutex_lock (&lock->guard) != 0) abort (); if (!lock->initialized) glthread_recursive_lock_init (lock); if (pthread_mutex_unlock (&lock->guard) != 0) abort (); } if (pthread_mutex_lock (&lock->recmutex) != 0) abort (); } void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock) { if (!lock->initialized) abort (); if (pthread_mutex_unlock (&lock->recmutex) != 0) abort (); } void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock) { if (!lock->initialized) abort (); if (pthread_mutex_destroy (&lock->recmutex) != 0) abort (); lock->initialized = 0; } # endif # else void glthread_recursive_lock_init (gl_recursive_lock_t *lock) { if (pthread_mutex_init (&lock->mutex, NULL) != 0) abort (); lock->owner = (pthread_t) 0; lock->depth = 0; } void glthread_recursive_lock_lock (gl_recursive_lock_t *lock) { pthread_t self = pthread_self (); if (lock->owner != self) { if (pthread_mutex_lock (&lock->mutex) != 0) abort (); lock->owner = self; } if (++(lock->depth) == 0) /* wraparound? */ abort (); } void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock) { if (lock->owner != pthread_self ()) abort (); if (lock->depth == 0) abort (); if (--(lock->depth) == 0) { lock->owner = (pthread_t) 0; if (pthread_mutex_unlock (&lock->mutex) != 0) abort (); } } void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock) { if (lock->owner != (pthread_t) 0) abort (); if (pthread_mutex_destroy (&lock->mutex) != 0) abort (); } # endif /* -------------------------- gl_once_t datatype -------------------------- */ static const pthread_once_t fresh_once = PTHREAD_ONCE_INIT; int glthread_once_singlethreaded (pthread_once_t *once_control) { /* We don't know whether pthread_once_t is an integer type, a floating-point type, a pointer type, or a structure type. */ char *firstbyte = (char *)once_control; if (*firstbyte == *(const char *)&fresh_once) { /* First time use of once_control. Invert the first byte. */ *firstbyte = ~ *(const char *)&fresh_once; return 1; } else return 0; } #endif /* ========================================================================= */ #if USE_PTH_THREADS /* Use the GNU Pth threads library. */ /* -------------------------- gl_lock_t datatype -------------------------- */ /* ------------------------- gl_rwlock_t datatype ------------------------- */ /* --------------------- gl_recursive_lock_t datatype --------------------- */ /* -------------------------- gl_once_t datatype -------------------------- */ void glthread_once_call (void *arg) { void (**gl_once_temp_addr) (void) = (void (**) (void)) arg; void (*initfunction) (void) = *gl_once_temp_addr; initfunction (); } int glthread_once_singlethreaded (pth_once_t *once_control) { /* We know that pth_once_t is an integer type. */ if (*once_control == PTH_ONCE_INIT) { /* First time use of once_control. Invert the marker. */ *once_control = ~ PTH_ONCE_INIT; return 1; } else return 0; } #endif /* ========================================================================= */ #if USE_SOLARIS_THREADS /* Use the old Solaris threads library. */ /* -------------------------- gl_lock_t datatype -------------------------- */ /* ------------------------- gl_rwlock_t datatype ------------------------- */ /* --------------------- gl_recursive_lock_t datatype --------------------- */ void glthread_recursive_lock_init (gl_recursive_lock_t *lock) { if (mutex_init (&lock->mutex, USYNC_THREAD, NULL) != 0) abort (); lock->owner = (thread_t) 0; lock->depth = 0; } void glthread_recursive_lock_lock (gl_recursive_lock_t *lock) { thread_t self = thr_self (); if (lock->owner != self) { if (mutex_lock (&lock->mutex) != 0) abort (); lock->owner = self; } if (++(lock->depth) == 0) /* wraparound? */ abort (); } void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock) { if (lock->owner != thr_self ()) abort (); if (lock->depth == 0) abort (); if (--(lock->depth) == 0) { lock->owner = (thread_t) 0; if (mutex_unlock (&lock->mutex) != 0) abort (); } } void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock) { if (lock->owner != (thread_t) 0) abort (); if (mutex_destroy (&lock->mutex) != 0) abort (); } /* -------------------------- gl_once_t datatype -------------------------- */ void glthread_once (gl_once_t *once_control, void (*initfunction) (void)) { if (!once_control->inited) { /* Use the mutex to guarantee that if another thread is already calling the initfunction, this thread waits until it's finished. */ if (mutex_lock (&once_control->mutex) != 0) abort (); if (!once_control->inited) { once_control->inited = 1; initfunction (); } if (mutex_unlock (&once_control->mutex) != 0) abort (); } } int glthread_once_singlethreaded (gl_once_t *once_control) { /* We know that gl_once_t contains an integer type. */ if (!once_control->inited) { /* First time use of once_control. Invert the marker. */ once_control->inited = ~ 0; return 1; } else return 0; } #endif /* ========================================================================= */ #if USE_WIN32_THREADS /* -------------------------- gl_lock_t datatype -------------------------- */ void glthread_lock_init (gl_lock_t *lock) { InitializeCriticalSection (&lock->lock); lock->guard.done = 1; } void glthread_lock_lock (gl_lock_t *lock) { if (!lock->guard.done) { if (InterlockedIncrement (&lock->guard.started) == 0) /* This thread is the first one to need this lock. Initialize it. */ glthread_lock_init (lock); else /* Yield the CPU while waiting for another thread to finish initializing this lock. */ while (!lock->guard.done) Sleep (0); } EnterCriticalSection (&lock->lock); } void glthread_lock_unlock (gl_lock_t *lock) { if (!lock->guard.done) abort (); LeaveCriticalSection (&lock->lock); } void glthread_lock_destroy (gl_lock_t *lock) { if (!lock->guard.done) abort (); DeleteCriticalSection (&lock->lock); lock->guard.done = 0; } /* ------------------------- gl_rwlock_t datatype ------------------------- */ static inline void gl_waitqueue_init (gl_waitqueue_t *wq) { wq->array = NULL; wq->count = 0; wq->alloc = 0; wq->offset = 0; } /* Enqueues the current thread, represented by an event, in a wait queue. Returns INVALID_HANDLE_VALUE if an allocation failure occurs. */ static HANDLE gl_waitqueue_add (gl_waitqueue_t *wq) { HANDLE event; unsigned int index; if (wq->count == wq->alloc) { unsigned int new_alloc = 2 * wq->alloc + 1; HANDLE *new_array = (HANDLE *) realloc (wq->array, new_alloc * sizeof (HANDLE)); if (new_array == NULL) /* No more memory. */ return INVALID_HANDLE_VALUE; /* Now is a good opportunity to rotate the array so that its contents starts at offset 0. */ if (wq->offset > 0) { unsigned int old_count = wq->count; unsigned int old_alloc = wq->alloc; unsigned int old_offset = wq->offset; unsigned int i; if (old_offset + old_count > old_alloc) { unsigned int limit = old_offset + old_count - old_alloc; for (i = 0; i < limit; i++) new_array[old_alloc + i] = new_array[i]; } for (i = 0; i < old_count; i++) new_array[i] = new_array[old_offset + i]; wq->offset = 0; } wq->array = new_array; wq->alloc = new_alloc; } event = CreateEvent (NULL, TRUE, FALSE, NULL); if (event == INVALID_HANDLE_VALUE) /* No way to allocate an event. */ return INVALID_HANDLE_VALUE; index = wq->offset + wq->count; if (index >= wq->alloc) index -= wq->alloc; wq->array[index] = event; wq->count++; return event; } /* Notifies the first thread from a wait queue and dequeues it. */ static inline void gl_waitqueue_notify_first (gl_waitqueue_t *wq) { SetEvent (wq->array[wq->offset + 0]); wq->offset++; wq->count--; if (wq->count == 0 || wq->offset == wq->alloc) wq->offset = 0; } /* Notifies all threads from a wait queue and dequeues them all. */ static inline void gl_waitqueue_notify_all (gl_waitqueue_t *wq) { unsigned int i; for (i = 0; i < wq->count; i++) { unsigned int index = wq->offset + i; if (index >= wq->alloc) index -= wq->alloc; SetEvent (wq->array[index]); } wq->count = 0; wq->offset = 0; } void glthread_rwlock_init (gl_rwlock_t *lock) { InitializeCriticalSection (&lock->lock); gl_waitqueue_init (&lock->waiting_readers); gl_waitqueue_init (&lock->waiting_writers); lock->runcount = 0; lock->guard.done = 1; } void glthread_rwlock_rdlock (gl_rwlock_t *lock) { if (!lock->guard.done) { if (InterlockedIncrement (&lock->guard.started) == 0) /* This thread is the first one to need this lock. Initialize it. */ glthread_rwlock_init (lock); else /* Yield the CPU while waiting for another thread to finish initializing this lock. */ while (!lock->guard.done) Sleep (0); } EnterCriticalSection (&lock->lock); /* Test whether only readers are currently running, and whether the runcount field will not overflow. */ if (!(lock->runcount + 1 > 0)) { /* This thread has to wait for a while. Enqueue it among the waiting_readers. */ HANDLE event = gl_waitqueue_add (&lock->waiting_readers); if (event != INVALID_HANDLE_VALUE) { DWORD result; LeaveCriticalSection (&lock->lock); /* Wait until another thread signals this event. */ result = WaitForSingleObject (event, INFINITE); if (result == WAIT_FAILED || result == WAIT_TIMEOUT) abort (); CloseHandle (event); /* The thread which signalled the event already did the bookkeeping: removed us from the waiting_readers, incremented lock->runcount. */ if (!(lock->runcount > 0)) abort (); return; } else { /* Allocation failure. Weird. */ do { LeaveCriticalSection (&lock->lock); Sleep (1); EnterCriticalSection (&lock->lock); } while (!(lock->runcount + 1 > 0)); } } lock->runcount++; LeaveCriticalSection (&lock->lock); } void glthread_rwlock_wrlock (gl_rwlock_t *lock) { if (!lock->guard.done) { if (InterlockedIncrement (&lock->guard.started) == 0) /* This thread is the first one to need this lock. Initialize it. */ glthread_rwlock_init (lock); else /* Yield the CPU while waiting for another thread to finish initializing this lock. */ while (!lock->guard.done) Sleep (0); } EnterCriticalSection (&lock->lock); /* Test whether no readers or writers are currently running. */ if (!(lock->runcount == 0)) { /* This thread has to wait for a while. Enqueue it among the waiting_writers. */ HANDLE event = gl_waitqueue_add (&lock->waiting_writers); if (event != INVALID_HANDLE_VALUE) { DWORD result; LeaveCriticalSection (&lock->lock); /* Wait until another thread signals this event. */ result = WaitForSingleObject (event, INFINITE); if (result == WAIT_FAILED || result == WAIT_TIMEOUT) abort (); CloseHandle (event); /* The thread which signalled the event already did the bookkeeping: removed us from the waiting_writers, set lock->runcount = -1. */ if (!(lock->runcount == -1)) abort (); return; } else { /* Allocation failure. Weird. */ do { LeaveCriticalSection (&lock->lock); Sleep (1); EnterCriticalSection (&lock->lock); } while (!(lock->runcount == 0)); } } lock->runcount--; /* runcount becomes -1 */ LeaveCriticalSection (&lock->lock); } void glthread_rwlock_unlock (gl_rwlock_t *lock) { if (!lock->guard.done) abort (); EnterCriticalSection (&lock->lock); if (lock->runcount < 0) { /* Drop a writer lock. */ if (!(lock->runcount == -1)) abort (); lock->runcount = 0; } else { /* Drop a reader lock. */ if (!(lock->runcount > 0)) abort (); lock->runcount--; } if (lock->runcount == 0) { /* POSIX recommends that "write locks shall take precedence over read locks", to avoid "writer starvation". */ if (lock->waiting_writers.count > 0) { /* Wake up one of the waiting writers. */ lock->runcount--; gl_waitqueue_notify_first (&lock->waiting_writers); } else { /* Wake up all waiting readers. */ lock->runcount += lock->waiting_readers.count; gl_waitqueue_notify_all (&lock->waiting_readers); } } LeaveCriticalSection (&lock->lock); } void glthread_rwlock_destroy (gl_rwlock_t *lock) { if (!lock->guard.done) abort (); if (lock->runcount != 0) abort (); DeleteCriticalSection (&lock->lock); if (lock->waiting_readers.array != NULL) free (lock->waiting_readers.array); if (lock->waiting_writers.array != NULL) free (lock->waiting_writers.array); lock->guard.done = 0; } /* --------------------- gl_recursive_lock_t datatype --------------------- */ void glthread_recursive_lock_init (gl_recursive_lock_t *lock) { lock->owner = 0; lock->depth = 0; InitializeCriticalSection (&lock->lock); lock->guard.done = 1; } void glthread_recursive_lock_lock (gl_recursive_lock_t *lock) { if (!lock->guard.done) { if (InterlockedIncrement (&lock->guard.started) == 0) /* This thread is the first one to need this lock. Initialize it. */ glthread_recursive_lock_init (lock); else /* Yield the CPU while waiting for another thread to finish initializing this lock. */ while (!lock->guard.done) Sleep (0); } { DWORD self = GetCurrentThreadId (); if (lock->owner != self) { EnterCriticalSection (&lock->lock); lock->owner = self; } if (++(lock->depth) == 0) /* wraparound? */ abort (); } } void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock) { if (lock->owner != GetCurrentThreadId ()) abort (); if (lock->depth == 0) abort (); if (--(lock->depth) == 0) { lock->owner = 0; LeaveCriticalSection (&lock->lock); } } void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock) { if (lock->owner != 0) abort (); DeleteCriticalSection (&lock->lock); lock->guard.done = 0; } /* -------------------------- gl_once_t datatype -------------------------- */ void glthread_once (gl_once_t *once_control, void (*initfunction) (void)) { if (once_control->inited <= 0) { if (InterlockedIncrement (&once_control->started) == 0) { /* This thread is the first one to come to this once_control. */ InitializeCriticalSection (&once_control->lock); EnterCriticalSection (&once_control->lock); once_control->inited = 0; initfunction (); once_control->inited = 1; LeaveCriticalSection (&once_control->lock); } else { /* Undo last operation. */ InterlockedDecrement (&once_control->started); /* Some other thread has already started the initialization. Yield the CPU while waiting for the other thread to finish initializing and taking the lock. */ while (once_control->inited < 0) Sleep (0); if (once_control->inited <= 0) { /* Take the lock. This blocks until the other thread has finished calling the initfunction. */ EnterCriticalSection (&once_control->lock); LeaveCriticalSection (&once_control->lock); if (!(once_control->inited > 0)) abort (); } } } } #endif /* ========================================================================= */ pbbuttonsd-0.8.1a/intl/relocatable.c0000644000175000017500000003353410641705132014364 00000000000000/* Provide relocatable packages. Copyright (C) 2003-2006 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Tell glibc's to provide a prototype for getline(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #include /* Specification. */ #include "relocatable.h" #if ENABLE_RELOCATABLE #include #include #include #include #ifdef NO_XMALLOC # define xmalloc malloc #else # include "xalloc.h" #endif #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ # define WIN32_LEAN_AND_MEAN # include #endif #if DEPENDS_ON_LIBCHARSET # include #endif #if DEPENDS_ON_LIBICONV && HAVE_ICONV # include #endif #if DEPENDS_ON_LIBINTL && ENABLE_NLS # include #endif /* Faked cheap 'bool'. */ #undef bool #undef false #undef true #define bool int #define false 0 #define true 1 /* Pathname support. ISSLASH(C) tests whether C is a directory separator character. IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. */ #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ /* Win32, Cygwin, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') # define HAS_DEVICE(P) \ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ && (P)[1] == ':') # define IS_PATH_WITH_DIR(P) \ (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P)) # define FILE_SYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0) #else /* Unix */ # define ISSLASH(C) ((C) == '/') # define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) # define FILE_SYSTEM_PREFIX_LEN(P) 0 #endif /* Original installation prefix. */ static char *orig_prefix; static size_t orig_prefix_len; /* Current installation prefix. */ static char *curr_prefix; static size_t curr_prefix_len; /* These prefixes do not end in a slash. Anything that will be concatenated to them must start with a slash. */ /* Sets the original and the current installation prefix of this module. Relocation simply replaces a pathname starting with the original prefix by the corresponding pathname with the current prefix instead. Both prefixes should be directory names without trailing slash (i.e. use "" instead of "/"). */ static void set_this_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg) { if (orig_prefix_arg != NULL && curr_prefix_arg != NULL /* Optimization: if orig_prefix and curr_prefix are equal, the relocation is a nop. */ && strcmp (orig_prefix_arg, curr_prefix_arg) != 0) { /* Duplicate the argument strings. */ char *memory; orig_prefix_len = strlen (orig_prefix_arg); curr_prefix_len = strlen (curr_prefix_arg); memory = (char *) xmalloc (orig_prefix_len + 1 + curr_prefix_len + 1); #ifdef NO_XMALLOC if (memory != NULL) #endif { memcpy (memory, orig_prefix_arg, orig_prefix_len + 1); orig_prefix = memory; memory += orig_prefix_len + 1; memcpy (memory, curr_prefix_arg, curr_prefix_len + 1); curr_prefix = memory; return; } } orig_prefix = NULL; curr_prefix = NULL; /* Don't worry about wasted memory here - this function is usually only called once. */ } /* Sets the original and the current installation prefix of the package. Relocation simply replaces a pathname starting with the original prefix by the corresponding pathname with the current prefix instead. Both prefixes should be directory names without trailing slash (i.e. use "" instead of "/"). */ void set_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg) { set_this_relocation_prefix (orig_prefix_arg, curr_prefix_arg); /* Now notify all dependent libraries. */ #if DEPENDS_ON_LIBCHARSET libcharset_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); #endif #if DEPENDS_ON_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109 libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); #endif #if DEPENDS_ON_LIBINTL && ENABLE_NLS && defined libintl_set_relocation_prefix libintl_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); #endif } #if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR) /* Convenience function: Computes the current installation prefix, based on the original installation prefix, the original installation directory of a particular file, and the current pathname of this file. Returns NULL upon failure. */ #ifdef IN_LIBRARY #define compute_curr_prefix local_compute_curr_prefix static #endif const char * compute_curr_prefix (const char *orig_installprefix, const char *orig_installdir, const char *curr_pathname) { const char *curr_installdir; const char *rel_installdir; if (curr_pathname == NULL) return NULL; /* Determine the relative installation directory, relative to the prefix. This is simply the difference between orig_installprefix and orig_installdir. */ if (strncmp (orig_installprefix, orig_installdir, strlen (orig_installprefix)) != 0) /* Shouldn't happen - nothing should be installed outside $(prefix). */ return NULL; rel_installdir = orig_installdir + strlen (orig_installprefix); /* Determine the current installation directory. */ { const char *p_base = curr_pathname + FILE_SYSTEM_PREFIX_LEN (curr_pathname); const char *p = curr_pathname + strlen (curr_pathname); char *q; while (p > p_base) { p--; if (ISSLASH (*p)) break; } q = (char *) xmalloc (p - curr_pathname + 1); #ifdef NO_XMALLOC if (q == NULL) return NULL; #endif memcpy (q, curr_pathname, p - curr_pathname); q[p - curr_pathname] = '\0'; curr_installdir = q; } /* Compute the current installation prefix by removing the trailing rel_installdir from it. */ { const char *rp = rel_installdir + strlen (rel_installdir); const char *cp = curr_installdir + strlen (curr_installdir); const char *cp_base = curr_installdir + FILE_SYSTEM_PREFIX_LEN (curr_installdir); while (rp > rel_installdir && cp > cp_base) { bool same = false; const char *rpi = rp; const char *cpi = cp; while (rpi > rel_installdir && cpi > cp_base) { rpi--; cpi--; if (ISSLASH (*rpi) || ISSLASH (*cpi)) { if (ISSLASH (*rpi) && ISSLASH (*cpi)) same = true; break; } /* Do case-insensitive comparison if the filesystem is always or often case-insensitive. It's better to accept the comparison if the difference is only in case, rather than to fail. */ #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ /* Win32, Cygwin, OS/2, DOS - case insignificant filesystem */ if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi) != (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi)) break; #else if (*rpi != *cpi) break; #endif } if (!same) break; /* The last pathname component was the same. opi and cpi now point to the slash before it. */ rp = rpi; cp = cpi; } if (rp > rel_installdir) /* Unexpected: The curr_installdir does not end with rel_installdir. */ return NULL; { size_t curr_prefix_len = cp - curr_installdir; char *curr_prefix; curr_prefix = (char *) xmalloc (curr_prefix_len + 1); #ifdef NO_XMALLOC if (curr_prefix == NULL) return NULL; #endif memcpy (curr_prefix, curr_installdir, curr_prefix_len); curr_prefix[curr_prefix_len] = '\0'; return curr_prefix; } } } #endif /* !IN_LIBRARY || PIC */ #if defined PIC && defined INSTALLDIR /* Full pathname of shared library, or NULL. */ static char *shared_library_fullname; #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ /* Determine the full pathname of the shared library when it is loaded. */ BOOL WINAPI DllMain (HINSTANCE module_handle, DWORD event, LPVOID reserved) { (void) reserved; if (event == DLL_PROCESS_ATTACH) { /* The DLL is being loaded into an application's address range. */ static char location[MAX_PATH]; if (!GetModuleFileName (module_handle, location, sizeof (location))) /* Shouldn't happen. */ return FALSE; if (!IS_PATH_WITH_DIR (location)) /* Shouldn't happen. */ return FALSE; { #if defined __CYGWIN__ /* On Cygwin, we need to convert paths coming from Win32 system calls to the Unix-like slashified notation. */ static char location_as_posix_path[2 * MAX_PATH]; /* There's no error return defined for cygwin_conv_to_posix_path. See cygwin-api/func-cygwin-conv-to-posix-path.html. Does it overflow the buffer of expected size MAX_PATH or does it truncate the path? I don't know. Let's catch both. */ cygwin_conv_to_posix_path (location, location_as_posix_path); location_as_posix_path[MAX_PATH - 1] = '\0'; if (strlen (location_as_posix_path) >= MAX_PATH - 1) /* A sign of buffer overflow or path truncation. */ return FALSE; shared_library_fullname = strdup (location_as_posix_path); #else shared_library_fullname = strdup (location); #endif } } return TRUE; } #else /* Unix except Cygwin */ static void find_shared_library_fullname () { #if defined __linux__ && __GLIBC__ >= 2 /* Linux has /proc/self/maps. glibc 2 has the getline() function. */ FILE *fp; /* Open the current process' maps file. It describes one VMA per line. */ fp = fopen ("/proc/self/maps", "r"); if (fp) { unsigned long address = (unsigned long) &find_shared_library_fullname; for (;;) { unsigned long start, end; int c; if (fscanf (fp, "%lx-%lx", &start, &end) != 2) break; if (address >= start && address <= end - 1) { /* Found it. Now see if this line contains a filename. */ while (c = getc (fp), c != EOF && c != '\n' && c != '/') continue; if (c == '/') { size_t size; int len; ungetc (c, fp); shared_library_fullname = NULL; size = 0; len = getline (&shared_library_fullname, &size, fp); if (len >= 0) { /* Success: filled shared_library_fullname. */ if (len > 0 && shared_library_fullname[len - 1] == '\n') shared_library_fullname[len - 1] = '\0'; } } break; } while (c = getc (fp), c != EOF && c != '\n') continue; } fclose (fp); } #endif } #endif /* (WIN32 or Cygwin) / (Unix except Cygwin) */ /* Return the full pathname of the current shared library. Return NULL if unknown. Guaranteed to work only on Linux, Cygwin and Woe32. */ static char * get_shared_library_fullname () { #if !(defined _WIN32 || defined __WIN32__ || defined __CYGWIN__) static bool tried_find_shared_library_fullname; if (!tried_find_shared_library_fullname) { find_shared_library_fullname (); tried_find_shared_library_fullname = true; } #endif return shared_library_fullname; } #endif /* PIC */ /* Returns the pathname, relocated according to the current installation directory. */ const char * relocate (const char *pathname) { #if defined PIC && defined INSTALLDIR static int initialized; /* Initialization code for a shared library. */ if (!initialized) { /* At this point, orig_prefix and curr_prefix likely have already been set through the main program's set_program_name_and_installdir function. This is sufficient in the case that the library has initially been installed in the same orig_prefix. But we can do better, to also cover the cases that 1. it has been installed in a different prefix before being moved to orig_prefix and (later) to curr_prefix, 2. unlike the program, it has not moved away from orig_prefix. */ const char *orig_installprefix = INSTALLPREFIX; const char *orig_installdir = INSTALLDIR; const char *curr_prefix_better; curr_prefix_better = compute_curr_prefix (orig_installprefix, orig_installdir, get_shared_library_fullname ()); if (curr_prefix_better == NULL) curr_prefix_better = curr_prefix; set_relocation_prefix (orig_installprefix, curr_prefix_better); initialized = 1; } #endif /* Note: It is not necessary to perform case insensitive comparison here, even for DOS-like filesystems, because the pathname argument was typically created from the same Makefile variable as orig_prefix came from. */ if (orig_prefix != NULL && curr_prefix != NULL && strncmp (pathname, orig_prefix, orig_prefix_len) == 0) { if (pathname[orig_prefix_len] == '\0') /* pathname equals orig_prefix. */ return curr_prefix; if (ISSLASH (pathname[orig_prefix_len])) { /* pathname starts with orig_prefix. */ const char *pathname_tail = &pathname[orig_prefix_len]; char *result = (char *) xmalloc (curr_prefix_len + strlen (pathname_tail) + 1); #ifdef NO_XMALLOC if (result != NULL) #endif { memcpy (result, curr_prefix, curr_prefix_len); strcpy (result + curr_prefix_len, pathname_tail); return result; } } } /* Nothing to relocate. */ return pathname; } #endif pbbuttonsd-0.8.1a/intl/langprefs.c0000644000175000017500000000737510641705135014077 00000000000000/* Determine the user's language preferences. Copyright (C) 2004-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Bruno Haible . */ #ifdef HAVE_CONFIG_H # include #endif #include #if HAVE_CFPREFERENCESCOPYAPPVALUE # include # include # include # include # include extern void _nl_locale_name_canonicalize (char *name); #endif /* Determine the user's language preferences, as a colon separated list of locale names in XPG syntax language[_territory][.codeset][@modifier] The result must not be freed; it is statically allocated. The LANGUAGE environment variable does not need to be considered; it is already taken into account by the caller. */ const char * _nl_language_preferences_default (void) { #if HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.2 or newer */ { /* Cache the preferences list, since CoreFoundation calls are expensive. */ static const char *cached_languages; static int cache_initialized; if (!cache_initialized) { CFTypeRef preferences = CFPreferencesCopyAppValue (CFSTR ("AppleLanguages"), kCFPreferencesCurrentApplication); if (preferences != NULL && CFGetTypeID (preferences) == CFArrayGetTypeID ()) { CFArrayRef prefArray = (CFArrayRef)preferences; int n = CFArrayGetCount (prefArray); char buf[256]; size_t size = 0; int i; for (i = 0; i < n; i++) { CFTypeRef element = CFArrayGetValueAtIndex (prefArray, i); if (element != NULL && CFGetTypeID (element) == CFStringGetTypeID () && CFStringGetCString ((CFStringRef)element, buf, sizeof (buf), kCFStringEncodingASCII)) { _nl_locale_name_canonicalize (buf); size += strlen (buf) + 1; /* Most GNU programs use msgids in English and don't ship an en.mo message catalog. Therefore when we see "en" in the preferences list, arrange for gettext() to return the msgid, and ignore all further elements of the preferences list. */ if (strcmp (buf, "en") == 0) break; } else break; } if (size > 0) { char *languages = (char *) malloc (size); if (languages != NULL) { char *p = languages; for (i = 0; i < n; i++) { CFTypeRef element = CFArrayGetValueAtIndex (prefArray, i); if (element != NULL && CFGetTypeID (element) == CFStringGetTypeID () && CFStringGetCString ((CFStringRef)element, buf, sizeof (buf), kCFStringEncodingASCII)) { _nl_locale_name_canonicalize (buf); strcpy (p, buf); p += strlen (buf); *p++ = ':'; if (strcmp (buf, "en") == 0) break; } else break; } *--p = '\0'; cached_languages = languages; } } } cache_initialized = 1; } if (cached_languages != NULL) return cached_languages; } #endif return NULL; } pbbuttonsd-0.8.1a/intl/localename.c0000644000175000017500000012433210641705131014203 00000000000000/* Determine the current selected locale. Copyright (C) 1995-1999, 2000-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Ulrich Drepper , 1995. */ /* Win32 code written by Tor Lillqvist . */ /* MacOS X code written by Bruno Haible . */ #ifdef HAVE_CONFIG_H # include #endif #include #include #if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE # include # include # if HAVE_CFLOCALECOPYCURRENT # include # elif HAVE_CFPREFERENCESCOPYAPPVALUE # include # endif #endif #if defined _WIN32 || defined __WIN32__ # define WIN32_NATIVE #endif #ifdef WIN32_NATIVE # define WIN32_LEAN_AND_MEAN # include /* List of language codes, sorted by value: 0x01 LANG_ARABIC 0x02 LANG_BULGARIAN 0x03 LANG_CATALAN 0x04 LANG_CHINESE 0x05 LANG_CZECH 0x06 LANG_DANISH 0x07 LANG_GERMAN 0x08 LANG_GREEK 0x09 LANG_ENGLISH 0x0a LANG_SPANISH 0x0b LANG_FINNISH 0x0c LANG_FRENCH 0x0d LANG_HEBREW 0x0e LANG_HUNGARIAN 0x0f LANG_ICELANDIC 0x10 LANG_ITALIAN 0x11 LANG_JAPANESE 0x12 LANG_KOREAN 0x13 LANG_DUTCH 0x14 LANG_NORWEGIAN 0x15 LANG_POLISH 0x16 LANG_PORTUGUESE 0x17 LANG_RHAETO_ROMANCE 0x18 LANG_ROMANIAN 0x19 LANG_RUSSIAN 0x1a LANG_CROATIAN == LANG_SERBIAN 0x1b LANG_SLOVAK 0x1c LANG_ALBANIAN 0x1d LANG_SWEDISH 0x1e LANG_THAI 0x1f LANG_TURKISH 0x20 LANG_URDU 0x21 LANG_INDONESIAN 0x22 LANG_UKRAINIAN 0x23 LANG_BELARUSIAN 0x24 LANG_SLOVENIAN 0x25 LANG_ESTONIAN 0x26 LANG_LATVIAN 0x27 LANG_LITHUANIAN 0x28 LANG_TAJIK 0x29 LANG_FARSI 0x2a LANG_VIETNAMESE 0x2b LANG_ARMENIAN 0x2c LANG_AZERI 0x2d LANG_BASQUE 0x2e LANG_SORBIAN 0x2f LANG_MACEDONIAN 0x30 LANG_SUTU 0x31 LANG_TSONGA 0x32 LANG_TSWANA 0x33 LANG_VENDA 0x34 LANG_XHOSA 0x35 LANG_ZULU 0x36 LANG_AFRIKAANS 0x37 LANG_GEORGIAN 0x38 LANG_FAEROESE 0x39 LANG_HINDI 0x3a LANG_MALTESE 0x3b LANG_SAAMI 0x3c LANG_GAELIC 0x3d LANG_YIDDISH 0x3e LANG_MALAY 0x3f LANG_KAZAK 0x40 LANG_KYRGYZ 0x41 LANG_SWAHILI 0x42 LANG_TURKMEN 0x43 LANG_UZBEK 0x44 LANG_TATAR 0x45 LANG_BENGALI 0x46 LANG_PUNJABI 0x47 LANG_GUJARATI 0x48 LANG_ORIYA 0x49 LANG_TAMIL 0x4a LANG_TELUGU 0x4b LANG_KANNADA 0x4c LANG_MALAYALAM 0x4d LANG_ASSAMESE 0x4e LANG_MARATHI 0x4f LANG_SANSKRIT 0x50 LANG_MONGOLIAN 0x51 LANG_TIBETAN 0x52 LANG_WELSH 0x53 LANG_CAMBODIAN 0x54 LANG_LAO 0x55 LANG_BURMESE 0x56 LANG_GALICIAN 0x57 LANG_KONKANI 0x58 LANG_MANIPURI 0x59 LANG_SINDHI 0x5a LANG_SYRIAC 0x5b LANG_SINHALESE 0x5c LANG_CHEROKEE 0x5d LANG_INUKTITUT 0x5e LANG_AMHARIC 0x5f LANG_TAMAZIGHT 0x60 LANG_KASHMIRI 0x61 LANG_NEPALI 0x62 LANG_FRISIAN 0x63 LANG_PASHTO 0x64 LANG_TAGALOG 0x65 LANG_DIVEHI 0x66 LANG_EDO 0x67 LANG_FULFULDE 0x68 LANG_HAUSA 0x69 LANG_IBIBIO 0x6a LANG_YORUBA 0x70 LANG_IGBO 0x71 LANG_KANURI 0x72 LANG_OROMO 0x73 LANG_TIGRINYA 0x74 LANG_GUARANI 0x75 LANG_HAWAIIAN 0x76 LANG_LATIN 0x77 LANG_SOMALI 0x78 LANG_YI 0x79 LANG_PAPIAMENTU */ /* Mingw headers don't have latest language and sublanguage codes. */ # ifndef LANG_AFRIKAANS # define LANG_AFRIKAANS 0x36 # endif # ifndef LANG_ALBANIAN # define LANG_ALBANIAN 0x1c # endif # ifndef LANG_AMHARIC # define LANG_AMHARIC 0x5e # endif # ifndef LANG_ARABIC # define LANG_ARABIC 0x01 # endif # ifndef LANG_ARMENIAN # define LANG_ARMENIAN 0x2b # endif # ifndef LANG_ASSAMESE # define LANG_ASSAMESE 0x4d # endif # ifndef LANG_AZERI # define LANG_AZERI 0x2c # endif # ifndef LANG_BASQUE # define LANG_BASQUE 0x2d # endif # ifndef LANG_BELARUSIAN # define LANG_BELARUSIAN 0x23 # endif # ifndef LANG_BENGALI # define LANG_BENGALI 0x45 # endif # ifndef LANG_BURMESE # define LANG_BURMESE 0x55 # endif # ifndef LANG_CAMBODIAN # define LANG_CAMBODIAN 0x53 # endif # ifndef LANG_CATALAN # define LANG_CATALAN 0x03 # endif # ifndef LANG_CHEROKEE # define LANG_CHEROKEE 0x5c # endif # ifndef LANG_DIVEHI # define LANG_DIVEHI 0x65 # endif # ifndef LANG_EDO # define LANG_EDO 0x66 # endif # ifndef LANG_ESTONIAN # define LANG_ESTONIAN 0x25 # endif # ifndef LANG_FAEROESE # define LANG_FAEROESE 0x38 # endif # ifndef LANG_FARSI # define LANG_FARSI 0x29 # endif # ifndef LANG_FRISIAN # define LANG_FRISIAN 0x62 # endif # ifndef LANG_FULFULDE # define LANG_FULFULDE 0x67 # endif # ifndef LANG_GAELIC # define LANG_GAELIC 0x3c # endif # ifndef LANG_GALICIAN # define LANG_GALICIAN 0x56 # endif # ifndef LANG_GEORGIAN # define LANG_GEORGIAN 0x37 # endif # ifndef LANG_GUARANI # define LANG_GUARANI 0x74 # endif # ifndef LANG_GUJARATI # define LANG_GUJARATI 0x47 # endif # ifndef LANG_HAUSA # define LANG_HAUSA 0x68 # endif # ifndef LANG_HAWAIIAN # define LANG_HAWAIIAN 0x75 # endif # ifndef LANG_HEBREW # define LANG_HEBREW 0x0d # endif # ifndef LANG_HINDI # define LANG_HINDI 0x39 # endif # ifndef LANG_IBIBIO # define LANG_IBIBIO 0x69 # endif # ifndef LANG_IGBO # define LANG_IGBO 0x70 # endif # ifndef LANG_INDONESIAN # define LANG_INDONESIAN 0x21 # endif # ifndef LANG_INUKTITUT # define LANG_INUKTITUT 0x5d # endif # ifndef LANG_KANNADA # define LANG_KANNADA 0x4b # endif # ifndef LANG_KANURI # define LANG_KANURI 0x71 # endif # ifndef LANG_KASHMIRI # define LANG_KASHMIRI 0x60 # endif # ifndef LANG_KAZAK # define LANG_KAZAK 0x3f # endif # ifndef LANG_KONKANI # define LANG_KONKANI 0x57 # endif # ifndef LANG_KYRGYZ # define LANG_KYRGYZ 0x40 # endif # ifndef LANG_LAO # define LANG_LAO 0x54 # endif # ifndef LANG_LATIN # define LANG_LATIN 0x76 # endif # ifndef LANG_LATVIAN # define LANG_LATVIAN 0x26 # endif # ifndef LANG_LITHUANIAN # define LANG_LITHUANIAN 0x27 # endif # ifndef LANG_MACEDONIAN # define LANG_MACEDONIAN 0x2f # endif # ifndef LANG_MALAY # define LANG_MALAY 0x3e # endif # ifndef LANG_MALAYALAM # define LANG_MALAYALAM 0x4c # endif # ifndef LANG_MALTESE # define LANG_MALTESE 0x3a # endif # ifndef LANG_MANIPURI # define LANG_MANIPURI 0x58 # endif # ifndef LANG_MARATHI # define LANG_MARATHI 0x4e # endif # ifndef LANG_MONGOLIAN # define LANG_MONGOLIAN 0x50 # endif # ifndef LANG_NEPALI # define LANG_NEPALI 0x61 # endif # ifndef LANG_ORIYA # define LANG_ORIYA 0x48 # endif # ifndef LANG_OROMO # define LANG_OROMO 0x72 # endif # ifndef LANG_PAPIAMENTU # define LANG_PAPIAMENTU 0x79 # endif # ifndef LANG_PASHTO # define LANG_PASHTO 0x63 # endif # ifndef LANG_PUNJABI # define LANG_PUNJABI 0x46 # endif # ifndef LANG_RHAETO_ROMANCE # define LANG_RHAETO_ROMANCE 0x17 # endif # ifndef LANG_SAAMI # define LANG_SAAMI 0x3b # endif # ifndef LANG_SANSKRIT # define LANG_SANSKRIT 0x4f # endif # ifndef LANG_SERBIAN # define LANG_SERBIAN 0x1a # endif # ifndef LANG_SINDHI # define LANG_SINDHI 0x59 # endif # ifndef LANG_SINHALESE # define LANG_SINHALESE 0x5b # endif # ifndef LANG_SLOVAK # define LANG_SLOVAK 0x1b # endif # ifndef LANG_SOMALI # define LANG_SOMALI 0x77 # endif # ifndef LANG_SORBIAN # define LANG_SORBIAN 0x2e # endif # ifndef LANG_SUTU # define LANG_SUTU 0x30 # endif # ifndef LANG_SWAHILI # define LANG_SWAHILI 0x41 # endif # ifndef LANG_SYRIAC # define LANG_SYRIAC 0x5a # endif # ifndef LANG_TAGALOG # define LANG_TAGALOG 0x64 # endif # ifndef LANG_TAJIK # define LANG_TAJIK 0x28 # endif # ifndef LANG_TAMAZIGHT # define LANG_TAMAZIGHT 0x5f # endif # ifndef LANG_TAMIL # define LANG_TAMIL 0x49 # endif # ifndef LANG_TATAR # define LANG_TATAR 0x44 # endif # ifndef LANG_TELUGU # define LANG_TELUGU 0x4a # endif # ifndef LANG_THAI # define LANG_THAI 0x1e # endif # ifndef LANG_TIBETAN # define LANG_TIBETAN 0x51 # endif # ifndef LANG_TIGRINYA # define LANG_TIGRINYA 0x73 # endif # ifndef LANG_TSONGA # define LANG_TSONGA 0x31 # endif # ifndef LANG_TSWANA # define LANG_TSWANA 0x32 # endif # ifndef LANG_TURKMEN # define LANG_TURKMEN 0x42 # endif # ifndef LANG_UKRAINIAN # define LANG_UKRAINIAN 0x22 # endif # ifndef LANG_URDU # define LANG_URDU 0x20 # endif # ifndef LANG_UZBEK # define LANG_UZBEK 0x43 # endif # ifndef LANG_VENDA # define LANG_VENDA 0x33 # endif # ifndef LANG_VIETNAMESE # define LANG_VIETNAMESE 0x2a # endif # ifndef LANG_WELSH # define LANG_WELSH 0x52 # endif # ifndef LANG_XHOSA # define LANG_XHOSA 0x34 # endif # ifndef LANG_YI # define LANG_YI 0x78 # endif # ifndef LANG_YIDDISH # define LANG_YIDDISH 0x3d # endif # ifndef LANG_YORUBA # define LANG_YORUBA 0x6a # endif # ifndef LANG_ZULU # define LANG_ZULU 0x35 # endif # ifndef SUBLANG_ARABIC_SAUDI_ARABIA # define SUBLANG_ARABIC_SAUDI_ARABIA 0x01 # endif # ifndef SUBLANG_ARABIC_IRAQ # define SUBLANG_ARABIC_IRAQ 0x02 # endif # ifndef SUBLANG_ARABIC_EGYPT # define SUBLANG_ARABIC_EGYPT 0x03 # endif # ifndef SUBLANG_ARABIC_LIBYA # define SUBLANG_ARABIC_LIBYA 0x04 # endif # ifndef SUBLANG_ARABIC_ALGERIA # define SUBLANG_ARABIC_ALGERIA 0x05 # endif # ifndef SUBLANG_ARABIC_MOROCCO # define SUBLANG_ARABIC_MOROCCO 0x06 # endif # ifndef SUBLANG_ARABIC_TUNISIA # define SUBLANG_ARABIC_TUNISIA 0x07 # endif # ifndef SUBLANG_ARABIC_OMAN # define SUBLANG_ARABIC_OMAN 0x08 # endif # ifndef SUBLANG_ARABIC_YEMEN # define SUBLANG_ARABIC_YEMEN 0x09 # endif # ifndef SUBLANG_ARABIC_SYRIA # define SUBLANG_ARABIC_SYRIA 0x0a # endif # ifndef SUBLANG_ARABIC_JORDAN # define SUBLANG_ARABIC_JORDAN 0x0b # endif # ifndef SUBLANG_ARABIC_LEBANON # define SUBLANG_ARABIC_LEBANON 0x0c # endif # ifndef SUBLANG_ARABIC_KUWAIT # define SUBLANG_ARABIC_KUWAIT 0x0d # endif # ifndef SUBLANG_ARABIC_UAE # define SUBLANG_ARABIC_UAE 0x0e # endif # ifndef SUBLANG_ARABIC_BAHRAIN # define SUBLANG_ARABIC_BAHRAIN 0x0f # endif # ifndef SUBLANG_ARABIC_QATAR # define SUBLANG_ARABIC_QATAR 0x10 # endif # ifndef SUBLANG_AZERI_LATIN # define SUBLANG_AZERI_LATIN 0x01 # endif # ifndef SUBLANG_AZERI_CYRILLIC # define SUBLANG_AZERI_CYRILLIC 0x02 # endif # ifndef SUBLANG_BENGALI_INDIA # define SUBLANG_BENGALI_INDIA 0x00 # endif # ifndef SUBLANG_BENGALI_BANGLADESH # define SUBLANG_BENGALI_BANGLADESH 0x01 # endif # ifndef SUBLANG_CHINESE_MACAU # define SUBLANG_CHINESE_MACAU 0x05 # endif # ifndef SUBLANG_ENGLISH_SOUTH_AFRICA # define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07 # endif # ifndef SUBLANG_ENGLISH_JAMAICA # define SUBLANG_ENGLISH_JAMAICA 0x08 # endif # ifndef SUBLANG_ENGLISH_CARIBBEAN # define SUBLANG_ENGLISH_CARIBBEAN 0x09 # endif # ifndef SUBLANG_ENGLISH_BELIZE # define SUBLANG_ENGLISH_BELIZE 0x0a # endif # ifndef SUBLANG_ENGLISH_TRINIDAD # define SUBLANG_ENGLISH_TRINIDAD 0x0b # endif # ifndef SUBLANG_ENGLISH_ZIMBABWE # define SUBLANG_ENGLISH_ZIMBABWE 0x0c # endif # ifndef SUBLANG_ENGLISH_PHILIPPINES # define SUBLANG_ENGLISH_PHILIPPINES 0x0d # endif # ifndef SUBLANG_ENGLISH_INDONESIA # define SUBLANG_ENGLISH_INDONESIA 0x0e # endif # ifndef SUBLANG_ENGLISH_HONGKONG # define SUBLANG_ENGLISH_HONGKONG 0x0f # endif # ifndef SUBLANG_ENGLISH_INDIA # define SUBLANG_ENGLISH_INDIA 0x10 # endif # ifndef SUBLANG_ENGLISH_MALAYSIA # define SUBLANG_ENGLISH_MALAYSIA 0x11 # endif # ifndef SUBLANG_ENGLISH_SINGAPORE # define SUBLANG_ENGLISH_SINGAPORE 0x12 # endif # ifndef SUBLANG_FRENCH_LUXEMBOURG # define SUBLANG_FRENCH_LUXEMBOURG 0x05 # endif # ifndef SUBLANG_FRENCH_MONACO # define SUBLANG_FRENCH_MONACO 0x06 # endif # ifndef SUBLANG_FRENCH_WESTINDIES # define SUBLANG_FRENCH_WESTINDIES 0x07 # endif # ifndef SUBLANG_FRENCH_REUNION # define SUBLANG_FRENCH_REUNION 0x08 # endif # ifndef SUBLANG_FRENCH_CONGO # define SUBLANG_FRENCH_CONGO 0x09 # endif # ifndef SUBLANG_FRENCH_SENEGAL # define SUBLANG_FRENCH_SENEGAL 0x0a # endif # ifndef SUBLANG_FRENCH_CAMEROON # define SUBLANG_FRENCH_CAMEROON 0x0b # endif # ifndef SUBLANG_FRENCH_COTEDIVOIRE # define SUBLANG_FRENCH_COTEDIVOIRE 0x0c # endif # ifndef SUBLANG_FRENCH_MALI # define SUBLANG_FRENCH_MALI 0x0d # endif # ifndef SUBLANG_FRENCH_MOROCCO # define SUBLANG_FRENCH_MOROCCO 0x0e # endif # ifndef SUBLANG_FRENCH_HAITI # define SUBLANG_FRENCH_HAITI 0x0f # endif # ifndef SUBLANG_GERMAN_LUXEMBOURG # define SUBLANG_GERMAN_LUXEMBOURG 0x04 # endif # ifndef SUBLANG_GERMAN_LIECHTENSTEIN # define SUBLANG_GERMAN_LIECHTENSTEIN 0x05 # endif # ifndef SUBLANG_KASHMIRI_INDIA # define SUBLANG_KASHMIRI_INDIA 0x02 # endif # ifndef SUBLANG_MALAY_MALAYSIA # define SUBLANG_MALAY_MALAYSIA 0x01 # endif # ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM # define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02 # endif # ifndef SUBLANG_NEPALI_INDIA # define SUBLANG_NEPALI_INDIA 0x02 # endif # ifndef SUBLANG_PUNJABI_INDIA # define SUBLANG_PUNJABI_INDIA 0x00 # endif # ifndef SUBLANG_PUNJABI_PAKISTAN # define SUBLANG_PUNJABI_PAKISTAN 0x01 # endif # ifndef SUBLANG_ROMANIAN_ROMANIA # define SUBLANG_ROMANIAN_ROMANIA 0x00 # endif # ifndef SUBLANG_ROMANIAN_MOLDOVA # define SUBLANG_ROMANIAN_MOLDOVA 0x01 # endif # ifndef SUBLANG_SERBIAN_LATIN # define SUBLANG_SERBIAN_LATIN 0x02 # endif # ifndef SUBLANG_SERBIAN_CYRILLIC # define SUBLANG_SERBIAN_CYRILLIC 0x03 # endif # ifndef SUBLANG_SINDHI_INDIA # define SUBLANG_SINDHI_INDIA 0x00 # endif # ifndef SUBLANG_SINDHI_PAKISTAN # define SUBLANG_SINDHI_PAKISTAN 0x01 # endif # ifndef SUBLANG_SPANISH_GUATEMALA # define SUBLANG_SPANISH_GUATEMALA 0x04 # endif # ifndef SUBLANG_SPANISH_COSTA_RICA # define SUBLANG_SPANISH_COSTA_RICA 0x05 # endif # ifndef SUBLANG_SPANISH_PANAMA # define SUBLANG_SPANISH_PANAMA 0x06 # endif # ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC # define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07 # endif # ifndef SUBLANG_SPANISH_VENEZUELA # define SUBLANG_SPANISH_VENEZUELA 0x08 # endif # ifndef SUBLANG_SPANISH_COLOMBIA # define SUBLANG_SPANISH_COLOMBIA 0x09 # endif # ifndef SUBLANG_SPANISH_PERU # define SUBLANG_SPANISH_PERU 0x0a # endif # ifndef SUBLANG_SPANISH_ARGENTINA # define SUBLANG_SPANISH_ARGENTINA 0x0b # endif # ifndef SUBLANG_SPANISH_ECUADOR # define SUBLANG_SPANISH_ECUADOR 0x0c # endif # ifndef SUBLANG_SPANISH_CHILE # define SUBLANG_SPANISH_CHILE 0x0d # endif # ifndef SUBLANG_SPANISH_URUGUAY # define SUBLANG_SPANISH_URUGUAY 0x0e # endif # ifndef SUBLANG_SPANISH_PARAGUAY # define SUBLANG_SPANISH_PARAGUAY 0x0f # endif # ifndef SUBLANG_SPANISH_BOLIVIA # define SUBLANG_SPANISH_BOLIVIA 0x10 # endif # ifndef SUBLANG_SPANISH_EL_SALVADOR # define SUBLANG_SPANISH_EL_SALVADOR 0x11 # endif # ifndef SUBLANG_SPANISH_HONDURAS # define SUBLANG_SPANISH_HONDURAS 0x12 # endif # ifndef SUBLANG_SPANISH_NICARAGUA # define SUBLANG_SPANISH_NICARAGUA 0x13 # endif # ifndef SUBLANG_SPANISH_PUERTO_RICO # define SUBLANG_SPANISH_PUERTO_RICO 0x14 # endif # ifndef SUBLANG_SWEDISH_FINLAND # define SUBLANG_SWEDISH_FINLAND 0x02 # endif # ifndef SUBLANG_TAMAZIGHT_ARABIC # define SUBLANG_TAMAZIGHT_ARABIC 0x01 # endif # ifndef SUBLANG_TAMAZIGHT_LATIN # define SUBLANG_TAMAZIGHT_LATIN 0x02 # endif # ifndef SUBLANG_TIGRINYA_ETHIOPIA # define SUBLANG_TIGRINYA_ETHIOPIA 0x00 # endif # ifndef SUBLANG_TIGRINYA_ERITREA # define SUBLANG_TIGRINYA_ERITREA 0x01 # endif # ifndef SUBLANG_URDU_PAKISTAN # define SUBLANG_URDU_PAKISTAN 0x01 # endif # ifndef SUBLANG_URDU_INDIA # define SUBLANG_URDU_INDIA 0x02 # endif # ifndef SUBLANG_UZBEK_LATIN # define SUBLANG_UZBEK_LATIN 0x01 # endif # ifndef SUBLANG_UZBEK_CYRILLIC # define SUBLANG_UZBEK_CYRILLIC 0x02 # endif #endif # if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.2 or newer */ /* Canonicalize a MacOS X locale name to a Unix locale name. NAME is a sufficiently large buffer. On input, it contains the MacOS X locale name. On output, it contains the Unix locale name. */ void _nl_locale_name_canonicalize (char *name) { /* This conversion is based on a posting by Deborah GoldSmith on 2005-03-08, http://lists.apple.com/archives/carbon-dev/2005/Mar/msg00293.html */ /* Convert legacy (NeXTstep inherited) English names to Unix (ISO 639 and ISO 3166) names. Prior to MacOS X 10.3, there is no API for doing this. Therefore we do it ourselves, using a table based on the results of the MacOS X 10.3.8 function CFLocaleCreateCanonicalLocaleIdentifierFromString(). */ typedef struct { const char legacy[21+1]; const char unixy[5+1]; } legacy_entry; static const legacy_entry legacy_table[] = { { "Afrikaans", "af" }, { "Albanian", "sq" }, { "Amharic", "am" }, { "Arabic", "ar" }, { "Armenian", "hy" }, { "Assamese", "as" }, { "Aymara", "ay" }, { "Azerbaijani", "az" }, { "Basque", "eu" }, { "Belarusian", "be" }, { "Belorussian", "be" }, { "Bengali", "bn" }, { "Brazilian Portugese", "pt_BR" }, { "Brazilian Portuguese", "pt_BR" }, { "Breton", "br" }, { "Bulgarian", "bg" }, { "Burmese", "my" }, { "Byelorussian", "be" }, { "Catalan", "ca" }, { "Chewa", "ny" }, { "Chichewa", "ny" }, { "Chinese", "zh" }, { "Chinese, Simplified", "zh_CN" }, { "Chinese, Traditional", "zh_TW" }, { "Chinese, Tradtional", "zh_TW" }, { "Croatian", "hr" }, { "Czech", "cs" }, { "Danish", "da" }, { "Dutch", "nl" }, { "Dzongkha", "dz" }, { "English", "en" }, { "Esperanto", "eo" }, { "Estonian", "et" }, { "Faroese", "fo" }, { "Farsi", "fa" }, { "Finnish", "fi" }, { "Flemish", "nl_BE" }, { "French", "fr" }, { "Galician", "gl" }, { "Gallegan", "gl" }, { "Georgian", "ka" }, { "German", "de" }, { "Greek", "el" }, { "Greenlandic", "kl" }, { "Guarani", "gn" }, { "Gujarati", "gu" }, { "Hawaiian", "haw" }, /* Yes, "haw", not "cpe". */ { "Hebrew", "he" }, { "Hindi", "hi" }, { "Hungarian", "hu" }, { "Icelandic", "is" }, { "Indonesian", "id" }, { "Inuktitut", "iu" }, { "Irish", "ga" }, { "Italian", "it" }, { "Japanese", "ja" }, { "Javanese", "jv" }, { "Kalaallisut", "kl" }, { "Kannada", "kn" }, { "Kashmiri", "ks" }, { "Kazakh", "kk" }, { "Khmer", "km" }, { "Kinyarwanda", "rw" }, { "Kirghiz", "ky" }, { "Korean", "ko" }, { "Kurdish", "ku" }, { "Latin", "la" }, { "Latvian", "lv" }, { "Lithuanian", "lt" }, { "Macedonian", "mk" }, { "Malagasy", "mg" }, { "Malay", "ms" }, { "Malayalam", "ml" }, { "Maltese", "mt" }, { "Manx", "gv" }, { "Marathi", "mr" }, { "Moldavian", "mo" }, { "Mongolian", "mn" }, { "Nepali", "ne" }, { "Norwegian", "nb" }, /* Yes, "nb", not the obsolete "no". */ { "Nyanja", "ny" }, { "Nynorsk", "nn" }, { "Oriya", "or" }, { "Oromo", "om" }, { "Panjabi", "pa" }, { "Pashto", "ps" }, { "Persian", "fa" }, { "Polish", "pl" }, { "Portuguese", "pt" }, { "Portuguese, Brazilian", "pt_BR" }, { "Punjabi", "pa" }, { "Pushto", "ps" }, { "Quechua", "qu" }, { "Romanian", "ro" }, { "Ruanda", "rw" }, { "Rundi", "rn" }, { "Russian", "ru" }, { "Sami", "se_NO" }, /* Not just "se". */ { "Sanskrit", "sa" }, { "Scottish", "gd" }, { "Serbian", "sr" }, { "Simplified Chinese", "zh_CN" }, { "Sindhi", "sd" }, { "Sinhalese", "si" }, { "Slovak", "sk" }, { "Slovenian", "sl" }, { "Somali", "so" }, { "Spanish", "es" }, { "Sundanese", "su" }, { "Swahili", "sw" }, { "Swedish", "sv" }, { "Tagalog", "tl" }, { "Tajik", "tg" }, { "Tajiki", "tg" }, { "Tamil", "ta" }, { "Tatar", "tt" }, { "Telugu", "te" }, { "Thai", "th" }, { "Tibetan", "bo" }, { "Tigrinya", "ti" }, { "Tongan", "to" }, { "Traditional Chinese", "zh_TW" }, { "Turkish", "tr" }, { "Turkmen", "tk" }, { "Uighur", "ug" }, { "Ukrainian", "uk" }, { "Urdu", "ur" }, { "Uzbek", "uz" }, { "Vietnamese", "vi" }, { "Welsh", "cy" }, { "Yiddish", "yi" } }; /* Convert new-style locale names with language tags (ISO 639 and ISO 15924) to Unix (ISO 639 and ISO 3166) names. */ typedef struct { const char langtag[7+1]; const char unixy[12+1]; } langtag_entry; static const langtag_entry langtag_table[] = { /* MacOS X has "az-Arab", "az-Cyrl", "az-Latn". The default script for az on Unix is Latin. */ { "az-Latn", "az" }, /* MacOS X has "ga-dots". Does not yet exist on Unix. */ { "ga-dots", "ga" }, /* MacOS X has "kk-Cyrl". Does not yet exist on Unix. */ /* MacOS X has "mn-Cyrl", "mn-Mong". The default script for mn on Unix is Cyrillic. */ { "mn-Cyrl", "mn" }, /* MacOS X has "ms-Arab", "ms-Latn". The default script for ms on Unix is Latin. */ { "ms-Latn", "ms" }, /* MacOS X has "tg-Cyrl". The default script for tg on Unix is Cyrillic. */ { "tg-Cyrl", "tg" }, /* MacOS X has "tk-Cyrl". Does not yet exist on Unix. */ /* MacOS X has "tt-Cyrl". The default script for tt on Unix is Cyrillic. */ { "tt-Cyrl", "tt" }, /* MacOS X has "zh-Hans", "zh-Hant". Country codes are used to distinguish these on Unix. */ { "zh-Hans", "zh_CN" }, { "zh-Hant", "zh_TW" } }; /* Convert script names (ISO 15924) to Unix conventions. See http://www.unicode.org/iso15924/iso15924-codes.html */ typedef struct { const char script[4+1]; const char unixy[9+1]; } script_entry; static const script_entry script_table[] = { { "Arab", "arabic" }, { "Cyrl", "cyrillic" }, { "Mong", "mongolian" } }; /* Step 1: Convert using legacy_table. */ if (name[0] >= 'A' && name[0] <= 'Z') { unsigned int i1, i2; i1 = 0; i2 = sizeof (legacy_table) / sizeof (legacy_entry); while (i2 - i1 > 1) { /* At this point we know that if name occurs in legacy_table, its index must be >= i1 and < i2. */ unsigned int i = (i1 + i2) >> 1; const legacy_entry *p = &legacy_table[i]; if (strcmp (name, p->legacy) < 0) i2 = i; else i1 = i; } if (strcmp (name, legacy_table[i1].legacy) == 0) { strcpy (name, legacy_table[i1].unixy); return; } } /* Step 2: Convert using langtag_table and script_table. */ if (strlen (name) == 7 && name[2] == '-') { unsigned int i1, i2; i1 = 0; i2 = sizeof (langtag_table) / sizeof (langtag_entry); while (i2 - i1 > 1) { /* At this point we know that if name occurs in langtag_table, its index must be >= i1 and < i2. */ unsigned int i = (i1 + i2) >> 1; const langtag_entry *p = &langtag_table[i]; if (strcmp (name, p->langtag) < 0) i2 = i; else i1 = i; } if (strcmp (name, langtag_table[i1].langtag) == 0) { strcpy (name, langtag_table[i1].unixy); return; } i1 = 0; i2 = sizeof (script_table) / sizeof (script_entry); while (i2 - i1 > 1) { /* At this point we know that if (name + 3) occurs in script_table, its index must be >= i1 and < i2. */ unsigned int i = (i1 + i2) >> 1; const script_entry *p = &script_table[i]; if (strcmp (name + 3, p->script) < 0) i2 = i; else i1 = i; } if (strcmp (name + 3, script_table[i1].script) == 0) { name[2] = '@'; strcpy (name + 3, script_table[i1].unixy); return; } } /* Step 3: Convert new-style dash to Unix underscore. */ { char *p; for (p = name; *p != '\0'; p++) if (*p == '-') *p = '_'; } } #endif /* XPG3 defines the result of 'setlocale (category, NULL)' as: "Directs 'setlocale()' to query 'category' and return the current setting of 'local'." However it does not specify the exact format. Neither do SUSV2 and ISO C 99. So we can use this feature only on selected systems (e.g. those using GNU C Library). */ #if defined _LIBC || (defined __GLIBC__ && __GLIBC__ >= 2) # define HAVE_LOCALE_NULL #endif /* Determine the current locale's name, and canonicalize it into XPG syntax language[_territory][.codeset][@modifier] The codeset part in the result is not reliable; the locale_charset() should be used for codeset information instead. The result must not be freed; it is statically allocated. */ const char * _nl_locale_name_posix (int category, const char *categoryname) { /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'. On some systems this can be done by the 'setlocale' function itself. */ #if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL return setlocale (category, NULL); #else const char *retval; /* Setting of LC_ALL overrides all other. */ retval = getenv ("LC_ALL"); if (retval != NULL && retval[0] != '\0') return retval; /* Next comes the name of the desired category. */ retval = getenv (categoryname); if (retval != NULL && retval[0] != '\0') return retval; /* Last possibility is the LANG environment variable. */ retval = getenv ("LANG"); if (retval != NULL && retval[0] != '\0') return retval; return NULL; #endif } const char * _nl_locale_name_default (void) { /* POSIX:2001 says: "All implementations shall define a locale as the default locale, to be invoked when no environment variables are set, or set to the empty string. This default locale can be the POSIX locale or any other implementation-defined locale. Some implementations may provide facilities for local installation administrators to set the default locale, customizing it for each location. POSIX:2001 does not require such a facility. */ #if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE || defined(WIN32_NATIVE)) /* The system does not have a way of setting the locale, other than the POSIX specified environment variables. We use C as default locale. */ return "C"; #else /* Return an XPG style locale name language[_territory][@modifier]. Don't even bother determining the codeset; it's not useful in this context, because message catalogs are not specific to a single codeset. */ # if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.2 or newer */ { /* Cache the locale name, since CoreFoundation calls are expensive. */ static const char *cached_localename; if (cached_localename == NULL) { char namebuf[256]; # if HAVE_CFLOCALECOPYCURRENT /* MacOS X 10.3 or newer */ CFLocaleRef locale = CFLocaleCopyCurrent (); CFStringRef name = CFLocaleGetIdentifier (locale); if (CFStringGetCString (name, namebuf, sizeof(namebuf), kCFStringEncodingASCII)) { _nl_locale_name_canonicalize (namebuf); cached_localename = strdup (namebuf); } CFRelease (locale); # elif HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.2 or newer */ CFTypeRef value = CFPreferencesCopyAppValue (CFSTR ("AppleLocale"), kCFPreferencesCurrentApplication); if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID () && CFStringGetCString ((CFStringRef)value, namebuf, sizeof(namebuf), kCFStringEncodingASCII)) { _nl_locale_name_canonicalize (namebuf); cached_localename = strdup (namebuf); } # endif if (cached_localename == NULL) cached_localename = "C"; } return cached_localename; } # endif # if defined(WIN32_NATIVE) /* WIN32, not Cygwin */ { LCID lcid; LANGID langid; int primary, sub; /* Use native Win32 API locale ID. */ lcid = GetThreadLocale (); /* Strip off the sorting rules, keep only the language part. */ langid = LANGIDFROMLCID (lcid); /* Split into language and territory part. */ primary = PRIMARYLANGID (langid); sub = SUBLANGID (langid); /* Dispatch on language. See also http://www.unicode.org/unicode/onlinedat/languages.html . For details about languages, see http://www.ethnologue.com/ . */ switch (primary) { case LANG_AFRIKAANS: return "af_ZA"; case LANG_ALBANIAN: return "sq_AL"; case LANG_AMHARIC: return "am_ET"; case LANG_ARABIC: switch (sub) { case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA"; case SUBLANG_ARABIC_IRAQ: return "ar_IQ"; case SUBLANG_ARABIC_EGYPT: return "ar_EG"; case SUBLANG_ARABIC_LIBYA: return "ar_LY"; case SUBLANG_ARABIC_ALGERIA: return "ar_DZ"; case SUBLANG_ARABIC_MOROCCO: return "ar_MA"; case SUBLANG_ARABIC_TUNISIA: return "ar_TN"; case SUBLANG_ARABIC_OMAN: return "ar_OM"; case SUBLANG_ARABIC_YEMEN: return "ar_YE"; case SUBLANG_ARABIC_SYRIA: return "ar_SY"; case SUBLANG_ARABIC_JORDAN: return "ar_JO"; case SUBLANG_ARABIC_LEBANON: return "ar_LB"; case SUBLANG_ARABIC_KUWAIT: return "ar_KW"; case SUBLANG_ARABIC_UAE: return "ar_AE"; case SUBLANG_ARABIC_BAHRAIN: return "ar_BH"; case SUBLANG_ARABIC_QATAR: return "ar_QA"; } return "ar"; case LANG_ARMENIAN: return "hy_AM"; case LANG_ASSAMESE: return "as_IN"; case LANG_AZERI: switch (sub) { /* FIXME: Adjust this when Azerbaijani locales appear on Unix. */ case SUBLANG_AZERI_LATIN: return "az_AZ@latin"; case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic"; } return "az"; case LANG_BASQUE: switch (sub) { case SUBLANG_DEFAULT: return "eu_ES"; } return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR". */ case LANG_BELARUSIAN: return "be_BY"; case LANG_BENGALI: switch (sub) { case SUBLANG_BENGALI_INDIA: return "bn_IN"; case SUBLANG_BENGALI_BANGLADESH: return "bn_BD"; } return "bn"; case LANG_BULGARIAN: return "bg_BG"; case LANG_BURMESE: return "my_MM"; case LANG_CAMBODIAN: return "km_KH"; case LANG_CATALAN: return "ca_ES"; case LANG_CHEROKEE: return "chr_US"; case LANG_CHINESE: switch (sub) { case SUBLANG_CHINESE_TRADITIONAL: return "zh_TW"; case SUBLANG_CHINESE_SIMPLIFIED: return "zh_CN"; case SUBLANG_CHINESE_HONGKONG: return "zh_HK"; case SUBLANG_CHINESE_SINGAPORE: return "zh_SG"; case SUBLANG_CHINESE_MACAU: return "zh_MO"; } return "zh"; case LANG_CROATIAN: /* LANG_CROATIAN == LANG_SERBIAN * What used to be called Serbo-Croatian * should really now be two separate * languages because of political reasons. * (Says tml, who knows nothing about Serbian * or Croatian.) * (I can feel those flames coming already.) */ switch (sub) { case SUBLANG_DEFAULT: return "hr_HR"; case SUBLANG_SERBIAN_LATIN: return "sr_CS"; case SUBLANG_SERBIAN_CYRILLIC: return "sr_CS@cyrillic"; } return "hr"; case LANG_CZECH: return "cs_CZ"; case LANG_DANISH: return "da_DK"; case LANG_DIVEHI: return "dv_MV"; case LANG_DUTCH: switch (sub) { case SUBLANG_DUTCH: return "nl_NL"; case SUBLANG_DUTCH_BELGIAN: /* FLEMISH, VLAAMS */ return "nl_BE"; } return "nl"; case LANG_EDO: return "bin_NG"; case LANG_ENGLISH: switch (sub) { /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought * English was the language spoken in England. * Oh well. */ case SUBLANG_ENGLISH_US: return "en_US"; case SUBLANG_ENGLISH_UK: return "en_GB"; case SUBLANG_ENGLISH_AUS: return "en_AU"; case SUBLANG_ENGLISH_CAN: return "en_CA"; case SUBLANG_ENGLISH_NZ: return "en_NZ"; case SUBLANG_ENGLISH_EIRE: return "en_IE"; case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA"; case SUBLANG_ENGLISH_JAMAICA: return "en_JM"; case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */ case SUBLANG_ENGLISH_BELIZE: return "en_BZ"; case SUBLANG_ENGLISH_TRINIDAD: return "en_TT"; case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW"; case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH"; case SUBLANG_ENGLISH_INDONESIA: return "en_ID"; case SUBLANG_ENGLISH_HONGKONG: return "en_HK"; case SUBLANG_ENGLISH_INDIA: return "en_IN"; case SUBLANG_ENGLISH_MALAYSIA: return "en_MY"; case SUBLANG_ENGLISH_SINGAPORE: return "en_SG"; } return "en"; case LANG_ESTONIAN: return "et_EE"; case LANG_FAEROESE: return "fo_FO"; case LANG_FARSI: return "fa_IR"; case LANG_FINNISH: return "fi_FI"; case LANG_FRENCH: switch (sub) { case SUBLANG_FRENCH: return "fr_FR"; case SUBLANG_FRENCH_BELGIAN: /* WALLOON */ return "fr_BE"; case SUBLANG_FRENCH_CANADIAN: return "fr_CA"; case SUBLANG_FRENCH_SWISS: return "fr_CH"; case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU"; case SUBLANG_FRENCH_MONACO: return "fr_MC"; case SUBLANG_FRENCH_WESTINDIES: return "fr"; /* Caribbean? */ case SUBLANG_FRENCH_REUNION: return "fr_RE"; case SUBLANG_FRENCH_CONGO: return "fr_CG"; case SUBLANG_FRENCH_SENEGAL: return "fr_SN"; case SUBLANG_FRENCH_CAMEROON: return "fr_CM"; case SUBLANG_FRENCH_COTEDIVOIRE: return "fr_CI"; case SUBLANG_FRENCH_MALI: return "fr_ML"; case SUBLANG_FRENCH_MOROCCO: return "fr_MA"; case SUBLANG_FRENCH_HAITI: return "fr_HT"; } return "fr"; case LANG_FRISIAN: return "fy_NL"; case LANG_FULFULDE: /* Spoken in Nigeria, Guinea, Senegal, Mali, Niger, Cameroon, Benin. */ return "ff_NG"; case LANG_GAELIC: switch (sub) { case 0x01: /* SCOTTISH */ return "gd_GB"; case 0x02: /* IRISH */ return "ga_IE"; } return "C"; case LANG_GALICIAN: return "gl_ES"; case LANG_GEORGIAN: return "ka_GE"; case LANG_GERMAN: switch (sub) { case SUBLANG_GERMAN: return "de_DE"; case SUBLANG_GERMAN_SWISS: return "de_CH"; case SUBLANG_GERMAN_AUSTRIAN: return "de_AT"; case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU"; case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI"; } return "de"; case LANG_GREEK: return "el_GR"; case LANG_GUARANI: return "gn_PY"; case LANG_GUJARATI: return "gu_IN"; case LANG_HAUSA: return "ha_NG"; case LANG_HAWAIIAN: /* FIXME: Do they mean Hawaiian ("haw_US", 1000 speakers) or Hawaii Creole English ("cpe_US", 600000 speakers)? */ return "cpe_US"; case LANG_HEBREW: return "he_IL"; case LANG_HINDI: return "hi_IN"; case LANG_HUNGARIAN: return "hu_HU"; case LANG_IBIBIO: return "nic_NG"; case LANG_ICELANDIC: return "is_IS"; case LANG_IGBO: return "ig_NG"; case LANG_INDONESIAN: return "id_ID"; case LANG_INUKTITUT: return "iu_CA"; case LANG_ITALIAN: switch (sub) { case SUBLANG_ITALIAN: return "it_IT"; case SUBLANG_ITALIAN_SWISS: return "it_CH"; } return "it"; case LANG_JAPANESE: return "ja_JP"; case LANG_KANNADA: return "kn_IN"; case LANG_KANURI: return "kr_NG"; case LANG_KASHMIRI: switch (sub) { case SUBLANG_DEFAULT: return "ks_PK"; case SUBLANG_KASHMIRI_INDIA: return "ks_IN"; } return "ks"; case LANG_KAZAK: return "kk_KZ"; case LANG_KONKANI: /* FIXME: Adjust this when such locales appear on Unix. */ return "kok_IN"; case LANG_KOREAN: return "ko_KR"; case LANG_KYRGYZ: return "ky_KG"; case LANG_LAO: return "lo_LA"; case LANG_LATIN: return "la_VA"; case LANG_LATVIAN: return "lv_LV"; case LANG_LITHUANIAN: return "lt_LT"; case LANG_MACEDONIAN: return "mk_MK"; case LANG_MALAY: switch (sub) { case SUBLANG_MALAY_MALAYSIA: return "ms_MY"; case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN"; } return "ms"; case LANG_MALAYALAM: return "ml_IN"; case LANG_MALTESE: return "mt_MT"; case LANG_MANIPURI: /* FIXME: Adjust this when such locales appear on Unix. */ return "mni_IN"; case LANG_MARATHI: return "mr_IN"; case LANG_MONGOLIAN: switch (sub) { case SUBLANG_DEFAULT: return "mn_MN"; } return "mn"; /* Ambiguous: could be "mn_CN" or "mn_MN". */ case LANG_NEPALI: switch (sub) { case SUBLANG_DEFAULT: return "ne_NP"; case SUBLANG_NEPALI_INDIA: return "ne_IN"; } return "ne"; case LANG_NORWEGIAN: switch (sub) { case SUBLANG_NORWEGIAN_BOKMAL: return "nb_NO"; case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO"; } return "no"; case LANG_ORIYA: return "or_IN"; case LANG_OROMO: return "om_ET"; case LANG_PAPIAMENTU: return "pap_AN"; case LANG_PASHTO: return "ps"; /* Ambiguous: could be "ps_PK" or "ps_AF". */ case LANG_POLISH: return "pl_PL"; case LANG_PORTUGUESE: switch (sub) { case SUBLANG_PORTUGUESE: return "pt_PT"; /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT. Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */ case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR"; } return "pt"; case LANG_PUNJABI: switch (sub) { case SUBLANG_PUNJABI_INDIA: return "pa_IN"; /* Gurmukhi script */ case SUBLANG_PUNJABI_PAKISTAN: return "pa_PK"; /* Arabic script */ } return "pa"; case LANG_RHAETO_ROMANCE: return "rm_CH"; case LANG_ROMANIAN: switch (sub) { case SUBLANG_ROMANIAN_ROMANIA: return "ro_RO"; case SUBLANG_ROMANIAN_MOLDOVA: return "ro_MD"; } return "ro"; case LANG_RUSSIAN: switch (sub) { case SUBLANG_DEFAULT: return "ru_RU"; } return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA" or "ru_MD". */ case LANG_SAAMI: /* actually Northern Sami */ return "se_NO"; case LANG_SANSKRIT: return "sa_IN"; case LANG_SINDHI: switch (sub) { case SUBLANG_SINDHI_INDIA: return "sd_IN"; case SUBLANG_SINDHI_PAKISTAN: return "sd_PK"; } return "sd"; case LANG_SINHALESE: return "si_LK"; case LANG_SLOVAK: return "sk_SK"; case LANG_SLOVENIAN: return "sl_SI"; case LANG_SOMALI: return "so_SO"; case LANG_SORBIAN: /* FIXME: Adjust this when such locales appear on Unix. */ return "wen_DE"; case LANG_SPANISH: switch (sub) { case SUBLANG_SPANISH: return "es_ES"; case SUBLANG_SPANISH_MEXICAN: return "es_MX"; case SUBLANG_SPANISH_MODERN: return "es_ES@modern"; /* not seen on Unix */ case SUBLANG_SPANISH_GUATEMALA: return "es_GT"; case SUBLANG_SPANISH_COSTA_RICA: return "es_CR"; case SUBLANG_SPANISH_PANAMA: return "es_PA"; case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO"; case SUBLANG_SPANISH_VENEZUELA: return "es_VE"; case SUBLANG_SPANISH_COLOMBIA: return "es_CO"; case SUBLANG_SPANISH_PERU: return "es_PE"; case SUBLANG_SPANISH_ARGENTINA: return "es_AR"; case SUBLANG_SPANISH_ECUADOR: return "es_EC"; case SUBLANG_SPANISH_CHILE: return "es_CL"; case SUBLANG_SPANISH_URUGUAY: return "es_UY"; case SUBLANG_SPANISH_PARAGUAY: return "es_PY"; case SUBLANG_SPANISH_BOLIVIA: return "es_BO"; case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV"; case SUBLANG_SPANISH_HONDURAS: return "es_HN"; case SUBLANG_SPANISH_NICARAGUA: return "es_NI"; case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR"; } return "es"; case LANG_SUTU: return "bnt_TZ"; /* or "st_LS" or "nso_ZA"? */ case LANG_SWAHILI: return "sw_KE"; case LANG_SWEDISH: switch (sub) { case SUBLANG_DEFAULT: return "sv_SE"; case SUBLANG_SWEDISH_FINLAND: return "sv_FI"; } return "sv"; case LANG_SYRIAC: return "syr_TR"; /* An extinct language. */ case LANG_TAGALOG: return "tl_PH"; case LANG_TAJIK: return "tg_TJ"; case LANG_TAMAZIGHT: switch (sub) { /* FIXME: Adjust this when Tamazight locales appear on Unix. */ case SUBLANG_TAMAZIGHT_ARABIC: return "ber_MA@arabic"; case SUBLANG_TAMAZIGHT_LATIN: return "ber_MA@latin"; } return "ber_MA"; case LANG_TAMIL: switch (sub) { case SUBLANG_DEFAULT: return "ta_IN"; } return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG". */ case LANG_TATAR: return "tt_RU"; case LANG_TELUGU: return "te_IN"; case LANG_THAI: return "th_TH"; case LANG_TIBETAN: return "bo_CN"; case LANG_TIGRINYA: switch (sub) { case SUBLANG_TIGRINYA_ETHIOPIA: return "ti_ET"; case SUBLANG_TIGRINYA_ERITREA: return "ti_ER"; } return "ti"; case LANG_TSONGA: return "ts_ZA"; case LANG_TSWANA: return "tn_BW"; case LANG_TURKISH: return "tr_TR"; case LANG_TURKMEN: return "tk_TM"; case LANG_UKRAINIAN: return "uk_UA"; case LANG_URDU: switch (sub) { case SUBLANG_URDU_PAKISTAN: return "ur_PK"; case SUBLANG_URDU_INDIA: return "ur_IN"; } return "ur"; case LANG_UZBEK: switch (sub) { case SUBLANG_UZBEK_LATIN: return "uz_UZ"; case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic"; } return "uz"; case LANG_VENDA: return "ve_ZA"; case LANG_VIETNAMESE: return "vi_VN"; case LANG_WELSH: return "cy_GB"; case LANG_XHOSA: return "xh_ZA"; case LANG_YI: return "sit_CN"; case LANG_YIDDISH: return "yi_IL"; case LANG_YORUBA: return "yo_NG"; case LANG_ZULU: return "zu_ZA"; default: return "C"; } } # endif #endif } const char * _nl_locale_name (int category, const char *categoryname) { const char *retval; retval = _nl_locale_name_posix (category, categoryname); if (retval != NULL) return retval; return _nl_locale_name_default (); } pbbuttonsd-0.8.1a/intl/log.c0000644000175000017500000000623110641705131012661 00000000000000/* Log file output. Copyright (C) 2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Bruno Haible . */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include /* Handle multi-threaded applications. */ #ifdef _LIBC # include #else # include "lock.h" #endif /* Print an ASCII string with quotes and escape sequences where needed. */ static void print_escaped (FILE *stream, const char *str) { putc ('"', stream); for (; *str != '\0'; str++) if (*str == '\n') { fputs ("\\n\"", stream); if (str[1] == '\0') return; fputs ("\n\"", stream); } else { if (*str == '"' || *str == '\\') putc ('\\', stream); putc (*str, stream); } putc ('"', stream); } static char *last_logfilename = NULL; static FILE *last_logfile = NULL; __libc_lock_define_initialized (static, lock) static inline void _nl_log_untranslated_locked (const char *logfilename, const char *domainname, const char *msgid1, const char *msgid2, int plural) { FILE *logfile; /* Can we reuse the last opened logfile? */ if (last_logfilename == NULL || strcmp (logfilename, last_logfilename) != 0) { /* Close the last used logfile. */ if (last_logfilename != NULL) { if (last_logfile != NULL) { fclose (last_logfile); last_logfile = NULL; } free (last_logfilename); last_logfilename = NULL; } /* Open the logfile. */ last_logfilename = (char *) malloc (strlen (logfilename) + 1); if (last_logfilename == NULL) return; strcpy (last_logfilename, logfilename); last_logfile = fopen (logfilename, "a"); if (last_logfile == NULL) return; } logfile = last_logfile; fprintf (logfile, "domain "); print_escaped (logfile, domainname); fprintf (logfile, "\nmsgid "); print_escaped (logfile, msgid1); if (plural) { fprintf (logfile, "\nmsgid_plural "); print_escaped (logfile, msgid2); fprintf (logfile, "\nmsgstr[0] \"\"\n"); } else fprintf (logfile, "\nmsgstr \"\"\n"); putc ('\n', logfile); } /* Add to the log file an entry denoting a failed translation. */ void _nl_log_untranslated (const char *logfilename, const char *domainname, const char *msgid1, const char *msgid2, int plural) { __libc_lock_lock (lock); _nl_log_untranslated_locked (logfilename, domainname, msgid1, msgid2, plural); __libc_lock_unlock (lock); } pbbuttonsd-0.8.1a/intl/printf.c0000644000175000017500000002170310641705132013404 00000000000000/* Formatted output to strings, using POSIX/XSI format strings with positions. Copyright (C) 2003, 2006 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #ifdef __GNUC__ # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else # ifdef _MSC_VER # include # define alloca _alloca # else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif # endif #endif #include #if !HAVE_POSIX_PRINTF #include #include #include #include /* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */ #ifndef EOVERFLOW # define EOVERFLOW E2BIG #endif /* When building a DLL, we must export some functions. Note that because the functions are only defined for binary backward compatibility, we don't need to use __declspec(dllimport) in any case. */ #if defined _MSC_VER && BUILDING_DLL # define DLL_EXPORTED __declspec(dllexport) #else # define DLL_EXPORTED #endif #define STATIC static /* This needs to be consistent with libgnuintl.h.in. */ #if defined __NetBSD__ || defined __CYGWIN__ || defined __MINGW32__ /* Don't break __attribute__((format(printf,M,N))). This redefinition is only possible because the libc in NetBSD, Cygwin, mingw does not have a function __printf__. */ # define libintl_printf __printf__ #endif /* Define auxiliary functions declared in "printf-args.h". */ #include "printf-args.c" /* Define auxiliary functions declared in "printf-parse.h". */ #include "printf-parse.c" /* Define functions declared in "vasnprintf.h". */ #define vasnprintf libintl_vasnprintf #include "vasnprintf.c" #if 0 /* not needed */ #define asnprintf libintl_asnprintf #include "asnprintf.c" #endif DLL_EXPORTED int libintl_vfprintf (FILE *stream, const char *format, va_list args) { if (strchr (format, '$') == NULL) return vfprintf (stream, format, args); else { size_t length; char *result = libintl_vasnprintf (NULL, &length, format, args); int retval = -1; if (result != NULL) { size_t written = fwrite (result, 1, length, stream); free (result); if (written == length) { if (length > INT_MAX) errno = EOVERFLOW; else retval = length; } } return retval; } } DLL_EXPORTED int libintl_fprintf (FILE *stream, const char *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vfprintf (stream, format, args); va_end (args); return retval; } DLL_EXPORTED int libintl_vprintf (const char *format, va_list args) { return libintl_vfprintf (stdout, format, args); } DLL_EXPORTED int libintl_printf (const char *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vprintf (format, args); va_end (args); return retval; } DLL_EXPORTED int libintl_vsprintf (char *resultbuf, const char *format, va_list args) { if (strchr (format, '$') == NULL) return vsprintf (resultbuf, format, args); else { size_t length = (size_t) ~0 / (4 * sizeof (char)); char *result = libintl_vasnprintf (resultbuf, &length, format, args); if (result != resultbuf) { free (result); return -1; } if (length > INT_MAX) { errno = EOVERFLOW; return -1; } else return length; } } DLL_EXPORTED int libintl_sprintf (char *resultbuf, const char *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vsprintf (resultbuf, format, args); va_end (args); return retval; } #if HAVE_SNPRINTF # if HAVE_DECL__SNPRINTF /* Windows. */ # define system_vsnprintf _vsnprintf # else /* Unix. */ # define system_vsnprintf vsnprintf # endif DLL_EXPORTED int libintl_vsnprintf (char *resultbuf, size_t length, const char *format, va_list args) { if (strchr (format, '$') == NULL) return system_vsnprintf (resultbuf, length, format, args); else { size_t maxlength = length; char *result = libintl_vasnprintf (resultbuf, &length, format, args); if (result != resultbuf) { if (maxlength > 0) { size_t pruned_length = (length < maxlength ? length : maxlength - 1); memcpy (resultbuf, result, pruned_length); resultbuf[pruned_length] = '\0'; } free (result); } if (length > INT_MAX) { errno = EOVERFLOW; return -1; } else return length; } } DLL_EXPORTED int libintl_snprintf (char *resultbuf, size_t length, const char *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vsnprintf (resultbuf, length, format, args); va_end (args); return retval; } #endif #if HAVE_ASPRINTF DLL_EXPORTED int libintl_vasprintf (char **resultp, const char *format, va_list args) { size_t length; char *result = libintl_vasnprintf (NULL, &length, format, args); if (result == NULL) return -1; if (length > INT_MAX) { free (result); errno = EOVERFLOW; return -1; } *resultp = result; return length; } DLL_EXPORTED int libintl_asprintf (char **resultp, const char *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vasprintf (resultp, format, args); va_end (args); return retval; } #endif #if HAVE_FWPRINTF #include #define WIDE_CHAR_VERSION 1 /* Define auxiliary functions declared in "wprintf-parse.h". */ #include "printf-parse.c" /* Define functions declared in "vasnprintf.h". */ #define vasnwprintf libintl_vasnwprintf #include "vasnprintf.c" #if 0 /* not needed */ #define asnwprintf libintl_asnwprintf #include "asnprintf.c" #endif # if HAVE_DECL__SNWPRINTF /* Windows. */ # define system_vswprintf _vsnwprintf # else /* Unix. */ # define system_vswprintf vswprintf # endif DLL_EXPORTED int libintl_vfwprintf (FILE *stream, const wchar_t *format, va_list args) { if (wcschr (format, '$') == NULL) return vfwprintf (stream, format, args); else { size_t length; wchar_t *result = libintl_vasnwprintf (NULL, &length, format, args); int retval = -1; if (result != NULL) { size_t i; for (i = 0; i < length; i++) if (fputwc (result[i], stream) == WEOF) break; free (result); if (i == length) { if (length > INT_MAX) errno = EOVERFLOW; else retval = length; } } return retval; } } DLL_EXPORTED int libintl_fwprintf (FILE *stream, const wchar_t *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vfwprintf (stream, format, args); va_end (args); return retval; } DLL_EXPORTED int libintl_vwprintf (const wchar_t *format, va_list args) { return libintl_vfwprintf (stdout, format, args); } DLL_EXPORTED int libintl_wprintf (const wchar_t *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vwprintf (format, args); va_end (args); return retval; } DLL_EXPORTED int libintl_vswprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, va_list args) { if (wcschr (format, '$') == NULL) return system_vswprintf (resultbuf, length, format, args); else { size_t maxlength = length; wchar_t *result = libintl_vasnwprintf (resultbuf, &length, format, args); if (result != resultbuf) { if (maxlength > 0) { size_t pruned_length = (length < maxlength ? length : maxlength - 1); memcpy (resultbuf, result, pruned_length * sizeof (wchar_t)); resultbuf[pruned_length] = 0; } free (result); /* Unlike vsnprintf, which has to return the number of character that would have been produced if the resultbuf had been sufficiently large, the vswprintf function has to return a negative value if the resultbuf was not sufficiently large. */ if (length >= maxlength) return -1; } if (length > INT_MAX) { errno = EOVERFLOW; return -1; } else return length; } } DLL_EXPORTED int libintl_swprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vswprintf (resultbuf, length, format, args); va_end (args); return retval; } #endif #endif pbbuttonsd-0.8.1a/intl/version.c0000644000175000017500000000173110641705137013573 00000000000000/* libintl library version. Copyright (C) 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "libgnuintl.h" /* Version number: (major<<16) + (minor<<8) + subminor */ int libintl_version = LIBINTL_VERSION; pbbuttonsd-0.8.1a/intl/osdep.c0000644000175000017500000000174110641705131013213 00000000000000/* OS dependent parts of libintl. Copyright (C) 2001-2002, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if defined __CYGWIN__ # include "intl-exports.c" #elif defined __EMX__ # include "os2compat.c" #else /* Avoid AIX compiler warning. */ typedef int dummy; #endif pbbuttonsd-0.8.1a/intl/os2compat.c0000644000175000017500000000550710641705131014014 00000000000000/* OS/2 compatibility functions. Copyright (C) 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define OS2_AWARE #ifdef HAVE_CONFIG_H #include #endif #include #include #include /* A version of getenv() that works from DLLs */ extern unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue); char * _nl_getenv (const char *name) { unsigned char *value; if (DosScanEnv (name, &value)) return NULL; else return value; } /* A fixed size buffer. */ char libintl_nl_default_dirname[MAXPATHLEN+1]; char *_nlos2_libdir = NULL; char *_nlos2_localealiaspath = NULL; char *_nlos2_localedir = NULL; static __attribute__((constructor)) void nlos2_initialize () { char *root = getenv ("UNIXROOT"); char *gnulocaledir = getenv ("GNULOCALEDIR"); _nlos2_libdir = gnulocaledir; if (!_nlos2_libdir) { if (root) { size_t sl = strlen (root); _nlos2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1); memcpy (_nlos2_libdir, root, sl); memcpy (_nlos2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1); } else _nlos2_libdir = LIBDIR; } _nlos2_localealiaspath = gnulocaledir; if (!_nlos2_localealiaspath) { if (root) { size_t sl = strlen (root); _nlos2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1); memcpy (_nlos2_localealiaspath, root, sl); memcpy (_nlos2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1); } else _nlos2_localealiaspath = LOCALE_ALIAS_PATH; } _nlos2_localedir = gnulocaledir; if (!_nlos2_localedir) { if (root) { size_t sl = strlen (root); _nlos2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1); memcpy (_nlos2_localedir, root, sl); memcpy (_nlos2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1); } else _nlos2_localedir = LOCALEDIR; } if (strlen (_nlos2_localedir) <= MAXPATHLEN) strcpy (libintl_nl_default_dirname, _nlos2_localedir); } pbbuttonsd-0.8.1a/intl/intl-exports.c0000644000175000017500000000273310641705134014556 00000000000000/* List of exported symbols of libintl on Cygwin. Copyright (C) 2006 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* IMP(x) is a symbol that contains the address of x. */ #define IMP(x) _imp__##x /* Ensure that the variable x is exported from the library, and that a pseudo-variable IMP(x) is available. */ #define VARIABLE(x) \ /* Export x without redefining x. This code was found by compiling a \ snippet: \ extern __declspec(dllexport) int x; int x = 42; */ \ asm (".section .drectve\n"); \ asm (".ascii \" -export:" #x ",data\"\n"); \ asm (".data\n"); \ /* Allocate a pseudo-variable IMP(x). */ \ extern int x; \ void * IMP(x) = &x; VARIABLE(libintl_version) pbbuttonsd-0.8.1a/intl/intl-compat.c0000644000175000017500000000662410641705130014334 00000000000000/* intl-compat.c - Stub functions to call gettext functions from GNU gettext Library. Copyright (C) 1995, 2000-2003, 2005 Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" /* @@ end of prolog @@ */ /* This file redirects the gettext functions (without prefix) to those defined in the included GNU libintl library (with "libintl_" prefix). It is compiled into libintl in order to make the AM_GNU_GETTEXT test of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which has the redirections primarily in the include file. It is also compiled into libgnuintl so that libgnuintl.so can be used as LD_PRELOADable library on glibc systems, to provide the extra features that the functions in the libc don't have (namely, logging). */ #undef gettext #undef dgettext #undef dcgettext #undef ngettext #undef dngettext #undef dcngettext #undef textdomain #undef bindtextdomain #undef bind_textdomain_codeset /* When building a DLL, we must export some functions. Note that because the functions are only defined for binary backward compatibility, we don't need to use __declspec(dllimport) in any case. */ #if HAVE_VISIBILITY && BUILDING_DLL # define DLL_EXPORTED __attribute__((__visibility__("default"))) #elif defined _MSC_VER && BUILDING_DLL # define DLL_EXPORTED __declspec(dllexport) #else # define DLL_EXPORTED #endif DLL_EXPORTED char * gettext (const char *msgid) { return libintl_gettext (msgid); } DLL_EXPORTED char * dgettext (const char *domainname, const char *msgid) { return libintl_dgettext (domainname, msgid); } DLL_EXPORTED char * dcgettext (const char *domainname, const char *msgid, int category) { return libintl_dcgettext (domainname, msgid, category); } DLL_EXPORTED char * ngettext (const char *msgid1, const char *msgid2, unsigned long int n) { return libintl_ngettext (msgid1, msgid2, n); } DLL_EXPORTED char * dngettext (const char *domainname, const char *msgid1, const char *msgid2, unsigned long int n) { return libintl_dngettext (domainname, msgid1, msgid2, n); } DLL_EXPORTED char * dcngettext (const char *domainname, const char *msgid1, const char *msgid2, unsigned long int n, int category) { return libintl_dcngettext (domainname, msgid1, msgid2, n, category); } DLL_EXPORTED char * textdomain (const char *domainname) { return libintl_textdomain (domainname); } DLL_EXPORTED char * bindtextdomain (const char *domainname, const char *dirname) { return libintl_bindtextdomain (domainname, dirname); } DLL_EXPORTED char * bind_textdomain_codeset (const char *domainname, const char *codeset) { return libintl_bind_textdomain_codeset (domainname, codeset); } pbbuttonsd-0.8.1a/intl/plural.c0000644000175000017500000011073410641705132013404 00000000000000/* A Bison parser, made from plural.y by GNU bison 1.35. */ #define YYBISON 1 /* Identify Bison output. */ #define yyparse __gettextparse #define yylex __gettextlex #define yyerror __gettexterror #define yylval __gettextlval #define yychar __gettextchar #define yydebug __gettextdebug #define yynerrs __gettextnerrs # define EQUOP2 257 # define CMPOP2 258 # define ADDOP2 259 # define MULOP2 260 # define NUMBER 261 #line 1 "plural.y" /* Expression parsing for plural form selection. Copyright (C) 2000-2001, 2003, 2005 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* For bison < 2.0, the bison generated parser uses alloca. AIX 3 forces us to put this declaration at the beginning of the file. The declaration in bison's skeleton file comes too late. This must come before because may include arbitrary system headers. This can go away once the AM_INTL_SUBDIR macro requires bison >= 2.0. */ #if defined _AIX && !defined __GNUC__ #pragma alloca #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "plural-exp.h" /* The main function generated by the parser is called __gettextparse, but we want it to be called PLURAL_PARSE. */ #ifndef _LIBC # define __gettextparse PLURAL_PARSE #endif #define YYLEX_PARAM &((struct parse_args *) arg)->cp #define YYPARSE_PARAM arg #line 51 "plural.y" #ifndef YYSTYPE typedef union { unsigned long int num; enum operator op; struct expression *exp; } yystype; # define YYSTYPE yystype # define YYSTYPE_IS_TRIVIAL 1 #endif #line 57 "plural.y" /* Prototypes for local functions. */ static int yylex (YYSTYPE *lval, const char **pexp); static void yyerror (const char *str); /* Allocation of expressions. */ static struct expression * new_exp (int nargs, enum operator op, struct expression * const *args) { int i; struct expression *newp; /* If any of the argument could not be malloc'ed, just return NULL. */ for (i = nargs - 1; i >= 0; i--) if (args[i] == NULL) goto fail; /* Allocate a new expression. */ newp = (struct expression *) malloc (sizeof (*newp)); if (newp != NULL) { newp->nargs = nargs; newp->operation = op; for (i = nargs - 1; i >= 0; i--) newp->val.args[i] = args[i]; return newp; } fail: for (i = nargs - 1; i >= 0; i--) FREE_EXPRESSION (args[i]); return NULL; } static inline struct expression * new_exp_0 (enum operator op) { return new_exp (0, op, NULL); } static inline struct expression * new_exp_1 (enum operator op, struct expression *right) { struct expression *args[1]; args[0] = right; return new_exp (1, op, args); } static struct expression * new_exp_2 (enum operator op, struct expression *left, struct expression *right) { struct expression *args[2]; args[0] = left; args[1] = right; return new_exp (2, op, args); } static inline struct expression * new_exp_3 (enum operator op, struct expression *bexp, struct expression *tbranch, struct expression *fbranch) { struct expression *args[3]; args[0] = bexp; args[1] = tbranch; args[2] = fbranch; return new_exp (3, op, args); } #ifndef YYDEBUG # define YYDEBUG 0 #endif #define YYFINAL 27 #define YYFLAG -32768 #define YYNTBASE 16 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ #define YYTRANSLATE(x) ((unsigned)(x) <= 261 ? yytranslate[x] : 18) /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 10, 2, 2, 2, 2, 5, 2, 14, 15, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 12, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 6, 7, 8, 9, 11 }; #if YYDEBUG static const short yyprhs[] = { 0, 0, 2, 8, 12, 16, 20, 24, 28, 32, 35, 37, 39 }; static const short yyrhs[] = { 17, 0, 17, 3, 17, 12, 17, 0, 17, 4, 17, 0, 17, 5, 17, 0, 17, 6, 17, 0, 17, 7, 17, 0, 17, 8, 17, 0, 17, 9, 17, 0, 10, 17, 0, 13, 0, 11, 0, 14, 17, 15, 0 }; #endif #if YYDEBUG /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const short yyrline[] = { 0, 152, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 201 }; #endif #if (YYDEBUG) || defined YYERROR_VERBOSE /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ static const char *const yytname[] = { "$", "error", "$undefined.", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2", "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'", "start", "exp", 0 }; #endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const short yyr1[] = { 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const short yyr2[] = { 0, 1, 5, 3, 3, 3, 3, 3, 3, 2, 1, 1, 3 }; /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const short yydefact[] = { 0, 0, 11, 10, 0, 1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 3, 4, 5, 6, 7, 8, 0, 2, 0, 0, 0 }; static const short yydefgoto[] = { 25, 5 }; static const short yypact[] = { -9, -9,-32768,-32768, -9, 34,-32768, 11, -9, -9, -9, -9, -9, -9, -9,-32768, 24, 39, 43, 16, 26, -3,-32768, -9, 34, 21, 53,-32768 }; static const short yypgoto[] = { -32768, -1 }; #define YYLAST 53 static const short yytable[] = { 6, 1, 2, 7, 3, 4, 14, 16, 17, 18, 19, 20, 21, 22, 8, 9, 10, 11, 12, 13, 14, 26, 24, 12, 13, 14, 15, 8, 9, 10, 11, 12, 13, 14, 13, 14, 23, 8, 9, 10, 11, 12, 13, 14, 10, 11, 12, 13, 14, 11, 12, 13, 14, 27 }; static const short yycheck[] = { 1, 10, 11, 4, 13, 14, 9, 8, 9, 10, 11, 12, 13, 14, 3, 4, 5, 6, 7, 8, 9, 0, 23, 7, 8, 9, 15, 3, 4, 5, 6, 7, 8, 9, 8, 9, 12, 3, 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 6, 7, 8, 9, 0 }; #define YYPURE 1 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* This is the parser code that is written into each bison parser when the %semantic_parser declaration is not specified in the grammar. It was written by Richard Stallman by simplifying the hairy parser used when %semantic_parser is specified. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) /* The parser invokes alloca or malloc; define the necessary symbols. */ # if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca # else # ifndef YYSTACK_USE_ALLOCA # if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca # else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # else # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif # define YYSTACK_ALLOC malloc # define YYSTACK_FREE free # endif #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short yyss; YYSTYPE yyvs; # if YYLSP_NEEDED YYLTYPE yyls; # endif }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # if YYLSP_NEEDED # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAX) # else # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAX) # endif /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif #if ! defined (YYSIZE_T) && defined (size_t) # define YYSIZE_T size_t #endif #if ! defined (YYSIZE_T) # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif #endif #if ! defined (YYSIZE_T) # define YYSIZE_T unsigned int #endif #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY -2 #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up"); \ YYERROR; \ } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions are run). When YYLLOC_DEFAULT is run, CURRENT is set the location of the first token. By default, to implement support for ranges, extend its range to the last symbol. */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ Current.last_line = Rhs[N].last_line; \ Current.last_column = Rhs[N].last_column; #endif /* YYLEX -- calling `yylex' with the right arguments. */ #if YYPURE # if YYLSP_NEEDED # ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) # else # define YYLEX yylex (&yylval, &yylloc) # endif # else /* !YYLSP_NEEDED */ # ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, YYLEX_PARAM) # else # define YYLEX yylex (&yylval) # endif # endif /* !YYLSP_NEEDED */ #else /* !YYPURE */ # define YYLEX yylex () #endif /* !YYPURE */ /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #if YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #ifdef YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T # if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) # else yystrlen (yystr) const char *yystr; # endif { register const char *yys = yystr; while (*yys++ != '\0') continue; return yys - yystr - 1; } # endif # endif # ifndef yystpcpy # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * # if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) # else yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; # endif { register char *yyd = yydest; register const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif #endif #line 315 "bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. It should actually point to an object. Grammar actions can access the variable by casting it to the proper pointer type. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM # define YYPARSE_PARAM_DECL # else # define YYPARSE_PARAM_ARG YYPARSE_PARAM # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; # endif #else /* !YYPARSE_PARAM */ # define YYPARSE_PARAM_ARG # define YYPARSE_PARAM_DECL #endif /* !YYPARSE_PARAM */ /* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ # ifdef YYPARSE_PARAM int yyparse (void *); # else int yyparse (void); # endif #endif /* YY_DECL_VARIABLES -- depending whether we use a pure parser, variables are global, or local to YYPARSE. */ #define YY_DECL_NON_LSP_VARIABLES \ /* The lookahead symbol. */ \ int yychar; \ \ /* The semantic value of the lookahead symbol. */ \ YYSTYPE yylval; \ \ /* Number of parse errors so far. */ \ int yynerrs; #if YYLSP_NEEDED # define YY_DECL_VARIABLES \ YY_DECL_NON_LSP_VARIABLES \ \ /* Location data for the lookahead symbol. */ \ YYLTYPE yylloc; #else # define YY_DECL_VARIABLES \ YY_DECL_NON_LSP_VARIABLES #endif /* If nonreentrant, generate the variables here. */ #if !YYPURE YY_DECL_VARIABLES #endif /* !YYPURE */ int yyparse (YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL { /* If reentrant, generate the variables here. */ #if YYPURE YY_DECL_VARIABLES #endif /* !YYPURE */ register int yystate; register int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ int yychar1 = 0; /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #if YYLSP_NEEDED /* The location stack. */ YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; #endif #if YYLSP_NEEDED # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else # define YYPOPSTACK (yyvsp--, yyssp--) #endif YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYLSP_NEEDED YYLTYPE yyloc; #endif /* When reducing, the number of symbols on the RHS of the reduced rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; #if YYLSP_NEEDED yylsp = yyls; #endif goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyssp >= yyss + yystacksize - 1) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. */ # if YYLSP_NEEDED YYLTYPE *yyls1 = yyls; /* This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yyls1, yysize * sizeof (*yylsp), &yystacksize); yyls = yyls1; # else yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); # endif yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyoverflowlab; # else /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) goto yyoverflowlab; yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; { short *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # if YYLSP_NEEDED YYSTACK_RELOCATE (yyls); # endif # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; #if YYLSP_NEEDED yylsp = yyls + yysize - 1; #endif YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyssp >= yyss + yystacksize - 1) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYFLAG) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* yychar is either YYEMPTY or YYEOF or a valid token in external form. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } /* Convert token to internal form (in yychar1) for indexing tables with */ if (yychar <= 0) /* This means end of input. */ { yychar1 = 0; yychar = YYEOF; /* Don't call YYLEX any more */ YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yychar1 = YYTRANSLATE (yychar); #if YYDEBUG /* We have to keep this `#if YYDEBUG', since we use variables which are defined only if `YYDEBUG' is set. */ if (yydebug) { YYFPRINTF (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); /* Give the individual parser a way to print the precise meaning of a token, for further debugging info. */ # ifdef YYPRINT YYPRINT (stderr, yychar, yylval); # endif YYFPRINTF (stderr, ")\n"); } #endif } yyn += yychar1; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; yyn = yytable[yyn]; /* yyn is what to do for this token type in this state. Negative => reduce, -yyn is rule number. Positive => shift, yyn is new state. New state is final state => don't bother to shift, just return success. 0, or most negative number => error. */ if (yyn < 0) { if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; #if YYLSP_NEEDED *++yylsp = yylloc; #endif /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to the semantic value of the lookahead token. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; #if YYLSP_NEEDED /* Similarly for the default location. Let the user run additional commands if for instance locations are ranges. */ yyloc = yylsp[1-yylen]; YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); #endif #if YYDEBUG /* We have to keep this `#if YYDEBUG', since we use variables which are defined only if `YYDEBUG' is set. */ if (yydebug) { int yyi; YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", yyn, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); } #endif switch (yyn) { case 1: #line 153 "plural.y" { if (yyvsp[0].exp == NULL) YYABORT; ((struct parse_args *) arg)->res = yyvsp[0].exp; } break; case 2: #line 161 "plural.y" { yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp); } break; case 3: #line 165 "plural.y" { yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp); } break; case 4: #line 169 "plural.y" { yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp); } break; case 5: #line 173 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); } break; case 6: #line 177 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); } break; case 7: #line 181 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); } break; case 8: #line 185 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); } break; case 9: #line 189 "plural.y" { yyval.exp = new_exp_1 (lnot, yyvsp[0].exp); } break; case 10: #line 193 "plural.y" { yyval.exp = new_exp_0 (var); } break; case 11: #line 197 "plural.y" { if ((yyval.exp = new_exp_0 (num)) != NULL) yyval.exp->val.num = yyvsp[0].num; } break; case 12: #line 202 "plural.y" { yyval.exp = yyvsp[-1].exp; } break; } #line 705 "bison.simple" yyvsp -= yylen; yyssp -= yylen; #if YYLSP_NEEDED yylsp -= yylen; #endif #if YYDEBUG if (yydebug) { short *yyssp1 = yyss - 1; YYFPRINTF (stderr, "state stack now"); while (yyssp1 != yyssp) YYFPRINTF (stderr, " %d", *++yyssp1); YYFPRINTF (stderr, "\n"); } #endif *++yyvsp = yyval; #if YYLSP_NEEDED *++yylsp = yyloc; #endif /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTBASE] + *yyssp; if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #ifdef YYERROR_VERBOSE yyn = yypact[yystate]; if (yyn > YYFLAG && yyn < YYLAST) { YYSIZE_T yysize = 0; char *yymsg; int yyx, yycount; yycount = 0; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx) yysize += yystrlen (yytname[yyx]) + 15, yycount++; yysize += yystrlen ("parse error, unexpected ") + 1; yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "parse error, unexpected "); yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); if (yycount < 5) { yycount = 0; for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); yyp = yystpcpy (yyp, yytname[yyx]); yycount++; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("parse error; also virtual memory exhausted"); } else #endif /* defined (YYERROR_VERBOSE) */ yyerror ("parse error"); } goto yyerrlab1; /*--------------------------------------------------. | yyerrlab1 -- error raised explicitly by an action | `--------------------------------------------------*/ yyerrlab1: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ /* return failure if at end of input */ if (yychar == YYEOF) YYABORT; YYDPRINTF ((stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1])); yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ yyerrstatus = 3; /* Each real token shifted decrements this */ goto yyerrhandle; /*-------------------------------------------------------------------. | yyerrdefault -- current state does not do anything special for the | | error token. | `-------------------------------------------------------------------*/ yyerrdefault: #if 0 /* This is wrong; only states that explicitly want error tokens should shift them. */ /* If its default is to accept any token, ok. Otherwise pop it. */ yyn = yydefact[yystate]; if (yyn) goto yydefault; #endif /*---------------------------------------------------------------. | yyerrpop -- pop the current state because it cannot handle the | | error token | `---------------------------------------------------------------*/ yyerrpop: if (yyssp == yyss) YYABORT; yyvsp--; yystate = *--yyssp; #if YYLSP_NEEDED yylsp--; #endif #if YYDEBUG if (yydebug) { short *yyssp1 = yyss - 1; YYFPRINTF (stderr, "Error: state stack now"); while (yyssp1 != yyssp) YYFPRINTF (stderr, " %d", *++yyssp1); YYFPRINTF (stderr, "\n"); } #endif /*--------------. | yyerrhandle. | `--------------*/ yyerrhandle: yyn = yypact[yystate]; if (yyn == YYFLAG) goto yyerrdefault; yyn += YYTERROR; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) goto yyerrdefault; yyn = yytable[yyn]; if (yyn < 0) { if (yyn == YYFLAG) goto yyerrpop; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; #if YYLSP_NEEDED *++yylsp = yylloc; #endif yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; /*---------------------------------------------. | yyoverflowab -- parser overflow comes here. | `---------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ yyreturn: #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 207 "plural.y" void internal_function FREE_EXPRESSION (struct expression *exp) { if (exp == NULL) return; /* Handle the recursive case. */ switch (exp->nargs) { case 3: FREE_EXPRESSION (exp->val.args[2]); /* FALLTHROUGH */ case 2: FREE_EXPRESSION (exp->val.args[1]); /* FALLTHROUGH */ case 1: FREE_EXPRESSION (exp->val.args[0]); /* FALLTHROUGH */ default: break; } free (exp); } static int yylex (YYSTYPE *lval, const char **pexp) { const char *exp = *pexp; int result; while (1) { if (exp[0] == '\0') { *pexp = exp; return YYEOF; } if (exp[0] != ' ' && exp[0] != '\t') break; ++exp; } result = *exp++; switch (result) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { unsigned long int n = result - '0'; while (exp[0] >= '0' && exp[0] <= '9') { n *= 10; n += exp[0] - '0'; ++exp; } lval->num = n; result = NUMBER; } break; case '=': if (exp[0] == '=') { ++exp; lval->op = equal; result = EQUOP2; } else result = YYERRCODE; break; case '!': if (exp[0] == '=') { ++exp; lval->op = not_equal; result = EQUOP2; } break; case '&': case '|': if (exp[0] == result) ++exp; else result = YYERRCODE; break; case '<': if (exp[0] == '=') { ++exp; lval->op = less_or_equal; } else lval->op = less_than; result = CMPOP2; break; case '>': if (exp[0] == '=') { ++exp; lval->op = greater_or_equal; } else lval->op = greater_than; result = CMPOP2; break; case '*': lval->op = mult; result = MULOP2; break; case '/': lval->op = divide; result = MULOP2; break; case '%': lval->op = module; result = MULOP2; break; case '+': lval->op = plus; result = ADDOP2; break; case '-': lval->op = minus; result = ADDOP2; break; case 'n': case '?': case ':': case '(': case ')': /* Nothing, just return the character. */ break; case ';': case '\n': case '\0': /* Be safe and let the user call this function again. */ --exp; result = YYEOF; break; default: result = YYERRCODE; #if YYDEBUG != 0 --exp; #endif break; } *pexp = exp; return result; } static void yyerror (const char *str) { /* Do nothing. We don't print error messages here. */ } pbbuttonsd-0.8.1a/intl/VERSION0000644000175000017500000000005010641705127013002 00000000000000GNU gettext library from gettext-0.16.1 pbbuttonsd-0.8.1a/po/0002777000175000017500000000000010652456420011476 500000000000000pbbuttonsd-0.8.1a/po/Makefile.in.in0000644000175000017500000003322110641705150014056 00000000000000# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2006 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.16 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ localedir = @localedir@ gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, # @install_sh@ does not start with $(SHELL), so we add it. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. mkinstalldirs = $(SHELL) @install_sh@ -d install_sh = $(SHELL) @install_sh@ MKDIR_P = @MKDIR_P@ mkdir_p = @mkdir_p@ GMSGFMT_ = @GMSGFMT@ GMSGFMT_no = @GMSGFMT@ GMSGFMT_yes = @GMSGFMT_015@ GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) MSGFMT_ = @MSGFMT@ MSGFMT_no = @MSGFMT@ MSGFMT_yes = @MSGFMT_015@ MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) XGETTEXT_ = @XGETTEXT@ XGETTEXT_no = @XGETTEXT@ XGETTEXT_yes = @XGETTEXT_015@ XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: all-@USE_NLS@ all-yes: stamp-po all-no: # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, stamp-po is a nop (i.e. a phony target). # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch stamp-po" && \ echo timestamp > stamp-poT && \ mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all $(mkdir_p) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: $(mkdir_p) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir) || exit 1; \ else \ cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && $(SHELL) ./config.status $(subdir)/$@.in po-directories force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pbbuttonsd-0.8.1a/po/remove-potcdate.sin0000644000175000017500000000066010641705151015217 00000000000000# Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } pbbuttonsd-0.8.1a/po/quot.sed0000644000175000017500000000023110641705151013065 00000000000000s/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g pbbuttonsd-0.8.1a/po/boldquot.sed0000644000175000017500000000033110641705150013726 00000000000000s/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g s/“/“/g s/”/”/g s/‘/‘/g s/’/’/g pbbuttonsd-0.8.1a/po/en@quot.header0000644000175000017500000000226310641705151014174 00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # pbbuttonsd-0.8.1a/po/en@boldquot.header0000644000175000017500000000247110641705151015036 00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # pbbuttonsd-0.8.1a/po/insert-header.sin0000644000175000017500000000124010641705151014646 00000000000000# Sed script that inserts the file called HEADER before the header entry. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } pbbuttonsd-0.8.1a/po/Rules-quot0000644000175000017500000000337610641705150013417 00000000000000# Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en@quot.po-create: $(MAKE) en@quot.po-update en@boldquot.po-create: $(MAKE) en@boldquot.po-update en@quot.po-update: en@quot.po-update-en en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en@quot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header en@boldquot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header pbbuttonsd-0.8.1a/po/Makevars0000644000175000017500000000214410641705150013100 00000000000000# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Matthias Grimm MSGID_BUGS_ADDRESS = matthiasgrimm@users.sourceforge.net # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = pbbuttonsd-0.8.1a/po/POTFILES.in0000644000175000017500000000074610641705150013167 00000000000000# List of source files containing translatable strings. src/init.c src/input_manager.c src/module_cdrom.c src/module_display.c src/module_peep.c src/module_pmac.c src/module_imac.c src/module_powersave.c src/module_system.c src/class_mixer.c src/driver_mixer_alsa.c src/driver_mixer_oss.c src/class_config.c src/class_backlight.c src/driver_backlight_pmu.c src/driver_backlight_sysfs.c src/driver_backlight_x1600.c src/pbbuttonsd.c src/support.c pbbcmd/pbbcmd.c libpbbipc/pbb_errno.c pbbuttonsd-0.8.1a/po/de.po0000644000175000017500000004704110643747411012351 00000000000000# German Translations for pbbuttonsd and gtkpbbuttons. # Copyright (C) 2002 Free Software Foundation, Inc. # Matthias Grimm , 2002. # msgid "" msgstr "" "Project-Id-Version: pbbuttons 0.8.0\n" "Report-Msgid-Bugs-To: matthiasgrimm@users.sourceforge.net\n" "POT-Creation-Date: 2007-07-07 19:36+0200\n" "PO-Revision-Date: 2007-02-09 22:26+0100\n" "Last-Translator: Matthias Grimm \n" "Language-Team: german\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n" #: src/init.c:187 #, c-format msgid "%s, version %s" msgstr "%s, Version %s" #: src/init.c:201 #, c-format msgid "ERROR: Have problems reading configuration file [%s]: %s\n" msgstr "FEHLER: Problem beim Lesen der Konfigdatei [%s]: %s.\n" #: src/init.c:207 #, c-format msgid "%s - daemon to support special features of laptops and notebooks.\n" msgstr "%s - Daemon zur Nutzung spezieller Laptop und Notebook Fhigkeiten\n" #: src/init.c:208 #, c-format msgid "Usage: %s [OPTION]... \n" msgstr "Benutzung: %s [Optionen]... \n" #: src/init.c:209 #, c-format msgid "" "Options:\n" " -%c, --help display this help text and exit\n" " -%c, --version display version information and exit\n" " -%c, --quiet suppress welcome message\n" " -%c, --detach[=PIDFILE] start %s as background process and\n" " optional use an alternative pid-file\n" " (default: %s)\n" " -%c, --configfile=CONFIG use alternative configuration file\n" " (default: %s)\n" "see configuration file for more options.\n" msgstr "" "Optionen:\n" " -%c, --help zeigt die Hilfe\n" " -%c, --version zeigt die Programmverion an\n" " -%c, --quiet unterdrckt die Startmeldung\n" " -%c, --detach[=PIDFILE] startet %s als Hintergrundprozess und\n" " verwendet ggf. eine alternative PID-Datei\n" " (Default: %s)\n" " -%c, --configfile=CONFIG benutze alternative Konfigurationsdatei\n" " (Default: %s)\n" "Siehe Konfigurationsdatei fr weitere Optionen.\n" #: src/init.c:327 msgid "Not all signal handlers could be installed.\n" msgstr "Nicht alle Signal-Handler konnten installiert werden.\n" #: src/init.c:329 msgid "Can't install any signal handler\n" msgstr "Kann keinen Signalhandler installieren.\n" #: src/init.c:362 #, c-format msgid "Can't create message port for server: %s.\n" msgstr "Kann den Messageport fr den Server nicht anlegen: %s\n" #: src/init.c:365 msgid "Server is already running. Sorry, only one instance allowed.\n" msgstr "Der Server darf nur einmal gestartet werden.\n" #: src/init.c:368 msgid "" "Orphaned server port found and removed. All running clients have to be " "restarted.\n" msgstr "" "Verwaisten Serverport gelscht. Alle laufenden Clients mssen neu gestartet " "werden.\n" #: src/input_manager.c:336 msgid "No event devices available. Please check your configuration.\n" msgstr "" "Kein Event Device verfgbar, bitte prfen Sie Ihre Systemkonfiguration\n" #: src/module_cdrom.c:64 msgid "Please check your CDROM settings in configuration file.\n" msgstr "" "Bitte berprfen Sie ihre CDROM Einstellungen in der Konfigurationsdatei\n" #: src/module_cdrom.c:351 #, c-format msgid "Can't open %s. Eject CDROM won't work.\n" msgstr "Kann %s nicht ffnen. Auswerfen der CDROM wird nicht funktionieren.\n" #: src/module_display.c:167 msgid "Ambient light sensor found.\n" msgstr "Umgebungslichtsensor gefunden.\n" #: src/module_display.c:1320 src/module_display.c:1367 #, c-format msgid "Can't open framebuffer device '%s'.\n" msgstr "Kann Framebuffer Device '%s' nicht ffnen.\n" #: src/module_peep.c:170 pbbcmd/pbbcmd.c:168 msgid "Permission denied" msgstr "Zugriff verweigert" #: src/module_peep.c:171 pbbcmd/pbbcmd.c:169 msgid "Private Tag" msgstr "Privater Tag" #: src/module_peep.c:172 pbbcmd/pbbcmd.c:170 msgid "File doesn't exist" msgstr "Datei existiert nicht" #: src/module_peep.c:173 pbbcmd/pbbcmd.c:171 #, fuzzy msgid "File not a character device" msgstr "Die Datei ist kein Zeichengert" #: src/module_peep.c:174 pbbcmd/pbbcmd.c:172 msgid "File not a block device" msgstr "Die Datei ist kein Blockgert" #: src/module_peep.c:175 pbbcmd/pbbcmd.c:173 msgid "File not a file" msgstr "Die Datei ist keine Datei" #: src/module_peep.c:176 pbbcmd/pbbcmd.c:174 msgid "Buffer overflow" msgstr "Buffer bergelaufen" #: src/module_peep.c:177 pbbcmd/pbbcmd.c:175 msgid "open error" msgstr "Fehler beim ffnen" #: src/module_peep.c:178 pbbcmd/pbbcmd.c:176 msgid "format error" msgstr "Fehler im Format" #: src/module_peep.c:179 pbbcmd/pbbcmd.c:177 msgid "Messageport not available" msgstr "Messageport nicht verfgbar" #: src/module_peep.c:180 pbbcmd/pbbcmd.c:178 msgid "Server already running" msgstr "Server luft bereits" #: src/module_peep.c:181 pbbcmd/pbbcmd.c:179 msgid "Help or version info" msgstr "Hilfe oder Versionsinformationen" #: src/module_peep.c:182 pbbcmd/pbbcmd.c:182 #, fuzzy msgid "Insecure script owner" msgstr "Besitzer des Scripts unsicher" #: src/module_peep.c:183 pbbcmd/pbbcmd.c:183 msgid "Script must be write-only by owner" msgstr "Script darf nur vom Besitzer schreibbar sein." #: src/module_peep.c:184 pbbcmd/pbbcmd.c:184 msgid "read-only value" msgstr "Wert kann nur gelesen werden" #: src/module_peep.c:185 pbbcmd/pbbcmd.c:185 msgid "write-only value" msgstr "Wert kann nur geschrieben werden" #: src/module_peep.c:186 pbbcmd/pbbcmd.c:186 msgid "argument invalid" msgstr "Ungltiges Argument" #: src/module_peep.c:187 pbbcmd/pbbcmd.c:187 msgid "function not supported" msgstr "Funktion nicht untersttzt" #: src/module_peep.c:352 msgid "unknown tag" msgstr "Unbekannter Tag" #: src/module_pmac.c:139 src/driver_backlight_pmu.c:161 #, c-format msgid "Can't open PMU device %s: %s\n" msgstr "Kann PMU Device [%s] nicht ffnen: %s\n" #: src/module_pmac.c:146 src/driver_backlight_pmu.c:172 #, c-format msgid "Can't open ADB device %s: %s\n" msgstr "Kann ADB Device [%s] nicht ffnen: %s\n" #: src/module_pmac.c:181 msgid "pmud support compiled in and active.\n" msgstr "Pmud Untersttzung vorhanden und aktiviert.\n" #: src/module_pmac.c:203 msgid "Can't install PMU input handler. Some functionality may be missing.\n" msgstr "" "Kann PMU Inputhandler nicht installieren. Einige Funktionen werden nicht " "gehen.\n" #: src/module_pmac.c:440 msgid "ADB keyboard can't disable fnmode, force mode to 'fkeyslast'.\n" msgstr "" "Die Taste Fn kann auf ADB Tastaturen nicht abgeschaltet werden, erzwinge " "Modus 'fkeyslast'.\n" #: src/module_pmac.c:699 msgid "Can't find pmud on port 879. Trigger PMU directly for sleep.\n" msgstr "Kann pmud nicht finden. Schalte in den Replacement Mode.\n" #: src/module_pmac.c:1407 #, c-format msgid "Can't access i2c device %s - %s.\n" msgstr "Kann auf I2C Gert %s nicht zugreifen - %s.\n" #: src/module_pmac.c:1636 msgid "Unknown PowerBook" msgstr "Unbekanntes PowerBook" #: src/module_pmac.c:1720 #, c-format msgid "Current battery cycle: %d, active logfile: %s.\n" msgstr "Aktueller Batteriezyklus: %d, aktive Logdatei: %s.\n" #: src/module_imac.c:233 msgid "Unknown MacBook" msgstr "Unbekanntes MacBook" #: src/module_imac.c:245 msgid "Unknown MacBook Pro" msgstr "Unbekanntes MacBook Pro" #: src/module_imac.c:270 msgid "Unknown Machine" msgstr "Unbekannter Rechner" #: src/module_powersave.c:168 msgid "Can't create IBaM object, out of memory.\n" msgstr "Kann IBaM Objekt nicht erzeugen, zu wenig Speicher.\n" #: src/module_powersave.c:303 #, c-format msgid "Too many formatsigns. Max three %%s allowed in TAG_SCRIPTPMCS.\n" msgstr "Zu viele Formatzeichen. Max. drei %%s in TAG_SCRIPTPMCS erlaubt.\n" #: src/class_mixer.c:76 src/class_backlight.c:72 #, c-format msgid "Initialized: %s\n" msgstr "Aktiviert: %s\n" #: src/class_mixer.c:78 msgid "No mixer driver available - check your Kernel configuration.\n" msgstr "" "Kein Treiber fr Soundmixer verfgbar, bitte prfen Sie Ihre " "Systemkonfiguration.\n" #: src/driver_mixer_alsa.c:101 msgid "Memory allocation failed.\n" msgstr "Speicheranforderung fehlgeschlagen.\n" #: src/driver_mixer_alsa.c:116 #, c-format msgid "Card '%s' has no '%s' element.\n" msgstr "Card '%s' hat kein Element mit Namen '%s'.\n" #: src/driver_mixer_alsa.c:127 msgid "Option 'ALSA_Elements' contains no valid elements\n" msgstr "Option 'ALSA_Elements' enthlt keine gltigen Elemente.\n" #: src/driver_mixer_alsa.c:134 #, c-format msgid "Mixer element '%s' has no playback volume control.\n" msgstr "Mixer Element '%s' hat keine Lautstrke-Eigenschaft.\n" #: src/driver_mixer_alsa.c:151 #, c-format msgid "Memory allocation failed: %s\n" msgstr "Speicheranforderung fehlgeschlagen: %s.\n" #: src/driver_mixer_alsa.c:169 #, c-format msgid "Can't open card '%s': %s\n" msgstr "Kann Card '%s' nicht ffnen: %s\n" #: src/driver_mixer_alsa.c:173 #, c-format msgid "Can't attach card '%s': %s\n" msgstr "Kann Card '%s' nicht hinzufgen: %s.\n" #: src/driver_mixer_alsa.c:178 #, c-format msgid "Can't register mixer: %s\n" msgstr "Kann Mixer nicht registrieren: %s.\n" #: src/driver_mixer_alsa.c:185 #, c-format msgid "Can't load card '%s': %s\n" msgstr "Kann Card '%s' nicht laden: %s.\n" #: src/driver_mixer_alsa.c:373 msgid "ALSA Mixer" msgstr "ALSA Mixer" #: src/driver_mixer_oss.c:185 #, c-format msgid "Can't get devmask from mixer [%s]; using default.\n" msgstr "" "Kann verfgbare Kanle des Mixer [%s] nicht ermitteln, benutze " "Standardwerte.\n" #: src/driver_mixer_oss.c:191 #, c-format msgid "Can't get volume of master channel [%s].\n" msgstr "Kann Lautstrke des Masterkanals [%s] nicht ermitteln.\n" #: src/driver_mixer_oss.c:194 #, c-format msgid "Can't open mixer device [%s]. %s\n" msgstr "Kann Mixer [%s] nicht ffnen: %s\n" #: src/driver_mixer_oss.c:357 msgid "OSS Mixer" msgstr "OSS Mixer" #: src/class_config.c:84 msgid "" " Configuration file for pbbuttonsd >= version 0.8.0\n" " For complete list of options please see pbbuttonsd.cnf man-page.\n" " For description of the file format please see\n" " http://freedesktop.org/Standards/desktop-entry-spec.\n" msgstr "" "Konfigurationsdatei fr pbbuttonsd >= Verision 0.8.0\n" "Fr die komplette Liste aller verfgbaren Optionen sehen Sie bitte in die " "pbbuttonsd.cnf man-page.\n" "Fr die Beschreibung des Dateiformates sehen Sie unter\n" " http://freedesktop.org/Standards/desktop-entry-spec.\n" #: src/class_config.c:90 #, c-format msgid "Can't load config file: %s, using defaults.\n" msgstr "Kann Konfigdatei %s nicht lesen, benutze Standardwerte.\n" #: src/class_config.c:144 #, c-format msgid "Configuration saved to %s.\n" msgstr "Konfiguration in %s gespeichert.\n" #: src/class_config.c:147 #, c-format msgid "Can't write config file %s\n" msgstr "Kann Konfigdatei %s nicht speichern\n" #: src/class_config.c:182 #, c-format msgid "Configuration file [%s] is insecure, saving denied.\n" msgstr "Konfigdatei [%s] ist unsicher; speichern der Konfig gesperrt.\n" #: src/class_config.c:184 #, c-format msgid "Configuration file [%s] is not writable, saving not possible.\n" msgstr "" "Konfigdatei [%s] nicht schreibbar; speichern der Konfig nicht mglich.\n" #: src/class_config.c:672 #, c-format msgid "config error: %s/%s contains non-integers - using defaults.\n" msgstr "" "Konfigurationsfehler: %s/%s enthlt ungltige Zahlen - verwende " "Standardwerte.\n" #: src/class_config.c:675 #, c-format msgid "config error: %s/%s needs exactly %d arguments - using defaults.\n" msgstr "" "Konfigurationsfehler: %s/%s braucht %d Argumente - verwende Standardwerte.\n" #: src/class_backlight.c:74 msgid "No backlight driver available - check your Kernel configuration.\n" msgstr "" "Kein Treiber fr die Hintergrundbeleuchtung verfgbar, bitte prfen Sie Ihre " "Kernelkonfiguration.\n" #: src/driver_backlight_pmu.c:135 msgid "PMU Backlight Driver" msgstr "PMU Treiber fr LCD Hintergrundbeleuchtung" #: src/driver_backlight_sysfs.c:163 msgid "SysFS Backlight Driver" msgstr "SysFS Treiber fr LCD Hintergrundbeleuchtung" #: src/driver_backlight_x1600.c:143 msgid "ATI X1600 Backlight Driver" msgstr "ATI X1600 Treiber fr LCD Hintergrundbeleuchtung" #: src/support.c:59 #, c-format msgid "The object '%s' doesn't exist.\n" msgstr "Das Objekt '%s' existiert nicht.\n" #: src/support.c:62 #, c-format msgid "The object '%s' is not a file.\n" msgstr "Das Objekt '%s' ist keine Datei.\n" #: src/support.c:65 #, c-format msgid "The object '%s' is not a directory.\n" msgstr "Das Objekt '%s' ist kein Verzeichnis.\n" #: src/support.c:68 #, c-format msgid "The object '%s' is not a character device.\n" msgstr "Das Objekt '%s' ist kein zeichenorientiertes Gert.\n" #: src/support.c:71 #, c-format msgid "The object '%s' is not a block device.\n" msgstr "Das Object '%s' ist kein blockorientiertes Gert.\n" #: src/support.c:74 #, c-format msgid "SECURITY: %s must be owned by the same owner as pbbuttonsd.\n" msgstr "" "SICHERHEIT: Der Besitzer von %s und PBButtonsd mssen identisch sein.\n" #: src/support.c:77 #, c-format msgid "SECURITY: %s must only be writable by the owner of pbbuttonsd.\n" msgstr "" "SICHERHEIT: %s darf nur durch den Besitzer von PBButtonsd schreibbar sein.\n" #: src/support.c:80 #, c-format msgid "Insufficient permissions for object %s, at least '0%o' needed.\n" msgstr "" "Zugriffsrechte fr Objekt %s reichen nicht aus, bentige mindestens '0%o'.\n" #: src/support.c:157 #, c-format msgid "Script '%s' lauched but killed after %d seconds.\n" msgstr "Script '%s' gestartet, aber nach %d Sekunden abgebrochen.\n" #: src/support.c:180 #, c-format msgid "Script '%s' lauched but exitcode is %d.\n" msgstr "Script '%s' gestartet, aber mit Fehlercode %d beendet.\n" #: src/support.c:182 #, c-format msgid "Script '%s' launched and exited normally.\n" msgstr "Script '%s' gestartet und normal beendet.\n" #: src/support.c:184 #, c-format msgid "Script '%s' lauched but exited by signal.\n" msgstr "Script '%s' gestartet, aber durch ein Signal beendet.\n" #: src/support.c:224 #, c-format msgid "Script '%s' can't be launched - fork() failed.\n" msgstr "Script '%s' nicht ausgefhrt - fork() ist fehlgeschlagen.\n" #: src/support.c:228 #, c-format msgid "Script '%s' doesn't exist.\n" msgstr "Script '%s' existiert nicht.\n" #: src/support.c:230 #, c-format msgid "Script '%s' skipped because it's not secure.\n" msgstr "Script '%s' bergangen weil nicht sicher.\n" #: src/support.c:257 msgid "launched and exited normally" msgstr "gestartet und normal beendet" #: src/support.c:260 msgid "doesn't exist" msgstr "existiert nicht" #: src/support.c:265 msgid "skipped because it's not secure" msgstr "bergangen weil nicht sicher" #: src/support.c:268 #, c-format msgid "lauched but killed after %d seconds" msgstr "gestartet, aber nach %d Sekunden abgebrochen" #: src/support.c:272 msgid "lauched but exitcode is not null" msgstr "gestartet, aber der Exitcode ist nicht Null" #: src/support.c:275 msgid "can't be launched - fork() failed" msgstr "nicht ausgefhrt - fork() ist fehlgeschlagen" #: src/support.c:278 msgid "lauched but exited by signal" msgstr "gestartet, aber beendet durch ein Signal" #: src/support.c:281 msgid "failed - unknown error code" msgstr "fehlgeschlagen - unbekannter Fehlercode" #: src/support.c:283 #, c-format msgid "Script '%s' %s\n" msgstr "Script '%s' %s\n" #: pbbcmd/pbbcmd.c:180 msgid "Server not found" msgstr "Server nicht gefunden" #: pbbcmd/pbbcmd.c:181 msgid "Registration failed" msgstr "Registrierung fehlgeschlagen" #: pbbcmd/pbbcmd.c:192 #, c-format msgid "%s (version %s) - control client for pbbuttonsd.\n" msgstr "%s (version %s) - Steuerungsprogramm fr PBButtonsd.\n" #: pbbcmd/pbbcmd.c:193 #, c-format msgid "Usage:\n" msgstr "Benutzung:\n" #: pbbcmd/pbbcmd.c:197 #, c-format msgid "" "Options:\n" " -%c, --help display this help and exit\n" " -%c, --version display version information and exit\n" " -%c, --ignore ignore config return and error values\n" msgstr "" "Optionen:\n" " -%c, --help zeigt die Kurzhilfe an\n" " -%c, --version zeigt Versionsinformationen an\n" " -%c, --ignore ignoriere 'config'-Rckgabewerte und " "Fehlermeldungen\n" #: pbbcmd/pbbcmd.c:210 #, c-format msgid "Supported commands:\n" msgstr "Untersttzte Befehle:\n" #: pbbcmd/pbbcmd.c:212 #, c-format msgid "%-14s - prints a list of clients attached\n" msgstr "%-14s - gibt eine Liste der angemeldeten Klienten aus\n" #: pbbcmd/pbbcmd.c:214 #, c-format msgid "%-14s - save the current configuration to disk\n" msgstr "%-14s - speichert die aktuelle Konfiguration auf Festplatte\n" #: pbbcmd/pbbcmd.c:216 #, c-format msgid "%-14s - reinitialising the keyboard and the trackpad\n" msgstr "%-14s - Reinitialisiert die Tastatur und das Trackpad\n" #: pbbcmd/pbbcmd.c:218 #, c-format msgid "%-14s - eject the CDROM\n" msgstr "%-14s - wirft die CDROM aus\n" #: pbbcmd/pbbcmd.c:220 #, c-format msgid "%-14s - suspend to RAM\n" msgstr "%-14s - legt die Maschine schlafen\n" #: pbbcmd/pbbcmd.c:222 #, c-format msgid "%-14s - suspend to Disk\n" msgstr "" "%-14s - sichert den Systemzustand auf Festplatte und schaltet den Rechner " "aus\n" #: pbbcmd/pbbcmd.c:224 #, c-format msgid "%-14s - reconfigure server parameters\n" msgstr "%-14s - verndern von Serverparametern\n" #: pbbcmd/pbbcmd.c:226 #, c-format msgid "%-14s - queries the server for certain parameters\n" msgstr "%-14s - Afragen von Serverparametern\n" #: pbbcmd/pbbcmd.c:235 #, c-format msgid "Supported tags:\n" msgstr "Untersttzte Tags:\n" #: pbbcmd/pbbcmd.c:246 #, c-format msgid "The leading 'TAG_' could be omited.\n" msgstr "Das fhrende 'TAG_' kann weggelassen werden.\n" #: pbbcmd/pbbcmd.c:269 #, c-format msgid "pbbcmd, version %s" msgstr "pbbcmd, Version %s" #: pbbcmd/pbbcmd.c:285 pbbcmd/pbbcmd.c:301 #, c-format msgid "ERROR: Missing arguments\n" msgstr "FEHLER: Argumente fehlen.\n" #: pbbcmd/pbbcmd.c:292 pbbcmd/pbbcmd.c:314 #, c-format msgid "WARNING: tag %s not supported.\n" msgstr "WARNUNG: Tag %s wird nicht untersttzt.\n" #: pbbcmd/pbbcmd.c:304 #, c-format msgid "ERROR: tag/data pairs not complete.\n" msgstr "FEHLER: Tag und Daten mssen immer paarweise auftreten\n" #: pbbcmd/pbbcmd.c:345 #, c-format msgid "Server didn't send an answer and timed out.\n" msgstr "Der Server antwortete nicht, Timeout.\n" #: pbbcmd/pbbcmd.c:427 #, c-format msgid "Sorry, Couldn't get data for %s: %s." msgstr "Kann Daten fr %s nicht bekommen: %s." #: pbbcmd/pbbcmd.c:449 #, c-format msgid "Setting of %s failed: %s.\n" msgstr "Setzen von %s fehlgeschlagen: %s.\n" #: pbbcmd/pbbcmd.c:454 #, c-format msgid "ERROR: Unexpected answer from server, actioncode %ld.\n" msgstr "FEHLER: Unerwartete Antwort vom Server, Actioncode %ld.\n" #: pbbcmd/pbbcmd.c:463 #, c-format msgid "" " PID | Name | Port | Flags\n" " ------+----------------------+---------+-----------\n" msgstr "" " PID | Name | Port | Schalter\n" " ------+----------------------+---------+-----------\n" #: pbbcmd/pbbcmd.c:473 msgid "" msgstr "" #: pbbcmd/pbbcmd.c:491 #, c-format msgid "ERROR: Problems with IPC, maybe server is not running.\n" msgstr "FEHLER: IPC Problem, wahrscheinlich luft der Server nicht.\n" #: pbbcmd/pbbcmd.c:495 #, c-format msgid "ERROR: Not enough memory for buffer.\n" msgstr "FEHLER: Zu wenig Speicher fr Buffer.\n" #: libpbbipc/pbb_errno.c:73 msgid "ERROR" msgstr "FEHLER" #: libpbbipc/pbb_errno.c:77 msgid "WARNING" msgstr "WARNUNG" #: libpbbipc/pbb_errno.c:81 msgid "INFO" msgstr "INFO" #~ msgid "LMU found, ambient light sensor and keyboard illumination active.\n" #~ msgstr "LMU gefunden, Umgebungslichtsensor und Tastaturbeleuchtung aktiv.\n" pbbuttonsd-0.8.1a/po/ca.po0000644000175000017500000005774010643747411012353 00000000000000# translation of ca.po to català # translation of ca.po_[IUVWxb].po to # translation of ca.po_[IUVWxb].po to # translation of pbbuttonsd.po to Catalan # This file is distributed under the same license as the PACKAGE package. # Copyright (C) YEAR Matthias Grimm. # David Riera , 2004. # Oriol Pellicer , 2004. # Oriol Pellicer i Sabrià , 2005. # msgid "" msgstr "" "Project-Id-Version: ca\n" "Report-Msgid-Bugs-To: matthiasgrimm@users.sourceforge.net\n" "POT-Creation-Date: 2007-07-07 19:36+0200\n" "PO-Revision-Date: 2005-07-04 11:30+0200\n" "Last-Translator: Oriol Pellicer i Sabrià \n" "Language-Team: català \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.10\n" #: src/init.c:187 #, c-format msgid "%s, version %s" msgstr "%s, versió %s" #: src/init.c:201 #, c-format msgid "ERROR: Have problems reading configuration file [%s]: %s\n" msgstr "" "ERROR: S'han trobat problemes llegint l'arxiu de configuració [%s]: %s\n" #: src/init.c:207 #, c-format msgid "%s - daemon to support special features of laptops and notebooks.\n" msgstr "" "%s - dimoni per al suport de característiques especials en ordinadors " "portàtils.\n" #: src/init.c:208 #, c-format msgid "Usage: %s [OPTION]... \n" msgstr "Utilització: %s[OPCIÓ]... \n" #: src/init.c:209 #, c-format msgid "" "Options:\n" " -%c, --help display this help text and exit\n" " -%c, --version display version information and exit\n" " -%c, --quiet suppress welcome message\n" " -%c, --detach[=PIDFILE] start %s as background process and\n" " optional use an alternative pid-file\n" " (default: %s)\n" " -%c, --configfile=CONFIG use alternative configuration file\n" " (default: %s)\n" "see configuration file for more options.\n" msgstr "" "Opcions:\n" " -%c, --help mostra aquest text i surt\n" " -%c, --version mostra informació sobre la versió i surt\n" " -%c, --quiet elimina els missatges de benvinguda\n" " -%c, --detach[=PIDFILE] inicia %s com a procés en segon pla i\n" " opcionalment utilitza un arxiu identificador " "alternatiu\n" " (per defecte: %s)\n" " -%c, --configfile=CONFIG utilitza un arxiu de configuració alternatiu\n" " (per defecte: %s)\n" "per a més opcions consulta l'arxiu de configuració.\n" #: src/init.c:327 msgid "Not all signal handlers could be installed.\n" msgstr "" #: src/init.c:329 #, fuzzy msgid "Can't install any signal handler\n" msgstr "No es pot instal·lar l'ajudant de senyal\n" #: src/init.c:362 #, c-format msgid "Can't create message port for server: %s.\n" msgstr "No es pot crear el port de missatges pel servidor. %s.\n" #: src/init.c:365 msgid "Server is already running. Sorry, only one instance allowed.\n" msgstr "El servidor ja està funcionant. Només es permet una instància.\n" #: src/init.c:368 msgid "" "Orphaned server port found and removed. All running clients have to be " "restarted.\n" msgstr "" "S'ha eliminat un \"orphaned server port\". S'han de reiniciar tots els " "clients.\n" #: src/input_manager.c:336 msgid "No event devices available. Please check your configuration.\n" msgstr "" "No hi ha disponible cap dispositiu d'events. Comprova la configuració.\n" #: src/module_cdrom.c:64 msgid "Please check your CDROM settings in configuration file.\n" msgstr "" "Sisplau comprova la configuració del CDROM al fitxer de configuració.\n" #: src/module_cdrom.c:351 #, c-format msgid "Can't open %s. Eject CDROM won't work.\n" msgstr "No es pot obrir %s. L'expulsió del CDROM no funcionarà.\n" #: src/module_display.c:167 msgid "Ambient light sensor found.\n" msgstr "" #: src/module_display.c:1320 src/module_display.c:1367 #, c-format msgid "Can't open framebuffer device '%s'.\n" msgstr "No es pot obrir el dispositiu de framebuffer '%s'.\n" #: src/module_peep.c:170 pbbcmd/pbbcmd.c:168 msgid "Permission denied" msgstr "Permís denegat" #: src/module_peep.c:171 pbbcmd/pbbcmd.c:169 msgid "Private Tag" msgstr "Etiqueta privada" #: src/module_peep.c:172 pbbcmd/pbbcmd.c:170 msgid "File doesn't exist" msgstr "El fitxer no existeix" #: src/module_peep.c:173 pbbcmd/pbbcmd.c:171 #, fuzzy msgid "File not a character device" msgstr "El fitxer no és un dispositiu de caràcters" #: src/module_peep.c:174 pbbcmd/pbbcmd.c:172 msgid "File not a block device" msgstr "El fitxer no és un dispositiu de bloc" #: src/module_peep.c:175 pbbcmd/pbbcmd.c:173 msgid "File not a file" msgstr "El fitxer no és un fitxer" #: src/module_peep.c:176 pbbcmd/pbbcmd.c:174 msgid "Buffer overflow" msgstr "Desbordament de la memòria intermitja" #: src/module_peep.c:177 pbbcmd/pbbcmd.c:175 msgid "open error" msgstr "error d'obertura" #: src/module_peep.c:178 pbbcmd/pbbcmd.c:176 msgid "format error" msgstr "error de format" #: src/module_peep.c:179 pbbcmd/pbbcmd.c:177 msgid "Messageport not available" msgstr "El port de missatges no està disponible" #: src/module_peep.c:180 pbbcmd/pbbcmd.c:178 msgid "Server already running" msgstr "El servidor ja està funcionant" #: src/module_peep.c:181 pbbcmd/pbbcmd.c:179 msgid "Help or version info" msgstr "Ajuda o informació sobre la versió" #: src/module_peep.c:182 pbbcmd/pbbcmd.c:182 #, fuzzy msgid "Insecure script owner" msgstr "Propietari del fitxer de comandes insegur" #: src/module_peep.c:183 pbbcmd/pbbcmd.c:183 msgid "Script must be write-only by owner" msgstr "Només el propietari ha de poder escriure en el fitxer de comandes" #: src/module_peep.c:184 pbbcmd/pbbcmd.c:184 msgid "read-only value" msgstr "valor de només lectura" #: src/module_peep.c:185 pbbcmd/pbbcmd.c:185 msgid "write-only value" msgstr "valor de només escriptura" #: src/module_peep.c:186 pbbcmd/pbbcmd.c:186 msgid "argument invalid" msgstr "argument no vàlid" #: src/module_peep.c:187 pbbcmd/pbbcmd.c:187 msgid "function not supported" msgstr "funció no suportada" #: src/module_peep.c:352 msgid "unknown tag" msgstr "etiqueta desconeguda" #: src/module_pmac.c:139 src/driver_backlight_pmu.c:161 #, c-format msgid "Can't open PMU device %s: %s\n" msgstr "No es pot obrir el dispositiu PMU %s: %s\n" #: src/module_pmac.c:146 src/driver_backlight_pmu.c:172 #, c-format msgid "Can't open ADB device %s: %s\n" msgstr "No es pot obrir el dispositiu ADB %s: %s\n" #: src/module_pmac.c:181 msgid "pmud support compiled in and active.\n" msgstr "està compilat amb support per pmud i aquest es troba actiu.\n" #: src/module_pmac.c:203 msgid "Can't install PMU input handler. Some functionality may be missing.\n" msgstr "" "No es pot instal·lar el manegador de les entrades PMU. Es pot trobar a " "faltar alguna funcionalitat.\n" #: src/module_pmac.c:440 msgid "ADB keyboard can't disable fnmode, force mode to 'fkeyslast'.\n" msgstr "" #: src/module_pmac.c:699 msgid "Can't find pmud on port 879. Trigger PMU directly for sleep.\n" msgstr "" "No es troba el pmud en el port 879. Provocant directament PMU per adormir " "l'equip.\n" #: src/module_pmac.c:1407 #, fuzzy, c-format msgid "Can't access i2c device %s - %s.\n" msgstr "No es pot accedir als dispositius i2c. Permís denegat.\n" #: src/module_pmac.c:1636 msgid "Unknown PowerBook" msgstr "PowerBook desconegut" #: src/module_pmac.c:1720 #, c-format msgid "Current battery cycle: %d, active logfile: %s.\n" msgstr "cicle de bateria actual: %d, fitxer de registre actiu: %s.\n" #: src/module_imac.c:233 #, fuzzy msgid "Unknown MacBook" msgstr "PowerBook desconegut" #: src/module_imac.c:245 #, fuzzy msgid "Unknown MacBook Pro" msgstr "PowerBook desconegut" #: src/module_imac.c:270 #, fuzzy msgid "Unknown Machine" msgstr "etiqueta desconeguda" #: src/module_powersave.c:168 #, fuzzy msgid "Can't create IBaM object, out of memory.\n" msgstr "No es pot registrar la secció de configuració %s, sense memòria." #: src/module_powersave.c:303 #, c-format msgid "Too many formatsigns. Max three %%s allowed in TAG_SCRIPTPMCS.\n" msgstr "Massa signes de format. Màxim tres %%s permesos a TAG_SCRIPTPMCS.\n" #: src/class_mixer.c:76 src/class_backlight.c:72 #, c-format msgid "Initialized: %s\n" msgstr "" #: src/class_mixer.c:78 #, fuzzy msgid "No mixer driver available - check your Kernel configuration.\n" msgstr "" "No hi ha disponible cap dispositiu d'events. Comprova la configuració.\n" #: src/driver_mixer_alsa.c:101 msgid "Memory allocation failed.\n" msgstr "Memory allocation failed.\n" #: src/driver_mixer_alsa.c:116 #, c-format msgid "Card '%s' has no '%s' element.\n" msgstr "La tarja '%s' no té l'element '%s'.\n" #: src/driver_mixer_alsa.c:127 msgid "Option 'ALSA_Elements' contains no valid elements\n" msgstr "L'opció 'ALSA_Elements' no conté elements vàlids\n" #: src/driver_mixer_alsa.c:134 #, c-format msgid "Mixer element '%s' has no playback volume control.\n" msgstr "El mesclador '%s' no té control de volum del playback.\n" #: src/driver_mixer_alsa.c:151 #, c-format msgid "Memory allocation failed: %s\n" msgstr "Memory allocation failed: %s\n" #: src/driver_mixer_alsa.c:169 #, c-format msgid "Can't open card '%s': %s\n" msgstr "No es pot obrir la tarja %s: %s\n" #: src/driver_mixer_alsa.c:173 #, c-format msgid "Can't attach card '%s': %s\n" msgstr "No es pot afegir la tarja '%s': %s\n" #: src/driver_mixer_alsa.c:178 #, c-format msgid "Can't register mixer: %s\n" msgstr "No es pot obrir el mesclador: %s\n" #: src/driver_mixer_alsa.c:185 #, c-format msgid "Can't load card '%s': %s\n" msgstr "No es pot carregar la tarja '%s': %s\n" #: src/driver_mixer_alsa.c:373 msgid "ALSA Mixer" msgstr "" #: src/driver_mixer_oss.c:185 #, c-format msgid "Can't get devmask from mixer [%s]; using default.\n" msgstr "" "No es pot accedir al devmask del mesclador [%s]; utilitzant els valors per " "defecte.\n" #: src/driver_mixer_oss.c:191 #, c-format msgid "Can't get volume of master channel [%s].\n" msgstr "No es pot accedir al volum del canal principal [%s].\n" #: src/driver_mixer_oss.c:194 #, c-format msgid "Can't open mixer device [%s]. %s\n" msgstr "No es pot obrir la unitat mescladora [%s]. %s\n" #: src/driver_mixer_oss.c:357 msgid "OSS Mixer" msgstr "" #: src/class_config.c:84 msgid "" " Configuration file for pbbuttonsd >= version 0.8.0\n" " For complete list of options please see pbbuttonsd.cnf man-page.\n" " For description of the file format please see\n" " http://freedesktop.org/Standards/desktop-entry-spec.\n" msgstr "" #: src/class_config.c:90 #, fuzzy, c-format msgid "Can't load config file: %s, using defaults.\n" msgstr "" "No es pot llegir l'arxiu de configuració [%s, %s], utilitzant valors per " "defecte.\n" #: src/class_config.c:144 #, c-format msgid "Configuration saved to %s.\n" msgstr "" #: src/class_config.c:147 #, fuzzy, c-format msgid "Can't write config file %s\n" msgstr "No es pot escriure l'arxiu de configuració [%s, fora de memòria].\n" #: src/class_config.c:182 #, fuzzy, c-format msgid "Configuration file [%s] is insecure, saving denied.\n" msgstr "" "el fitxer de configuració [%s] és insegur, deshabilitant el desar la " "configuració.\n" #: src/class_config.c:184 #, fuzzy, c-format msgid "Configuration file [%s] is not writable, saving not possible.\n" msgstr "" "no es pot escriure en el fitxer de configuració [%s], deshabilitant el desar " "la configuració.\n" #: src/class_config.c:672 #, c-format msgid "config error: %s/%s contains non-integers - using defaults.\n" msgstr "" #: src/class_config.c:675 #, c-format msgid "config error: %s/%s needs exactly %d arguments - using defaults.\n" msgstr "" #: src/class_backlight.c:74 #, fuzzy msgid "No backlight driver available - check your Kernel configuration.\n" msgstr "" "No hi ha disponible cap dispositiu d'events. Comprova la configuració.\n" #: src/driver_backlight_pmu.c:135 msgid "PMU Backlight Driver" msgstr "" #: src/driver_backlight_sysfs.c:163 msgid "SysFS Backlight Driver" msgstr "" #: src/driver_backlight_x1600.c:143 msgid "ATI X1600 Backlight Driver" msgstr "" #: src/support.c:59 #, fuzzy, c-format msgid "The object '%s' doesn't exist.\n" msgstr "El fitxer '%s' no existeix.\n" #: src/support.c:62 #, fuzzy, c-format msgid "The object '%s' is not a file.\n" msgstr "El fitxer '%s' no és un fitxer.\n" #: src/support.c:65 #, fuzzy, c-format msgid "The object '%s' is not a directory.\n" msgstr "El fitxer '%s' no és un fitxer.\n" #: src/support.c:68 #, fuzzy, c-format msgid "The object '%s' is not a character device.\n" msgstr "El fitxer '%s' no és un dispositiu de caràcters.\n" #: src/support.c:71 #, fuzzy, c-format msgid "The object '%s' is not a block device.\n" msgstr "El fitxer '%s' no és un dispositiu de blocs.\n" #: src/support.c:74 #, c-format msgid "SECURITY: %s must be owned by the same owner as pbbuttonsd.\n" msgstr "SEGURETAT: %s ha de ser del mateix propietari que pbbuttonsd.\n" #: src/support.c:77 #, fuzzy, c-format msgid "SECURITY: %s must only be writable by the owner of pbbuttonsd.\n" msgstr "" "SEGURETAT: %s només ha de ser modificable pel propietari de pbbuttonsd.\n" #: src/support.c:80 #, c-format msgid "Insufficient permissions for object %s, at least '0%o' needed.\n" msgstr "" #: src/support.c:157 #, fuzzy, c-format msgid "Script '%s' lauched but killed after %d seconds.\n" msgstr "llançat però matat després de %d segons" #: src/support.c:180 #, fuzzy, c-format msgid "Script '%s' lauched but exitcode is %d.\n" msgstr "llançat però el codi de sortida no és nul" #: src/support.c:182 #, fuzzy, c-format msgid "Script '%s' launched and exited normally.\n" msgstr "llançament i sortida normal" #: src/support.c:184 #, fuzzy, c-format msgid "Script '%s' lauched but exited by signal.\n" msgstr "llançat però finalitzat per senyal" #: src/support.c:224 #, fuzzy, c-format msgid "Script '%s' can't be launched - fork() failed.\n" msgstr "no pot ser llançat - ha fallat el fork()" #: src/support.c:228 #, fuzzy, c-format msgid "Script '%s' doesn't exist.\n" msgstr "El fitxer '%s' no existeix.\n" #: src/support.c:230 #, fuzzy, c-format msgid "Script '%s' skipped because it's not secure.\n" msgstr "ignorat perquè no és segur" #: src/support.c:257 msgid "launched and exited normally" msgstr "llançament i sortida normal" #: src/support.c:260 msgid "doesn't exist" msgstr "no existeix" #: src/support.c:265 msgid "skipped because it's not secure" msgstr "ignorat perquè no és segur" #: src/support.c:268 #, c-format msgid "lauched but killed after %d seconds" msgstr "llançat però matat després de %d segons" #: src/support.c:272 msgid "lauched but exitcode is not null" msgstr "llançat però el codi de sortida no és nul" #: src/support.c:275 msgid "can't be launched - fork() failed" msgstr "no pot ser llançat - ha fallat el fork()" #: src/support.c:278 msgid "lauched but exited by signal" msgstr "llançat però finalitzat per senyal" #: src/support.c:281 msgid "failed - unknown error code" msgstr "ha fallat - codi d'error desconegut" #: src/support.c:283 #, c-format msgid "Script '%s' %s\n" msgstr "Arxiu de comandes '%s' %s\n" #: pbbcmd/pbbcmd.c:180 msgid "Server not found" msgstr "No es troba el servidor" #: pbbcmd/pbbcmd.c:181 msgid "Registration failed" msgstr "Error de registre" #: pbbcmd/pbbcmd.c:192 #, c-format msgid "%s (version %s) - control client for pbbuttonsd.\n" msgstr "%s (versió %s) - client de control per al pbbuttonsd.\n" #: pbbcmd/pbbcmd.c:193 #, c-format msgid "Usage:\n" msgstr "Utilització:\n" #: pbbcmd/pbbcmd.c:197 #, c-format msgid "" "Options:\n" " -%c, --help display this help and exit\n" " -%c, --version display version information and exit\n" " -%c, --ignore ignore config return and error values\n" msgstr "" "Opcions:\n" " -%c, --help mostra per pantalla aquesta ajuda i surt\n" " -%c, --version mostra per pantalla informació sobre la versió " "i surt \n" " -%c, --ignore ignora valors de configuració i d'error\n" "\n" #: pbbcmd/pbbcmd.c:210 #, c-format msgid "Supported commands:\n" msgstr "Comandes suportades:\n" #: pbbcmd/pbbcmd.c:212 #, c-format msgid "%-14s - prints a list of clients attached\n" msgstr "%-14s - llista els clients associats\n" #: pbbcmd/pbbcmd.c:214 #, c-format msgid "%-14s - save the current configuration to disk\n" msgstr "%-14s - desa la configuració actual al disc\n" #: pbbcmd/pbbcmd.c:216 #, c-format msgid "%-14s - reinitialising the keyboard and the trackpad\n" msgstr "%-14s - reinicialitza el teclat i el trackpad\n" #: pbbcmd/pbbcmd.c:218 #, c-format msgid "%-14s - eject the CDROM\n" msgstr "%-14s - expulsa el cdrom\n" #: pbbcmd/pbbcmd.c:220 #, c-format msgid "%-14s - suspend to RAM\n" msgstr "%-14s - suspèn a la RAM\n" #: pbbcmd/pbbcmd.c:222 #, fuzzy, c-format msgid "%-14s - suspend to Disk\n" msgstr "%-14s - suspèn a la RAM\n" #: pbbcmd/pbbcmd.c:224 #, c-format msgid "%-14s - reconfigure server parameters\n" msgstr "%-14s - reconfigura els paràmetres del servidor\n" #: pbbcmd/pbbcmd.c:226 #, c-format msgid "%-14s - queries the server for certain parameters\n" msgstr "%-14s - interroga el servidor per certs paràmetres\n" #: pbbcmd/pbbcmd.c:235 #, c-format msgid "Supported tags:\n" msgstr "Etiquetes suportades:\n" #: pbbcmd/pbbcmd.c:246 #, c-format msgid "The leading 'TAG_' could be omited.\n" msgstr "El primer 'TAG_' podria ser omès.\n" #: pbbcmd/pbbcmd.c:269 #, c-format msgid "pbbcmd, version %s" msgstr "pbbcmd, versió %s" #: pbbcmd/pbbcmd.c:285 pbbcmd/pbbcmd.c:301 #, c-format msgid "ERROR: Missing arguments\n" msgstr "ERROR: Falten arguments\n" #: pbbcmd/pbbcmd.c:292 pbbcmd/pbbcmd.c:314 #, c-format msgid "WARNING: tag %s not supported.\n" msgstr "ATENCIÓ: No està suportada l'etiqueta %s.\n" #: pbbcmd/pbbcmd.c:304 #, c-format msgid "ERROR: tag/data pairs not complete.\n" msgstr "ERROR: la parella etiqueta/data no és completa.\n" #: pbbcmd/pbbcmd.c:345 #, c-format msgid "Server didn't send an answer and timed out.\n" msgstr "Temps finalitzat, el servidor no ha pogut enviar una resposta.\n" #: pbbcmd/pbbcmd.c:427 #, c-format msgid "Sorry, Couldn't get data for %s: %s." msgstr "No es pot obtenir la data per %s: %s." #: pbbcmd/pbbcmd.c:449 #, c-format msgid "Setting of %s failed: %s.\n" msgstr "L'ajustament de %s ha fallat: %s.\n" #: pbbcmd/pbbcmd.c:454 #, c-format msgid "ERROR: Unexpected answer from server, actioncode %ld.\n" msgstr "ERROR: Resposta inesperada del servidor, codi d'acció: %ld.\n" #: pbbcmd/pbbcmd.c:463 #, c-format msgid "" " PID | Name | Port | Flags\n" " ------+----------------------+---------+-----------\n" msgstr "" " PID | Nom | Port | Flags\n" " ------+----------------------+---------+-----------\n" #: pbbcmd/pbbcmd.c:473 msgid "" msgstr "" #: pbbcmd/pbbcmd.c:491 #, c-format msgid "ERROR: Problems with IPC, maybe server is not running.\n" msgstr "" "ERROR: Problemes amb IPC, pot ser que el servidor no estigui en " "funcionament.\n" #: pbbcmd/pbbcmd.c:495 #, c-format msgid "ERROR: Not enough memory for buffer.\n" msgstr "ERROR: No queda suficient memòria pel buffer.\n" #: libpbbipc/pbb_errno.c:73 msgid "ERROR" msgstr "ERROR" #: libpbbipc/pbb_errno.c:77 msgid "WARNING" msgstr "ATENCIÓ" #: libpbbipc/pbb_errno.c:81 msgid "INFO" msgstr "INFORMACIÓ" #~ msgid "LMU found, ambient light sensor and keyboard illumination active.\n" #~ msgstr "" #~ "Trobat LMU, sensor de llum d'ambient i d'il·luminació de teclat actiu.\n" #~ msgid "Couldn't read configfile [%s, out of memory], using defaults.\n" #~ msgstr "" #~ "No es pot llegir l'arxiu de configuració [%s, fora de memòria] utilitzant " #~ "valors per defecte.\n" #~ msgid "" #~ "# Configuration file for pbbuttonsd >= version 0.5\n" #~ "# for options see man pbbuttonsd.conf\n" #~ msgstr "" #~ "# Arxiu de configuració per al pbbuttonsd >= versió 0.5\n" #~ "# per a opcions veure man pbbuttonsd.conf\n" #~ msgid "Can't register configuration section %s, out of memory." #~ msgstr "No es pot registrar la secció de configuració %s, sense memòria." #, fuzzy #~ msgid "initial LCD brightness level in percent" #~ msgstr "nivell de lluminositat inicial per al monitor" #~ msgid "0 = no smooth fading" #~ msgstr "0 = cap degradació de lluminositat del monitor" #~ msgid "only on Aluminum PowerBooks" #~ msgstr "només en els Powerbooks d'alumini" #~ msgid "ambient light threshold in percent for backlight autoadj." #~ msgstr "" #~ "interval de llum ambiental en percentatge per a l'autoajustament de la " #~ "llum del darrera" #~ msgid "autoadjustment range parameters" #~ msgstr "paràmetres del rang d'autoajustament" #, fuzzy #~ msgid "initial keyboard illumination level in percent" #~ msgstr "nivell inicial d'il·luminació del teclat" #, fuzzy #~ msgid "initial level in percent if KBD on/off key is pressed" #~ msgstr "nivell inicial si la tecla KBD on/off és premuda" #~ msgid "ambient light threshold in percent for keyboard light autoadj." #~ msgstr "" #~ "interval de llum ambiental (en percentatge) per a l'autoajustament de la " #~ "llum del teclat" #~ msgid "'" #~ msgstr "'" #~ msgid "', '" #~ msgstr "', '" #~ msgid "' or '" #~ msgstr "' o '" #~ msgid "" #~ "MixerInitDelay is not possible with automatic mixer detection; option " #~ "disabled.\n" #~ msgstr "" #~ "El valor MixerInitDelay no és possible amb la detecció automàtica del " #~ "mesclador; opció deshabilitada.\n" #~ msgid "" #~ "Soundsystem requested: %s, detected: %s and at least activated: %s.\n" #~ msgstr "" #~ "Sistema de so requerit: %s, detectat: %s i com a mínim activat: %s.\n" #~ msgid "Soundsystem requested: %s and at least activated: %s.\n" #~ msgstr "Sistema de so requerit: %s i almenys activat: %s.\n" #~ msgid "initial volume level" #~ msgstr "nivell inicial de volum" #~ msgid "mute after startup?" #~ msgstr "silenciat després d'iniciar?" #~ msgid "ALSA Card name too long. Buffer overflow\n" #~ msgstr "El nom de la tarja ALSA és massa llarg. Buffer overflow\n" #~ msgid "Too much ALSA elements given. Buffer overflow.\n" #~ msgstr "S'han donat massa elements ALSA. Buffer overflow\n" #~ msgid "switch trackpad to 'notap-mode' while typing" #~ msgstr "canvia el 'trackpad' a 'notap-mode' mentre escriu" #~ msgid "see TimerAction for possible values" #~ msgstr "Veure TimerAction pels valors possibles" #~ msgid "Action (see TimerAction) for the sleepkey" #~ msgstr "Acció (veure TimerAction) per la tecla d'adormida" #~ msgid "" #~ "values > 0 may be dangerous, if the power key is used to trigger sleep" #~ msgstr "" #~ "valors més grans de 0 poden ser perillosos si s'utilitza la tecla " #~ "d'apagarper a l'adormida" #~ msgid "first battery warnlevel, time in minutes" #~ msgstr "primera alerta de nivell de càrrega de bateria, temps en minuts" #~ msgid "second battery warnlevel, time in minutes" #~ msgstr "segona alerta de nivell de càrrega de bateria, temps en minuts" #~ msgid "last battery warnlevel, time in minutes" #~ msgstr "última alerta de nivell de càrrega de bateria, temps en minuts" #~ msgid "action, if battery is critically low" #~ msgstr "acció, si el nivell de càrrega de bateria és críticament baix" #~ msgid "beep, if nothing else showed that the computer lives" #~ msgstr "" #~ "pita, si no hi ha cap altre indici que l'ordinador està en funcionament" #~ msgid "value in percent" #~ msgstr "valor en percentatge" #~ msgid "time in seconds" #~ msgstr "temps en segons" #~ msgid "traffic in Bytes/s" #~ msgstr "trànsit en Bytes/s" #~ msgid "user who is allowed to use IPC" #~ msgstr "Usuari a qui es permet usar l'IPC" #~ msgid "automatic rescan of event devices" #~ msgstr "exploració automàtica de dispositius d'esdeveniment" #~ msgid "timeout in seconds for launched scripts, etc." #~ msgstr "timeout en segons pels scripts llançats, etc." #~ msgid "saving of config enabled to %s.\n" #~ msgstr "guardar la configuració habilitat a %s.\n" #~ msgid "Path of '%s' is to long.\n" #~ msgstr "La ruta de '%s' és massa llarga.\n" #, fuzzy #~ msgid "Wow, later than an Alluminum PB! ;-)" #~ msgstr "Uau, més nou que un Titanium! :-)" #~ msgid "Can't read filehandle %d anymore ... exiting!\n" #~ msgstr "No es pot seguir llegint %d el descriptor de fitxers... sortint!\n" pbbuttonsd-0.8.1a/po/es.po0000644000175000017500000005107510643747411012372 00000000000000# pbbuttonsd translation to spanish # Copyright (C) 2004 Software in the Public Interest # This file is distributed under the same license as the postfix package. # # Changes: # - Initial translation # Rudy Godoy , 2004 # # # Traductores, si no conoce el formato PO, merece la pena leer la # documentacin de gettext, especialmente las secciones dedicadas a este # formato, por ejemplo ejecutando: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # # Equipo de traduccin al espaol, por favor lean antes de traducir # los siguientes documentos: # # - El proyecto de traduccin de Debian al espaol # http://www.debian.org/intl/spanish/coordinacion # especialmente las notas de traduccin en # http://www.debian.org/intl/spanish/notas # # - La gua de traduccin de po's de debconf: # /usr/share/doc/po-debconf/README-trans # o http://www.debian.org/intl/l10n/po-debconf/README-trans # msgid "" msgstr "" "Project-Id-Version: pbbuttonsd 0.8.0\n" "Report-Msgid-Bugs-To: matthiasgrimm@users.sourceforge.net\n" "POT-Creation-Date: 2007-07-07 19:36+0200\n" "PO-Revision-Date: 2007-02-11 22:21-0300\n" "Last-Translator: Gustavo Boksar \n" "Language-Team: Debian l10n spanish team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: Spanish\n" "X-Poedit-SourceCharset: iso-8859-1\n" #: src/init.c:187 #, c-format msgid "%s, version %s" msgstr "%s, versin %s" #: src/init.c:201 #, c-format msgid "ERROR: Have problems reading configuration file [%s]: %s\n" msgstr "" "ERROR: Ocurrieron problemas al leer fichero de configuracin [%s]: %s\n" #: src/init.c:207 #, c-format msgid "%s - daemon to support special features of laptops and notebooks.\n" msgstr "" "%s - demonio para soporte de caractersticas especiales de ordenadores " "porttiles.\n" #: src/init.c:208 #, c-format msgid "Usage: %s [OPTION]... \n" msgstr "Uso: %s [OPCIN]... \n" #: src/init.c:209 #, c-format msgid "" "Options:\n" " -%c, --help display this help text and exit\n" " -%c, --version display version information and exit\n" " -%c, --quiet suppress welcome message\n" " -%c, --detach[=PIDFILE] start %s as background process and\n" " optional use an alternative pid-file\n" " (default: %s)\n" " -%c, --configfile=CONFIG use alternative configuration file\n" " (default: %s)\n" "see configuration file for more options.\n" msgstr "" "Opciones:\n" " -%c, --help muestra este mensaje y finaliza\n" " -%c, --version muestra informacin de versin y finaliza\n" " -%c, --quiet no muestra el mensaje de bienvenida\n" " -%c, --detach[=FICHEROPID] inicia %s como proceso en segundo plano y\n" " opcionalmente usa un fichero pid alternativo\n" " (predeterminado: %s)\n" " -%c, --configfile=CONFIG usar un fichero de configuracin alternativo\n" " (predeterminado: %s)\n" "vase ficheros de configuracin para ms opciones.\n" #: src/init.c:327 msgid "Not all signal handlers could be installed.\n" msgstr "No todos los gestores de seales han podido ser instalados.\n" #: src/init.c:329 msgid "Can't install any signal handler\n" msgstr "No se pudo instalar ningn gestor de seal\n" #: src/init.c:362 #, c-format msgid "Can't create message port for server: %s.\n" msgstr "No se puede crear el transporte de mensajes para el servidor: %s.\n" #: src/init.c:365 msgid "Server is already running. Sorry, only one instance allowed.\n" msgstr "" "El servidor ya se est ejecutando. Disculpe, solo se permite una instancia.\n" #: src/init.c:368 msgid "" "Orphaned server port found and removed. All running clients have to be " "restarted.\n" msgstr "" "Se ha encontrado un puerto de servidor hurfano y se ha eliminado. Se debe " "reiniciar todos los clientes.\n" #: src/input_manager.c:336 msgid "No event devices available. Please check your configuration.\n" msgstr "" "No existen dispositivos de eventos disponibles. Por favor verifique " "suconfiguracin.\n" #: src/module_cdrom.c:64 msgid "Please check your CDROM settings in configuration file.\n" msgstr "Por favor verifique los valores de configuracin del CDROM.\n" #: src/module_cdrom.c:351 #, c-format msgid "Can't open %s. Eject CDROM won't work.\n" msgstr "No se puede abrir %s. No se podr expulsar CDROM.\n" #: src/module_display.c:167 msgid "Ambient light sensor found.\n" msgstr "Sensor de luz ambiente encontrado.\n" #: src/module_display.c:1320 src/module_display.c:1367 #, c-format msgid "Can't open framebuffer device '%s'.\n" msgstr "No se puede abrir dispositivo framebuffer '%s'.\n" #: src/module_peep.c:170 pbbcmd/pbbcmd.c:168 msgid "Permission denied" msgstr "Permiso denegado" #: src/module_peep.c:171 pbbcmd/pbbcmd.c:169 msgid "Private Tag" msgstr "Etiqueta privada" #: src/module_peep.c:172 pbbcmd/pbbcmd.c:170 msgid "File doesn't exist" msgstr "Fichero no existe" #: src/module_peep.c:173 pbbcmd/pbbcmd.c:171 #, fuzzy msgid "File not a character device" msgstr "Fichero no es un dispositivo de caracteres" #: src/module_peep.c:174 pbbcmd/pbbcmd.c:172 msgid "File not a block device" msgstr "Fichero no es un dispositivo de bloques" #: src/module_peep.c:175 pbbcmd/pbbcmd.c:173 msgid "File not a file" msgstr "Fichero no es un fichero" #: src/module_peep.c:176 pbbcmd/pbbcmd.c:174 msgid "Buffer overflow" msgstr "Desbordamiento de buffer" #: src/module_peep.c:177 pbbcmd/pbbcmd.c:175 msgid "open error" msgstr "Error al abrir" #: src/module_peep.c:178 pbbcmd/pbbcmd.c:176 msgid "format error" msgstr "Error de formato" #: src/module_peep.c:179 pbbcmd/pbbcmd.c:177 msgid "Messageport not available" msgstr "Puerto de mensajes no disponible" #: src/module_peep.c:180 pbbcmd/pbbcmd.c:178 msgid "Server already running" msgstr "El servidor ya se est ejecutando" #: src/module_peep.c:181 pbbcmd/pbbcmd.c:179 msgid "Help or version info" msgstr "Ayuda o informacin de versin" #: src/module_peep.c:182 pbbcmd/pbbcmd.c:182 #, fuzzy msgid "Insecure script owner" msgstr "Dueo de script no es seguro" #: src/module_peep.c:183 pbbcmd/pbbcmd.c:183 msgid "Script must be write-only by owner" msgstr "" "El programa debe tener permisos de escritura solamente para el propietario" #: src/module_peep.c:184 pbbcmd/pbbcmd.c:184 msgid "read-only value" msgstr "Valor de solo lectura" #: src/module_peep.c:185 pbbcmd/pbbcmd.c:185 msgid "write-only value" msgstr "Valor de solo escritura" #: src/module_peep.c:186 pbbcmd/pbbcmd.c:186 msgid "argument invalid" msgstr "Argumento invlido" #: src/module_peep.c:187 pbbcmd/pbbcmd.c:187 msgid "function not supported" msgstr "Funcin no soportada" #: src/module_peep.c:352 msgid "unknown tag" msgstr "Etiqueta desconocida" #: src/module_pmac.c:139 src/driver_backlight_pmu.c:161 #, c-format msgid "Can't open PMU device %s: %s\n" msgstr "No se puede abrir dispositivo PMU %s: %s\n" #: src/module_pmac.c:146 src/driver_backlight_pmu.c:172 #, c-format msgid "Can't open ADB device %s: %s\n" msgstr "No se puede abrir dispositivo ADB %s: %s\n" #: src/module_pmac.c:181 msgid "pmud support compiled in and active.\n" msgstr "Soporte de pmud compilado y activo.\n" #: src/module_pmac.c:203 msgid "Can't install PMU input handler. Some functionality may be missing.\n" msgstr "" "No se pudo instalar gestor de entrada de PMU. Algunas funcionalidades " "podran no estar disponibles.\n" #: src/module_pmac.c:440 msgid "ADB keyboard can't disable fnmode, force mode to 'fkeyslast'.\n" msgstr "" "El teclado ADB no puede deshabilitar el fnmode, fuerze la modalidad " "'fkevslast'.\n" #: src/module_pmac.c:699 msgid "Can't find pmud on port 879. Trigger PMU directly for sleep.\n" msgstr "" "No se pudo encontrar pmud en puerto 879. Usar direcamente PMU para " "suspender.\n" #: src/module_pmac.c:1407 #, c-format msgid "Can't access i2c device %s - %s.\n" msgstr "No se puede acceder a dispositivos i2c %s - %s.\n" #: src/module_pmac.c:1636 msgid "Unknown PowerBook" msgstr "PowerBook desconocida" #: src/module_pmac.c:1720 #, c-format msgid "Current battery cycle: %d, active logfile: %s.\n" msgstr "Ciclo actual de batera: %d, fichero de registro activo: %s.\n" #: src/module_imac.c:233 msgid "Unknown MacBook" msgstr "MacBook desconocida" #: src/module_imac.c:245 msgid "Unknown MacBook Pro" msgstr "MacBook Pro desconocida" #: src/module_imac.c:270 msgid "Unknown Machine" msgstr "Equipo desconocido" #: src/module_powersave.c:168 msgid "Can't create IBaM object, out of memory.\n" msgstr "No se pudo crear objeto IBaM, no hay memoria suficiente.\n" #: src/module_powersave.c:303 #, c-format msgid "Too many formatsigns. Max three %%s allowed in TAG_SCRIPTPMCS.\n" msgstr "" "Demasiados signos de formato. El mximo permitido es tres %%s en " "TAG_SCRIPTPMCS.\n" #: src/class_mixer.c:76 src/class_backlight.c:72 #, c-format msgid "Initialized: %s\n" msgstr "Inicia;izado: %s\n" #: src/class_mixer.c:78 msgid "No mixer driver available - check your Kernel configuration.\n" msgstr "" "No hay controladores para mezclador de sonido disponibles - Verificque la " "configuracin de su Kernel.\n" #: src/driver_mixer_alsa.c:101 msgid "Memory allocation failed.\n" msgstr "Fallo en asignacin de memoria.\n" #: src/driver_mixer_alsa.c:116 #, c-format msgid "Card '%s' has no '%s' element.\n" msgstr "La tarjeta '%s' no tiene el elemento '%s'.\n" #: src/driver_mixer_alsa.c:127 msgid "Option 'ALSA_Elements' contains no valid elements\n" msgstr "La opcin 'ALSA_Elements' no tiene elementos vlidos.\n" #: src/driver_mixer_alsa.c:134 #, c-format msgid "Mixer element '%s' has no playback volume control.\n" msgstr "" "El elemento mezclador '%s' no tiene control de volumen de reproduccin.\n" #: src/driver_mixer_alsa.c:151 #, c-format msgid "Memory allocation failed: %s\n" msgstr "Fallo en asignacin de memoria: %s\n" #: src/driver_mixer_alsa.c:169 #, c-format msgid "Can't open card '%s': %s\n" msgstr "No se puede abrir tarjeta '%s': %s\n" #: src/driver_mixer_alsa.c:173 #, c-format msgid "Can't attach card '%s': %s\n" msgstr "No se puede adjuntar la tarjeta '%s': %s\n" #: src/driver_mixer_alsa.c:178 #, c-format msgid "Can't register mixer: %s\n" msgstr "No se puede registrar dispositivo de mezcla: %s\n" #: src/driver_mixer_alsa.c:185 #, c-format msgid "Can't load card '%s': %s\n" msgstr "No se puede cargar tarjeta %s: %s\n" #: src/driver_mixer_alsa.c:373 msgid "ALSA Mixer" msgstr "Mezclador ALSA" #: src/driver_mixer_oss.c:185 #, c-format msgid "Can't get devmask from mixer [%s]; using default.\n" msgstr "" "No se puede obtener devmask para mezclador [%s]; se usarn valores " "predeterminados.\n" #: src/driver_mixer_oss.c:191 #, c-format msgid "Can't get volume of master channel [%s].\n" msgstr "No se puede obtener volumen de canal maestro [%s].\n" #: src/driver_mixer_oss.c:194 #, c-format msgid "Can't open mixer device [%s]. %s\n" msgstr "No se puede abrir dispositivo de mezcla [%s]. %s\n" #: src/driver_mixer_oss.c:357 msgid "OSS Mixer" msgstr "Mezclador OSS" #: src/class_config.c:84 msgid "" " Configuration file for pbbuttonsd >= version 0.8.0\n" " For complete list of options please see pbbuttonsd.cnf man-page.\n" " For description of the file format please see\n" " http://freedesktop.org/Standards/desktop-entry-spec.\n" msgstr "" "Archivo de configuracin para pbbuttonsd >= versin 0.8.0\n" "Para obtener una lista completa de opciones vea pbbuttonsd.cnf\n" #: src/class_config.c:90 #, c-format msgid "Can't load config file: %s, using defaults.\n" msgstr "" "No se puede leer fichero de configuracin: %s, se usarn valores " "predeterminados.\n" #: src/class_config.c:144 #, c-format msgid "Configuration saved to %s.\n" msgstr "Configuracin almacenada en %s\n" #: src/class_config.c:147 #, c-format msgid "Can't write config file %s\n" msgstr "No se puede escribir fichero de configuracin %s\n" #: src/class_config.c:182 #, c-format msgid "Configuration file [%s] is insecure, saving denied.\n" msgstr "" "El fichero de configuracin [%s] es inseguro, el permiso de guardar es " "denegado.\n" #: src/class_config.c:184 #, c-format msgid "Configuration file [%s] is not writable, saving not possible.\n" msgstr "" "No se puede escribir en el fichero de configuracin [%s], imposible " "guardar.\n" #: src/class_config.c:672 #, c-format msgid "config error: %s/%s contains non-integers - using defaults.\n" msgstr "" "Error de configuracin: %s/%s no contiene nmeros enteros - utilizando " "valores por defecto.\n" #: src/class_config.c:675 #, c-format msgid "config error: %s/%s needs exactly %d arguments - using defaults.\n" msgstr "" "Error de configuracin: %s/%s necesita de exactamente %d argumentos - " "Utilizando argumentos por defecto.\n" #: src/class_backlight.c:74 msgid "No backlight driver available - check your Kernel configuration.\n" msgstr "" "No hay controladores de retro-iluminacindisponibles - verifique la " "configuracin de su Kernel.\n" #: src/driver_backlight_pmu.c:135 msgid "PMU Backlight Driver" msgstr "Controlador de Retro-iluminacin PMU" #: src/driver_backlight_sysfs.c:163 msgid "SysFS Backlight Driver" msgstr "Controlador de Retro-iluminacin SysFS" #: src/driver_backlight_x1600.c:143 msgid "ATI X1600 Backlight Driver" msgstr "Controlador de Retro-iluminacin ATI X1 1600" #: src/support.c:59 #, c-format msgid "The object '%s' doesn't exist.\n" msgstr "El objeto '%s' no existe.\n" #: src/support.c:62 #, c-format msgid "The object '%s' is not a file.\n" msgstr "El objeto '%s' no es un fichero.\n" #: src/support.c:65 #, c-format msgid "The object '%s' is not a directory.\n" msgstr "El objeto '%s' no es un directorio.\n" #: src/support.c:68 #, c-format msgid "The object '%s' is not a character device.\n" msgstr "El objeto '%s' no es un dispositivo de caracteres.\n" #: src/support.c:71 #, c-format msgid "The object '%s' is not a block device.\n" msgstr "El objeto '%s' no es un dispositivo de bloques.\n" #: src/support.c:74 #, c-format msgid "SECURITY: %s must be owned by the same owner as pbbuttonsd.\n" msgstr "SEGURIDAD: %s debe tener el mismo propietario que pbbuttonsd.\n" #: src/support.c:77 #, c-format msgid "SECURITY: %s must only be writable by the owner of pbbuttonsd.\n" msgstr "SEGURIDAD: Slo el propietario de pbbuttonsd puede escribir en %s.\n" #: src/support.c:80 #, c-format msgid "Insufficient permissions for object %s, at least '0%o' needed.\n" msgstr "" "Permisos insuficientes para el objeto '%s', se requiere como mnimo 0%o.\n" #: src/support.c:157 #, c-format msgid "Script '%s' lauched but killed after %d seconds.\n" msgstr "" "Se ha ejecutado el script '%s' pero se ha matado el proceso luego de %d " "segundos.\n" #: src/support.c:180 #, c-format msgid "Script '%s' lauched but exitcode is %d.\n" msgstr "Se ha ejecutado el script '%s' pero el cdigo de salida es %d.\n" #: src/support.c:182 #, c-format msgid "Script '%s' launched and exited normally.\n" msgstr "Se ha ejecutado el script '%s' y terminado normalmente.\n" #: src/support.c:184 #, c-format msgid "Script '%s' lauched but exited by signal.\n" msgstr "Se ha ejecutado el script '%s' pero ha terminado por seal.\n" #: src/support.c:224 #, c-format msgid "Script '%s' can't be launched - fork() failed.\n" msgstr "El script '%s' no puede ser ejecutado - Ha fallado el fork().\n" #: src/support.c:228 #, c-format msgid "Script '%s' doesn't exist.\n" msgstr "El script '%s' no existe.\n" #: src/support.c:230 #, c-format msgid "Script '%s' skipped because it's not secure.\n" msgstr "El script '%s' no se ha ejecutado debido a que no es seguro.\n" #: src/support.c:257 msgid "launched and exited normally" msgstr "cargado y finalizado normalmente" #: src/support.c:260 msgid "doesn't exist" msgstr "no existe" #: src/support.c:265 msgid "skipped because it's not secure" msgstr "saltado porque no es seguro" #: src/support.c:268 #, c-format msgid "lauched but killed after %d seconds" msgstr "ejecutado pero terminado despus de %d segundos" #: src/support.c:272 msgid "lauched but exitcode is not null" msgstr "ejecutado pero el cdigo de finalizacin no es null" #: src/support.c:275 msgid "can't be launched - fork() failed" msgstr "no se puede ejecutar - fallo en fork()" #: src/support.c:278 msgid "lauched but exited by signal" msgstr "ejecutado pero finalizado por seal" #: src/support.c:281 msgid "failed - unknown error code" msgstr "Fallo - cdigo de fallo desconocido" #: src/support.c:283 #, c-format msgid "Script '%s' %s\n" msgstr "Programa '%s' %s\n" #: pbbcmd/pbbcmd.c:180 msgid "Server not found" msgstr "Servidor no encontrado" #: pbbcmd/pbbcmd.c:181 msgid "Registration failed" msgstr "Fallo de registro" #: pbbcmd/pbbcmd.c:192 #, c-format msgid "%s (version %s) - control client for pbbuttonsd.\n" msgstr "%s (versin %s) - cliente de control para pbbuttonsd.\n" #: pbbcmd/pbbcmd.c:193 #, c-format msgid "Usage:\n" msgstr "Uso:\n" #: pbbcmd/pbbcmd.c:197 #, c-format msgid "" "Options:\n" " -%c, --help display this help and exit\n" " -%c, --version display version information and exit\n" " -%c, --ignore ignore config return and error values\n" msgstr "" "Opciones:\n" " -%c, --help muestra esta ayuda y finaliza\n" " -%c, --version muestra informacin de versin y finaliza\n" " -%c, --ignore ignora valores de retorno de configuracin y " "errores\n" #: pbbcmd/pbbcmd.c:210 #, c-format msgid "Supported commands:\n" msgstr "Comandos soportadas:\n" #: pbbcmd/pbbcmd.c:212 #, c-format msgid "%-14s - prints a list of clients attached\n" msgstr "%-14s - imprime una lista de clientes conectados\n" #: pbbcmd/pbbcmd.c:214 #, c-format msgid "%-14s - save the current configuration to disk\n" msgstr "%-14s - guarda a disco la configuracin actual\n" #: pbbcmd/pbbcmd.c:216 #, c-format msgid "%-14s - reinitialising the keyboard and the trackpad\n" msgstr "%-14s - reinicializando el teclado y trackpad\n" #: pbbcmd/pbbcmd.c:218 #, c-format msgid "%-14s - eject the CDROM\n" msgstr "%-14s - expulsa el CDROM\n" #: pbbcmd/pbbcmd.c:220 #, c-format msgid "%-14s - suspend to RAM\n" msgstr "%-14s - suspende a RAM\n" #: pbbcmd/pbbcmd.c:222 #, c-format msgid "%-14s - suspend to Disk\n" msgstr "%-14s - suspende a Disco\n" #: pbbcmd/pbbcmd.c:224 #, c-format msgid "%-14s - reconfigure server parameters\n" msgstr "%-14s - reconfigura parmetros del servidor\n" #: pbbcmd/pbbcmd.c:226 #, c-format msgid "%-14s - queries the server for certain parameters\n" msgstr "%-14s - consulta ciertos parmetros al servidor\n" #: pbbcmd/pbbcmd.c:235 #, c-format msgid "Supported tags:\n" msgstr "Etiquetas soportadas:\n" #: pbbcmd/pbbcmd.c:246 #, c-format msgid "The leading 'TAG_' could be omited.\n" msgstr "El prefijo TAG_ puede ser omitido.\n" #: pbbcmd/pbbcmd.c:269 #, c-format msgid "pbbcmd, version %s" msgstr "pbbcmd, versin %s" #: pbbcmd/pbbcmd.c:285 pbbcmd/pbbcmd.c:301 #, c-format msgid "ERROR: Missing arguments\n" msgstr "ERROR: No se indico argumentos\n" #: pbbcmd/pbbcmd.c:292 pbbcmd/pbbcmd.c:314 #, c-format msgid "WARNING: tag %s not supported.\n" msgstr "ADVERTENCIA: La etiqueta '%s' no est soportada.\n" #: pbbcmd/pbbcmd.c:304 #, c-format msgid "ERROR: tag/data pairs not complete.\n" msgstr "ERROR: El par etiqueta/dato est incompleto.\n" #: pbbcmd/pbbcmd.c:345 #, c-format msgid "Server didn't send an answer and timed out.\n" msgstr "" "El servidor no ha enviado respuesta y ha finalizado el tipo de espera.\n" #: pbbcmd/pbbcmd.c:427 #, c-format msgid "Sorry, Couldn't get data for %s: %s." msgstr "Disculpe, no se puede obtener datos para %s: %s." #: pbbcmd/pbbcmd.c:449 #, c-format msgid "Setting of %s failed: %s.\n" msgstr "Fallo en configuracin en %s: %s.\n" #: pbbcmd/pbbcmd.c:454 #, c-format msgid "ERROR: Unexpected answer from server, actioncode %ld.\n" msgstr "ERROR: Respuesta de servidor inesperada, cdigo de accin %ld.\n" #: pbbcmd/pbbcmd.c:463 #, c-format msgid "" " PID | Name | Port | Flags\n" " ------+----------------------+---------+-----------\n" msgstr "" " PID | Nombre | Puerto | Opciones\n" " -------+----------------------+---------+-----------\n" #: pbbcmd/pbbcmd.c:473 msgid "" msgstr "" #: pbbcmd/pbbcmd.c:491 #, c-format msgid "ERROR: Problems with IPC, maybe server is not running.\n" msgstr "ERROR: Problemas con IPC, tal vez el servidor no se est ejecutando.\n" #: pbbcmd/pbbcmd.c:495 #, c-format msgid "ERROR: Not enough memory for buffer.\n" msgstr "ERROR: No hay suficiente memoria para buffer.\n" #: libpbbipc/pbb_errno.c:73 msgid "ERROR" msgstr "ERROR" #: libpbbipc/pbb_errno.c:77 msgid "WARNING" msgstr "ADVERTENCIA" #: libpbbipc/pbb_errno.c:81 msgid "INFO" msgstr "INFO" pbbuttonsd-0.8.1a/po/de.gmo0000644000175000017500000003513010643747412012512 00000000000000,< g Y 8* Q2 |& 5 /  < U1 mB  > :E`}!)*= 2^)D!",<'i$! .Hd4>/D9J%76$3Xk?73QA==,C p2zwRt8 '3<G?/( *I1t*-"",9=f$ $2W'w+$?P`t!<AN   #@ ]h%{ j!!"6#%#S'#y6#<#N$#$d5$C$% %\% %z0%%%,%%&4&=6&r9&N&7'2P'j(' '8(D(>&(&( (,(!)#)A$)e+)>)G)!*=3*_*5**&*<+8+O7++++ ,,/,4K,C$,(,,5,b-/G-R-6.- .d8.n./wT1t*11I2 2Q2^F2{K23:33Y73w63:3*4!*4L-4w4&4-45"5%%5H5n5,5-5!52646I&6~!6A67 7757I 7_7k7(77,7O7K8K8'888+8(9',9P9}99,99: :' :7NfU%X&3yh'c`+~ Cu#t>qY / \Z? Ao9E Pk-wT,7szbQ6g[di"WxV|lG<JaM_}$2m R=@]Sr.8v*F:0B!pe4n({^O)DH1j5;KLI PID | Name | Port | Flags ------+----------------------+---------+----------- Configuration file for pbbuttonsd >= version 0.8.0 For complete list of options please see pbbuttonsd.cnf man-page. For description of the file format please see http://freedesktop.org/Standards/desktop-entry-spec. %-14s - eject the CDROM %-14s - prints a list of clients attached %-14s - queries the server for certain parameters %-14s - reconfigure server parameters %-14s - reinitialising the keyboard and the trackpad %-14s - save the current configuration to disk %-14s - suspend to Disk %-14s - suspend to RAM %s (version %s) - control client for pbbuttonsd. %s - daemon to support special features of laptops and notebooks. %s, version %sADB keyboard can't disable fnmode, force mode to 'fkeyslast'. ALSA MixerATI X1600 Backlight DriverAmbient light sensor found. Buffer overflowCan't access i2c device %s - %s. Can't attach card '%s': %s Can't create IBaM object, out of memory. Can't create message port for server: %s. Can't find pmud on port 879. Trigger PMU directly for sleep. Can't get devmask from mixer [%s]; using default. Can't get volume of master channel [%s]. Can't install PMU input handler. Some functionality may be missing. Can't install any signal handler Can't load card '%s': %s Can't load config file: %s, using defaults. Can't open %s. Eject CDROM won't work. Can't open ADB device %s: %s Can't open PMU device %s: %s Can't open card '%s': %s Can't open framebuffer device '%s'. Can't open mixer device [%s]. %s Can't register mixer: %s Can't write config file %s Card '%s' has no '%s' element. Configuration file [%s] is insecure, saving denied. Configuration file [%s] is not writable, saving not possible. Configuration saved to %s. Current battery cycle: %d, active logfile: %s. ERRORERROR: Have problems reading configuration file [%s]: %s ERROR: Missing arguments ERROR: Not enough memory for buffer. ERROR: Problems with IPC, maybe server is not running. ERROR: Unexpected answer from server, actioncode %ld. ERROR: tag/data pairs not complete. File doesn't existFile not a block deviceFile not a fileHelp or version infoINFOInitialized: %s Insufficient permissions for object %s, at least '0%o' needed. Memory allocation failed. Memory allocation failed: %s Messageport not availableMixer element '%s' has no playback volume control. No backlight driver available - check your Kernel configuration. No event devices available. Please check your configuration. No mixer driver available - check your Kernel configuration. Not all signal handlers could be installed. OSS MixerOption 'ALSA_Elements' contains no valid elements Options: -%c, --help display this help and exit -%c, --version display version information and exit -%c, --ignore ignore config return and error values Options: -%c, --help display this help text and exit -%c, --version display version information and exit -%c, --quiet suppress welcome message -%c, --detach[=PIDFILE] start %s as background process and optional use an alternative pid-file (default: %s) -%c, --configfile=CONFIG use alternative configuration file (default: %s) see configuration file for more options. Orphaned server port found and removed. All running clients have to be restarted. PMU Backlight DriverPermission deniedPlease check your CDROM settings in configuration file. Private TagRegistration failedSECURITY: %s must be owned by the same owner as pbbuttonsd. SECURITY: %s must only be writable by the owner of pbbuttonsd. Script '%s' %s Script '%s' can't be launched - fork() failed. Script '%s' doesn't exist. Script '%s' lauched but exitcode is %d. Script '%s' lauched but exited by signal. Script '%s' lauched but killed after %d seconds. Script '%s' launched and exited normally. Script '%s' skipped because it's not secure. Script must be write-only by ownerServer already runningServer didn't send an answer and timed out. Server is already running. Sorry, only one instance allowed. Server not foundSetting of %s failed: %s. Sorry, Couldn't get data for %s: %s.Supported commands: Supported tags: SysFS Backlight DriverThe leading 'TAG_' could be omited. The object '%s' doesn't exist. The object '%s' is not a block device. The object '%s' is not a character device. The object '%s' is not a directory. The object '%s' is not a file. Too many formatsigns. Max three %%s allowed in TAG_SCRIPTPMCS. Unknown MacBookUnknown MacBook ProUnknown MachineUnknown PowerBookUsage: Usage: %s [OPTION]... WARNINGWARNING: tag %s not supported. argument invalidcan't be launched - fork() failedconfig error: %s/%s contains non-integers - using defaults. config error: %s/%s needs exactly %d arguments - using defaults. doesn't existfailed - unknown error codeformat errorfunction not supportedlauched but exitcode is not nulllauched but exited by signallauched but killed after %d secondslaunched and exited normallyopen errorpbbcmd, version %spmud support compiled in and active. read-only valueskipped because it's not secureunknown tagwrite-only valueProject-Id-Version: pbbuttons 0.8.0 Report-Msgid-Bugs-To: matthiasgrimm@users.sourceforge.net POT-Creation-Date: 2007-07-07 19:36+0200 PO-Revision-Date: 2007-02-09 22:26+0100 Last-Translator: Matthias Grimm Language-Team: german MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1; PID | Name | Port | Schalter ------+----------------------+---------+----------- Konfigurationsdatei fr pbbuttonsd >= Verision 0.8.0 Fr die komplette Liste aller verfgbaren Optionen sehen Sie bitte in die pbbuttonsd.cnf man-page. Fr die Beschreibung des Dateiformates sehen Sie unter http://freedesktop.org/Standards/desktop-entry-spec. %-14s - wirft die CDROM aus %-14s - gibt eine Liste der angemeldeten Klienten aus %-14s - Afragen von Serverparametern %-14s - verndern von Serverparametern %-14s - Reinitialisiert die Tastatur und das Trackpad %-14s - speichert die aktuelle Konfiguration auf Festplatte %-14s - sichert den Systemzustand auf Festplatte und schaltet den Rechner aus %-14s - legt die Maschine schlafen %s (version %s) - Steuerungsprogramm fr PBButtonsd. %s - Daemon zur Nutzung spezieller Laptop und Notebook Fhigkeiten %s, Version %sDie Taste Fn kann auf ADB Tastaturen nicht abgeschaltet werden, erzwinge Modus 'fkeyslast'. ALSA MixerATI X1600 Treiber fr LCD HintergrundbeleuchtungUmgebungslichtsensor gefunden. Buffer bergelaufenKann auf I2C Gert %s nicht zugreifen - %s. Kann Card '%s' nicht hinzufgen: %s. Kann IBaM Objekt nicht erzeugen, zu wenig Speicher. Kann den Messageport fr den Server nicht anlegen: %s Kann pmud nicht finden. Schalte in den Replacement Mode. Kann verfgbare Kanle des Mixer [%s] nicht ermitteln, benutze Standardwerte. Kann Lautstrke des Masterkanals [%s] nicht ermitteln. Kann PMU Inputhandler nicht installieren. Einige Funktionen werden nicht gehen. Kann keinen Signalhandler installieren. Kann Card '%s' nicht laden: %s. Kann Konfigdatei %s nicht lesen, benutze Standardwerte. Kann %s nicht ffnen. Auswerfen der CDROM wird nicht funktionieren. Kann ADB Device [%s] nicht ffnen: %s Kann PMU Device [%s] nicht ffnen: %s Kann Card '%s' nicht ffnen: %s Kann Framebuffer Device '%s' nicht ffnen. Kann Mixer [%s] nicht ffnen: %s Kann Mixer nicht registrieren: %s. Kann Konfigdatei %s nicht speichern Card '%s' hat kein Element mit Namen '%s'. Konfigdatei [%s] ist unsicher; speichern der Konfig gesperrt. Konfigdatei [%s] nicht schreibbar; speichern der Konfig nicht mglich. Konfiguration in %s gespeichert. Aktueller Batteriezyklus: %d, aktive Logdatei: %s. FEHLERFEHLER: Problem beim Lesen der Konfigdatei [%s]: %s. FEHLER: Argumente fehlen. FEHLER: Zu wenig Speicher fr Buffer. FEHLER: IPC Problem, wahrscheinlich luft der Server nicht. FEHLER: Unerwartete Antwort vom Server, Actioncode %ld. FEHLER: Tag und Daten mssen immer paarweise auftreten Datei existiert nichtDie Datei ist kein BlockgertDie Datei ist keine DateiHilfe oder VersionsinformationenINFOAktiviert: %s Zugriffsrechte fr Objekt %s reichen nicht aus, bentige mindestens '0%o'. Speicheranforderung fehlgeschlagen. Speicheranforderung fehlgeschlagen: %s. Messageport nicht verfgbarMixer Element '%s' hat keine Lautstrke-Eigenschaft. Kein Treiber fr die Hintergrundbeleuchtung verfgbar, bitte prfen Sie Ihre Kernelkonfiguration. Kein Event Device verfgbar, bitte prfen Sie Ihre Systemkonfiguration Kein Treiber fr Soundmixer verfgbar, bitte prfen Sie Ihre Systemkonfiguration. Nicht alle Signal-Handler konnten installiert werden. OSS MixerOption 'ALSA_Elements' enthlt keine gltigen Elemente. Optionen: -%c, --help zeigt die Kurzhilfe an -%c, --version zeigt Versionsinformationen an -%c, --ignore ignoriere 'config'-Rckgabewerte und Fehlermeldungen Optionen: -%c, --help zeigt die Hilfe -%c, --version zeigt die Programmverion an -%c, --quiet unterdrckt die Startmeldung -%c, --detach[=PIDFILE] startet %s als Hintergrundprozess und verwendet ggf. eine alternative PID-Datei (Default: %s) -%c, --configfile=CONFIG benutze alternative Konfigurationsdatei (Default: %s) Siehe Konfigurationsdatei fr weitere Optionen. Verwaisten Serverport gelscht. Alle laufenden Clients mssen neu gestartet werden. PMU Treiber fr LCD HintergrundbeleuchtungZugriff verweigertBitte berprfen Sie ihre CDROM Einstellungen in der Konfigurationsdatei Privater TagRegistrierung fehlgeschlagenSICHERHEIT: Der Besitzer von %s und PBButtonsd mssen identisch sein. SICHERHEIT: %s darf nur durch den Besitzer von PBButtonsd schreibbar sein. Script '%s' %s Script '%s' nicht ausgefhrt - fork() ist fehlgeschlagen. Script '%s' existiert nicht. Script '%s' gestartet, aber mit Fehlercode %d beendet. Script '%s' gestartet, aber durch ein Signal beendet. Script '%s' gestartet, aber nach %d Sekunden abgebrochen. Script '%s' gestartet und normal beendet. Script '%s' bergangen weil nicht sicher. Script darf nur vom Besitzer schreibbar sein.Server luft bereitsDer Server antwortete nicht, Timeout. Der Server darf nur einmal gestartet werden. Server nicht gefundenSetzen von %s fehlgeschlagen: %s. Kann Daten fr %s nicht bekommen: %s.Untersttzte Befehle: Untersttzte Tags: SysFS Treiber fr LCD HintergrundbeleuchtungDas fhrende 'TAG_' kann weggelassen werden. Das Objekt '%s' existiert nicht. Das Object '%s' ist kein blockorientiertes Gert. Das Objekt '%s' ist kein zeichenorientiertes Gert. Das Objekt '%s' ist kein Verzeichnis. Das Objekt '%s' ist keine Datei. Zu viele Formatzeichen. Max. drei %%s in TAG_SCRIPTPMCS erlaubt. Unbekanntes MacBookUnbekanntes MacBook ProUnbekannter RechnerUnbekanntes PowerBookBenutzung: Benutzung: %s [Optionen]... WARNUNGWARNUNG: Tag %s wird nicht untersttzt. Ungltiges Argumentnicht ausgefhrt - fork() ist fehlgeschlagenKonfigurationsfehler: %s/%s enthlt ungltige Zahlen - verwende Standardwerte. Konfigurationsfehler: %s/%s braucht %d Argumente - verwende Standardwerte. existiert nichtfehlgeschlagen - unbekannter FehlercodeFehler im FormatFunktion nicht untersttztgestartet, aber der Exitcode ist nicht Nullgestartet, aber beendet durch ein Signalgestartet, aber nach %d Sekunden abgebrochengestartet und normal beendetFehler beim ffnenpbbcmd, Version %sPmud Untersttzung vorhanden und aktiviert. Wert kann nur gelesen werdenbergangen weil nicht sicherUnbekannter TagWert kann nur geschrieben werdenpbbuttonsd-0.8.1a/po/ca.gmo0000644000175000017500000002424610643747412012513 00000000000000Zg!*:2e&5/ %1 =B o   * = "2 `) D  '  D b $ !   /  K9 Q % 7 6 $ : _ r      3=;2yvRs8 <1n"~,=#4$Ot$?19Y!j   #< Yd%w tg_%41<.n-7Sq &#7STd5e%U:{))  3+._!%;Ha/zN=17i&$  (+8TH4 > N#:#H###>$$DB$_$?$B%%E"%]%%%%#%C%&;&P&_&},&&)& &#&' '0,'E$'r*''''=((A(Y(v(3T*IP1XK> (2J: .FL A<EB=# 'N+QM%DH/@;!,$89UC&046WS7?O)V-Z"RG Y5 PID | Name | Port | Flags ------+----------------------+---------+----------- %-14s - eject the CDROM %-14s - prints a list of clients attached %-14s - queries the server for certain parameters %-14s - reconfigure server parameters %-14s - reinitialising the keyboard and the trackpad %-14s - save the current configuration to disk %-14s - suspend to RAM %s (version %s) - control client for pbbuttonsd. %s - daemon to support special features of laptops and notebooks. %s, version %sBuffer overflowCan't attach card '%s': %s Can't create message port for server: %s. Can't find pmud on port 879. Trigger PMU directly for sleep. Can't get devmask from mixer [%s]; using default. Can't get volume of master channel [%s]. Can't install PMU input handler. Some functionality may be missing. Can't load card '%s': %s Can't open %s. Eject CDROM won't work. Can't open ADB device %s: %s Can't open PMU device %s: %s Can't open card '%s': %s Can't open framebuffer device '%s'. Can't open mixer device [%s]. %s Can't register mixer: %s Card '%s' has no '%s' element. Current battery cycle: %d, active logfile: %s. ERRORERROR: Have problems reading configuration file [%s]: %s ERROR: Missing arguments ERROR: Not enough memory for buffer. ERROR: Problems with IPC, maybe server is not running. ERROR: Unexpected answer from server, actioncode %ld. ERROR: tag/data pairs not complete. File doesn't existFile not a block deviceFile not a fileHelp or version infoINFOMemory allocation failed. Memory allocation failed: %s Messageport not availableMixer element '%s' has no playback volume control. No event devices available. Please check your configuration. Option 'ALSA_Elements' contains no valid elements Options: -%c, --help display this help and exit -%c, --version display version information and exit -%c, --ignore ignore config return and error values Options: -%c, --help display this help text and exit -%c, --version display version information and exit -%c, --quiet suppress welcome message -%c, --detach[=PIDFILE] start %s as background process and optional use an alternative pid-file (default: %s) -%c, --configfile=CONFIG use alternative configuration file (default: %s) see configuration file for more options. Orphaned server port found and removed. All running clients have to be restarted. Permission deniedPlease check your CDROM settings in configuration file. Private TagRegistration failedSECURITY: %s must be owned by the same owner as pbbuttonsd. Script '%s' %s Script must be write-only by ownerServer already runningServer didn't send an answer and timed out. Server is already running. Sorry, only one instance allowed. Server not foundSetting of %s failed: %s. Sorry, Couldn't get data for %s: %s.Supported commands: Supported tags: The leading 'TAG_' could be omited. Too many formatsigns. Max three %%s allowed in TAG_SCRIPTPMCS. Unknown PowerBookUsage: Usage: %s [OPTION]... WARNINGWARNING: tag %s not supported. argument invalidcan't be launched - fork() faileddoesn't existfailed - unknown error codeformat errorfunction not supportedlauched but exitcode is not nulllauched but exited by signallauched but killed after %d secondslaunched and exited normallyopen errorpbbcmd, version %spmud support compiled in and active. read-only valueskipped because it's not secureunknown tagwrite-only valueProject-Id-Version: ca Report-Msgid-Bugs-To: matthiasgrimm@users.sourceforge.net POT-Creation-Date: 2007-07-07 19:36+0200 PO-Revision-Date: 2005-07-04 11:30+0200 Last-Translator: Oriol Pellicer i Sabrià Language-Team: català MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Generator: KBabel 1.10 PID | Nom | Port | Flags ------+----------------------+---------+----------- %-14s - expulsa el cdrom %-14s - llista els clients associats %-14s - interroga el servidor per certs paràmetres %-14s - reconfigura els paràmetres del servidor %-14s - reinicialitza el teclat i el trackpad %-14s - desa la configuració actual al disc %-14s - suspèn a la RAM %s (versió %s) - client de control per al pbbuttonsd. %s - dimoni per al suport de característiques especials en ordinadors portàtils. %s, versió %sDesbordament de la memòria intermitjaNo es pot afegir la tarja '%s': %s No es pot crear el port de missatges pel servidor. %s. No es troba el pmud en el port 879. Provocant directament PMU per adormir l'equip. No es pot accedir al devmask del mesclador [%s]; utilitzant els valors per defecte. No es pot accedir al volum del canal principal [%s]. No es pot instal·lar el manegador de les entrades PMU. Es pot trobar a faltar alguna funcionalitat. No es pot carregar la tarja '%s': %s No es pot obrir %s. L'expulsió del CDROM no funcionarà. No es pot obrir el dispositiu ADB %s: %s No es pot obrir el dispositiu PMU %s: %s No es pot obrir la tarja %s: %s No es pot obrir el dispositiu de framebuffer '%s'. No es pot obrir la unitat mescladora [%s]. %s No es pot obrir el mesclador: %s La tarja '%s' no té l'element '%s'. cicle de bateria actual: %d, fitxer de registre actiu: %s. ERRORERROR: S'han trobat problemes llegint l'arxiu de configuració [%s]: %s ERROR: Falten arguments ERROR: No queda suficient memòria pel buffer. ERROR: Problemes amb IPC, pot ser que el servidor no estigui en funcionament. ERROR: Resposta inesperada del servidor, codi d'acció: %ld. ERROR: la parella etiqueta/data no és completa. El fitxer no existeixEl fitxer no és un dispositiu de blocEl fitxer no és un fitxerAjuda o informació sobre la versióINFORMACIÓMemory allocation failed. Memory allocation failed: %s El port de missatges no està disponibleEl mesclador '%s' no té control de volum del playback. No hi ha disponible cap dispositiu d'events. Comprova la configuració. L'opció 'ALSA_Elements' no conté elements vàlids Opcions: -%c, --help mostra per pantalla aquesta ajuda i surt -%c, --version mostra per pantalla informació sobre la versió i surt -%c, --ignore ignora valors de configuració i d'error Opcions: -%c, --help mostra aquest text i surt -%c, --version mostra informació sobre la versió i surt -%c, --quiet elimina els missatges de benvinguda -%c, --detach[=PIDFILE] inicia %s com a procés en segon pla i opcionalment utilitza un arxiu identificador alternatiu (per defecte: %s) -%c, --configfile=CONFIG utilitza un arxiu de configuració alternatiu (per defecte: %s) per a més opcions consulta l'arxiu de configuració. S'ha eliminat un "orphaned server port". S'han de reiniciar tots els clients. Permís denegatSisplau comprova la configuració del CDROM al fitxer de configuració. Etiqueta privadaError de registreSEGURETAT: %s ha de ser del mateix propietari que pbbuttonsd. Arxiu de comandes '%s' %s Només el propietari ha de poder escriure en el fitxer de comandesEl servidor ja està funcionantTemps finalitzat, el servidor no ha pogut enviar una resposta. El servidor ja està funcionant. Només es permet una instància. No es troba el servidorL'ajustament de %s ha fallat: %s. No es pot obtenir la data per %s: %s.Comandes suportades: Etiquetes suportades: El primer 'TAG_' podria ser omès. Massa signes de format. Màxim tres %%s permesos a TAG_SCRIPTPMCS. PowerBook desconegutUtilització: Utilització: %s[OPCIÓ]... ATENCIÓATENCIÓ: No està suportada l'etiqueta %s. argument no vàlidno pot ser llançat - ha fallat el fork()no existeixha fallat - codi d'error desconeguterror de formatfunció no suportadallançat però el codi de sortida no és nulllançat però finalitzat per senyalllançat però matat després de %d segonsllançament i sortida normalerror d'oberturapbbcmd, versió %sestà compilat amb support per pmud i aquest es troba actiu. valor de només lecturaignorat perquè no és seguretiqueta desconegudavalor de només escripturapbbuttonsd-0.8.1a/po/es.gmo0000644000175000017500000003571510643747412012542 00000000000000,< g Y 8* Q2 |& 5 /  < U1 mB  > :E`}!)*= 2^)D!",<'i$! .Hd4>/D9J%76$3Xk?73QA==,C p2zwRt8 '3<G?/( *I1t*-"",9=f$ $2W'w+$?P`t!<AN   #@ ]h%{ j!y"-"1"0",#$.#Q/###6#S$$m $|Q$$,$#%%<0%U)%9%B%N&-T&|3&d'+'j$'R'2()(A)(k#(0(1(0)1)M+)Q)M)*K=*k*F**.+E+E?+-++', ,3,L,k,pK, ,#, -H-4`-}U-f.4<. .6./B/i2B$22<2330>3BC33>34?41<4qR485=5:J5x!5G5L6-6z"60666&7%797_07z37$7!8Q8&8x88888 8189'&9:\9ai9 :(#:2:V:g5:|#:/: ;;';6$;I;n;;;NfU%X&3yh'c`+~ Cu#t>qY / \Z? Ao9E Pk-wT,7szbQ6g[di"WxV|lG<JaM_}$2m R=@]Sr.8v*F:0B!pe4n({^O)DH1j5;KLI PID | Name | Port | Flags ------+----------------------+---------+----------- Configuration file for pbbuttonsd >= version 0.8.0 For complete list of options please see pbbuttonsd.cnf man-page. For description of the file format please see http://freedesktop.org/Standards/desktop-entry-spec. %-14s - eject the CDROM %-14s - prints a list of clients attached %-14s - queries the server for certain parameters %-14s - reconfigure server parameters %-14s - reinitialising the keyboard and the trackpad %-14s - save the current configuration to disk %-14s - suspend to Disk %-14s - suspend to RAM %s (version %s) - control client for pbbuttonsd. %s - daemon to support special features of laptops and notebooks. %s, version %sADB keyboard can't disable fnmode, force mode to 'fkeyslast'. ALSA MixerATI X1600 Backlight DriverAmbient light sensor found. Buffer overflowCan't access i2c device %s - %s. Can't attach card '%s': %s Can't create IBaM object, out of memory. Can't create message port for server: %s. Can't find pmud on port 879. Trigger PMU directly for sleep. Can't get devmask from mixer [%s]; using default. Can't get volume of master channel [%s]. Can't install PMU input handler. Some functionality may be missing. Can't install any signal handler Can't load card '%s': %s Can't load config file: %s, using defaults. Can't open %s. Eject CDROM won't work. Can't open ADB device %s: %s Can't open PMU device %s: %s Can't open card '%s': %s Can't open framebuffer device '%s'. Can't open mixer device [%s]. %s Can't register mixer: %s Can't write config file %s Card '%s' has no '%s' element. Configuration file [%s] is insecure, saving denied. Configuration file [%s] is not writable, saving not possible. Configuration saved to %s. Current battery cycle: %d, active logfile: %s. ERRORERROR: Have problems reading configuration file [%s]: %s ERROR: Missing arguments ERROR: Not enough memory for buffer. ERROR: Problems with IPC, maybe server is not running. ERROR: Unexpected answer from server, actioncode %ld. ERROR: tag/data pairs not complete. File doesn't existFile not a block deviceFile not a fileHelp or version infoINFOInitialized: %s Insufficient permissions for object %s, at least '0%o' needed. Memory allocation failed. Memory allocation failed: %s Messageport not availableMixer element '%s' has no playback volume control. No backlight driver available - check your Kernel configuration. No event devices available. Please check your configuration. No mixer driver available - check your Kernel configuration. Not all signal handlers could be installed. OSS MixerOption 'ALSA_Elements' contains no valid elements Options: -%c, --help display this help and exit -%c, --version display version information and exit -%c, --ignore ignore config return and error values Options: -%c, --help display this help text and exit -%c, --version display version information and exit -%c, --quiet suppress welcome message -%c, --detach[=PIDFILE] start %s as background process and optional use an alternative pid-file (default: %s) -%c, --configfile=CONFIG use alternative configuration file (default: %s) see configuration file for more options. Orphaned server port found and removed. All running clients have to be restarted. PMU Backlight DriverPermission deniedPlease check your CDROM settings in configuration file. Private TagRegistration failedSECURITY: %s must be owned by the same owner as pbbuttonsd. SECURITY: %s must only be writable by the owner of pbbuttonsd. Script '%s' %s Script '%s' can't be launched - fork() failed. Script '%s' doesn't exist. Script '%s' lauched but exitcode is %d. Script '%s' lauched but exited by signal. Script '%s' lauched but killed after %d seconds. Script '%s' launched and exited normally. Script '%s' skipped because it's not secure. Script must be write-only by ownerServer already runningServer didn't send an answer and timed out. Server is already running. Sorry, only one instance allowed. Server not foundSetting of %s failed: %s. Sorry, Couldn't get data for %s: %s.Supported commands: Supported tags: SysFS Backlight DriverThe leading 'TAG_' could be omited. The object '%s' doesn't exist. The object '%s' is not a block device. The object '%s' is not a character device. The object '%s' is not a directory. The object '%s' is not a file. Too many formatsigns. Max three %%s allowed in TAG_SCRIPTPMCS. Unknown MacBookUnknown MacBook ProUnknown MachineUnknown PowerBookUsage: Usage: %s [OPTION]... WARNINGWARNING: tag %s not supported. argument invalidcan't be launched - fork() failedconfig error: %s/%s contains non-integers - using defaults. config error: %s/%s needs exactly %d arguments - using defaults. doesn't existfailed - unknown error codeformat errorfunction not supportedlauched but exitcode is not nulllauched but exited by signallauched but killed after %d secondslaunched and exited normallyopen errorpbbcmd, version %spmud support compiled in and active. read-only valueskipped because it's not secureunknown tagwrite-only valueProject-Id-Version: pbbuttonsd 0.8.0 Report-Msgid-Bugs-To: matthiasgrimm@users.sourceforge.net POT-Creation-Date: 2007-07-07 19:36+0200 PO-Revision-Date: 2007-02-11 22:21-0300 Last-Translator: Gustavo Boksar Language-Team: Debian l10n spanish team MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit X-Poedit-Language: Spanish X-Poedit-SourceCharset: iso-8859-1 PID | Nombre | Puerto | Opciones -------+----------------------+---------+----------- Archivo de configuracin para pbbuttonsd >= versin 0.8.0 Para obtener una lista completa de opciones vea pbbuttonsd.cnf %-14s - expulsa el CDROM %-14s - imprime una lista de clientes conectados %-14s - consulta ciertos parmetros al servidor %-14s - reconfigura parmetros del servidor %-14s - reinicializando el teclado y trackpad %-14s - guarda a disco la configuracin actual %-14s - suspende a Disco %-14s - suspende a RAM %s (versin %s) - cliente de control para pbbuttonsd. %s - demonio para soporte de caractersticas especiales de ordenadores porttiles. %s, versin %sEl teclado ADB no puede deshabilitar el fnmode, fuerze la modalidad 'fkevslast'. Mezclador ALSAControlador de Retro-iluminacin ATI X1 1600Sensor de luz ambiente encontrado. Desbordamiento de bufferNo se puede acceder a dispositivos i2c %s - %s. No se puede adjuntar la tarjeta '%s': %s No se pudo crear objeto IBaM, no hay memoria suficiente. No se puede crear el transporte de mensajes para el servidor: %s. No se pudo encontrar pmud en puerto 879. Usar direcamente PMU para suspender. No se puede obtener devmask para mezclador [%s]; se usarn valores predeterminados. No se puede obtener volumen de canal maestro [%s]. No se pudo instalar gestor de entrada de PMU. Algunas funcionalidades podran no estar disponibles. No se pudo instalar ningn gestor de seal No se puede cargar tarjeta %s: %s No se puede leer fichero de configuracin: %s, se usarn valores predeterminados. No se puede abrir %s. No se podr expulsar CDROM. No se puede abrir dispositivo ADB %s: %s No se puede abrir dispositivo PMU %s: %s No se puede abrir tarjeta '%s': %s No se puede abrir dispositivo framebuffer '%s'. No se puede abrir dispositivo de mezcla [%s]. %s No se puede registrar dispositivo de mezcla: %s No se puede escribir fichero de configuracin %s La tarjeta '%s' no tiene el elemento '%s'. El fichero de configuracin [%s] es inseguro, el permiso de guardar es denegado. No se puede escribir en el fichero de configuracin [%s], imposible guardar. Configuracin almacenada en %s Ciclo actual de batera: %d, fichero de registro activo: %s. ERRORERROR: Ocurrieron problemas al leer fichero de configuracin [%s]: %s ERROR: No se indico argumentos ERROR: No hay suficiente memoria para buffer. ERROR: Problemas con IPC, tal vez el servidor no se est ejecutando. ERROR: Respuesta de servidor inesperada, cdigo de accin %ld. ERROR: El par etiqueta/dato est incompleto. Fichero no existeFichero no es un dispositivo de bloquesFichero no es un ficheroAyuda o informacin de versinINFOInicia;izado: %s Permisos insuficientes para el objeto '%s', se requiere como mnimo 0%o. Fallo en asignacin de memoria. Fallo en asignacin de memoria: %s Puerto de mensajes no disponibleEl elemento mezclador '%s' no tiene control de volumen de reproduccin. No hay controladores de retro-iluminacindisponibles - verifique la configuracin de su Kernel. No existen dispositivos de eventos disponibles. Por favor verifique suconfiguracin. No hay controladores para mezclador de sonido disponibles - Verificque la configuracin de su Kernel. No todos los gestores de seales han podido ser instalados. Mezclador OSSLa opcin 'ALSA_Elements' no tiene elementos vlidos. Opciones: -%c, --help muestra esta ayuda y finaliza -%c, --version muestra informacin de versin y finaliza -%c, --ignore ignora valores de retorno de configuracin y errores Opciones: -%c, --help muestra este mensaje y finaliza -%c, --version muestra informacin de versin y finaliza -%c, --quiet no muestra el mensaje de bienvenida -%c, --detach[=FICHEROPID] inicia %s como proceso en segundo plano y opcionalmente usa un fichero pid alternativo (predeterminado: %s) -%c, --configfile=CONFIG usar un fichero de configuracin alternativo (predeterminado: %s) vase ficheros de configuracin para ms opciones. Se ha encontrado un puerto de servidor hurfano y se ha eliminado. Se debe reiniciar todos los clientes. Controlador de Retro-iluminacin PMUPermiso denegadoPor favor verifique los valores de configuracin del CDROM. Etiqueta privadaFallo de registroSEGURIDAD: %s debe tener el mismo propietario que pbbuttonsd. SEGURIDAD: Slo el propietario de pbbuttonsd puede escribir en %s. Programa '%s' %s El script '%s' no puede ser ejecutado - Ha fallado el fork(). El script '%s' no existe. Se ha ejecutado el script '%s' pero el cdigo de salida es %d. Se ha ejecutado el script '%s' pero ha terminado por seal. Se ha ejecutado el script '%s' pero se ha matado el proceso luego de %d segundos. Se ha ejecutado el script '%s' y terminado normalmente. El script '%s' no se ha ejecutado debido a que no es seguro. El programa debe tener permisos de escritura solamente para el propietarioEl servidor ya se est ejecutandoEl servidor no ha enviado respuesta y ha finalizado el tipo de espera. El servidor ya se est ejecutando. Disculpe, solo se permite una instancia. Servidor no encontradoFallo en configuracin en %s: %s. Disculpe, no se puede obtener datos para %s: %s.Comandos soportadas: Etiquetas soportadas: Controlador de Retro-iluminacin SysFSEl prefijo TAG_ puede ser omitido. El objeto '%s' no existe. El objeto '%s' no es un dispositivo de bloques. El objeto '%s' no es un dispositivo de caracteres. El objeto '%s' no es un directorio. El objeto '%s' no es un fichero. Demasiados signos de formato. El mximo permitido es tres %%s en TAG_SCRIPTPMCS. MacBook desconocidaMacBook Pro desconocidaEquipo desconocidoPowerBook desconocidaUso: Uso: %s [OPCIN]... ADVERTENCIAADVERTENCIA: La etiqueta '%s' no est soportada. Argumento invlidono se puede ejecutar - fallo en fork()Error de configuracin: %s/%s no contiene nmeros enteros - utilizando valores por defecto. Error de configuracin: %s/%s necesita de exactamente %d argumentos - Utilizando argumentos por defecto. no existeFallo - cdigo de fallo desconocidoError de formatoFuncin no soportadaejecutado pero el cdigo de finalizacin no es nullejecutado pero finalizado por sealejecutado pero terminado despus de %d segundoscargado y finalizado normalmenteError al abrirpbbcmd, versin %sSoporte de pmud compilado y activo. Valor de solo lecturasaltado porque no es seguroEtiqueta desconocidaValor de solo escriturapbbuttonsd-0.8.1a/po/pbbuttonsd.pot0000644000175000017500000003170210643747410014325 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Matthias Grimm # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: matthiasgrimm@users.sourceforge.net\n" "POT-Creation-Date: 2007-07-07 19:36+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: src/init.c:187 #, c-format msgid "%s, version %s" msgstr "" #: src/init.c:201 #, c-format msgid "ERROR: Have problems reading configuration file [%s]: %s\n" msgstr "" #: src/init.c:207 #, c-format msgid "%s - daemon to support special features of laptops and notebooks.\n" msgstr "" #: src/init.c:208 #, c-format msgid "Usage: %s [OPTION]... \n" msgstr "" #: src/init.c:209 #, c-format msgid "" "Options:\n" " -%c, --help display this help text and exit\n" " -%c, --version display version information and exit\n" " -%c, --quiet suppress welcome message\n" " -%c, --detach[=PIDFILE] start %s as background process and\n" " optional use an alternative pid-file\n" " (default: %s)\n" " -%c, --configfile=CONFIG use alternative configuration file\n" " (default: %s)\n" "see configuration file for more options.\n" msgstr "" #: src/init.c:327 msgid "Not all signal handlers could be installed.\n" msgstr "" #: src/init.c:329 msgid "Can't install any signal handler\n" msgstr "" #: src/init.c:362 #, c-format msgid "Can't create message port for server: %s.\n" msgstr "" #: src/init.c:365 msgid "Server is already running. Sorry, only one instance allowed.\n" msgstr "" #: src/init.c:368 msgid "" "Orphaned server port found and removed. All running clients have to be " "restarted.\n" msgstr "" #: src/input_manager.c:336 msgid "No event devices available. Please check your configuration.\n" msgstr "" #: src/module_cdrom.c:64 msgid "Please check your CDROM settings in configuration file.\n" msgstr "" #: src/module_cdrom.c:351 #, c-format msgid "Can't open %s. Eject CDROM won't work.\n" msgstr "" #: src/module_display.c:167 msgid "Ambient light sensor found.\n" msgstr "" #: src/module_display.c:1320 src/module_display.c:1367 #, c-format msgid "Can't open framebuffer device '%s'.\n" msgstr "" #: src/module_peep.c:170 pbbcmd/pbbcmd.c:168 msgid "Permission denied" msgstr "" #: src/module_peep.c:171 pbbcmd/pbbcmd.c:169 msgid "Private Tag" msgstr "" #: src/module_peep.c:172 pbbcmd/pbbcmd.c:170 msgid "File doesn't exist" msgstr "" #: src/module_peep.c:173 pbbcmd/pbbcmd.c:171 msgid "File not a character device" msgstr "" #: src/module_peep.c:174 pbbcmd/pbbcmd.c:172 msgid "File not a block device" msgstr "" #: src/module_peep.c:175 pbbcmd/pbbcmd.c:173 msgid "File not a file" msgstr "" #: src/module_peep.c:176 pbbcmd/pbbcmd.c:174 msgid "Buffer overflow" msgstr "" #: src/module_peep.c:177 pbbcmd/pbbcmd.c:175 msgid "open error" msgstr "" #: src/module_peep.c:178 pbbcmd/pbbcmd.c:176 msgid "format error" msgstr "" #: src/module_peep.c:179 pbbcmd/pbbcmd.c:177 msgid "Messageport not available" msgstr "" #: src/module_peep.c:180 pbbcmd/pbbcmd.c:178 msgid "Server already running" msgstr "" #: src/module_peep.c:181 pbbcmd/pbbcmd.c:179 msgid "Help or version info" msgstr "" #: src/module_peep.c:182 pbbcmd/pbbcmd.c:182 msgid "Insecure script owner" msgstr "" #: src/module_peep.c:183 pbbcmd/pbbcmd.c:183 msgid "Script must be write-only by owner" msgstr "" #: src/module_peep.c:184 pbbcmd/pbbcmd.c:184 msgid "read-only value" msgstr "" #: src/module_peep.c:185 pbbcmd/pbbcmd.c:185 msgid "write-only value" msgstr "" #: src/module_peep.c:186 pbbcmd/pbbcmd.c:186 msgid "argument invalid" msgstr "" #: src/module_peep.c:187 pbbcmd/pbbcmd.c:187 msgid "function not supported" msgstr "" #: src/module_peep.c:352 msgid "unknown tag" msgstr "" #: src/module_pmac.c:139 src/driver_backlight_pmu.c:161 #, c-format msgid "Can't open PMU device %s: %s\n" msgstr "" #: src/module_pmac.c:146 src/driver_backlight_pmu.c:172 #, c-format msgid "Can't open ADB device %s: %s\n" msgstr "" #: src/module_pmac.c:181 msgid "pmud support compiled in and active.\n" msgstr "" #: src/module_pmac.c:203 msgid "Can't install PMU input handler. Some functionality may be missing.\n" msgstr "" #: src/module_pmac.c:440 msgid "ADB keyboard can't disable fnmode, force mode to 'fkeyslast'.\n" msgstr "" #: src/module_pmac.c:699 msgid "Can't find pmud on port 879. Trigger PMU directly for sleep.\n" msgstr "" #: src/module_pmac.c:1407 #, c-format msgid "Can't access i2c device %s - %s.\n" msgstr "" #: src/module_pmac.c:1636 msgid "Unknown PowerBook" msgstr "" #: src/module_pmac.c:1720 #, c-format msgid "Current battery cycle: %d, active logfile: %s.\n" msgstr "" #: src/module_imac.c:233 msgid "Unknown MacBook" msgstr "" #: src/module_imac.c:245 msgid "Unknown MacBook Pro" msgstr "" #: src/module_imac.c:270 msgid "Unknown Machine" msgstr "" #: src/module_powersave.c:168 msgid "Can't create IBaM object, out of memory.\n" msgstr "" #: src/module_powersave.c:303 #, c-format msgid "Too many formatsigns. Max three %%s allowed in TAG_SCRIPTPMCS.\n" msgstr "" #: src/class_mixer.c:76 src/class_backlight.c:72 #, c-format msgid "Initialized: %s\n" msgstr "" #: src/class_mixer.c:78 msgid "No mixer driver available - check your Kernel configuration.\n" msgstr "" #: src/driver_mixer_alsa.c:101 msgid "Memory allocation failed.\n" msgstr "" #: src/driver_mixer_alsa.c:116 #, c-format msgid "Card '%s' has no '%s' element.\n" msgstr "" #: src/driver_mixer_alsa.c:127 msgid "Option 'ALSA_Elements' contains no valid elements\n" msgstr "" #: src/driver_mixer_alsa.c:134 #, c-format msgid "Mixer element '%s' has no playback volume control.\n" msgstr "" #: src/driver_mixer_alsa.c:151 #, c-format msgid "Memory allocation failed: %s\n" msgstr "" #: src/driver_mixer_alsa.c:169 #, c-format msgid "Can't open card '%s': %s\n" msgstr "" #: src/driver_mixer_alsa.c:173 #, c-format msgid "Can't attach card '%s': %s\n" msgstr "" #: src/driver_mixer_alsa.c:178 #, c-format msgid "Can't register mixer: %s\n" msgstr "" #: src/driver_mixer_alsa.c:185 #, c-format msgid "Can't load card '%s': %s\n" msgstr "" #: src/driver_mixer_alsa.c:373 msgid "ALSA Mixer" msgstr "" #: src/driver_mixer_oss.c:185 #, c-format msgid "Can't get devmask from mixer [%s]; using default.\n" msgstr "" #: src/driver_mixer_oss.c:191 #, c-format msgid "Can't get volume of master channel [%s].\n" msgstr "" #: src/driver_mixer_oss.c:194 #, c-format msgid "Can't open mixer device [%s]. %s\n" msgstr "" #: src/driver_mixer_oss.c:357 msgid "OSS Mixer" msgstr "" #: src/class_config.c:84 msgid "" " Configuration file for pbbuttonsd >= version 0.8.0\n" " For complete list of options please see pbbuttonsd.cnf man-page.\n" " For description of the file format please see\n" " http://freedesktop.org/Standards/desktop-entry-spec.\n" msgstr "" #: src/class_config.c:90 #, c-format msgid "Can't load config file: %s, using defaults.\n" msgstr "" #: src/class_config.c:144 #, c-format msgid "Configuration saved to %s.\n" msgstr "" #: src/class_config.c:147 #, c-format msgid "Can't write config file %s\n" msgstr "" #: src/class_config.c:182 #, c-format msgid "Configuration file [%s] is insecure, saving denied.\n" msgstr "" #: src/class_config.c:184 #, c-format msgid "Configuration file [%s] is not writable, saving not possible.\n" msgstr "" #: src/class_config.c:672 #, c-format msgid "config error: %s/%s contains non-integers - using defaults.\n" msgstr "" #: src/class_config.c:675 #, c-format msgid "config error: %s/%s needs exactly %d arguments - using defaults.\n" msgstr "" #: src/class_backlight.c:74 msgid "No backlight driver available - check your Kernel configuration.\n" msgstr "" #: src/driver_backlight_pmu.c:135 msgid "PMU Backlight Driver" msgstr "" #: src/driver_backlight_sysfs.c:163 msgid "SysFS Backlight Driver" msgstr "" #: src/driver_backlight_x1600.c:143 msgid "ATI X1600 Backlight Driver" msgstr "" #: src/support.c:59 #, c-format msgid "The object '%s' doesn't exist.\n" msgstr "" #: src/support.c:62 #, c-format msgid "The object '%s' is not a file.\n" msgstr "" #: src/support.c:65 #, c-format msgid "The object '%s' is not a directory.\n" msgstr "" #: src/support.c:68 #, c-format msgid "The object '%s' is not a character device.\n" msgstr "" #: src/support.c:71 #, c-format msgid "The object '%s' is not a block device.\n" msgstr "" #: src/support.c:74 #, c-format msgid "SECURITY: %s must be owned by the same owner as pbbuttonsd.\n" msgstr "" #: src/support.c:77 #, c-format msgid "SECURITY: %s must only be writable by the owner of pbbuttonsd.\n" msgstr "" #: src/support.c:80 #, c-format msgid "Insufficient permissions for object %s, at least '0%o' needed.\n" msgstr "" #: src/support.c:157 #, c-format msgid "Script '%s' lauched but killed after %d seconds.\n" msgstr "" #: src/support.c:180 #, c-format msgid "Script '%s' lauched but exitcode is %d.\n" msgstr "" #: src/support.c:182 #, c-format msgid "Script '%s' launched and exited normally.\n" msgstr "" #: src/support.c:184 #, c-format msgid "Script '%s' lauched but exited by signal.\n" msgstr "" #: src/support.c:224 #, c-format msgid "Script '%s' can't be launched - fork() failed.\n" msgstr "" #: src/support.c:228 #, c-format msgid "Script '%s' doesn't exist.\n" msgstr "" #: src/support.c:230 #, c-format msgid "Script '%s' skipped because it's not secure.\n" msgstr "" #: src/support.c:257 msgid "launched and exited normally" msgstr "" #: src/support.c:260 msgid "doesn't exist" msgstr "" #: src/support.c:265 msgid "skipped because it's not secure" msgstr "" #: src/support.c:268 #, c-format msgid "lauched but killed after %d seconds" msgstr "" #: src/support.c:272 msgid "lauched but exitcode is not null" msgstr "" #: src/support.c:275 msgid "can't be launched - fork() failed" msgstr "" #: src/support.c:278 msgid "lauched but exited by signal" msgstr "" #: src/support.c:281 msgid "failed - unknown error code" msgstr "" #: src/support.c:283 #, c-format msgid "Script '%s' %s\n" msgstr "" #: pbbcmd/pbbcmd.c:180 msgid "Server not found" msgstr "" #: pbbcmd/pbbcmd.c:181 msgid "Registration failed" msgstr "" #: pbbcmd/pbbcmd.c:192 #, c-format msgid "%s (version %s) - control client for pbbuttonsd.\n" msgstr "" #: pbbcmd/pbbcmd.c:193 #, c-format msgid "Usage:\n" msgstr "" #: pbbcmd/pbbcmd.c:197 #, c-format msgid "" "Options:\n" " -%c, --help display this help and exit\n" " -%c, --version display version information and exit\n" " -%c, --ignore ignore config return and error values\n" msgstr "" #: pbbcmd/pbbcmd.c:210 #, c-format msgid "Supported commands:\n" msgstr "" #: pbbcmd/pbbcmd.c:212 #, c-format msgid "%-14s - prints a list of clients attached\n" msgstr "" #: pbbcmd/pbbcmd.c:214 #, c-format msgid "%-14s - save the current configuration to disk\n" msgstr "" #: pbbcmd/pbbcmd.c:216 #, c-format msgid "%-14s - reinitialising the keyboard and the trackpad\n" msgstr "" #: pbbcmd/pbbcmd.c:218 #, c-format msgid "%-14s - eject the CDROM\n" msgstr "" #: pbbcmd/pbbcmd.c:220 #, c-format msgid "%-14s - suspend to RAM\n" msgstr "" #: pbbcmd/pbbcmd.c:222 #, c-format msgid "%-14s - suspend to Disk\n" msgstr "" #: pbbcmd/pbbcmd.c:224 #, c-format msgid "%-14s - reconfigure server parameters\n" msgstr "" #: pbbcmd/pbbcmd.c:226 #, c-format msgid "%-14s - queries the server for certain parameters\n" msgstr "" #: pbbcmd/pbbcmd.c:235 #, c-format msgid "Supported tags:\n" msgstr "" #: pbbcmd/pbbcmd.c:246 #, c-format msgid "The leading 'TAG_' could be omited.\n" msgstr "" #: pbbcmd/pbbcmd.c:269 #, c-format msgid "pbbcmd, version %s" msgstr "" #: pbbcmd/pbbcmd.c:285 pbbcmd/pbbcmd.c:301 #, c-format msgid "ERROR: Missing arguments\n" msgstr "" #: pbbcmd/pbbcmd.c:292 pbbcmd/pbbcmd.c:314 #, c-format msgid "WARNING: tag %s not supported.\n" msgstr "" #: pbbcmd/pbbcmd.c:304 #, c-format msgid "ERROR: tag/data pairs not complete.\n" msgstr "" #: pbbcmd/pbbcmd.c:345 #, c-format msgid "Server didn't send an answer and timed out.\n" msgstr "" #: pbbcmd/pbbcmd.c:427 #, c-format msgid "Sorry, Couldn't get data for %s: %s." msgstr "" #: pbbcmd/pbbcmd.c:449 #, c-format msgid "Setting of %s failed: %s.\n" msgstr "" #: pbbcmd/pbbcmd.c:454 #, c-format msgid "ERROR: Unexpected answer from server, actioncode %ld.\n" msgstr "" #: pbbcmd/pbbcmd.c:463 #, c-format msgid "" " PID | Name | Port | Flags\n" " ------+----------------------+---------+-----------\n" msgstr "" #: pbbcmd/pbbcmd.c:473 msgid "" msgstr "" #: pbbcmd/pbbcmd.c:491 #, c-format msgid "ERROR: Problems with IPC, maybe server is not running.\n" msgstr "" #: pbbcmd/pbbcmd.c:495 #, c-format msgid "ERROR: Not enough memory for buffer.\n" msgstr "" #: libpbbipc/pbb_errno.c:73 msgid "ERROR" msgstr "" #: libpbbipc/pbb_errno.c:77 msgid "WARNING" msgstr "" #: libpbbipc/pbb_errno.c:81 msgid "INFO" msgstr "" pbbuttonsd-0.8.1a/po/stamp-po0000644000175000017500000000001210643747412013070 00000000000000timestamp pbbuttonsd-0.8.1a/po/ChangeLog0000644000175000017500000001454310641705150013164 000000000000002004-01-17 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2004-01-17 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2004-01-08 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-12-29 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-12-29 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-12-27 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-12-19 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-12-05 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-12-05 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-12 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-12 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-12 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-12 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-12 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-12 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-12 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-10 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-09 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-08 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-04 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-01 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-10-31 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-10-30 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-10-29 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-10-07 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-10-06 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-10-06 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-10-02 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-30 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-30 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-24 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-24 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-24 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-24 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-22 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-22 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-22 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-22 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-22 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-22 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-13 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-13 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-13 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. pbbuttonsd-0.8.1a/README0000644000175000017500000002611510641704554011661 00000000000000 README ====== PBButtons is a program suite to support laptop specific functions and make them available again under Linux. Basically it was developed to support the special hotkeys of an Apple iBook, Powerbook or TiBook but since version 0.5 the design has been changed to support all kind of laptop or notebook. (c) 2002-2006 Matthias Grimm IBAM is (c) 2004-2006 Sebastian Ritterbusch With this programs the keys for the display brightness, the volume of speaker and headphone, the mute key and the eject key will do their job as expected. This package contains the PBButtons server: pbbuttonsd The server work as a daemon that do all the work. It runs in background and is preferable started at boot time. Multiple clients could register themselves to get messages about events from the server. The following list shows what's done by the daemon. Advanced Power Management: - suspend the machine (configurable) if idle to save energy, - prevent the machine from entering sleep mode if CPU or Net is busy until the job is finished, - send a warning if battery is running low, - configurable emergency actions if battery is critically low, - dims the display if user is passive to save energy - suspend the machine (configurable) if cover was closed, - executes external scripts on certain power management events to allow most flexibility, - is able to replace power management daemons like pmud, apmd, etc. Support for laptop dependent hotkeys: - to adjust display brightness - to adjust keyboard illumination, - to adjust the sound volume, - to mute/unmute the sound channels, - to open/close the CDROM tray, - to trigger sleep mode. - to switch external video on/off Support for laptop dependent specialities: - initializes trackpad and keyboard mode during startup, - disables trackpad's mouse click emulation while typing on a keyboard, - keeps keyboard settings during machine suspend, - cycles through the trackpad operating modes via hotkeys, - support ambient light sensor and automatic adjustment of LCD and keyboard brightness on PowerBooks and MacBook Pros. Currently the following events cause a message broadcast to clients: - The display brightness has changed by the user, - the keyboard brightness has changed by the user, - the speaker volume has changed by the user, - the speakers has been muted/unmuted by the user, - the battery is running out of energy, - the machine is going to enter sleep mode, - the machine is going to be shut down by the daemon and - the user wants to eject a cdrom. - the external video output has been switched on/off. It is up to the clients what they do with this messages. Due to the redesign of the client/server interface the versions 0.5.x isn't compatible to older versions. Older clients won't work with the new daemon. Please update also any clients you use. REQUIREMENTS ============ To use this program, you need some additional parts: 1. An laptop or notebook supported by pbbuttonsd. - Apple PowerBooks and iBooks are fully supported - Apple MacBooks are partially supported (brightness control, ambient sensor, basic ACPI handling). - Intel based laptops are supported without powermanagement and model specific features. Help with writing additional hardware modules to support more machines is always welcome. 2. Kernel support for /proc/pmu/ for battery features (only on pmac). 3. Kernel support for /dev/input/event% for input handling. This support is sufficiently implemented for Powerbooks in Kernel 2.4 (versions 2.4.18-rc2-benh or newer should be preferred). User of x86 notebooks need the full patch from Vojtech Pavlik. Kernel 2.6 should be prepared sufficiently. 4. OSS or ALSA Sounddriver, 5. GLib library 2.6 or later 6. Kernel 2.4.18-rc2-benh or later for full funcionallity. 7. Kernel 2.6.18 for sysfs backlight support INSTALLATION ============ To compile and install pbbuttonsd please see INSTALL. Pbbuttonsd can be compiled for a specific laptop model or family to support specific features. To do this the model must be specified and command line option for ./configure in the following manner: ./configure LAPTOP= Following models/families were supported: LAPTOP=[POWERBOOK | powerbook | pb | PB] PowerPC based Apple PowerBooks or iBooks, all models. LAPTOP=[MACBOOK | macbook | mb | MB] Intel based Apple MacBooks or MacBook Pros, all models. LAPTOP=[I386 | i386] Generic support for Intel based laptops. Up to now support for powermanagement and specific laptop features is missing but it's also up to you to push this tool forward. Two additional features could be activated at compile time. To do this call the configure script with the option --enable-: debug: Activates additional output to console. Pbbuttonsd should not be called with -d (detach) to get full benefit of this option. The complete internal data communication between modules and the current status of the sleeplocks will be displayed. The former features 'batcycle' and 'batlog' have become runtime options They are not longer available on compile level. Please see man-pages for details. One additional module could be activated at compile time. To do this call the configure script with the option --with-: ibam: This option will enable the intelligent battery monitor that uses statistical methods to increase accuracy of battery life time predictions. See the man page for full description. This option is enanbled by default. To disable is use the --without-ibam option. oss: The OSS mixer module will be compiled in. This is the default behaviour. If you don't have OSS on your system or you don't want to use it, give --without-oss to disable the OSS mixer module. alsa: The native ALSA mixer module will be compiled in. This would be the default behaviour if the ALSA libraries were found in your system. If you don't have ALSA or you don't want to use the native ALSA mixer give --without-alsa to disable it. ALSA's OSS emulation works also with the OSS mixer modules. -- if both mixer modules were compiled in you could choose -- -- the module to be used in pbbuttonsd's configuration file -- pmud: Additional code will be integrated in Pbbuttonsd to use pmud as low level power manager. Normally PBButtons will do all necessary jobs by its own, but for special applications it could make sense to keep pmud running. In this case PBButtons must be compiled with pmud support to cooperate and don't conflict with it. Compiled with pmud support PBButtonsd uses pmud to trigger sleep mode and release cover control. If the machine went to sleep after closing the lid would be the responsibility of pmud then. -- I recommend not to use this option. Compile pbbuttonsd -- -- without pmud support. It will work better. -- BUILDING FROM CVS ================= If you got the source from the CVS repository you would need to run ./autogen.sh first to build all necessary files for compiling. To do this the autotools (autoconf and automake) and a recent gettext development package have to be installed. After autogen.sh have successfully executed the program can be compiled and installed with the usual tripple: ./configure; make; make install. DIFFERENCES TO PMUD =================== PBButtonsd could be configured to work in friendly coexistence with pmud but it is designed to fully replace it. So, if there isn't any very good reason to keep pmud running, remove it and configure PBButtonsd to do all the jobs. This is also important because pmud's development has been given up. Of course there are a lot of differences between pmud and PBButtons and please read the documentation to catch all details. At this point only those pmud options should be discussed that PBButtonsd doesn't support. - test pccard eject >> Not possible on Pismo, it seems to be that the pmu doesn't >> recognize this key, need feedback from users in this case - option to send SIGPWR whenever sleep is requested or triggered >> I don't think that it would be meaningful but pmud did it. - maybe export pmu version in environment >> I don't think it's necessary except to be 100% compatible with pmud - option to disable backlight control by pbbuttonsd >> pmud has such an option but until now nobody requested it for >> pbbuttonsd. If so it could be easily implemented. You see that some options depend on user request. If you think you need one or more of the missing options or you missed any other feature, please write an email to me. Until now I always found a way to content the users. LEGAL NOTICE ============ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. CREDITS ======= Special thanks deserve some people who supported pbbuttonsd with their own contributions: ALSA mixer module from John Steele Scott catalan translation from David Riera and Oriol Pellicer spanish translation from Rudy Godoy This program wouldn't exists if not some people wrote other programs from which I learned how special things worked. I can't name all of them so I picked those out, whose programs I could call the 'parents' of PBButtons: keyevd from Joseph P. Garcia ikeyd from Stefan Pfetzing pmud from Stephan Leemburg snooze from Paul Mackerras and Stephan Leemburg trackpad from Ben Herrenschmidt fnset from Jimi X lmud from Andreas Jaggi alcd from Federico Gamio ibam from Sebastion Ritterbusch mbpeventd from Julien Blache Also thanks to all unknown developers, who make my little program possible. HOW IT WORKS ============ The daemon 'pbbuttonsd' gets its input directly from the keyboard event handler. Consequently the keys are always active. It doesn't matter if X11 is in front or if you are working on a console or which X11 window has the focus. You can always use the hotkeys and get the appropriate reaction. A lot of parameters are configurable with a configuration file. Please read the man page for details. Enjoy Matthias Grimm pbbuttonsd-0.8.1a/configure.in0000644000175000017500000002025510652444242013306 00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT([pbbuttonsd], [0.8.1a]) AM_INIT_AUTOMAKE(no-dependencies) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE AC_GNU_SOURCE dnl Checks for programs. AC_ISC_POSIX AC_PROG_CC AC_PROG_CXX AM_PROG_CC_STDC AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_RANLIB AC_CANONICAL_HOST AC_SUBST(localstatedir, "/var/lib") dnl default configuration LCD_FADINGSPEED="448" LCD_AUTOADJMODE="linear" LCD_AUTOADJPARMBAT="0,1,94,54" LCD_AUTOADJPARMAC="0,1,94,100" KBD_FADINGSPEED="0" KBD_AUTOADJMODE="hysteresis" KBD_AUTOADJPARMBAT="10,100,28,0" KBD_AUTOADJPARMAC="10,100,28,0" PB_OBJECTS= PB_LIBS= if test "x$laptop" != "x"; then ac_laptop=$laptop elif test "x$LAPTOP" != "x"; then ac_laptop=$LAPTOP else case $host in powerpc*) ac_laptop=powerbook;; i686*) ac_laptop=macbook;; i?86*) ac_laptop=i386acpi;; *) AC_MSG_ERROR([Unknown system, please set LAPTOP environment variable.]) esac fi case "$ac_laptop" in POWERBOOK | powerbook | pb | PB ) ac_laptop="Apple PowerBook" AC_DEFINE_UNQUOTED(SYS_POWERBOOK, "", [machine to build the package for]) PB_OBJECTS+=" driver_backlight_pmu.$OBJEXT module_pmac.$OBJEXT" ;; MACBOOK | macbook | mb | MB ) ac_laptop="Apple MacBook (Intel based)" ac_macbook=no AC_DEFINE_UNQUOTED(SYS_MACBOOK, "", [machine to build the package for]) AC_CHECK_HEADERS([smbios/SystemInfo.h], AC_DEFINE_UNQUOTED(WITH_SMBIOS, 1, [SMBIOS available]), AC_MSG_ERROR([SMBios library not available. Please install development files for libsmbios.]), [/* dummy */]) AC_CHECK_HEADERS([pci/pci.h sys/io.h], ac_macbook=yes, AC_MSG_ERROR([Please install development files for libpci and direct I/O.]), [/* dummy */]) PB_OBJECTS+=" driver_backlight_x1600.$OBJEXT driver_backlight_gma950.$OBJEXT module_acpi.$OBJEXT module_imac.$OBJEXT" PB_LIBS+=" -lpci -lsmbios" LCD_FADINGSPEED="448" LCD_AUTOADJMODE="linear" LCD_AUTOADJPARMBAT="0,10,80,30" LCD_AUTOADJPARMAC="0,30,80,60" KBD_FADINGSPEED="35" KBD_AUTOADJMODE="hysteresis" KBD_AUTOADJPARMBAT="30,50,40,0" KBD_AUTOADJPARMAC="30,30,40,0" ;; I386ACPI | i386acpi | acpi | ACPI ) AC_DEFINE_UNQUOTED(SYS_I386_ACPI, "", [machine to build the package for]) ac_laptop="Intel based laptop with ACPI" ;; I386 | i386) AC_DEFINE_UNQUOTED(SYS_I386_GENERIC, "", [machine to build the package for]) ac_laptop="Intel based laptop" ;; *) echo -e "\nOption 'laptop' not set or unknown. Please call 'configure laptop='" echo "Possible targets are: powerbook, macbook" AC_MSG_ERROR(unknown target system) ;; esac dnl roll out configuration AC_SUBST(LCD_FADINGSPEED) AC_SUBST(LCD_AUTOADJMODE) AC_SUBST(LCD_AUTOADJPARMBAT) AC_SUBST(LCD_AUTOADJPARMAC) AC_SUBST(KBD_FADINGSPEED) AC_SUBST(KBD_AUTOADJMODE) AC_SUBST(KBD_AUTOADJPARMBAT) AC_SUBST(KBD_AUTOADJPARMAC) dnl Checks for libraries. AC_CHECK_LIB([dl], [dlopen]) pkg_modules="glib-2.0 >= 2.6.0" PKG_CHECK_MODULES(PACKAGE, [$pkg_modules]) AC_SUBST(PACKAGE_CFLAGS) AC_SUBST(PACKAGE_LIBS) pbb_with_pmud=no AC_ARG_WITH(pmud, [ --with-pmud use pmud as low level power manager (default=no)], pbb_with_pmud=$withval, ) if test "$pbb_with_pmud" = "yes"; then AC_DEFINE_UNQUOTED(WITH_PMUD, 1, [use pmud as basement]) PB_OBJECTS+="tcp.$OBJEXT" fi pbb_with_oss=yes AC_ARG_WITH(oss, [ --with-oss enable OSS support in pbbuttonsd (default=yes)], pbb_with_oss=$withval, ) if test "$pbb_with_oss" = "yes"; then AC_DEFINE_UNQUOTED(WITH_OSS, 1, [enable OSS support]) PB_OBJECTS+=" driver_mixer_oss.$OBJEXT" fi pbb_with_alsa=yes AC_ARG_WITH(alsa, [ --with-alsa enable ALSA support in pbbuttonsd (default=yes)], pbb_with_alsa=$withval, ) if test "$pbb_with_alsa" = "yes"; then AM_PATH_ALSA(1.0.0, [pbb_have_alsa=yes], [pbb_have_alsa=no]) if test "$pbb_have_alsa" = "yes"; then AC_DEFINE_UNQUOTED(WITH_ALSA, 1, [enable ALSA support]) PB_OBJECTS+=" driver_mixer_alsa.$OBJEXT" PB_LIBS+=$ALSA_LIBS fi fi pbb_with_ibam=yes AC_ARG_WITH(ibam, [ --with-ibam enable IBAM support in pbbuttonsd (default=yes)], pbb_with_ibam=$withval, ) if test "$pbb_with_ibam" = "yes"; then AC_DEFINE_UNQUOTED(WITH_IBAM, 1, [enable IBAM support]) PB_OBJECTS+=" ibam_stub.$OBJEXT" PB_LIBS+=" -lstdc++" fi AC_ARG_WITH(doxygen-docs, AS_HELP_STRING([--with-doxygen-docs],[build DOXYGEN documentation (requires Doxygen)]) ,with_doxygen_docs=$withval,with_doxygen_docs=no) AC_PATH_PROG(DOXYGEN, doxygen, no) AC_PATH_PROG(DOT, dot, no) AC_MSG_CHECKING([whether to build Doxygen documentation]) if test x$DOXYGEN = xno ; then have_doxygen=no else have_doxygen=yes fi DOT_PATH= HAVE_DOT=NO if test x$DOT != xno; then HAVE_DOT=YES DOT_PATH=`dirname $DOT` fi AC_SUBST(HAVE_DOT) AC_SUBST(DOT_PATH) if test x$with_doxygen_docs = xauto ; then if test x$have_doxygen = xno ; then with_doxygen_docs=no else with_doxygen_docs=yes fi fi if test x$with_doxygen_docs = xyes; then if test x$have_doxygen = xno; then AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found]) fi fi AM_CONDITIONAL(DOXYGEN_DOCS_ENABLED, test x$with_doxygen_docs = xyes) AC_MSG_RESULT($with_doxygen_docs) AM_CONDITIONAL(DEBUG, test "$enable_debug" = yes) if test "$enable_debug" = "yes"; then PB_OBJECTS+=" module_peep.$OBJEXT" else enable_debug=no; fi AC_SUBST([PB_OBJECTS]) AC_SUBST([PB_LIBS]) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([initreq.h alloca.h argz.h errno.h fcntl.h langinfo.h libintl.h limits.h locale.h malloc.h stddef.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h unistd.h]) dnl defining some constants dnl Add the languages which your application supports here. ALL_LINGUAS="de ca es" AM_GNU_GETTEXT AM_GNU_GETTEXT_VERSION(0.16.1) test "x${prefix}" = "xNONE" && prefix=${ac_default_prefix} dnl Set SYS_CONF_DIR in config.h. while true; do tmp="`eval echo $sysconfdir`" if test "x${tmp}" = "x${sysconfdir}"; then break; fi sysconfdir=$tmp done AC_DEFINE_UNQUOTED(SYS_CONF_DIR, "${sysconfdir}", [target dir for configuration files]) AC_SUBST(sysconfdir) dnl Set PACKAGE_DATA_DIR in config.h. while true; do tmp="`eval echo $datadir`" if test "x${tmp}" = "x${datadir}"; then break; fi datadir=$tmp done AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}", [target dir for data files]) dnl Set PACKAGE_LOCALE_DIR in config.h. while true; do tmp="`eval echo $localedir`" if test "x${tmp}" = "x${localedir}"; then break; fi localedir=$tmp done AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${localedir}", [target dir for language files]) dnl beautify the compile process. This few defines get rid of the nasty dnl compiling output which autotools generates. Warnings will be visible dnl again. :-) HOSTCC="${CC}" QUIET='@${top_srcdir}/ccdv' AC_SUBST([HOSTCC]) AC_SUBST([QUIET]) CC="${QUIET} ${CC}" CXX="${QUIET} ${CXX}" CPP="${QUIET} ${CPP}" AM_MAKEFLAGS="--no-print-directory" AC_SUBST([AM_MAKEFLAGS]) AC_OUTPUT([ Doxyfile Makefile pbbuttonsd.cnf src/Makefile po/Makefile.in po/Makefile libpbbipc/Makefile pbbcmd/Makefile intl/Makefile ]) ${ac_make} clean >/dev/null 2>&1 echo -e "------------------------------------------------------" echo -e "PBButtonsd configuration summary\n" echo -e "System: $ac_laptop\n" echo -e "Options:" echo " IBAM support built in - ${pbb_with_ibam}" echo " OSS support built in - ${pbb_with_oss}" echo -n " ALSA support built in - " if test "$pbb_have_alsa" = "yes"; then echo "yes" elif test "$pbb_with_alsa" = "yes"; then echo "no (not available, development files?)" else echo "no" fi echo " Extra debug code enabled - ${enable_debug}" echo " Pmud support built in - ${pbb_with_pmud}" echo -n " Building doxygen docs - ${with_doxygen_docs}" if test "$with_doxygen_docs" = "no"; then echo elif test "$HAVE_DOT" = "NO"; then echo " (without graphs)" else echo " (with graphs)" fi echo -e "\nPaths:" echo -e " config: $sysconfdir" echo -e " data: $datadir" echo -e " locale: $localedir" echo -e " batlog: /var/lib/pbbuttons (hardcoded)" echo -e " ibam: /var/lib/ibam (hardcoded)" echo -e "\nCompiler:" echo -e " CFLAGS: $CFLAGS" echo -e " CXXFLAGS: $CXXFLAGS" echo -e "------------------------------------------------------" pbbuttonsd-0.8.1a/aclocal.m40000644000175000017500000046171110652444312012641 00000000000000# generated automatically by aclocal 1.9.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. dnl Configure Paths for Alsa dnl Some modifications by Richard Boulton dnl Christopher Lansdown dnl Jaroslav Kysela dnl Last modification: $Id: alsa.m4,v 1.24 2004/09/15 18:48:07 tiwai Exp $ dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate. dnl enables arguments --with-alsa-prefix= dnl --with-alsa-enc-prefix= dnl --disable-alsatest dnl dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified, dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result. dnl AC_DEFUN([AM_PATH_ALSA], [dnl Save the original CFLAGS, LDFLAGS, and LIBS alsa_save_CFLAGS="$CFLAGS" alsa_save_LDFLAGS="$LDFLAGS" alsa_save_LIBS="$LIBS" alsa_found=yes dnl dnl Get the cflags and libraries for alsa dnl AC_ARG_WITH(alsa-prefix, [ --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional)], [alsa_prefix="$withval"], [alsa_prefix=""]) AC_ARG_WITH(alsa-inc-prefix, [ --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional)], [alsa_inc_prefix="$withval"], [alsa_inc_prefix=""]) dnl FIXME: this is not yet implemented AC_ARG_ENABLE(alsatest, [ --disable-alsatest Do not try to compile and run a test Alsa program], [enable_alsatest="$enableval"], [enable_alsatest=yes]) dnl Add any special include directories AC_MSG_CHECKING(for ALSA CFLAGS) if test "$alsa_inc_prefix" != "" ; then ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix" CFLAGS="$CFLAGS -I$alsa_inc_prefix" fi AC_MSG_RESULT($ALSA_CFLAGS) CFLAGS="$alsa_save_CFLAGS" dnl add any special lib dirs AC_MSG_CHECKING(for ALSA LDFLAGS) if test "$alsa_prefix" != "" ; then ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix" LDFLAGS="$LDFLAGS $ALSA_LIBS" fi dnl add the alsa library ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" LIBS="$ALSA_LIBS $LIBS" AC_MSG_RESULT($ALSA_LIBS) dnl Check for a working version of libasound that is of the right version. min_alsa_version=ifelse([$1], ,0.1.1,$1) AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version) no_alsa="" alsa_min_major_version=`echo $min_alsa_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` alsa_min_minor_version=`echo $min_alsa_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` alsa_min_micro_version=`echo $min_alsa_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` AC_LANG_SAVE AC_LANG_C AC_TRY_COMPILE([ #include ], [ /* ensure backward compatibility */ #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR) #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR #endif #if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR) #define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR #endif #if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR) #define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR #endif # if(SND_LIB_MAJOR > $alsa_min_major_version) exit(0); # else # if(SND_LIB_MAJOR < $alsa_min_major_version) # error not present # endif # if(SND_LIB_MINOR > $alsa_min_minor_version) exit(0); # else # if(SND_LIB_MINOR < $alsa_min_minor_version) # error not present # endif # if(SND_LIB_SUBMINOR < $alsa_min_micro_version) # error not present # endif # endif # endif exit(0); ], [AC_MSG_RESULT(found.)], [AC_MSG_RESULT(not present.) ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)]) alsa_found=no] ) AC_LANG_RESTORE dnl Now that we know that we have the right version, let's see if we have the library and not just the headers. if test "x$enable_alsatest" = "xyes"; then AC_CHECK_LIB([asound], [snd_ctl_open],, [ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)]) alsa_found=no] ) fi LDFLAGS="$alsa_save_LDFLAGS" LIBS="$alsa_save_LIBS" if test "x$alsa_found" = "xyes" ; then ifelse([$2], , :, [$2]) else ALSA_CFLAGS="" ALSA_LIBS="" ifelse([$3], , :, [$3]) fi dnl That should be it. Now just export out symbols: AC_SUBST(ALSA_CFLAGS) AC_SUBST(ALSA_LIBS) ]) # codeset.m4 serial 2 (gettext-0.16) dnl Copyright (C) 2000-2002, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, [AC_TRY_LINK([#include ], [char* cs = nl_langinfo(CODESET); return !cs;], am_cv_langinfo_codeset=yes, am_cv_langinfo_codeset=no) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE(HAVE_LANGINFO_CODESET, 1, [Define if you have and nl_langinfo(CODESET).]) fi ]) # gettext.m4 serial 59 (gettext-0.16.1) dnl Copyright (C) 1995-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2006. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value `$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], ifelse([$1], [external], ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), [yes])) define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) gt_NEEDS_INIT AM_GNU_GETTEXT_NEED([$2]) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. AC_REQUIRE([AM_NLS]) ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl Add a version number to the cache macros. case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH(included-gettext, [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], [AC_TRY_LINK([#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings;], [bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], [$gt_func_gnugettext_libintl], [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_TRY_LINK([#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) dnl Now see whether libintl exists and depends on libiconv. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Some extra flags are needed during linking. LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE(HAVE_GETTEXT, 1, [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE(HAVE_DCGETTEXT, 1, [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATOBJEXT) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST(DATADIRNAME) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST(INSTOBJEXT) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST(GENCAT) dnl For backward compatibility. Some Makefiles may be using this. INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi AC_SUBST(INTLOBJS) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST(INTLLIBS) dnl Make all documented variables known to autoconf. AC_SUBST(LIBINTL) AC_SUBST(LTLIBINTL) AC_SUBST(POSUB) ]) dnl Checks for special options needed on MacOS X. dnl Defines INTL_MACOSX_LIBS. AC_DEFUN([gt_INTL_MACOSX], [ dnl Check for API introduced in MacOS X 10.2. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], gt_cv_func_CFPreferencesCopyAppValue, [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_TRY_LINK([#include ], [CFPreferencesCopyAppValue(NULL, NULL)], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Check for API introduced in MacOS X 10.3. AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent, [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_TRY_LINK([#include ], [CFLocaleCopyCurrent();], [gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi AC_SUBST([INTL_MACOSX_LIBS]) ]) dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. m4_define([gt_NEEDS_INIT], [ m4_divert_text([DEFAULTS], [gt_needs=]) m4_define([gt_NEEDS_INIT], []) ]) dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) AC_DEFUN([AM_GNU_GETTEXT_NEED], [ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) # glibc2.m4 serial 1 dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Test for the GNU C Library, version 2.0 or newer. # From Bruno Haible. AC_DEFUN([gt_GLIBC2], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer, ac_cv_gnu_library_2, [AC_EGREP_CPP([Lucky GNU user], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ >= 2) Lucky GNU user #endif #endif ], ac_cv_gnu_library_2=yes, ac_cv_gnu_library_2=no) ] ) AC_SUBST(GLIBC2) GLIBC2="$ac_cv_gnu_library_2" ] ) # glibc21.m4 serial 3 dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Test for the GNU C Library, version 2.1 or newer. # From Bruno Haible. AC_DEFUN([gl_GLIBC21], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, ac_cv_gnu_library_2_1, [AC_EGREP_CPP([Lucky GNU user], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif #endif ], ac_cv_gnu_library_2_1=yes, ac_cv_gnu_library_2_1=no) ] ) AC_SUBST(GLIBC21) GLIBC21="$ac_cv_gnu_library_2_1" ] ) # iconv.m4 serial AM4 (gettext-0.11.3) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST(LIBICONV) AC_SUBST(LTLIBICONV) ]) AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi ]) # intdiv0.m4 serial 1 (gettext-0.11.3) dnl Copyright (C) 2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([gt_INTDIV0], [ AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], gt_cv_int_divbyzero_sigfpe, [ AC_TRY_RUN([ #include #include static void #ifdef __cplusplus sigfpe_handler (int sig) #else sigfpe_handler (sig) int sig; #endif { /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ exit (sig != SIGFPE); } int x = 1; int y = 0; int z; int nan; int main () { signal (SIGFPE, sigfpe_handler); /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) signal (SIGTRAP, sigfpe_handler); #endif /* Linux/SPARC yields signal SIGILL. */ #if defined (__sparc__) && defined (__linux__) signal (SIGILL, sigfpe_handler); #endif z = x / y; nan = y / y; exit (1); } ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, [ # Guess based on the CPU. case "$host_cpu" in alpha* | i[34567]86 | m68k | s390*) gt_cv_int_divbyzero_sigfpe="guessing yes";; *) gt_cv_int_divbyzero_sigfpe="guessing no";; esac ]) ]) case "$gt_cv_int_divbyzero_sigfpe" in *yes) value=1;; *) value=0;; esac AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, [Define if integer division by zero raises signal SIGFPE.]) ]) # intl.m4 serial 3 (gettext-0.16) dnl Copyright (C) 1995-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2006. AC_PREREQ(2.52) dnl Checks for all prerequisites of the intl subdirectory, dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. AC_DEFUN([AM_INTL_SUBDIR], [ AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([gt_GLIBC2])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([gl_VISIBILITY])dnl AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl AC_REQUIRE([gt_TYPE_WCHAR_T])dnl AC_REQUIRE([gt_TYPE_WINT_T])dnl AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gt_TYPE_INTMAX_T]) AC_REQUIRE([gt_PRINTF_POSIX]) AC_REQUIRE([gl_GLIBC21])dnl AC_REQUIRE([gl_XSIZE])dnl AC_REQUIRE([gt_INTL_MACOSX])dnl AC_CHECK_TYPE([ptrdiff_t], , [AC_DEFINE([ptrdiff_t], [long], [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) ]) AC_CHECK_HEADERS([stddef.h stdlib.h string.h]) AC_CHECK_FUNCS([asprintf fwprintf putenv setenv setlocale snprintf wcslen]) dnl Use the _snprintf function only if it is declared (because on NetBSD it dnl is defined as a weak alias of snprintf; we prefer to use the latter). gt_CHECK_DECL(_snprintf, [#include ]) gt_CHECK_DECL(_snwprintf, [#include ]) dnl Use the *_unlocked functions only if they are declared. dnl (because some of them were defined without being declared in Solaris dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built dnl on Solaris 2.5.1 to run on Solaris 2.6). dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. gt_CHECK_DECL(getc_unlocked, [#include ]) case $gt_cv_func_printf_posix in *yes) HAVE_POSIX_PRINTF=1 ;; *) HAVE_POSIX_PRINTF=0 ;; esac AC_SUBST([HAVE_POSIX_PRINTF]) if test "$ac_cv_func_asprintf" = yes; then HAVE_ASPRINTF=1 else HAVE_ASPRINTF=0 fi AC_SUBST([HAVE_ASPRINTF]) if test "$ac_cv_func_snprintf" = yes; then HAVE_SNPRINTF=1 else HAVE_SNPRINTF=0 fi AC_SUBST([HAVE_SNPRINTF]) if test "$ac_cv_func_wprintf" = yes; then HAVE_WPRINTF=1 else HAVE_WPRINTF=0 fi AC_SUBST([HAVE_WPRINTF]) AM_LANGINFO_CODESET gt_LC_MESSAGES dnl Compilation on mingw and Cygwin needs special Makefile rules, because dnl 1. when we install a shared library, we must arrange to export dnl auxiliary pointer variables for every exported variable, dnl 2. when we install a shared library and a static library simultaneously, dnl the include file specifies __declspec(dllimport) and therefore we dnl must arrange to define the auxiliary pointer variables for the dnl exported variables _also_ in the static library. if test "$enable_shared" = yes; then case "$host_os" in cygwin*) is_woe32dll=yes ;; *) is_woe32dll=no ;; esac else is_woe32dll=no fi WOE32DLL=$is_woe32dll AC_SUBST([WOE32DLL]) dnl Rename some macros and functions used for locking. AH_BOTTOM([ #define __libc_lock_t gl_lock_t #define __libc_lock_define gl_lock_define #define __libc_lock_define_initialized gl_lock_define_initialized #define __libc_lock_init gl_lock_init #define __libc_lock_lock gl_lock_lock #define __libc_lock_unlock gl_lock_unlock #define __libc_lock_recursive_t gl_recursive_lock_t #define __libc_lock_define_recursive gl_recursive_lock_define #define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized #define __libc_lock_init_recursive gl_recursive_lock_init #define __libc_lock_lock_recursive gl_recursive_lock_lock #define __libc_lock_unlock_recursive gl_recursive_lock_unlock #define glthread_in_use libintl_thread_in_use #define glthread_lock_init libintl_lock_init #define glthread_lock_lock libintl_lock_lock #define glthread_lock_unlock libintl_lock_unlock #define glthread_lock_destroy libintl_lock_destroy #define glthread_rwlock_init libintl_rwlock_init #define glthread_rwlock_rdlock libintl_rwlock_rdlock #define glthread_rwlock_wrlock libintl_rwlock_wrlock #define glthread_rwlock_unlock libintl_rwlock_unlock #define glthread_rwlock_destroy libintl_rwlock_destroy #define glthread_recursive_lock_init libintl_recursive_lock_init #define glthread_recursive_lock_lock libintl_recursive_lock_lock #define glthread_recursive_lock_unlock libintl_recursive_lock_unlock #define glthread_recursive_lock_destroy libintl_recursive_lock_destroy #define glthread_once libintl_once #define glthread_once_call libintl_once_call #define glthread_once_singlethreaded libintl_once_singlethreaded ]) ]) dnl Checks for the core files of the intl subdirectory: dnl dcigettext.c dnl eval-plural.h dnl explodename.c dnl finddomain.c dnl gettextP.h dnl gmo.h dnl hash-string.h hash-string.c dnl l10nflist.c dnl libgnuintl.h.in (except the *printf stuff) dnl loadinfo.h dnl loadmsgcat.c dnl localealias.c dnl log.c dnl plural-exp.h plural-exp.c dnl plural.y dnl Used by libglocale. AC_DEFUN([gt_INTL_SUBDIR_CORE], [ AC_REQUIRE([AC_C_INLINE])dnl AC_REQUIRE([AC_TYPE_SIZE_T])dnl AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_REQUIRE([AC_FUNC_ALLOCA])dnl AC_REQUIRE([AC_FUNC_MMAP])dnl AC_REQUIRE([gt_INTDIV0])dnl AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl AC_REQUIRE([gt_INTTYPES_PRI])dnl AC_REQUIRE([gl_LOCK])dnl AC_TRY_LINK( [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }], [], [AC_DEFINE([HAVE_BUILTIN_EXPECT], 1, [Define to 1 if the compiler understands __builtin_expect.])]) AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h]) AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \ stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \ argz_next __fsetlocking]) dnl Use the *_unlocked functions only if they are declared. dnl (because some of them were defined without being declared in Solaris dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built dnl on Solaris 2.5.1 to run on Solaris 2.6). dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. gt_CHECK_DECL(feof_unlocked, [#include ]) gt_CHECK_DECL(fgets_unlocked, [#include ]) AM_ICONV dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined, dnl and a _NL_LOCALE_NAME macro always. AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name, [AC_TRY_LINK([#include #include ], [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));], gt_cv_nl_locale_name=yes, gt_cv_nl_locale_name=no) ]) if test $gt_cv_nl_locale_name = yes; then AC_DEFINE(HAVE_NL_LOCALE_NAME, 1, [Define if you have and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined.]) fi dnl intl/plural.c is generated from intl/plural.y. It requires bison, dnl because plural.y uses bison specific features. It requires at least dnl bison-1.26 because earlier versions generate a plural.c that doesn't dnl compile. dnl bison is only needed for the maintainer (who touches plural.y). But in dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put dnl the rule in general Makefile. Now, some people carelessly touch the dnl files or have a broken "make" program, hence the plural.c rule will dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not dnl present or too old. AC_CHECK_PROGS([INTLBISON], [bison]) if test -z "$INTLBISON"; then ac_verc_fail=yes else dnl Found it, now check the version. AC_MSG_CHECKING([version of bison]) changequote(<<,>>)dnl ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) changequote([,])dnl ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac AC_MSG_RESULT([$ac_prog_version]) fi if test $ac_verc_fail = yes; then INTLBISON=: fi ]) dnl gt_CHECK_DECL(FUNC, INCLUDES) dnl Check whether a function is declared. AC_DEFUN([gt_CHECK_DECL], [ AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1, [AC_TRY_COMPILE([$2], [ #ifndef $1 char *p = (char *) $1; #endif ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)]) if test $ac_cv_have_decl_$1 = yes; then gt_value=1 else gt_value=0 fi AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value], [Define to 1 if you have the declaration of `$1', and to 0 if you don't.]) ]) # intmax.m4 serial 3 (gettext-0.16) dnl Copyright (C) 2002-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether the system has the 'intmax_t' type, but don't attempt to dnl find a replacement if it is lacking. AC_DEFUN([gt_TYPE_INTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, [AC_TRY_COMPILE([ #include #include #if HAVE_STDINT_H_WITH_UINTMAX #include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX #include #endif ], [intmax_t x = -1; return !x;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) if test $gt_cv_c_intmax_t = yes; then AC_DEFINE(HAVE_INTMAX_T, 1, [Define if you have the 'intmax_t' type in or .]) fi ]) # inttypes-pri.m4 serial 4 (gettext-0.16) dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_PREREQ(2.52) # Define PRI_MACROS_BROKEN if exists and defines the PRI* # macros to non-string values. This is the case on AIX 4.3.3. AC_DEFUN([gt_INTTYPES_PRI], [ AC_CHECK_HEADERS([inttypes.h]) if test $ac_cv_header_inttypes_h = yes; then AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], gt_cv_inttypes_pri_broken, [ AC_TRY_COMPILE([#include #ifdef PRId32 char *p = PRId32; #endif ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) ]) fi if test "$gt_cv_inttypes_pri_broken" = yes; then AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, [Define if exists and defines unusable PRI* macros.]) PRI_MACROS_BROKEN=1 else PRI_MACROS_BROKEN=0 fi AC_SUBST([PRI_MACROS_BROKEN]) ]) # inttypes_h.m4 serial 7 dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1; return !i;], gl_cv_header_inttypes_h=yes, gl_cv_header_inttypes_h=no)]) if test $gl_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) # lcmessage.m4 serial 4 (gettext-0.14.2) dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995. # Check whether LC_MESSAGES is available in . AC_DEFUN([gt_LC_MESSAGES], [ AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)]) if test $gt_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi ]) # lib-ld.m4 serial 3 (gettext-0.13) dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision dnl with libtool.m4. dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]* | [A-Za-z]:[\\/]*)] [re_direlt='/[^/][^/]*/\.\./'] # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(acl_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$acl_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_LIB_PROG_LD_GNU ]) # lib-link.m4 serial 9 (gettext-0.16) dnl Copyright (C) 2001-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_PREREQ(2.50) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes undefine([Name]) undefine([NAME]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. If found, it dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" LIBS="$LIBS $LIB[]NAME" AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) undefine([Name]) undefine([NAME]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, dnl hardcode_direct, hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ dnl Tell automake >= 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE(rpath, [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib$1-prefix], [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib --without-lib$1-prefix don't search for lib$1 in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" \ && { test -f "$additional_libdir/lib$name.$shlibext" \ || { test "$shlibext" = dll \ && test -f "$additional_libdir/lib$name.dll.a"; }; }; then found_dir="$additional_libdir" if test -f "$additional_libdir/lib$name.$shlibext"; then found_so="$additional_libdir/lib$name.$shlibext" else found_so="$additional_libdir/lib$name.dll.a" fi if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" \ && { test -f "$dir/lib$name.$shlibext" \ || { test "$shlibext" = dll \ && test -f "$dir/lib$name.dll.a"; }; }; then found_dir="$dir" if test -f "$dir/lib$name.$shlibext"; then found_so="$dir/lib$name.$shlibext" else found_so="$dir/lib$name.dll.a" fi if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) # lib-prefix.m4 serial 5 (gettext-0.15) dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing dnl the basename of the libdir, either "lib" or "lib64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. The current dnl practice is that on a system supporting 32-bit and 64-bit instruction dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit dnl libraries go under $prefix/lib. We determine the compiler's default dnl mode by looking at the compiler's library search path. If at least dnl of its elements ends in /lib64 or points to a directory whose absolute dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the dnl default, namely "lib". acl_libdirstem=lib searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ]) # lock.m4 serial 6 (gettext-0.16) dnl Copyright (C) 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Tests for a multithreading library to be used. dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS, dnl USE_PTH_THREADS, USE_WIN32_THREADS dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with dnl libtool). dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for dnl programs that really need multithread functionality. The difference dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread". dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for dnl multithread-safe programs. AC_DEFUN([gl_LOCK_EARLY], [ AC_REQUIRE([gl_LOCK_EARLY_BODY]) ]) dnl The guts of gl_LOCK_EARLY. Needs to be expanded only once. AC_DEFUN([gl_LOCK_EARLY_BODY], [ dnl Ordering constraints: This macro modifies CPPFLAGS in a way that dnl influences the result of the autoconf tests that test for *_unlocked dnl declarations, on AIX 5 at least. Therefore it must come early. AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl AC_BEFORE([$0], [gl_ARGP])dnl AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems dnl Check for multithreading. AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API]) AC_HELP_STRING([--disable-threads], [build without multithread safety]), [gl_use_threads=$enableval], [case "$host_os" in dnl Disable multithreading by default on OSF/1, because it interferes dnl with fork()/exec(): When msgexec is linked with -lpthread, its child dnl process gets an endless segmentation fault inside execvp(). osf*) gl_use_threads=no ;; *) gl_use_threads=yes ;; esac ]) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then # For using : case "$host_os" in osf*) # On OSF/1, the compiler needs the flag -D_REENTRANT so that it # groks . cc also understands the flag -pthread, but # we don't use it because 1. gcc-2.95 doesn't understand -pthread, # 2. putting a flag into CPPFLAGS that has an effect on the linker # causes the AC_TRY_LINK test below to succeed unexpectedly, # leading to wrong values of LIBTHREAD and LTLIBTHREAD. CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; esac # Some systems optimize for single-threaded programs by default, and # need special flags to disable these optimizations. For example, the # definition of 'errno' in . case "$host_os" in aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;; solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; esac fi ]) dnl The guts of gl_LOCK. Needs to be expanded only once. AC_DEFUN([gl_LOCK_BODY], [ AC_REQUIRE([gl_LOCK_EARLY_BODY]) gl_threads_api=none LIBTHREAD= LTLIBTHREAD= LIBMULTITHREAD= LTLIBMULTITHREAD= if test "$gl_use_threads" != no; then dnl Check whether the compiler and linker support weak declarations. AC_MSG_CHECKING([whether imported symbols can be declared weak]) gl_have_weak=no AC_TRY_LINK([extern void xyzzy (); #pragma weak xyzzy], [xyzzy();], [gl_have_weak=yes]) AC_MSG_RESULT([$gl_have_weak]) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that # it groks . It's added above, in gl_LOCK_EARLY_BODY. AC_CHECK_HEADER(pthread.h, gl_have_pthread_h=yes, gl_have_pthread_h=no) if test "$gl_have_pthread_h" = yes; then # Other possible tests: # -lpthreads (FSU threads, PCthreads) # -lgthreads gl_have_pthread= # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist # in libc. IRIX 6.5 has the first one in both libc and libpthread, but # the second one only in libpthread, and lock.c needs it. AC_TRY_LINK([#include ], [pthread_mutex_lock((pthread_mutex_t*)0); pthread_mutexattr_init((pthread_mutexattr_t*)0);], [gl_have_pthread=yes]) # Test for libpthread by looking for pthread_kill. (Not pthread_self, # since it is defined as a macro on OSF/1.) if test -n "$gl_have_pthread"; then # The program links fine without libpthread. But it may actually # need to link with libpthread in order to create multiple threads. AC_CHECK_LIB(pthread, pthread_kill, [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread # On Solaris and HP-UX, most pthread functions exist also in libc. # Therefore pthread_in_use() needs to actually try to create a # thread: pthread_create from libc will fail, whereas # pthread_create will actually create a thread. case "$host_os" in solaris* | hpux*) AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], 1, [Define if the pthread_in_use() detection is hard.]) esac ]) else # Some library is needed. Try libpthread and libc_r. AC_CHECK_LIB(pthread, pthread_kill, [gl_have_pthread=yes LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread]) if test -z "$gl_have_pthread"; then # For FreeBSD 4. AC_CHECK_LIB(c_r, pthread_kill, [gl_have_pthread=yes LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r]) fi fi if test -n "$gl_have_pthread"; then gl_threads_api=posix AC_DEFINE([USE_POSIX_THREADS], 1, [Define if the POSIX multithreading library can be used.]) if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if test $gl_have_weak = yes; then AC_DEFINE([USE_POSIX_THREADS_WEAK], 1, [Define if references to the POSIX multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= fi fi # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the # pthread_rwlock_* functions. AC_CHECK_TYPE([pthread_rwlock_t], [AC_DEFINE([HAVE_PTHREAD_RWLOCK], 1, [Define if the POSIX multithreading library has read/write locks.])], [], [#include ]) # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. AC_TRY_COMPILE([#include ], [#if __FreeBSD__ == 4 error "No, in FreeBSD 4.0 recursive mutexes actually don't work." #else int x = (int)PTHREAD_MUTEX_RECURSIVE; return !x; #endif], [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1, [Define if the defines PTHREAD_MUTEX_RECURSIVE.])]) fi fi fi if test -z "$gl_have_pthread"; then if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then gl_have_solaristhread= gl_save_LIBS="$LIBS" LIBS="$LIBS -lthread" AC_TRY_LINK([#include #include ], [thr_self();], [gl_have_solaristhread=yes]) LIBS="$gl_save_LIBS" if test -n "$gl_have_solaristhread"; then gl_threads_api=solaris LIBTHREAD=-lthread LTLIBTHREAD=-lthread LIBMULTITHREAD="$LIBTHREAD" LTLIBMULTITHREAD="$LTLIBTHREAD" AC_DEFINE([USE_SOLARIS_THREADS], 1, [Define if the old Solaris multithreading library can be used.]) if test $gl_have_weak = yes; then AC_DEFINE([USE_SOLARIS_THREADS_WEAK], 1, [Define if references to the old Solaris multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= fi fi fi fi if test "$gl_use_threads" = pth; then gl_save_CPPFLAGS="$CPPFLAGS" AC_LIB_LINKFLAGS(pth) gl_have_pth= gl_save_LIBS="$LIBS" LIBS="$LIBS -lpth" AC_TRY_LINK([#include ], [pth_self();], gl_have_pth=yes) LIBS="$gl_save_LIBS" if test -n "$gl_have_pth"; then gl_threads_api=pth LIBTHREAD="$LIBPTH" LTLIBTHREAD="$LTLIBPTH" LIBMULTITHREAD="$LIBTHREAD" LTLIBMULTITHREAD="$LTLIBTHREAD" AC_DEFINE([USE_PTH_THREADS], 1, [Define if the GNU Pth multithreading library can be used.]) if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if test $gl_have_weak = yes; then AC_DEFINE([USE_PTH_THREADS_WEAK], 1, [Define if references to the GNU Pth multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= fi fi else CPPFLAGS="$gl_save_CPPFLAGS" fi fi if test -z "$gl_have_pthread"; then if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then if { case "$host_os" in mingw*) true;; *) false;; esac }; then gl_threads_api=win32 AC_DEFINE([USE_WIN32_THREADS], 1, [Define if the Win32 multithreading API can be used.]) fi fi fi fi AC_MSG_CHECKING([for multithread API to use]) AC_MSG_RESULT([$gl_threads_api]) AC_SUBST(LIBTHREAD) AC_SUBST(LTLIBTHREAD) AC_SUBST(LIBMULTITHREAD) AC_SUBST(LTLIBMULTITHREAD) ]) AC_DEFUN([gl_LOCK], [ AC_REQUIRE([gl_LOCK_EARLY]) AC_REQUIRE([gl_LOCK_BODY]) gl_PREREQ_LOCK ]) # Prerequisites of lib/lock.c. AC_DEFUN([gl_PREREQ_LOCK], [ AC_REQUIRE([AC_C_INLINE]) ]) dnl Survey of platforms: dnl dnl Platform Available Compiler Supports test-lock dnl flavours option weak result dnl --------------- --------- --------- -------- --------- dnl Linux 2.4/glibc posix -lpthread Y OK dnl dnl GNU Hurd/glibc posix dnl dnl FreeBSD 5.3 posix -lc_r Y dnl posix -lkse ? Y dnl posix -lpthread ? Y dnl posix -lthr Y dnl dnl FreeBSD 5.2 posix -lc_r Y dnl posix -lkse Y dnl posix -lthr Y dnl dnl FreeBSD 4.0,4.10 posix -lc_r Y OK dnl dnl NetBSD 1.6 -- dnl dnl OpenBSD 3.4 posix -lpthread Y OK dnl dnl MacOS X 10.[123] posix -lpthread Y OK dnl dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK dnl dnl HP-UX 11 posix -lpthread N (cc) OK dnl Y (gcc) dnl dnl IRIX 6.5 posix -lpthread Y 0.5 dnl dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK dnl dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK dnl -lpthread (gcc) Y dnl dnl Cygwin posix -lpthread Y OK dnl dnl Any of the above pth -lpth 0.0 dnl dnl Mingw win32 N OK dnl dnl BeOS 5 -- dnl dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is dnl turned off: dnl OK if all three tests terminate OK, dnl 0.5 if the first test terminates OK but the second one loops endlessly, dnl 0.0 if the first test already loops endlessly. # longdouble.m4 serial 2 (gettext-0.15) dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether the compiler supports the 'long double' type. dnl Prerequisite: AC_PROG_CC dnl This file is only needed in autoconf <= 2.59. Newer versions of autoconf dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics. AC_DEFUN([gt_TYPE_LONGDOUBLE], [ AC_CACHE_CHECK([for long double], gt_cv_c_long_double, [if test "$GCC" = yes; then gt_cv_c_long_double=yes else AC_TRY_COMPILE([ /* The Stardent Vistra knows sizeof(long double), but does not support it. */ long double foo = 0.0; /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ int array [2*(sizeof(long double) >= sizeof(double)) - 1]; ], , gt_cv_c_long_double=yes, gt_cv_c_long_double=no) fi]) if test $gt_cv_c_long_double = yes; then AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.]) fi ]) # longlong.m4 serial 8 dnl Copyright (C) 1999-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_LONG_LONG_INT if 'long long int' works. # This fixes a bug in Autoconf 2.60, but can be removed once we # assume 2.61 everywhere. # Note: If the type 'long long int' exists but is only 32 bits large # (as on some very old compilers), AC_TYPE_LONG_LONG_INT will not be # defined. In this case you can treat 'long long int' like 'long int'. AC_DEFUN([AC_TYPE_LONG_LONG_INT], [ AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) ? 1 : -1)]; int i = 63;]], [[long long int llmax = 9223372036854775807ll; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | (llmax / ll) | (llmax % ll));]])], [ac_cv_type_long_long_int=yes], [ac_cv_type_long_long_int=no])]) if test $ac_cv_type_long_long_int = yes; then AC_DEFINE([HAVE_LONG_LONG_INT], 1, [Define to 1 if the system has the type `long long int'.]) fi ]) # This macro is obsolescent and should go away soon. AC_DEFUN([gl_AC_TYPE_LONG_LONG], [ AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) ac_cv_type_long_long=$ac_cv_type_long_long_int if test $ac_cv_type_long_long = yes; then AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have the 'long long' type.]) fi ]) # nls.m4 serial 3 (gettext-0.15) dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ(2.50) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE(nls, [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT($USE_NLS) AC_SUBST(USE_NLS) ]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # # Similar to PKG_CHECK_MODULES, make sure that the first instance of # this or PKG_CHECK_MODULES is called, or make sure to call # PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_ifval([$2], [$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$PKG_CONFIG"; then if test -n "$$1"; then pkg_cv_[]$1="$$1" else PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) fi else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` else $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD ifelse([$4], , [AC_MSG_ERROR(dnl [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT ])], [AC_MSG_RESULT([no]) $4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])], [$4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) ifelse([$3], , :, [$3]) fi[]dnl ])# PKG_CHECK_MODULES # po.m4 serial 13 (gettext-0.15) dnl Copyright (C) 1995-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ(2.50) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake AC_REQUIRE([AM_NLS])dnl dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac changequote([,])dnl AC_SUBST([MSGFMT_015]) changequote(,)dnl case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac changequote([,])dnl AC_SUBST([GMSGFMT_015]) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Test whether it is GNU xgettext >= 0.15. changequote(,)dnl case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac changequote([,])dnl AC_SUBST([XGETTEXT_015]) dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) dnl Installation directories. dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we dnl have to define it here, so that it can be used in po/Makefile. test -n "$localedir" || localedir='${datadir}/locale' AC_SUBST([localedir]) AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done]], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" < #include /* The string "%2$d %1$d", with dollar characters protected from the shell's dollar expansion (possibly an autoconf bug). */ static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; static char buf[100]; int main () { sprintf (buf, format, 33, 55); return (strcmp (buf, "55 33") != 0); }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, [ AC_EGREP_CPP(notposix, [ #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ notposix #endif ], gt_cv_func_printf_posix="guessing no", gt_cv_func_printf_posix="guessing yes") ]) ]) case $gt_cv_func_printf_posix in *yes) AC_DEFINE(HAVE_POSIX_PRINTF, 1, [Define if your printf() function supports format strings with positions.]) ;; esac ]) # progtest.m4 serial 4 (gettext-0.14.2) dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1996. AC_PREREQ(2.50) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) # size_max.m4 serial 5 dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([gl_SIZE_MAX], [ AC_CHECK_HEADERS(stdint.h) dnl First test whether the system already has SIZE_MAX. AC_MSG_CHECKING([for SIZE_MAX]) AC_CACHE_VAL([gl_cv_size_max], [ gl_cv_size_max= AC_EGREP_CPP([Found it], [ #include #if HAVE_STDINT_H #include #endif #ifdef SIZE_MAX Found it #endif ], gl_cv_size_max=yes) if test -z "$gl_cv_size_max"; then dnl Define it ourselves. Here we assume that the type 'size_t' is not wider dnl than the type 'unsigned long'. Try hard to find a definition that can dnl be used in a preprocessor #if, i.e. doesn't contain a cast. _AC_COMPUTE_INT([sizeof (size_t) * CHAR_BIT - 1], size_t_bits_minus_1, [#include #include ], size_t_bits_minus_1=) _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint, [#include ], fits_in_uint=) if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then if test $fits_in_uint = 1; then dnl Even though SIZE_MAX fits in an unsigned int, it must be of type dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. AC_TRY_COMPILE([#include extern size_t foo; extern unsigned long foo; ], [], fits_in_uint=0) fi dnl We cannot use 'expr' to simplify this expression, because 'expr' dnl works only with 'long' integers in the host environment, while we dnl might be cross-compiling from a 32-bit platform to a 64-bit platform. if test $fits_in_uint = 1; then gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" else gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" fi else dnl Shouldn't happen, but who knows... gl_cv_size_max='((size_t)~(size_t)0)' fi fi ]) AC_MSG_RESULT([$gl_cv_size_max]) if test "$gl_cv_size_max" != yes; then AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max], [Define as the maximum value of type 'size_t', if the system doesn't define it.]) fi ]) # stdint_h.m4 serial 6 dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_STDINT_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_STDINT_H], [ AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1; return !i;], gl_cv_header_stdint_h=yes, gl_cv_header_stdint_h=no)]) if test $gl_cv_header_stdint_h = yes; then AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) # uintmax_t.m4 serial 9 dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. AC_PREREQ(2.13) # Define uintmax_t to 'unsigned long' or 'unsigned long long' # if it is not already defined in or . AC_DEFUN([gl_AC_TYPE_UINTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG]) test $ac_cv_type_unsigned_long_long = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, [Define to unsigned long or unsigned long long if and don't define.]) else AC_DEFINE(HAVE_UINTMAX_T, 1, [Define if you have the 'uintmax_t' type in or .]) fi ]) # ulonglong.m4 serial 6 dnl Copyright (C) 1999-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. # This fixes a bug in Autoconf 2.60, but can be removed once we # assume 2.61 everywhere. # Note: If the type 'unsigned long long int' exists but is only 32 bits # large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT # will not be defined. In this case you can treat 'unsigned long long int' # like 'unsigned long int'. AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], [ AC_CACHE_CHECK([for unsigned long long int], [ac_cv_type_unsigned_long_long_int], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[unsigned long long int ull = 18446744073709551615ULL; typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1 ? 1 : -1)]; int i = 63;]], [[unsigned long long int ullmax = 18446744073709551615ull; return (ull << 63 | ull >> 63 | ull << i | ull >> i | ullmax / ull | ullmax % ull);]])], [ac_cv_type_unsigned_long_long_int=yes], [ac_cv_type_unsigned_long_long_int=no])]) if test $ac_cv_type_unsigned_long_long_int = yes; then AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1, [Define to 1 if the system has the type `unsigned long long int'.]) fi ]) # This macro is obsolescent and should go away soon. AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG], [ AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) ac_cv_type_unsigned_long_long=$ac_cv_type_unsigned_long_long_int if test $ac_cv_type_unsigned_long_long = yes; then AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, [Define if you have the 'unsigned long long' type.]) fi ]) # visibility.m4 serial 1 (gettext-0.15) dnl Copyright (C) 2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Tests whether the compiler supports the command-line option dnl -fvisibility=hidden and the function and variable attributes dnl __attribute__((__visibility__("hidden"))) and dnl __attribute__((__visibility__("default"))). dnl Does *not* test for __visibility__("protected") - which has tricky dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on dnl MacOS X. dnl Does *not* test for __visibility__("internal") - which has processor dnl dependent semantics. dnl Does *not* test for #pragma GCC visibility push(hidden) - which is dnl "really only recommended for legacy code". dnl Set the variable CFLAG_VISIBILITY. dnl Defines and sets the variable HAVE_VISIBILITY. AC_DEFUN([gl_VISIBILITY], [ AC_REQUIRE([AC_PROG_CC]) CFLAG_VISIBILITY= HAVE_VISIBILITY=0 if test -n "$GCC"; then AC_MSG_CHECKING([for simple visibility declarations]) AC_CACHE_VAL(gl_cv_cc_visibility, [ gl_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden" AC_TRY_COMPILE( [extern __attribute__((__visibility__("hidden"))) int hiddenvar; extern __attribute__((__visibility__("default"))) int exportedvar; extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); extern __attribute__((__visibility__("default"))) int exportedfunc (void);], [], gl_cv_cc_visibility=yes, gl_cv_cc_visibility=no) CFLAGS="$gl_save_CFLAGS"]) AC_MSG_RESULT([$gl_cv_cc_visibility]) if test $gl_cv_cc_visibility = yes; then CFLAG_VISIBILITY="-fvisibility=hidden" HAVE_VISIBILITY=1 fi fi AC_SUBST([CFLAG_VISIBILITY]) AC_SUBST([HAVE_VISIBILITY]) AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY], [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.]) ]) # wchar_t.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether has the 'wchar_t' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WCHAR_T], [ AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, [AC_TRY_COMPILE([#include wchar_t foo = (wchar_t)'\0';], , gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) if test $gt_cv_c_wchar_t = yes; then AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.]) fi ]) # wint_t.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether has the 'wint_t' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WINT_T], [ AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, [AC_TRY_COMPILE([#include wint_t foo = (wchar_t)'\0';], , gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) if test $gt_cv_c_wint_t = yes; then AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) fi ]) # xsize.m4 serial 3 dnl Copyright (C) 2003-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_XSIZE], [ dnl Prerequisites of lib/xsize.h. AC_REQUIRE([gl_SIZE_MAX]) AC_REQUIRE([AC_C_INLINE]) AC_CHECK_HEADERS(stdint.h) ]) # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.6])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # This was merged into AC_PROG_CC in Autoconf. AU_DEFUN([AM_PROG_CC_STDC], [AC_PROG_CC AC_DIAGNOSE([obsolete], [$0: your code should no longer depend upon `am_cv_prog_cc_stdc', but upon `ac_cv_prog_cc_stdc'. Remove this warning and the assignment when you adjust the code. You can also remove the above call to AC_PROG_CC if you already called it elsewhere.]) am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc ]) AU_DEFUN([fp_PROG_CC_STDC]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR pbbuttonsd-0.8.1a/Doxyfile.in0000644000175000017500000002140710641704554013113 00000000000000# Doxyfile 1.4.7 #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = pbbuttonsd PROJECT_NUMBER = @VERSION@ OUTPUT_DIRECTORY = doc/ CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ "The $name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = YES STRIP_FROM_PATH = STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO DETAILS_AT_TOP = YES INHERIT_DOCS = YES SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 4 ALIASES = OPTIMIZE_OUTPUT_FOR_C = YES OPTIMIZE_OUTPUT_JAVA = NO BUILTIN_STL_SUPPORT = YES DISTRIBUTE_GROUP_DOC = NO SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = YES EXTRACT_PRIVATE = NO EXTRACT_STATIC = NO EXTRACT_LOCAL_CLASSES = YES EXTRACT_LOCAL_METHODS = NO HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO HIDE_FRIEND_COMPOUNDS = NO HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO SHOW_INCLUDE_FILES = YES INLINE_INFO = YES SORT_MEMBER_DOCS = YES SORT_BRIEF_DOCS = NO SORT_BY_SCOPE_NAME = NO GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES GENERATE_DEPRECATEDLIST= YES ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES SHOW_DIRECTORIES = NO FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = YES WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = src/ libpbbipc/ srcdoc/ FILE_PATTERNS = *.c \ *.cpp \ *.txt \ *.h RECURSIVE = NO EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = EXAMPLE_PATH = EXAMPLE_PATTERNS = * EXAMPLE_RECURSIVE = NO IMAGE_PATH = INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = YES INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = NO REFERENCES_LINK_SOURCE = NO USE_HTAGS = NO VERBATIM_HEADERS = NO #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = NO COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html HTML_HEADER = HTML_FOOTER = HTML_STYLESHEET = srcdoc/pbbuttonsd.css HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO CHM_FILE = HHC_LOCATION = GENERATE_CHI = NO BINARY_TOC = NO TOC_EXPAND = NO DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = YES TREEVIEW_WIDTH = 200 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = NO LATEX_OUTPUT = latex LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4wide EXTRA_PACKAGES = LATEX_HEADER = PDF_HYPERLINKS = NO USE_PDFLATEX = NO LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf COMPACT_RTF = NO RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml XML_SCHEMA = XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = /usr/include/ INCLUDE_FILE_PATTERNS = PREDEFINED = EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = YES HIDE_UNDOC_RELATIONS = YES HAVE_DOT = @HAVE_DOT@ CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES UML_LOOK = NO TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = NO INCLUDED_BY_GRAPH = YES CALL_GRAPH = NO CALLER_GRAPH = YES GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = png DOT_PATH = @DOT_PATH@ DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 800 MAX_DOT_GRAPH_HEIGHT = 1024 MAX_DOT_GRAPH_DEPTH = 1000 DOT_TRANSPARENT = YES DOT_MULTI_TARGETS = YES GENERATE_LEGEND = NO DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = NO pbbuttonsd-0.8.1a/Makefile.am0000644000175000017500000000411610641704554013032 00000000000000## Process this file with automake to produce Makefile.in SUBDIRS = . intl libpbbipc pbbcmd po src EXTRA_DIST = autogen.sh BUGS pbbcmd.1 pbbuttonsd.1 pbbuttonsd.cnf.5\ pbbuttonsd.cnf.in config.rpath Doxyfile.in man_MANS = pbbuttonsd.1 pbbuttonsd.cnf.5 pbbcmd.1 noinst_PROGRAMS = ccdv ccdv_SOURCES = ccdv.c ccdv: ccdv.c @${HOSTCC} -O1 -o ccdv ccdv.c .SILENT: ccdv if DOXYGEN_DOCS_ENABLED all-local: doxygen-docs endif doxygen-docs: ${QUIET} $(DOXYGEN) install-data-local: @$(NORMAL_INSTALL) $(INSTALL) -d $(DESTDIR)$(sysconfdir) $(INSTALL) -d $(DESTDIR)$(localstatedir)/pbbuttons $(INSTALL) -d $(DESTDIR)$(localstatedir)/ibam $(INSTALL_DATA) --suffix=.old -b $(srcdir)/pbbuttonsd.cnf $(DESTDIR)$(sysconfdir)/pbbuttonsd.cnf @for dir in power power/scripts.d power/event.d; do \ $(INSTALL) -d $(DESTDIR)$(sysconfdir)/$$dir; \ src=`basename $$dir`; \ if [ $$src == $$dir ]; then src=""; fi; \ for file in $(srcdir)/scripts/$$src/*; do \ name=`basename $$file`; \ if [ "$$src" != "" ] && [ "$$src" != "scripts.d" ]; then \ $(LN_S) -f ../scripts.d/$$name $(DESTDIR)$(sysconfdir)/$$dir/$$name; \ elif test -x $$file; then \ $(INSTALL_SCRIPT) $$file $(DESTDIR)$(sysconfdir)/$$dir/; \ elif test -f $$file; then \ $(INSTALL_DATA) $$file $(DESTDIR)$(sysconfdir)/$$dir/; \ fi; \ done; \ done; dist-hook: @for dir in scripts scripts/scripts.d scripts/event.d; do \ $(INSTALL) -d $(distdir)/$$dir; \ for file in $(srcdir)/$$dir/*; do \ if [ `basename $$file` == "laptop-mode" ]; then \ continue; \ elif test -x $$file; then \ $(INSTALL_SCRIPT) $$file $(distdir)/$$dir/; \ elif test -f $$file; then \ $(INSTALL_DATA) $$file $(distdir)/$$dir/; \ fi; \ done; \ done; $(INSTALL) -d $(distdir)/srcdoc; $(INSTALL) -d $(distdir)/doc/images; @for file in $(srcdir)/srcdoc/*; do \ if [ `basename $$file` == "index.html" ]; then \ $(INSTALL_DATA) $$file $(distdir)/doc/; \ else \ $(INSTALL_DATA) $$file $(distdir)/srcdoc/; \ fi; \ done; @for file in $(srcdir)/srcdoc/images/*; do \ $(INSTALL_DATA) $$file $(distdir)/doc/images; \ done; pbbuttonsd-0.8.1a/Makefile.in0000644000175000017500000006555410652444342013056 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = ccdv$(EXEEXT) DIST_COMMON = README $(am__configure_deps) $(srcdir)/Doxyfile.in \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(srcdir)/pbbuttonsd.cnf.in \ $(top_srcdir)/configure $(top_srcdir)/intl/Makefile.in \ ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS TODO \ config.guess config.rpath config.sub depcomp install-sh \ missing mkinstalldirs subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = Doxyfile pbbuttonsd.cnf intl/Makefile PROGRAMS = $(noinst_PROGRAMS) am_ccdv_OBJECTS = ccdv.$(OBJEXT) ccdv_OBJECTS = $(am_ccdv_OBJECTS) ccdv_LDADD = $(LDADD) DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(ccdv_SOURCES) DIST_SOURCES = $(ccdv_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" man5dir = $(mandir)/man5 NROFF = nroff MANS = $(man_MANS) ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEBUG_FALSE = @DEBUG_FALSE@ DEBUG_TRUE = @DEBUG_TRUE@ DEFS = @DEFS@ DOT = @DOT@ DOT_PATH = @DOT_PATH@ DOXYGEN = @DOXYGEN@ DOXYGEN_DOCS_ENABLED_FALSE = @DOXYGEN_DOCS_ENABLED_FALSE@ DOXYGEN_DOCS_ENABLED_TRUE = @DOXYGEN_DOCS_ENABLED_TRUE@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GENCAT = @GENCAT@ GLIBC2 = @GLIBC2@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_ASPRINTF = @HAVE_ASPRINTF@ HAVE_DOT = @HAVE_DOT@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ HAVE_SNPRINTF = @HAVE_SNPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ HAVE_WPRINTF = @HAVE_WPRINTF@ HOSTCC = @HOSTCC@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ KBD_AUTOADJMODE = @KBD_AUTOADJMODE@ KBD_AUTOADJPARMAC = @KBD_AUTOADJPARMAC@ KBD_AUTOADJPARMBAT = @KBD_AUTOADJPARMBAT@ KBD_FADINGSPEED = @KBD_FADINGSPEED@ LCD_AUTOADJMODE = @LCD_AUTOADJMODE@ LCD_AUTOADJPARMAC = @LCD_AUTOADJPARMAC@ LCD_AUTOADJPARMBAT = @LCD_AUTOADJPARMBAT@ LCD_FADINGSPEED = @LCD_FADINGSPEED@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPTH = @LIBPTH@ LIBS = @LIBS@ LIBTHREAD = @LIBTHREAD@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ PACKAGE_LIBS = @PACKAGE_LIBS@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PB_LIBS = @PB_LIBS@ PB_OBJECTS = @PB_OBJECTS@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ QUIET = @QUIET@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WOE32DLL = @WOE32DLL@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = . intl libpbbipc pbbcmd po src EXTRA_DIST = autogen.sh BUGS pbbcmd.1 pbbuttonsd.1 pbbuttonsd.cnf.5\ pbbuttonsd.cnf.in config.rpath Doxyfile.in man_MANS = pbbuttonsd.1 pbbuttonsd.cnf.5 pbbcmd.1 ccdv_SOURCES = ccdv.c all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .o .obj am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu --ignore-deps'; \ cd $(srcdir) && $(AUTOMAKE) --gnu --ignore-deps \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu --ignore-deps Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in cd $(top_builddir) && $(SHELL) ./config.status $@ pbbuttonsd.cnf: $(top_builddir)/config.status $(srcdir)/pbbuttonsd.cnf.in cd $(top_builddir) && $(SHELL) ./config.status $@ intl/Makefile: $(top_builddir)/config.status $(top_srcdir)/intl/Makefile.in cd $(top_builddir) && $(SHELL) ./config.status $@ clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done install-man5: $(man5_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man5dir)" || $(mkdir_p) "$(DESTDIR)$(man5dir)" @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.5*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 5*) ;; \ *) ext='5' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst"; \ done uninstall-man5: @$(NORMAL_UNINSTALL) @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.5*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 5*) ;; \ *) ext='5' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man5dir)/$$inst"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/. $(distdir)/intl $(distdir)/po @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ --with-included-gettext \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive @DOXYGEN_DOCS_ENABLED_FALSE@all-local: all-am: Makefile $(PROGRAMS) $(MANS) config.h all-local installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-data-local install-man install-exec-am: install-info: install-info-recursive install-man: install-man1 install-man5 installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-man uninstall-info: uninstall-info-recursive uninstall-man: uninstall-man1 uninstall-man5 .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am all-local \ am--refresh check check-am clean clean-generic \ clean-noinstPROGRAMS clean-recursive ctags ctags-recursive \ dist dist-all dist-bzip2 dist-gzip dist-hook dist-shar \ dist-tarZ dist-zip distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-recursive \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local install-exec \ install-exec-am install-info install-info-am install-man \ install-man1 install-man5 install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-info-am uninstall-man \ uninstall-man1 uninstall-man5 ccdv: ccdv.c @${HOSTCC} -O1 -o ccdv ccdv.c .SILENT: ccdv @DOXYGEN_DOCS_ENABLED_TRUE@all-local: doxygen-docs doxygen-docs: ${QUIET} $(DOXYGEN) install-data-local: @$(NORMAL_INSTALL) $(INSTALL) -d $(DESTDIR)$(sysconfdir) $(INSTALL) -d $(DESTDIR)$(localstatedir)/pbbuttons $(INSTALL) -d $(DESTDIR)$(localstatedir)/ibam $(INSTALL_DATA) --suffix=.old -b $(srcdir)/pbbuttonsd.cnf $(DESTDIR)$(sysconfdir)/pbbuttonsd.cnf @for dir in power power/scripts.d power/event.d; do \ $(INSTALL) -d $(DESTDIR)$(sysconfdir)/$$dir; \ src=`basename $$dir`; \ if [ $$src == $$dir ]; then src=""; fi; \ for file in $(srcdir)/scripts/$$src/*; do \ name=`basename $$file`; \ if [ "$$src" != "" ] && [ "$$src" != "scripts.d" ]; then \ $(LN_S) -f ../scripts.d/$$name $(DESTDIR)$(sysconfdir)/$$dir/$$name; \ elif test -x $$file; then \ $(INSTALL_SCRIPT) $$file $(DESTDIR)$(sysconfdir)/$$dir/; \ elif test -f $$file; then \ $(INSTALL_DATA) $$file $(DESTDIR)$(sysconfdir)/$$dir/; \ fi; \ done; \ done; dist-hook: @for dir in scripts scripts/scripts.d scripts/event.d; do \ $(INSTALL) -d $(distdir)/$$dir; \ for file in $(srcdir)/$$dir/*; do \ if [ `basename $$file` == "laptop-mode" ]; then \ continue; \ elif test -x $$file; then \ $(INSTALL_SCRIPT) $$file $(distdir)/$$dir/; \ elif test -f $$file; then \ $(INSTALL_DATA) $$file $(distdir)/$$dir/; \ fi; \ done; \ done; $(INSTALL) -d $(distdir)/srcdoc; $(INSTALL) -d $(distdir)/doc/images; @for file in $(srcdir)/srcdoc/*; do \ if [ `basename $$file` == "index.html" ]; then \ $(INSTALL_DATA) $$file $(distdir)/doc/; \ else \ $(INSTALL_DATA) $$file $(distdir)/srcdoc/; \ fi; \ done; @for file in $(srcdir)/srcdoc/images/*; do \ $(INSTALL_DATA) $$file $(distdir)/doc/images; \ done; # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pbbuttonsd-0.8.1a/config.h.in0000644000175000017500000003073310641704556013027 00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the `argz_count' function. */ #undef HAVE_ARGZ_COUNT /* Define to 1 if you have the header file. */ #undef HAVE_ARGZ_H /* Define to 1 if you have the `argz_next' function. */ #undef HAVE_ARGZ_NEXT /* Define to 1 if you have the `argz_stringify' function. */ #undef HAVE_ARGZ_STRINGIFY /* Define to 1 if you have the `asprintf' function. */ #undef HAVE_ASPRINTF /* Define to 1 if the compiler understands __builtin_expect. */ #undef HAVE_BUILTIN_EXPECT /* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework. */ #undef HAVE_CFLOCALECOPYCURRENT /* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework. */ #undef HAVE_CFPREFERENCESCOPYAPPVALUE /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FEOF_UNLOCKED /* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FGETS_UNLOCKED /* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_GETC_UNLOCKED /* Define to 1 if you have the declaration of `_snprintf', and to 0 if you don't. */ #undef HAVE_DECL__SNPRINTF /* Define to 1 if you have the declaration of `_snwprintf', and to 0 if you don't. */ #undef HAVE_DECL__SNWPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fwprintf' function. */ #undef HAVE_FWPRINTF /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `getegid' function. */ #undef HAVE_GETEGID /* Define to 1 if you have the `geteuid' function. */ #undef HAVE_GETEUID /* Define to 1 if you have the `getgid' function. */ #undef HAVE_GETGID /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define to 1 if you have the `getuid' function. */ #undef HAVE_GETUID /* Define if you have the iconv() function. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INITREQ_H /* Define if you have the 'intmax_t' type in or . */ #undef HAVE_INTMAX_T /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if exists, doesn't clash with , and declares uintmax_t. */ #undef HAVE_INTTYPES_H_WITH_UINTMAX /* Define if you have and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H /* Define if your file defines LC_MESSAGES. */ #undef HAVE_LC_MESSAGES /* Define to 1 if you have the `asound' library (-lasound). */ #undef HAVE_LIBASOUND /* Define to 1 if you have the `dl' library (-ldl). */ #undef HAVE_LIBDL /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define if you have the 'long double' type. */ #undef HAVE_LONG_DOUBLE /* Define to 1 if the system has the type `long long int'. */ #undef HAVE_LONG_LONG_INT /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mempcpy' function. */ #undef HAVE_MEMPCPY /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the `munmap' function. */ #undef HAVE_MUNMAP /* Define if you have and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined. */ #undef HAVE_NL_LOCALE_NAME /* Define to 1 if you have the header file. */ #undef HAVE_PCI_PCI_H /* Define if your printf() function supports format strings with positions. */ #undef HAVE_POSIX_PRINTF /* Define if the defines PTHREAD_MUTEX_RECURSIVE. */ #undef HAVE_PTHREAD_MUTEX_RECURSIVE /* Define if the POSIX multithreading library has read/write locks. */ #undef HAVE_PTHREAD_RWLOCK /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if you have the `setenv' function. */ #undef HAVE_SETENV /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the header file. */ #undef HAVE_SMBIOS_SYSTEMINFO_H /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define if exists, doesn't clash with , and declares uintmax_t. */ #undef HAVE_STDINT_H_WITH_UINTMAX /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `stpcpy' function. */ #undef HAVE_STPCPY /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the `tsearch' function. */ #undef HAVE_TSEARCH /* Define if you have the 'uintmax_t' type in or . */ #undef HAVE_UINTMAX_T /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define if you have the 'unsigned long long' type. */ #undef HAVE_UNSIGNED_LONG_LONG /* Define to 1 if the system has the type `unsigned long long int'. */ #undef HAVE_UNSIGNED_LONG_LONG_INT /* Define to 1 or 0, depending whether the compiler supports simple visibility declarations. */ #undef HAVE_VISIBILITY /* Define if you have the 'wchar_t' type. */ #undef HAVE_WCHAR_T /* Define to 1 if you have the `wcslen' function. */ #undef HAVE_WCSLEN /* Define if you have the 'wint_t' type. */ #undef HAVE_WINT_T /* Define to 1 if you have the `__fsetlocking' function. */ #undef HAVE___FSETLOCKING /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST /* Define if integer division by zero raises signal SIGFPE. */ #undef INTDIV0_RAISES_SIGFPE /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* target dir for data files */ #undef PACKAGE_DATA_DIR /* target dir for language files */ #undef PACKAGE_LOCALE_DIR /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define if exists and defines unusable PRI* macros. */ #undef PRI_MACROS_BROKEN /* Define if the pthread_in_use() detection is hard. */ #undef PTHREAD_IN_USE_DETECTION_HARD /* Define as the maximum value of type 'size_t', if the system doesn't define it. */ #undef SIZE_MAX /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* target dir for configuration files */ #undef SYS_CONF_DIR /* machine to build the package for */ #undef SYS_I386_ACPI /* machine to build the package for */ #undef SYS_I386_GENERIC /* machine to build the package for */ #undef SYS_MACBOOK /* machine to build the package for */ #undef SYS_POWERBOOK /* Define if the POSIX multithreading library can be used. */ #undef USE_POSIX_THREADS /* Define if references to the POSIX multithreading library should be made weak. */ #undef USE_POSIX_THREADS_WEAK /* Define if the GNU Pth multithreading library can be used. */ #undef USE_PTH_THREADS /* Define if references to the GNU Pth multithreading library should be made weak. */ #undef USE_PTH_THREADS_WEAK /* Define if the old Solaris multithreading library can be used. */ #undef USE_SOLARIS_THREADS /* Define if references to the old Solaris multithreading library should be made weak. */ #undef USE_SOLARIS_THREADS_WEAK /* Define if the Win32 multithreading API can be used. */ #undef USE_WIN32_THREADS /* Version number of package */ #undef VERSION /* enable ALSA support */ #undef WITH_ALSA /* enable IBAM support */ #undef WITH_IBAM /* enable OSS support */ #undef WITH_OSS /* use pmud as basement */ #undef WITH_PMUD /* SMBIOS available */ #undef WITH_SMBIOS /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define as the type of the result of subtracting two pointers, if the system doesn't define it. */ #undef ptrdiff_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to unsigned long or unsigned long long if and don't define. */ #undef uintmax_t #define __libc_lock_t gl_lock_t #define __libc_lock_define gl_lock_define #define __libc_lock_define_initialized gl_lock_define_initialized #define __libc_lock_init gl_lock_init #define __libc_lock_lock gl_lock_lock #define __libc_lock_unlock gl_lock_unlock #define __libc_lock_recursive_t gl_recursive_lock_t #define __libc_lock_define_recursive gl_recursive_lock_define #define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized #define __libc_lock_init_recursive gl_recursive_lock_init #define __libc_lock_lock_recursive gl_recursive_lock_lock #define __libc_lock_unlock_recursive gl_recursive_lock_unlock #define glthread_in_use libintl_thread_in_use #define glthread_lock_init libintl_lock_init #define glthread_lock_lock libintl_lock_lock #define glthread_lock_unlock libintl_lock_unlock #define glthread_lock_destroy libintl_lock_destroy #define glthread_rwlock_init libintl_rwlock_init #define glthread_rwlock_rdlock libintl_rwlock_rdlock #define glthread_rwlock_wrlock libintl_rwlock_wrlock #define glthread_rwlock_unlock libintl_rwlock_unlock #define glthread_rwlock_destroy libintl_rwlock_destroy #define glthread_recursive_lock_init libintl_recursive_lock_init #define glthread_recursive_lock_lock libintl_recursive_lock_lock #define glthread_recursive_lock_unlock libintl_recursive_lock_unlock #define glthread_recursive_lock_destroy libintl_recursive_lock_destroy #define glthread_once libintl_once #define glthread_once_call libintl_once_call #define glthread_once_singlethreaded libintl_once_singlethreaded pbbuttonsd-0.8.1a/pbbuttonsd.cnf.in0000644000175000017500000000327410641704560014260 00000000000000# Configuration file for pbbuttonsd >= version 0.8.0 # For complete list of options please see pbbuttonsd.cnf man-page. # For description of the file format please see # http://freedesktop.org/Standards/desktop-entry-spec. [SYSTEM] #userallowed=paranoid CmdTimeout=8 autorescan=true [MODULE DISPLAY] #LCD_Brightness=90 LCD_FadingSpeed=@LCD_FADINGSPEED@ LCD_AutoadjMode=@LCD_AUTOADJMODE@ LCD_AutoadjParm_onBattery=@LCD_AUTOADJPARMBAT@ LCD_AutoadjParm_onAC=@LCD_AUTOADJPARMAC@ #KBD_OnBrightness=21 KBD_FadingSpeed=@KBD_FADINGSPEED@ KBD_AutoadjMode=@KBD_AUTOADJMODE@ KBD_AutoadjParm_onBattery=@KBD_AUTOADJPARMBAT@ KBD_AutoadjParm_onAC=@KBD_AUTOADJPARMAC@ Device_FB=/dev/fb0 UseFBBlank=false DimFullyDark=false CRT_MirrorKey=65 + ctrl [MODULE CDROM] Device=/dev/cdrom EjectCDKey=161 EjectCDKeyDelay=0 [MODULE MIXER OSS] Device=/dev/mixer Channels=volume, speaker [MODULE MIXER ALSA] Card=default Channels=Master, PC Speaker [MODULE PMAC] TPModeUpKey=225 + alt TPModeDownKey=224 + alt TPMode=drag KBDMode=fkeysfirst Batlog=none NoTapTyping=false [MODULE POWERSAVE] onAC_Policy=performance onAC_TimerAction=none onAC_CoverAction=suspend-to-ram onAC_KeyAction=suspend-to-ram onAC_SuspendTime=0 onAC_DimTime=0 onBattery_Policy=powersave onBattery_TimerAction=suspend-to-ram onBattery_CoverAction=suspend-to-ram onBattery_KeyAction=suspend-to-ram onBattery_SuspendTime=3000 onBattery_DimTime=600 SleepKey=116 SleepKeyDelay=0 BWL_First=22 BWL_Second=10 BWL_Last=3 Script_PMCS=@sysconfdir@/power/pmcs-pbbuttonsd %s %s %s EmergencyAction=sleep HeartbeatBeep=false CPULoad_sleeplock=true CPULoad_min=20 CPULoad_period=20 NETLoad_sleeplock=true NETLoad_min=4096 NetLoad_period=20 NETLoad_device=eth0 IBAM_DataDir=/var/lib/ibam pbbuttonsd-0.8.1a/configure0000755000175000017500000161453110652444347012721 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for pbbuttonsd 0.8.1a. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='pbbuttonsd' PACKAGE_TARNAME='pbbuttonsd' PACKAGE_VERSION='0.8.1a' PACKAGE_STRING='pbbuttonsd 0.8.1a' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" gt_needs= ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX LN_S RANLIB build build_cpu build_vendor build_os host host_cpu host_vendor host_os LCD_FADINGSPEED LCD_AUTOADJMODE LCD_AUTOADJPARMBAT LCD_AUTOADJPARMAC KBD_FADINGSPEED KBD_AUTOADJMODE KBD_AUTOADJPARMBAT KBD_AUTOADJPARMAC PKG_CONFIG PACKAGE_CFLAGS PACKAGE_LIBS ALSA_CFLAGS ALSA_LIBS DOXYGEN DOT HAVE_DOT DOT_PATH DOXYGEN_DOCS_ENABLED_TRUE DOXYGEN_DOCS_ENABLED_FALSE DEBUG_TRUE DEBUG_FALSE PB_OBJECTS PB_LIBS CPP GREP EGREP USE_NLS MSGFMT GMSGFMT MSGFMT_015 GMSGFMT_015 XGETTEXT XGETTEXT_015 MSGMERGE GLIBC2 CFLAG_VISIBILITY HAVE_VISIBILITY ALLOCA PRI_MACROS_BROKEN LIBPTH LTLIBPTH LIBTHREAD LTLIBTHREAD LIBMULTITHREAD LTLIBMULTITHREAD LIBICONV LTLIBICONV INTLBISON GLIBC21 INTL_MACOSX_LIBS HAVE_POSIX_PRINTF HAVE_ASPRINTF HAVE_SNPRINTF HAVE_WPRINTF WOE32DLL BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB HOSTCC QUIET AM_MAKEFLAGS LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC PKG_CONFIG PACKAGE_CFLAGS PACKAGE_LIBS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures pbbuttonsd 0.8.1a to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/pbbuttonsd] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of pbbuttonsd 0.8.1a:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-alsatest Do not try to compile and run a test Alsa program --disable-nls do not use Native Language Support --enable-threads={posix|solaris|pth|win32} specify multithreading API --disable-threads build without multithread safety --disable-rpath do not hardcode runtime library paths Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pmud use pmud as low level power manager (default=no) --with-oss enable OSS support in pbbuttonsd (default=yes) --with-alsa enable ALSA support in pbbuttonsd (default=yes) --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional) --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional) --with-ibam enable IBAM support in pbbuttonsd (default=yes) --with-doxygen-docs build DOXYGEN documentation (requires Doxygen) --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libpth-prefix[=DIR] search for libpth in DIR/include and DIR/lib --without-libpth-prefix don't search for libpth in includedir and libdir --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-included-gettext use the GNU gettext library included here --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags PKG_CONFIG path to pkg-config utility PACKAGE_CFLAGS C compiler flags for PACKAGE, overriding pkg-config PACKAGE_LIBS linker flags for PACKAGE, overriding pkg-config CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF pbbuttonsd configure 0.8.1a generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by pbbuttonsd $as_me 0.8.1a, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi gt_needs="$gt_needs " # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version="1.9" ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='pbbuttonsd' VERSION='0.8.1a' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h" { echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE cat >>confdefs.h <<\_ACEOF #define _GNU_SOURCE 1 _ACEOF ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking for library containing strerror" >&5 echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; } if test "${ac_cv_search_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strerror (); int main () { return strerror (); ; return 0; } _ACEOF for ac_lib in '' cposix; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_strerror=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_strerror+set}" = set; then break fi done if test "${ac_cv_search_strerror+set}" = set; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 echo "${ECHO_T}$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6; } fi { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac localstatedir="/var/lib" LCD_FADINGSPEED="448" LCD_AUTOADJMODE="linear" LCD_AUTOADJPARMBAT="0,1,94,54" LCD_AUTOADJPARMAC="0,1,94,100" KBD_FADINGSPEED="0" KBD_AUTOADJMODE="hysteresis" KBD_AUTOADJPARMBAT="10,100,28,0" KBD_AUTOADJPARMAC="10,100,28,0" PB_OBJECTS= PB_LIBS= if test "x$laptop" != "x"; then ac_laptop=$laptop elif test "x$LAPTOP" != "x"; then ac_laptop=$LAPTOP else case $host in powerpc*) ac_laptop=powerbook;; i686*) ac_laptop=macbook;; i?86*) ac_laptop=i386acpi;; *) { { echo "$as_me:$LINENO: error: Unknown system, please set LAPTOP environment variable." >&5 echo "$as_me: error: Unknown system, please set LAPTOP environment variable." >&2;} { (exit 1); exit 1; }; } esac fi case "$ac_laptop" in POWERBOOK | powerbook | pb | PB ) ac_laptop="Apple PowerBook" cat >>confdefs.h <<_ACEOF #define SYS_POWERBOOK "" _ACEOF PB_OBJECTS+=" driver_backlight_pmu.$OBJEXT module_pmac.$OBJEXT" ;; MACBOOK | macbook | mb | MB ) ac_laptop="Apple MacBook (Intel based)" ac_macbook=no cat >>confdefs.h <<_ACEOF #define SYS_MACBOOK "" _ACEOF for ac_header in smbios/SystemInfo.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* dummy */ #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF cat >>confdefs.h <<_ACEOF #define WITH_SMBIOS 1 _ACEOF else { { echo "$as_me:$LINENO: error: SMBios library not available. Please install development files for libsmbios." >&5 echo "$as_me: error: SMBios library not available. Please install development files for libsmbios." >&2;} { (exit 1); exit 1; }; } fi done for ac_header in pci/pci.h sys/io.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* dummy */ #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF ac_macbook=yes else { { echo "$as_me:$LINENO: error: Please install development files for libpci and direct I/O." >&5 echo "$as_me: error: Please install development files for libpci and direct I/O." >&2;} { (exit 1); exit 1; }; } fi done PB_OBJECTS+=" driver_backlight_x1600.$OBJEXT driver_backlight_gma950.$OBJEXT module_acpi.$OBJEXT module_imac.$OBJEXT" PB_LIBS+=" -lpci -lsmbios" LCD_FADINGSPEED="448" LCD_AUTOADJMODE="linear" LCD_AUTOADJPARMBAT="0,10,80,30" LCD_AUTOADJPARMAC="0,30,80,60" KBD_FADINGSPEED="35" KBD_AUTOADJMODE="hysteresis" KBD_AUTOADJPARMBAT="30,50,40,0" KBD_AUTOADJPARMAC="30,30,40,0" ;; I386ACPI | i386acpi | acpi | ACPI ) cat >>confdefs.h <<_ACEOF #define SYS_I386_ACPI "" _ACEOF ac_laptop="Intel based laptop with ACPI" ;; I386 | i386) cat >>confdefs.h <<_ACEOF #define SYS_I386_GENERIC "" _ACEOF ac_laptop="Intel based laptop" ;; *) echo -e "\nOption 'laptop' not set or unknown. Please call 'configure laptop='" echo "Possible targets are: powerbook, macbook" { { echo "$as_me:$LINENO: error: unknown target system" >&5 echo "$as_me: error: unknown target system" >&2;} { (exit 1); exit 1; }; } ;; esac { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF LIBS="-ldl $LIBS" fi pkg_modules="glib-2.0 >= 2.6.0" if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { echo "$as_me:$LINENO: checking for PACKAGE" >&5 echo $ECHO_N "checking for PACKAGE... $ECHO_C" >&6; } if test -n "$PKG_CONFIG"; then if test -n "$PACKAGE_CFLAGS"; then pkg_cv_PACKAGE_CFLAGS="$PACKAGE_CFLAGS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$pkg_modules\"") >&5 ($PKG_CONFIG --exists --print-errors "$pkg_modules") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_PACKAGE_CFLAGS=`$PKG_CONFIG --cflags "$pkg_modules" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$PACKAGE_LIBS"; then pkg_cv_PACKAGE_LIBS="$PACKAGE_LIBS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$pkg_modules\"") >&5 ($PKG_CONFIG --exists --print-errors "$pkg_modules") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_PACKAGE_LIBS=`$PKG_CONFIG --libs "$pkg_modules" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PACKAGE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$pkg_modules"` else PACKAGE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$pkg_modules"` fi # Put the nasty error message in config.log where it belongs echo "$PACKAGE_PKG_ERRORS" >&5 { { echo "$as_me:$LINENO: error: Package requirements ($pkg_modules) were not met: $PACKAGE_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables PACKAGE_CFLAGS and PACKAGE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&5 echo "$as_me: error: Package requirements ($pkg_modules) were not met: $PACKAGE_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables PACKAGE_CFLAGS and PACKAGE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables PACKAGE_CFLAGS and PACKAGE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&5 echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables PACKAGE_CFLAGS and PACKAGE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else PACKAGE_CFLAGS=$pkg_cv_PACKAGE_CFLAGS PACKAGE_LIBS=$pkg_cv_PACKAGE_LIBS { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } : fi pbb_with_pmud=no # Check whether --with-pmud was given. if test "${with_pmud+set}" = set; then withval=$with_pmud; pbb_with_pmud=$withval fi if test "$pbb_with_pmud" = "yes"; then cat >>confdefs.h <<_ACEOF #define WITH_PMUD 1 _ACEOF PB_OBJECTS+="tcp.$OBJEXT" fi pbb_with_oss=yes # Check whether --with-oss was given. if test "${with_oss+set}" = set; then withval=$with_oss; pbb_with_oss=$withval fi if test "$pbb_with_oss" = "yes"; then cat >>confdefs.h <<_ACEOF #define WITH_OSS 1 _ACEOF PB_OBJECTS+=" driver_mixer_oss.$OBJEXT" fi pbb_with_alsa=yes # Check whether --with-alsa was given. if test "${with_alsa+set}" = set; then withval=$with_alsa; pbb_with_alsa=$withval fi if test "$pbb_with_alsa" = "yes"; then alsa_save_CFLAGS="$CFLAGS" alsa_save_LDFLAGS="$LDFLAGS" alsa_save_LIBS="$LIBS" alsa_found=yes # Check whether --with-alsa-prefix was given. if test "${with_alsa_prefix+set}" = set; then withval=$with_alsa_prefix; alsa_prefix="$withval" else alsa_prefix="" fi # Check whether --with-alsa-inc-prefix was given. if test "${with_alsa_inc_prefix+set}" = set; then withval=$with_alsa_inc_prefix; alsa_inc_prefix="$withval" else alsa_inc_prefix="" fi # Check whether --enable-alsatest was given. if test "${enable_alsatest+set}" = set; then enableval=$enable_alsatest; enable_alsatest="$enableval" else enable_alsatest=yes fi { echo "$as_me:$LINENO: checking for ALSA CFLAGS" >&5 echo $ECHO_N "checking for ALSA CFLAGS... $ECHO_C" >&6; } if test "$alsa_inc_prefix" != "" ; then ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix" CFLAGS="$CFLAGS -I$alsa_inc_prefix" fi { echo "$as_me:$LINENO: result: $ALSA_CFLAGS" >&5 echo "${ECHO_T}$ALSA_CFLAGS" >&6; } CFLAGS="$alsa_save_CFLAGS" { echo "$as_me:$LINENO: checking for ALSA LDFLAGS" >&5 echo $ECHO_N "checking for ALSA LDFLAGS... $ECHO_C" >&6; } if test "$alsa_prefix" != "" ; then ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix" LDFLAGS="$LDFLAGS $ALSA_LIBS" fi ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" LIBS="$ALSA_LIBS $LIBS" { echo "$as_me:$LINENO: result: $ALSA_LIBS" >&5 echo "${ECHO_T}$ALSA_LIBS" >&6; } min_alsa_version=1.0.0 { echo "$as_me:$LINENO: checking for libasound headers version >= $min_alsa_version" >&5 echo $ECHO_N "checking for libasound headers version >= $min_alsa_version... $ECHO_C" >&6; } no_alsa="" alsa_min_major_version=`echo $min_alsa_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` alsa_min_minor_version=`echo $min_alsa_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` alsa_min_micro_version=`echo $min_alsa_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { /* ensure backward compatibility */ #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR) #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR #endif #if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR) #define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR #endif #if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR) #define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR #endif # if(SND_LIB_MAJOR > $alsa_min_major_version) exit(0); # else # if(SND_LIB_MAJOR < $alsa_min_major_version) # error not present # endif # if(SND_LIB_MINOR > $alsa_min_minor_version) exit(0); # else # if(SND_LIB_MINOR < $alsa_min_minor_version) # error not present # endif # if(SND_LIB_SUBMINOR < $alsa_min_micro_version) # error not present # endif # endif # endif exit(0); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then { echo "$as_me:$LINENO: result: found." >&5 echo "${ECHO_T}found." >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: not present." >&5 echo "${ECHO_T}not present." >&6; } alsa_found=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "x$enable_alsatest" = "xyes"; then { echo "$as_me:$LINENO: checking for snd_ctl_open in -lasound" >&5 echo $ECHO_N "checking for snd_ctl_open in -lasound... $ECHO_C" >&6; } if test "${ac_cv_lib_asound_snd_ctl_open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lasound $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char snd_ctl_open (); int main () { return snd_ctl_open (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_asound_snd_ctl_open=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_asound_snd_ctl_open=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_ctl_open" >&5 echo "${ECHO_T}$ac_cv_lib_asound_snd_ctl_open" >&6; } if test $ac_cv_lib_asound_snd_ctl_open = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBASOUND 1 _ACEOF LIBS="-lasound $LIBS" else alsa_found=no fi fi LDFLAGS="$alsa_save_LDFLAGS" LIBS="$alsa_save_LIBS" if test "x$alsa_found" = "xyes" ; then pbb_have_alsa=yes else ALSA_CFLAGS="" ALSA_LIBS="" pbb_have_alsa=no fi if test "$pbb_have_alsa" = "yes"; then cat >>confdefs.h <<_ACEOF #define WITH_ALSA 1 _ACEOF PB_OBJECTS+=" driver_mixer_alsa.$OBJEXT" PB_LIBS+=$ALSA_LIBS fi fi pbb_with_ibam=yes # Check whether --with-ibam was given. if test "${with_ibam+set}" = set; then withval=$with_ibam; pbb_with_ibam=$withval fi if test "$pbb_with_ibam" = "yes"; then cat >>confdefs.h <<_ACEOF #define WITH_IBAM 1 _ACEOF PB_OBJECTS+=" ibam_stub.$OBJEXT" PB_LIBS+=" -lstdc++" fi # Check whether --with-doxygen-docs was given. if test "${with_doxygen_docs+set}" = set; then withval=$with_doxygen_docs; with_doxygen_docs=$withval else with_doxygen_docs=no fi # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_DOXYGEN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $DOXYGEN in [\\/]* | ?:[\\/]*) ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_DOXYGEN" && ac_cv_path_DOXYGEN="no" ;; esac fi DOXYGEN=$ac_cv_path_DOXYGEN if test -n "$DOXYGEN"; then { echo "$as_me:$LINENO: result: $DOXYGEN" >&5 echo "${ECHO_T}$DOXYGEN" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Extract the first word of "dot", so it can be a program name with args. set dummy dot; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_DOT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $DOT in [\\/]* | ?:[\\/]*) ac_cv_path_DOT="$DOT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_DOT" && ac_cv_path_DOT="no" ;; esac fi DOT=$ac_cv_path_DOT if test -n "$DOT"; then { echo "$as_me:$LINENO: result: $DOT" >&5 echo "${ECHO_T}$DOT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi { echo "$as_me:$LINENO: checking whether to build Doxygen documentation" >&5 echo $ECHO_N "checking whether to build Doxygen documentation... $ECHO_C" >&6; } if test x$DOXYGEN = xno ; then have_doxygen=no else have_doxygen=yes fi DOT_PATH= HAVE_DOT=NO if test x$DOT != xno; then HAVE_DOT=YES DOT_PATH=`dirname $DOT` fi if test x$with_doxygen_docs = xauto ; then if test x$have_doxygen = xno ; then with_doxygen_docs=no else with_doxygen_docs=yes fi fi if test x$with_doxygen_docs = xyes; then if test x$have_doxygen = xno; then { { echo "$as_me:$LINENO: error: Building Doxygen docs explicitly required, but Doxygen not found" >&5 echo "$as_me: error: Building Doxygen docs explicitly required, but Doxygen not found" >&2;} { (exit 1); exit 1; }; } fi fi if test x$with_doxygen_docs = xyes; then DOXYGEN_DOCS_ENABLED_TRUE= DOXYGEN_DOCS_ENABLED_FALSE='#' else DOXYGEN_DOCS_ENABLED_TRUE='#' DOXYGEN_DOCS_ENABLED_FALSE= fi { echo "$as_me:$LINENO: result: $with_doxygen_docs" >&5 echo "${ECHO_T}$with_doxygen_docs" >&6; } if test "$enable_debug" = yes; then DEBUG_TRUE= DEBUG_FALSE='#' else DEBUG_TRUE='#' DEBUG_FALSE= fi if test "$enable_debug" = "yes"; then PB_OBJECTS+=" module_peep.$OBJEXT" else enable_debug=no; fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in initreq.h alloca.h argz.h errno.h fcntl.h langinfo.h libintl.h limits.h locale.h malloc.h stddef.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ALL_LINGUAS="de ca es" { echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6; } # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then { echo "$as_me:$LINENO: result: $MSGFMT" >&5 echo "${ECHO_T}$MSGFMT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_GMSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { echo "$as_me:$LINENO: result: $GMSGFMT" >&5 echo "${ECHO_T}$GMSGFMT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { echo "$as_me:$LINENO: result: $XGETTEXT" >&5 echo "${ECHO_T}$XGETTEXT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f messages.po case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGMERGE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGMERGE" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then { echo "$as_me:$LINENO: result: $MSGMERGE" >&5 echo "${ECHO_T}$MSGMERGE" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$localedir" || localedir='${datadir}/locale' ac_config_commands="$ac_config_commands po-directories" { echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2 or newer" >&5 echo $ECHO_N "checking whether we are using the GNU C Library 2 or newer... $ECHO_C" >&6; } if test "${ac_cv_gnu_library_2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ >= 2) Lucky GNU user #endif #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "Lucky GNU user" >/dev/null 2>&1; then ac_cv_gnu_library_2=yes else ac_cv_gnu_library_2=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2" >&5 echo "${ECHO_T}$ac_cv_gnu_library_2" >&6; } GLIBC2="$ac_cv_gnu_library_2" CFLAG_VISIBILITY= HAVE_VISIBILITY=0 if test -n "$GCC"; then { echo "$as_me:$LINENO: checking for simple visibility declarations" >&5 echo $ECHO_N "checking for simple visibility declarations... $ECHO_C" >&6; } if test "${gl_cv_cc_visibility+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gl_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern __attribute__((__visibility__("hidden"))) int hiddenvar; extern __attribute__((__visibility__("default"))) int exportedvar; extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); extern __attribute__((__visibility__("default"))) int exportedfunc (void); int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_cc_visibility=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_cc_visibility=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$gl_save_CFLAGS" fi { echo "$as_me:$LINENO: result: $gl_cv_cc_visibility" >&5 echo "${ECHO_T}$gl_cv_cc_visibility" >&6; } if test $gl_cv_cc_visibility = yes; then CFLAG_VISIBILITY="-fvisibility=hidden" HAVE_VISIBILITY=1 fi fi cat >>confdefs.h <<_ACEOF #define HAVE_VISIBILITY $HAVE_VISIBILITY _ACEOF { echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6; } if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef size_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { echo "$as_me:$LINENO: checking for stdint.h" >&5 echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6; } if test "${gl_cv_header_stdint_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { uintmax_t i = (uintmax_t) -1; return !i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_header_stdint_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_header_stdint_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gl_cv_header_stdint_h" >&5 echo "${ECHO_T}$gl_cv_header_stdint_h" >&6; } if test $gl_cv_header_stdint_h = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STDINT_H_WITH_UINTMAX 1 _ACEOF fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { echo "$as_me:$LINENO: checking for working alloca.h" >&5 echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; } if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for alloca" >&5 echo $ECHO_N "checking for alloca... $ECHO_C" >&6; } if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=\${LIBOBJDIR}alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF { echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; } if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined CRAY && ! defined CRAY2 webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 echo "${ECHO_T}$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi { echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; } if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { return find_stack_direction () < 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi for ac_header in stdlib.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for working mmap" >&5 echo $ECHO_N "checking for working mmap... $ECHO_C" >&6; } if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include #include #if !defined STDC_HEADERS && !defined HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H # define HAVE_SYS_PARAM_H 1 # endif # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # ifdef HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ int main () { char *data, *data2, *data3; int i, pagesize; int fd; pagesize = getpagesize (); /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) return 1; for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) return 1; if (write (fd, data, pagesize) != pagesize) return 1; close (fd); /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) return 1; data2 = (char *) malloc (2 * pagesize); if (!data2) return 1; data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) return 1; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) return 1; /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) return 1; if (read (fd, data3, pagesize) != pagesize) return 1; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) return 1; close (fd); return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mmap_fixed_mapped=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6; } if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP 1 _ACEOF fi rm -f conftest.mmap { echo "$as_me:$LINENO: checking whether integer division by zero raises SIGFPE" >&5 echo $ECHO_N "checking whether integer division by zero raises SIGFPE... $ECHO_C" >&6; } if test "${gt_cv_int_divbyzero_sigfpe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Guess based on the CPU. case "$host_cpu" in alpha* | i3456786 | m68k | s390*) gt_cv_int_divbyzero_sigfpe="guessing yes";; *) gt_cv_int_divbyzero_sigfpe="guessing no";; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include static void #ifdef __cplusplus sigfpe_handler (int sig) #else sigfpe_handler (sig) int sig; #endif { /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ exit (sig != SIGFPE); } int x = 1; int y = 0; int z; int nan; int main () { signal (SIGFPE, sigfpe_handler); /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) signal (SIGTRAP, sigfpe_handler); #endif /* Linux/SPARC yields signal SIGILL. */ #if defined (__sparc__) && defined (__linux__) signal (SIGILL, sigfpe_handler); #endif z = x / y; nan = y / y; exit (1); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_int_divbyzero_sigfpe=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) gt_cv_int_divbyzero_sigfpe=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $gt_cv_int_divbyzero_sigfpe" >&5 echo "${ECHO_T}$gt_cv_int_divbyzero_sigfpe" >&6; } case "$gt_cv_int_divbyzero_sigfpe" in *yes) value=1;; *) value=0;; esac cat >>confdefs.h <<_ACEOF #define INTDIV0_RAISES_SIGFPE $value _ACEOF { echo "$as_me:$LINENO: checking for inttypes.h" >&5 echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6; } if test "${gl_cv_header_inttypes_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { uintmax_t i = (uintmax_t) -1; return !i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_header_inttypes_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_header_inttypes_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gl_cv_header_inttypes_h" >&5 echo "${ECHO_T}$gl_cv_header_inttypes_h" >&6; } if test $gl_cv_header_inttypes_h = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_INTTYPES_H_WITH_UINTMAX 1 _ACEOF fi { echo "$as_me:$LINENO: checking for unsigned long long int" >&5 echo $ECHO_N "checking for unsigned long long int... $ECHO_C" >&6; } if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ unsigned long long int ull = 18446744073709551615ULL; typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1 ? 1 : -1)]; int i = 63; int main () { unsigned long long int ullmax = 18446744073709551615ull; return (ull << 63 | ull >> 63 | ull << i | ull >> i | ullmax / ull | ullmax % ull); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_type_unsigned_long_long_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_unsigned_long_long_int=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long_int" >&5 echo "${ECHO_T}$ac_cv_type_unsigned_long_long_int" >&6; } if test $ac_cv_type_unsigned_long_long_int = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_UNSIGNED_LONG_LONG_INT 1 _ACEOF fi ac_cv_type_unsigned_long_long=$ac_cv_type_unsigned_long_long_int if test $ac_cv_type_unsigned_long_long = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_UNSIGNED_LONG_LONG 1 _ACEOF fi if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then test $ac_cv_type_unsigned_long_long = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' cat >>confdefs.h <<_ACEOF #define uintmax_t $ac_type _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_UINTMAX_T 1 _ACEOF fi for ac_header in inttypes.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test $ac_cv_header_inttypes_h = yes; then { echo "$as_me:$LINENO: checking whether the inttypes.h PRIxNN macros are broken" >&5 echo $ECHO_N "checking whether the inttypes.h PRIxNN macros are broken... $ECHO_C" >&6; } if test "${gt_cv_inttypes_pri_broken+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef PRId32 char *p = PRId32; #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gt_cv_inttypes_pri_broken=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_inttypes_pri_broken=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_inttypes_pri_broken" >&5 echo "${ECHO_T}$gt_cv_inttypes_pri_broken" >&6; } fi if test "$gt_cv_inttypes_pri_broken" = yes; then cat >>confdefs.h <<_ACEOF #define PRI_MACROS_BROKEN 1 _ACEOF PRI_MACROS_BROKEN=1 else PRI_MACROS_BROKEN=0 fi # Check whether --enable-threads was given. if test "${enable_threads+set}" = set; then enableval=$enable_threads; gl_use_threads=$enableval else case "$host_os" in osf*) gl_use_threads=no ;; *) gl_use_threads=yes ;; esac fi if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then # For using : case "$host_os" in osf*) # On OSF/1, the compiler needs the flag -D_REENTRANT so that it # groks . cc also understands the flag -pthread, but # we don't use it because 1. gcc-2.95 doesn't understand -pthread, # 2. putting a flag into CPPFLAGS that has an effect on the linker # causes the AC_TRY_LINK test below to succeed unexpectedly, # leading to wrong values of LIBTHREAD and LTLIBTHREAD. CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; esac # Some systems optimize for single-threaded programs by default, and # need special flags to disable these optimizations. For example, the # definition of 'errno' in . case "$host_os" in aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;; solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; esac fi if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { echo "$as_me:$LINENO: checking for ld used by GCC" >&5 echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${acl_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$acl_cv_path_LD" if test -n "$LD"; then { echo "$as_me:$LINENO: result: $LD" >&5 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${acl_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { echo "$as_me:$LINENO: checking for shared library run path origin" >&5 echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6; } if test "${acl_cv_rpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 echo "${ECHO_T}$acl_cv_rpath" >&6; } wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then enableval=$enable_rpath; : else enable_rpath=yes fi acl_libdirstem=lib searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi gl_threads_api=none LIBTHREAD= LTLIBTHREAD= LIBMULTITHREAD= LTLIBMULTITHREAD= if test "$gl_use_threads" != no; then { echo "$as_me:$LINENO: checking whether imported symbols can be declared weak" >&5 echo $ECHO_N "checking whether imported symbols can be declared weak... $ECHO_C" >&6; } gl_have_weak=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern void xyzzy (); #pragma weak xyzzy int main () { xyzzy(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gl_have_weak=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext { echo "$as_me:$LINENO: result: $gl_have_weak" >&5 echo "${ECHO_T}$gl_have_weak" >&6; } if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that # it groks . It's added above, in gl_LOCK_EARLY_BODY. if test "${ac_cv_header_pthread_h+set}" = set; then { echo "$as_me:$LINENO: checking for pthread.h" >&5 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking pthread.h usability" >&5 echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking pthread.h presence" >&5 echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for pthread.h" >&5 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_pthread_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } fi if test $ac_cv_header_pthread_h = yes; then gl_have_pthread_h=yes else gl_have_pthread_h=no fi if test "$gl_have_pthread_h" = yes; then # Other possible tests: # -lpthreads (FSU threads, PCthreads) # -lgthreads gl_have_pthread= # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist # in libc. IRIX 6.5 has the first one in both libc and libpthread, but # the second one only in libpthread, and lock.c needs it. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { pthread_mutex_lock((pthread_mutex_t*)0); pthread_mutexattr_init((pthread_mutexattr_t*)0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gl_have_pthread=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext # Test for libpthread by looking for pthread_kill. (Not pthread_self, # since it is defined as a macro on OSF/1.) if test -n "$gl_have_pthread"; then # The program links fine without libpthread. But it may actually # need to link with libpthread in order to create multiple threads. { echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5 echo $ECHO_N "checking for pthread_kill in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_kill (); int main () { return pthread_kill (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread_pthread_kill=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_kill=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_kill" >&6; } if test $ac_cv_lib_pthread_pthread_kill = yes; then LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread # On Solaris and HP-UX, most pthread functions exist also in libc. # Therefore pthread_in_use() needs to actually try to create a # thread: pthread_create from libc will fail, whereas # pthread_create will actually create a thread. case "$host_os" in solaris* | hpux*) cat >>confdefs.h <<\_ACEOF #define PTHREAD_IN_USE_DETECTION_HARD 1 _ACEOF esac fi else # Some library is needed. Try libpthread and libc_r. { echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5 echo $ECHO_N "checking for pthread_kill in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_kill (); int main () { return pthread_kill (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread_pthread_kill=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_kill=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_kill" >&6; } if test $ac_cv_lib_pthread_pthread_kill = yes; then gl_have_pthread=yes LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread fi if test -z "$gl_have_pthread"; then # For FreeBSD 4. { echo "$as_me:$LINENO: checking for pthread_kill in -lc_r" >&5 echo $ECHO_N "checking for pthread_kill in -lc_r... $ECHO_C" >&6; } if test "${ac_cv_lib_c_r_pthread_kill+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_kill (); int main () { return pthread_kill (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_c_r_pthread_kill=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_kill=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_kill" >&5 echo "${ECHO_T}$ac_cv_lib_c_r_pthread_kill" >&6; } if test $ac_cv_lib_c_r_pthread_kill = yes; then gl_have_pthread=yes LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r fi fi fi if test -n "$gl_have_pthread"; then gl_threads_api=posix cat >>confdefs.h <<\_ACEOF #define USE_POSIX_THREADS 1 _ACEOF if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if test $gl_have_weak = yes; then cat >>confdefs.h <<\_ACEOF #define USE_POSIX_THREADS_WEAK 1 _ACEOF LIBTHREAD= LTLIBTHREAD= fi fi # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the # pthread_rwlock_* functions. { echo "$as_me:$LINENO: checking for pthread_rwlock_t" >&5 echo $ECHO_N "checking for pthread_rwlock_t... $ECHO_C" >&6; } if test "${ac_cv_type_pthread_rwlock_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include typedef pthread_rwlock_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_pthread_rwlock_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pthread_rwlock_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_pthread_rwlock_t" >&5 echo "${ECHO_T}$ac_cv_type_pthread_rwlock_t" >&6; } if test $ac_cv_type_pthread_rwlock_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PTHREAD_RWLOCK 1 _ACEOF fi # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #if __FreeBSD__ == 4 error "No, in FreeBSD 4.0 recursive mutexes actually don't work." #else int x = (int)PTHREAD_MUTEX_RECURSIVE; return !x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >>confdefs.h <<\_ACEOF #define HAVE_PTHREAD_MUTEX_RECURSIVE 1 _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi fi if test -z "$gl_have_pthread"; then if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then gl_have_solaristhread= gl_save_LIBS="$LIBS" LIBS="$LIBS -lthread" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { thr_self(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gl_have_solaristhread=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$gl_save_LIBS" if test -n "$gl_have_solaristhread"; then gl_threads_api=solaris LIBTHREAD=-lthread LTLIBTHREAD=-lthread LIBMULTITHREAD="$LIBTHREAD" LTLIBMULTITHREAD="$LTLIBTHREAD" cat >>confdefs.h <<\_ACEOF #define USE_SOLARIS_THREADS 1 _ACEOF if test $gl_have_weak = yes; then cat >>confdefs.h <<\_ACEOF #define USE_SOLARIS_THREADS_WEAK 1 _ACEOF LIBTHREAD= LTLIBTHREAD= fi fi fi fi if test "$gl_use_threads" = pth; then gl_save_CPPFLAGS="$CPPFLAGS" { echo "$as_me:$LINENO: checking how to link with libpth" >&5 echo $ECHO_N "checking how to link with libpth... $ECHO_C" >&6; } if test "${ac_cv_libpth_libs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libpth-prefix was given. if test "${with_libpth_prefix+set}" = set; then withval=$with_libpth_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi fi LIBPTH= LTLIBPTH= INCPTH= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='pth ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBPTH="${LIBPTH}${LIBPTH:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }$value" else : fi else found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" \ && { test -f "$additional_libdir/lib$name.$shlibext" \ || { test "$shlibext" = dll \ && test -f "$additional_libdir/lib$name.dll.a"; }; }; then found_dir="$additional_libdir" if test -f "$additional_libdir/lib$name.$shlibext"; then found_so="$additional_libdir/lib$name.$shlibext" else found_so="$additional_libdir/lib$name.dll.a" fi if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBPTH; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" \ && { test -f "$dir/lib$name.$shlibext" \ || { test "$shlibext" = dll \ && test -f "$dir/lib$name.dll.a"; }; }; then found_dir="$dir" if test -f "$dir/lib$name.$shlibext"; then found_so="$dir/lib$name.$shlibext" else found_so="$dir/lib$name.dll.a" fi if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$hardcode_direct" = yes; then LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBPTH; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBPTH="${LIBPTH}${LIBPTH:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" else LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBPTH="${LIBPTH}${LIBPTH:+ }$found_a" else LIBPTH="${LIBPTH}${LIBPTH:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCPTH; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCPTH="${INCPTH}${INCPTH:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBPTH; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBPTH="${LIBPTH}${LIBPTH:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBPTH; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBPTH="${LIBPTH}${LIBPTH:+ }$dep" LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }$dep" ;; esac done fi else LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name" LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBPTH="${LIBPTH}${LIBPTH:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBPTH="${LIBPTH}${LIBPTH:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-R$found_dir" done fi ac_cv_libpth_libs="$LIBPTH" ac_cv_libpth_ltlibs="$LTLIBPTH" ac_cv_libpth_cppflags="$INCPTH" fi { echo "$as_me:$LINENO: result: $ac_cv_libpth_libs" >&5 echo "${ECHO_T}$ac_cv_libpth_libs" >&6; } LIBPTH="$ac_cv_libpth_libs" LTLIBPTH="$ac_cv_libpth_ltlibs" INCPTH="$ac_cv_libpth_cppflags" for element in $INCPTH; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done HAVE_LIBPTH=yes gl_have_pth= gl_save_LIBS="$LIBS" LIBS="$LIBS -lpth" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { pth_self(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gl_have_pth=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$gl_save_LIBS" if test -n "$gl_have_pth"; then gl_threads_api=pth LIBTHREAD="$LIBPTH" LTLIBTHREAD="$LTLIBPTH" LIBMULTITHREAD="$LIBTHREAD" LTLIBMULTITHREAD="$LTLIBTHREAD" cat >>confdefs.h <<\_ACEOF #define USE_PTH_THREADS 1 _ACEOF if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if test $gl_have_weak = yes; then cat >>confdefs.h <<\_ACEOF #define USE_PTH_THREADS_WEAK 1 _ACEOF LIBTHREAD= LTLIBTHREAD= fi fi else CPPFLAGS="$gl_save_CPPFLAGS" fi fi if test -z "$gl_have_pthread"; then if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then if { case "$host_os" in mingw*) true;; *) false;; esac }; then gl_threads_api=win32 cat >>confdefs.h <<\_ACEOF #define USE_WIN32_THREADS 1 _ACEOF fi fi fi fi { echo "$as_me:$LINENO: checking for multithread API to use" >&5 echo $ECHO_N "checking for multithread API to use... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $gl_threads_api" >&5 echo "${ECHO_T}$gl_threads_api" >&6; } use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi fi LIBICONV= LTLIBICONV= INCICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" \ && { test -f "$additional_libdir/lib$name.$shlibext" \ || { test "$shlibext" = dll \ && test -f "$additional_libdir/lib$name.dll.a"; }; }; then found_dir="$additional_libdir" if test -f "$additional_libdir/lib$name.$shlibext"; then found_so="$additional_libdir/lib$name.$shlibext" else found_so="$additional_libdir/lib$name.dll.a" fi if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" \ && { test -f "$dir/lib$name.$shlibext" \ || { test "$shlibext" = dll \ && test -f "$dir/lib$name.dll.a"; }; }; then found_dir="$dir" if test -f "$dir/lib$name.$shlibext"; then found_so="$dir/lib$name.$shlibext" else found_so="$dir/lib$name.dll.a" fi if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; } int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then cat >>confdefs.h <<\_ACEOF #define HAVE_BUILTIN_EXPECT 1 _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext for ac_header in argz.h inttypes.h limits.h unistd.h sys/param.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getcwd getegid geteuid getgid getuid mempcpy munmap \ stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \ argz_next __fsetlocking do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking whether feof_unlocked is declared" >&5 echo $ECHO_N "checking whether feof_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef feof_unlocked char *p = (char *) feof_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_feof_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_feof_unlocked=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_feof_unlocked" >&6; } if test $ac_cv_have_decl_feof_unlocked = yes; then gt_value=1 else gt_value=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FEOF_UNLOCKED $gt_value _ACEOF { echo "$as_me:$LINENO: checking whether fgets_unlocked is declared" >&5 echo $ECHO_N "checking whether fgets_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef fgets_unlocked char *p = (char *) fgets_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_fgets_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_fgets_unlocked=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_fgets_unlocked" >&6; } if test $ac_cv_have_decl_fgets_unlocked = yes; then gt_value=1 else gt_value=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FGETS_UNLOCKED $gt_value _ACEOF am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { echo "$as_me:$LINENO: checking for iconv" >&5 echo $ECHO_N "checking for iconv... $ECHO_C" >&6; } if test "${am_cv_func_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then am_cv_lib_iconv=yes am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 echo "${ECHO_T}$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ICONV 1 _ACEOF fi if test "$am_cv_lib_iconv" = yes; then { echo "$as_me:$LINENO: checking how to link with libiconv" >&5 echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $LIBICONV" >&5 echo "${ECHO_T}$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi if test "$am_cv_func_iconv" = yes; then { echo "$as_me:$LINENO: checking for iconv declaration" >&5 echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6; } if test "${am_cv_proto_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then am_cv_proto_iconv_arg1="" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_proto_iconv_arg1="const" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` { echo "$as_me:$LINENO: result: ${ac_t:- }$am_cv_proto_iconv" >&5 echo "${ECHO_T}${ac_t:- }$am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF fi { echo "$as_me:$LINENO: checking for NL_LOCALE_NAME macro" >&5 echo $ECHO_N "checking for NL_LOCALE_NAME macro... $ECHO_C" >&6; } if test "${gt_cv_nl_locale_name+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gt_cv_nl_locale_name=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_nl_locale_name=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_nl_locale_name" >&5 echo "${ECHO_T}$gt_cv_nl_locale_name" >&6; } if test $gt_cv_nl_locale_name = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NL_LOCALE_NAME 1 _ACEOF fi for ac_prog in bison do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_INTLBISON+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$INTLBISON"; then ac_cv_prog_INTLBISON="$INTLBISON" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_INTLBISON="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi INTLBISON=$ac_cv_prog_INTLBISON if test -n "$INTLBISON"; then { echo "$as_me:$LINENO: result: $INTLBISON" >&5 echo "${ECHO_T}$INTLBISON" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$INTLBISON" && break done if test -z "$INTLBISON"; then ac_verc_fail=yes else { echo "$as_me:$LINENO: checking version of bison" >&5 echo $ECHO_N "checking version of bison... $ECHO_C" >&6; } ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac { echo "$as_me:$LINENO: result: $ac_prog_version" >&5 echo "${ECHO_T}$ac_prog_version" >&6; } fi if test $ac_verc_fail = yes; then INTLBISON=: fi { echo "$as_me:$LINENO: checking for long long int" >&5 echo $ECHO_N "checking for long long int... $ECHO_C" >&6; } if test "${ac_cv_type_long_long_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) ? 1 : -1)]; int i = 63; int main () { long long int llmax = 9223372036854775807ll; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | (llmax / ll) | (llmax % ll)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_type_long_long_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long_long_int=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5 echo "${ECHO_T}$ac_cv_type_long_long_int" >&6; } if test $ac_cv_type_long_long_int = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LONG_LONG_INT 1 _ACEOF fi { echo "$as_me:$LINENO: checking for long double" >&5 echo $ECHO_N "checking for long double... $ECHO_C" >&6; } if test "${gt_cv_c_long_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$GCC" = yes; then gt_cv_c_long_double=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* The Stardent Vistra knows sizeof(long double), but does not support it. */ long double foo = 0.0; /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ int array [2*(sizeof(long double) >= sizeof(double)) - 1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gt_cv_c_long_double=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_long_double=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $gt_cv_c_long_double" >&5 echo "${ECHO_T}$gt_cv_c_long_double" >&6; } if test $gt_cv_c_long_double = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LONG_DOUBLE 1 _ACEOF fi { echo "$as_me:$LINENO: checking for wchar_t" >&5 echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6; } if test "${gt_cv_c_wchar_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include wchar_t foo = (wchar_t)'\0'; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gt_cv_c_wchar_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_wchar_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5 echo "${ECHO_T}$gt_cv_c_wchar_t" >&6; } if test $gt_cv_c_wchar_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WCHAR_T 1 _ACEOF fi { echo "$as_me:$LINENO: checking for wint_t" >&5 echo $ECHO_N "checking for wint_t... $ECHO_C" >&6; } if test "${gt_cv_c_wint_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include wint_t foo = (wchar_t)'\0'; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gt_cv_c_wint_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_wint_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5 echo "${ECHO_T}$gt_cv_c_wint_t" >&6; } if test $gt_cv_c_wint_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WINT_T 1 _ACEOF fi { echo "$as_me:$LINENO: checking for intmax_t" >&5 echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6; } if test "${gt_cv_c_intmax_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if HAVE_STDINT_H_WITH_UINTMAX #include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX #include #endif int main () { intmax_t x = -1; return !x; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gt_cv_c_intmax_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_intmax_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_c_intmax_t" >&5 echo "${ECHO_T}$gt_cv_c_intmax_t" >&6; } if test $gt_cv_c_intmax_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_INTMAX_T 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether printf() supports POSIX/XSI format strings" >&5 echo $ECHO_N "checking whether printf() supports POSIX/XSI format strings... $ECHO_C" >&6; } if test "${gt_cv_func_printf_posix+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ notposix #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "notposix" >/dev/null 2>&1; then gt_cv_func_printf_posix="guessing no" else gt_cv_func_printf_posix="guessing yes" fi rm -f conftest* else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include /* The string "%2$d %1$d", with dollar characters protected from the shell's dollar expansion (possibly an autoconf bug). */ static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; static char buf[100]; int main () { sprintf (buf, format, 33, 55); return (strcmp (buf, "55 33") != 0); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_func_printf_posix=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) gt_cv_func_printf_posix=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $gt_cv_func_printf_posix" >&5 echo "${ECHO_T}$gt_cv_func_printf_posix" >&6; } case $gt_cv_func_printf_posix in *yes) cat >>confdefs.h <<\_ACEOF #define HAVE_POSIX_PRINTF 1 _ACEOF ;; esac { echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5 echo $ECHO_N "checking whether we are using the GNU C Library 2.1 or newer... $ECHO_C" >&6; } if test "${ac_cv_gnu_library_2_1+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "Lucky GNU user" >/dev/null 2>&1; then ac_cv_gnu_library_2_1=yes else ac_cv_gnu_library_2_1=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5 echo "${ECHO_T}$ac_cv_gnu_library_2_1" >&6; } GLIBC21="$ac_cv_gnu_library_2_1" for ac_header in stdint.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for SIZE_MAX" >&5 echo $ECHO_N "checking for SIZE_MAX... $ECHO_C" >&6; } if test "${gl_cv_size_max+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gl_cv_size_max= cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if HAVE_STDINT_H #include #endif #ifdef SIZE_MAX Found it #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "Found it" >/dev/null 2>&1; then gl_cv_size_max=yes fi rm -f conftest* if test -z "$gl_cv_size_max"; then if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) size_t_bits_minus_1=$ac_lo;; '') size_t_bits_minus_1= ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include static long int longval () { return sizeof (size_t) * CHAR_BIT - 1; } static unsigned long int ulongval () { return sizeof (size_t) * CHAR_BIT - 1; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if ((sizeof (size_t) * CHAR_BIT - 1) < 0) { long int i = longval (); if (i != (sizeof (size_t) * CHAR_BIT - 1)) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != (sizeof (size_t) * CHAR_BIT - 1)) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then size_t_bits_minus_1=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) size_t_bits_minus_1= fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) fits_in_uint=$ac_lo;; '') fits_in_uint= ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include static long int longval () { return sizeof (size_t) <= sizeof (unsigned int); } static unsigned long int ulongval () { return sizeof (size_t) <= sizeof (unsigned int); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if ((sizeof (size_t) <= sizeof (unsigned int)) < 0) { long int i = longval (); if (i != (sizeof (size_t) <= sizeof (unsigned int))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != (sizeof (size_t) <= sizeof (unsigned int))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then fits_in_uint=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) fits_in_uint= fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then if test $fits_in_uint = 1; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern size_t foo; extern unsigned long foo; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then fits_in_uint=0 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $fits_in_uint = 1; then gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" else gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" fi else gl_cv_size_max='((size_t)~(size_t)0)' fi fi fi { echo "$as_me:$LINENO: result: $gl_cv_size_max" >&5 echo "${ECHO_T}$gl_cv_size_max" >&6; } if test "$gl_cv_size_max" != yes; then cat >>confdefs.h <<_ACEOF #define SIZE_MAX $gl_cv_size_max _ACEOF fi for ac_header in stdint.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for CFPreferencesCopyAppValue" >&5 echo $ECHO_N "checking for CFPreferencesCopyAppValue... $ECHO_C" >&6; } if test "${gt_cv_func_CFPreferencesCopyAppValue+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gt_cv_func_CFPreferencesCopyAppValue=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { echo "$as_me:$LINENO: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 echo "${ECHO_T}$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CFPREFERENCESCOPYAPPVALUE 1 _ACEOF fi { echo "$as_me:$LINENO: checking for CFLocaleCopyCurrent" >&5 echo $ECHO_N "checking for CFLocaleCopyCurrent... $ECHO_C" >&6; } if test "${gt_cv_func_CFLocaleCopyCurrent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { CFLocaleCopyCurrent(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gt_cv_func_CFLocaleCopyCurrent=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_CFLocaleCopyCurrent=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { echo "$as_me:$LINENO: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 echo "${ECHO_T}$gt_cv_func_CFLocaleCopyCurrent" >&6; } if test $gt_cv_func_CFLocaleCopyCurrent = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CFLOCALECOPYCURRENT 1 _ACEOF fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi { echo "$as_me:$LINENO: checking for ptrdiff_t" >&5 echo $ECHO_N "checking for ptrdiff_t... $ECHO_C" >&6; } if test "${ac_cv_type_ptrdiff_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef ptrdiff_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_ptrdiff_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_ptrdiff_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5 echo "${ECHO_T}$ac_cv_type_ptrdiff_t" >&6; } if test $ac_cv_type_ptrdiff_t = yes; then : else cat >>confdefs.h <<\_ACEOF #define ptrdiff_t long _ACEOF fi for ac_header in stddef.h stdlib.h string.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in asprintf fwprintf putenv setenv setlocale snprintf wcslen do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking whether _snprintf is declared" >&5 echo $ECHO_N "checking whether _snprintf is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl__snprintf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef _snprintf char *p = (char *) _snprintf; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl__snprintf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl__snprintf=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl__snprintf" >&5 echo "${ECHO_T}$ac_cv_have_decl__snprintf" >&6; } if test $ac_cv_have_decl__snprintf = yes; then gt_value=1 else gt_value=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL__SNPRINTF $gt_value _ACEOF { echo "$as_me:$LINENO: checking whether _snwprintf is declared" >&5 echo $ECHO_N "checking whether _snwprintf is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl__snwprintf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef _snwprintf char *p = (char *) _snwprintf; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl__snwprintf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl__snwprintf=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl__snwprintf" >&5 echo "${ECHO_T}$ac_cv_have_decl__snwprintf" >&6; } if test $ac_cv_have_decl__snwprintf = yes; then gt_value=1 else gt_value=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL__SNWPRINTF $gt_value _ACEOF { echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 echo $ECHO_N "checking whether getc_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef getc_unlocked char *p = (char *) getc_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_getc_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_getc_unlocked=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_getc_unlocked" >&6; } if test $ac_cv_have_decl_getc_unlocked = yes; then gt_value=1 else gt_value=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETC_UNLOCKED $gt_value _ACEOF case $gt_cv_func_printf_posix in *yes) HAVE_POSIX_PRINTF=1 ;; *) HAVE_POSIX_PRINTF=0 ;; esac if test "$ac_cv_func_asprintf" = yes; then HAVE_ASPRINTF=1 else HAVE_ASPRINTF=0 fi if test "$ac_cv_func_snprintf" = yes; then HAVE_SNPRINTF=1 else HAVE_SNPRINTF=0 fi if test "$ac_cv_func_wprintf" = yes; then HAVE_WPRINTF=1 else HAVE_WPRINTF=0 fi { echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6; } if test "${am_cv_langinfo_codeset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char* cs = nl_langinfo(CODESET); return !cs; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then am_cv_langinfo_codeset=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_langinfo_codeset=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6; } if test $am_cv_langinfo_codeset = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LANGINFO_CODESET 1 _ACEOF fi { echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6; } if test "${gt_cv_val_LC_MESSAGES+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { return LC_MESSAGES ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gt_cv_val_LC_MESSAGES=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_val_LC_MESSAGES=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_val_LC_MESSAGES" >&5 echo "${ECHO_T}$gt_cv_val_LC_MESSAGES" >&6; } if test $gt_cv_val_LC_MESSAGES = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LC_MESSAGES 1 _ACEOF fi if test "$enable_shared" = yes; then case "$host_os" in cygwin*) is_woe32dll=yes ;; *) is_woe32dll=no ;; esac else is_woe32dll=no fi WOE32DLL=$is_woe32dll { echo "$as_me:$LINENO: checking for CFPreferencesCopyAppValue" >&5 echo $ECHO_N "checking for CFPreferencesCopyAppValue... $ECHO_C" >&6; } if test "${gt_cv_func_CFPreferencesCopyAppValue+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gt_cv_func_CFPreferencesCopyAppValue=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { echo "$as_me:$LINENO: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 echo "${ECHO_T}$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CFPREFERENCESCOPYAPPVALUE 1 _ACEOF fi { echo "$as_me:$LINENO: checking for CFLocaleCopyCurrent" >&5 echo $ECHO_N "checking for CFLocaleCopyCurrent... $ECHO_C" >&6; } if test "${gt_cv_func_CFLocaleCopyCurrent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { CFLocaleCopyCurrent(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gt_cv_func_CFLocaleCopyCurrent=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_CFLocaleCopyCurrent=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { echo "$as_me:$LINENO: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 echo "${ECHO_T}$gt_cv_func_CFLocaleCopyCurrent" >&6; } if test $gt_cv_func_CFLocaleCopyCurrent = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CFLOCALECOPYCURRENT 1 _ACEOF fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no LIBINTL= LTLIBINTL= POSUB= case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no { echo "$as_me:$LINENO: checking whether included gettext is requested" >&5 echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6; } # Check whether --with-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval=$with_included_gettext; nls_cv_force_use_gnu_gettext=$withval else nls_cv_force_use_gnu_gettext=no fi { echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5 echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6; } nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi { echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6; } if { as_var=$gt_func_gnugettext_libc; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$gt_func_gnugettext_libc=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$gt_func_gnugettext_libc=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$gt_func_gnugettext_libc'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi fi LIBINTL= LTLIBINTL= INCINTL= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" else : fi else found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" \ && { test -f "$additional_libdir/lib$name.$shlibext" \ || { test "$shlibext" = dll \ && test -f "$additional_libdir/lib$name.dll.a"; }; }; then found_dir="$additional_libdir" if test -f "$additional_libdir/lib$name.$shlibext"; then found_so="$additional_libdir/lib$name.$shlibext" else found_so="$additional_libdir/lib$name.dll.a" fi if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" \ && { test -f "$dir/lib$name.$shlibext" \ || { test "$shlibext" = dll \ && test -f "$dir/lib$name.dll.a"; }; }; then found_dir="$dir" if test -f "$dir/lib$name.$shlibext"; then found_so="$dir/lib$name.$shlibext" else found_so="$dir/lib$name.dll.a" fi if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$hardcode_direct" = yes; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi { echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6; } if { as_var=$gt_func_gnugettext_libintl; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$gt_func_gnugettext_libintl=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$gt_func_gnugettext_libintl=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi ac_res=`eval echo '${'$gt_func_gnugettext_libintl'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test "$gt_use_preinstalled_gnugettext" != "yes"; then nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="\${top_builddir}/intl/libintl.a $LIBICONV $LIBTHREAD" LTLIBINTL="\${top_builddir}/intl/libintl.a $LTLIBICONV $LTLIBTHREAD" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then CATOBJEXT=.gmo fi if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 _ACEOF else USE_NLS=no fi fi { echo "$as_me:$LINENO: checking whether to use NLS" >&5 echo $ECHO_N "checking whether to use NLS... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then { echo "$as_me:$LINENO: checking where the gettext function comes from" >&5 echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi { echo "$as_me:$LINENO: result: $gt_source" >&5 echo "${ECHO_T}$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then { echo "$as_me:$LINENO: checking how to link with libintl" >&5 echo $ECHO_N "checking how to link with libintl... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $LIBINTL" >&5 echo "${ECHO_T}$LIBINTL" >&6; } for element in $INCINTL; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done fi cat >>confdefs.h <<\_ACEOF #define HAVE_GETTEXT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_DCGETTEXT 1 _ACEOF fi POSUB=po fi if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi nls_cv_header_intl= nls_cv_header_libgt= DATADIRNAME=share INSTOBJEXT=.mo GENCAT=gencat INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi INTL_LIBTOOL_SUFFIX_PREFIX= INTLLIBS="$LIBINTL" test "x${prefix}" = "xNONE" && prefix=${ac_default_prefix} while true; do tmp="`eval echo $sysconfdir`" if test "x${tmp}" = "x${sysconfdir}"; then break; fi sysconfdir=$tmp done cat >>confdefs.h <<_ACEOF #define SYS_CONF_DIR "${sysconfdir}" _ACEOF while true; do tmp="`eval echo $datadir`" if test "x${tmp}" = "x${datadir}"; then break; fi datadir=$tmp done cat >>confdefs.h <<_ACEOF #define PACKAGE_DATA_DIR "${datadir}" _ACEOF while true; do tmp="`eval echo $localedir`" if test "x${tmp}" = "x${localedir}"; then break; fi localedir=$tmp done cat >>confdefs.h <<_ACEOF #define PACKAGE_LOCALE_DIR "${localedir}" _ACEOF HOSTCC="${CC}" QUIET='@${top_srcdir}/ccdv' CC="${QUIET} ${CC}" CXX="${QUIET} ${CXX}" CPP="${QUIET} ${CPP}" AM_MAKEFLAGS="--no-print-directory" ac_config_files="$ac_config_files Doxyfile Makefile pbbuttonsd.cnf src/Makefile po/Makefile.in po/Makefile libpbbipc/Makefile pbbcmd/Makefile intl/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${DOXYGEN_DOCS_ENABLED_TRUE}" && test -z "${DOXYGEN_DOCS_ENABLED_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"DOXYGEN_DOCS_ENABLED\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"DOXYGEN_DOCS_ENABLED\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by pbbuttonsd $as_me 0.8.1a, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ pbbuttonsd config.status 0.8.1a configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS # # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; "Doxyfile") CONFIG_FILES="$CONFIG_FILES Doxyfile" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "pbbuttonsd.cnf") CONFIG_FILES="$CONFIG_FILES pbbuttonsd.cnf" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "po/Makefile") CONFIG_FILES="$CONFIG_FILES po/Makefile" ;; "libpbbipc/Makefile") CONFIG_FILES="$CONFIG_FILES libpbbipc/Makefile" ;; "pbbcmd/Makefile") CONFIG_FILES="$CONFIG_FILES pbbcmd/Makefile" ;; "intl/Makefile") CONFIG_FILES="$CONFIG_FILES intl/Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim MAINT!$MAINT$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim LN_S!$LN_S$ac_delim RANLIB!$RANLIB$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim LCD_FADINGSPEED!$LCD_FADINGSPEED$ac_delim LCD_AUTOADJMODE!$LCD_AUTOADJMODE$ac_delim LCD_AUTOADJPARMBAT!$LCD_AUTOADJPARMBAT$ac_delim LCD_AUTOADJPARMAC!$LCD_AUTOADJPARMAC$ac_delim KBD_FADINGSPEED!$KBD_FADINGSPEED$ac_delim KBD_AUTOADJMODE!$KBD_AUTOADJMODE$ac_delim KBD_AUTOADJPARMBAT!$KBD_AUTOADJPARMBAT$ac_delim KBD_AUTOADJPARMAC!$KBD_AUTOADJPARMAC$ac_delim PKG_CONFIG!$PKG_CONFIG$ac_delim PACKAGE_CFLAGS!$PACKAGE_CFLAGS$ac_delim PACKAGE_LIBS!$PACKAGE_LIBS$ac_delim ALSA_CFLAGS!$ALSA_CFLAGS$ac_delim ALSA_LIBS!$ALSA_LIBS$ac_delim DOXYGEN!$DOXYGEN$ac_delim DOT!$DOT$ac_delim HAVE_DOT!$HAVE_DOT$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF DOT_PATH!$DOT_PATH$ac_delim DOXYGEN_DOCS_ENABLED_TRUE!$DOXYGEN_DOCS_ENABLED_TRUE$ac_delim DOXYGEN_DOCS_ENABLED_FALSE!$DOXYGEN_DOCS_ENABLED_FALSE$ac_delim DEBUG_TRUE!$DEBUG_TRUE$ac_delim DEBUG_FALSE!$DEBUG_FALSE$ac_delim PB_OBJECTS!$PB_OBJECTS$ac_delim PB_LIBS!$PB_LIBS$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim USE_NLS!$USE_NLS$ac_delim MSGFMT!$MSGFMT$ac_delim GMSGFMT!$GMSGFMT$ac_delim MSGFMT_015!$MSGFMT_015$ac_delim GMSGFMT_015!$GMSGFMT_015$ac_delim XGETTEXT!$XGETTEXT$ac_delim XGETTEXT_015!$XGETTEXT_015$ac_delim MSGMERGE!$MSGMERGE$ac_delim GLIBC2!$GLIBC2$ac_delim CFLAG_VISIBILITY!$CFLAG_VISIBILITY$ac_delim HAVE_VISIBILITY!$HAVE_VISIBILITY$ac_delim ALLOCA!$ALLOCA$ac_delim PRI_MACROS_BROKEN!$PRI_MACROS_BROKEN$ac_delim LIBPTH!$LIBPTH$ac_delim LTLIBPTH!$LTLIBPTH$ac_delim LIBTHREAD!$LIBTHREAD$ac_delim LTLIBTHREAD!$LTLIBTHREAD$ac_delim LIBMULTITHREAD!$LIBMULTITHREAD$ac_delim LTLIBMULTITHREAD!$LTLIBMULTITHREAD$ac_delim LIBICONV!$LIBICONV$ac_delim LTLIBICONV!$LTLIBICONV$ac_delim INTLBISON!$INTLBISON$ac_delim GLIBC21!$GLIBC21$ac_delim INTL_MACOSX_LIBS!$INTL_MACOSX_LIBS$ac_delim HAVE_POSIX_PRINTF!$HAVE_POSIX_PRINTF$ac_delim HAVE_ASPRINTF!$HAVE_ASPRINTF$ac_delim HAVE_SNPRINTF!$HAVE_SNPRINTF$ac_delim HAVE_WPRINTF!$HAVE_WPRINTF$ac_delim WOE32DLL!$WOE32DLL$ac_delim BUILD_INCLUDED_LIBINTL!$BUILD_INCLUDED_LIBINTL$ac_delim USE_INCLUDED_LIBINTL!$USE_INCLUDED_LIBINTL$ac_delim CATOBJEXT!$CATOBJEXT$ac_delim DATADIRNAME!$DATADIRNAME$ac_delim INSTOBJEXT!$INSTOBJEXT$ac_delim GENCAT!$GENCAT$ac_delim INTLOBJS!$INTLOBJS$ac_delim INTL_LIBTOOL_SUFFIX_PREFIX!$INTL_LIBTOOL_SUFFIX_PREFIX$ac_delim INTLLIBS!$INTLLIBS$ac_delim LIBINTL!$LIBINTL$ac_delim LTLIBINTL!$LTLIBINTL$ac_delim POSUB!$POSUB$ac_delim HOSTCC!$HOSTCC$ac_delim QUIET!$QUIET$ac_delim AM_MAKEFLAGS!$AM_MAKEFLAGS$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 56; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| . 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "po-directories":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi ${ac_make} clean >/dev/null 2>&1 echo -e "------------------------------------------------------" echo -e "PBButtonsd configuration summary\n" echo -e "System: $ac_laptop\n" echo -e "Options:" echo " IBAM support built in - ${pbb_with_ibam}" echo " OSS support built in - ${pbb_with_oss}" echo -n " ALSA support built in - " if test "$pbb_have_alsa" = "yes"; then echo "yes" elif test "$pbb_with_alsa" = "yes"; then echo "no (not available, development files?)" else echo "no" fi echo " Extra debug code enabled - ${enable_debug}" echo " Pmud support built in - ${pbb_with_pmud}" echo -n " Building doxygen docs - ${with_doxygen_docs}" if test "$with_doxygen_docs" = "no"; then echo elif test "$HAVE_DOT" = "NO"; then echo " (without graphs)" else echo " (with graphs)" fi echo -e "\nPaths:" echo -e " config: $sysconfdir" echo -e " data: $datadir" echo -e " locale: $localedir" echo -e " batlog: /var/lib/pbbuttons (hardcoded)" echo -e " ibam: /var/lib/ibam (hardcoded)" echo -e "\nCompiler:" echo -e " CFLAGS: $CFLAGS" echo -e " CXXFLAGS: $CXXFLAGS" echo -e "------------------------------------------------------" pbbuttonsd-0.8.1a/ABOUT-NLS0000644000175000017500000023334010641704553012227 000000000000001 Notes on the Free Translation Project *************************************** Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that free software will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work on translations can contact the appropriate team. When reporting bugs in the `intl/' directory or bugs which may be related to internationalization, you should tell about the version of `gettext' which is used. The information can be found in the `intl/VERSION' file, in internationalized packages. 1.1 Quick configuration advice ============================== If you want to exploit the full power of internationalization, you should configure it using ./configure --with-included-gettext to force usage of internationalizing routines provided within this package, despite the existence of internationalizing capabilities in the operating system where this package is being installed. So far, only the `gettext' implementation in the GNU C library version 2 provides as many features (such as locale alias, message inheritance, automatic charset conversion or plural form handling) as the implementation here. It is also not possible to offer this additional functionality on top of a `catgets' implementation. Future versions of GNU `gettext' will very likely convey even more functionality. So it might be a good idea to change to GNU `gettext' as soon as possible. So you need _not_ provide this option if you are using GNU libc 2 or you have installed a recent copy of the GNU gettext package with the included `libintl'. 1.2 INSTALL Matters =================== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. If not, the included GNU `gettext' library will be used. This library is wholly contained within this package, usually in the `intl/' subdirectory, so prior installation of the GNU `gettext' package is _not_ required. Installers may use special options at configuration time for changing the default behaviour. The commands: ./configure --with-included-gettext ./configure --disable-nls will, respectively, bypass any pre-existing `gettext' to use the internationalizing routines provided within this package, or else, _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl.a' file and will decide to use this. This might not be desirable. You should use the more recent version of the GNU `gettext' library. I.e. if the file `intl/VERSION' shows that the library which comes with this package is more recent, you should use ./configure --with-included-gettext to prevent auto-detection. The configuration process will not test for the `catgets' function and therefore it will not be used. The reason is that even an emulation of `gettext' on top of `catgets' could not provide all the extensions of the GNU `gettext' library. Internationalized packages usually have many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. 1.3 Using This Package ====================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of `LL_CC', with `LL' denoting the language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of locales supported by your system for your language by running the command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. Special advice for Norwegian users: The language code for Norwegian bokma*l changed from `no' to `nb' recently (in 2003). During the transition period, while some message catalogs for this language are installed under `nb' and some older ones under `no', it's recommended for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and older translations are used. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. 1.4 Translating Teams ===================== For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `translation@iro.umontreal.ca' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skills are praised more than programming skills, here. 1.5 Available Packages ====================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of October 2006. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB eo +----------------------------------------------------+ GNUnet | [] | a2ps | [] [] [] [] [] | aegis | () | ant-phone | () | anubis | [] | ap-utils | | aspell | [] [] [] [] [] | bash | [] [] [] | batchelor | [] | bfd | | bibshelf | [] | binutils | [] | bison | [] [] | bison-runtime | | bluez-pin | [] [] [] [] [] | cflow | [] | clisp | [] [] | console-tools | [] [] | coreutils | [] [] [] | cpio | | cpplib | [] [] [] | cryptonit | [] | darkstat | [] () [] | dialog | [] [] [] [] [] [] | diffutils | [] [] [] [] [] [] | doodle | [] | e2fsprogs | [] [] | enscript | [] [] [] [] | error | [] [] [] [] | fetchmail | [] [] () [] | fileutils | [] [] | findutils | [] [] [] | flex | [] [] [] | fslint | [] | gas | | gawk | [] [] [] | gbiff | [] | gcal | [] | gcc | [] | gettext-examples | [] [] [] [] [] | gettext-runtime | [] [] [] [] [] | gettext-tools | [] [] | gimp-print | [] [] [] [] | gip | [] | gliv | [] | glunarclock | [] | gmult | [] [] | gnubiff | () | gnucash | () () [] | gnucash-glossary | [] () | gnuedu | | gnulib | [] [] [] [] [] [] | gnunet-gtk | | gnutls | | gpe-aerial | [] [] | gpe-beam | [] [] | gpe-calendar | | gpe-clock | [] [] | gpe-conf | [] [] | gpe-contacts | | gpe-edit | [] | gpe-filemanager | | gpe-go | [] | gpe-login | [] [] | gpe-ownerinfo | [] [] | gpe-package | | gpe-sketchbook | [] [] | gpe-su | [] [] | gpe-taskmanager | [] [] | gpe-timesheet | [] | gpe-today | [] [] | gpe-todo | | gphoto2 | [] [] [] [] | gprof | [] [] | gpsdrive | () () | gramadoir | [] [] | grep | [] [] [] [] [] [] | gretl | | gsasl | | gss | | gst-plugins | [] [] [] [] | gst-plugins-base | [] [] [] | gst-plugins-good | [] [] [] [] [] [] [] | gstreamer | [] [] [] [] [] [] [] | gtick | () | gtkam | [] [] [] | gtkorphan | [] [] | gtkspell | [] [] [] [] | gutenprint | [] | hello | [] [] [] [] [] | id-utils | [] [] | impost | | indent | [] [] [] | iso_3166 | [] [] | iso_3166_2 | | iso_4217 | [] | iso_639 | [] [] | jpilot | [] | jtag | | jwhois | | kbd | [] [] [] [] | keytouch | | keytouch-editor | | keytouch-keyboa... | | latrine | () | ld | [] | leafpad | [] [] [] [] [] | libc | [] [] [] [] [] | libexif | [] | libextractor | [] | libgpewidget | [] [] [] | libgpg-error | [] | libgphoto2 | [] [] | libgphoto2_port | [] [] | libgsasl | | libiconv | [] [] | libidn | [] [] | lifelines | [] () | lilypond | [] | lingoteach | | lynx | [] [] [] [] | m4 | [] [] [] [] | mailutils | [] | make | [] [] | man-db | [] () [] [] | minicom | [] [] [] | mysecretdiary | [] [] | nano | [] [] [] | nano_1_0 | [] () [] [] | opcodes | [] | parted | | pilot-qof | [] | psmisc | [] | pwdutils | | python | | qof | | radius | [] | recode | [] [] [] [] [] [] | rpm | [] [] | screem | | scrollkeeper | [] [] [] [] [] [] [] [] | sed | [] [] [] | sh-utils | [] [] | shared-mime-info | [] [] [] [] | sharutils | [] [] [] [] [] [] | shishi | | silky | | skencil | [] () | sketch | [] () | solfege | | soundtracker | [] [] | sp | [] | stardict | [] | system-tools-ba... | [] [] [] [] [] [] [] [] [] | tar | [] | texinfo | [] [] [] | textutils | [] [] [] | tin | () () | tp-robot | [] | tuxpaint | [] [] [] [] [] | unicode-han-tra... | | unicode-transla... | | util-linux | [] [] [] [] | vorbis-tools | [] [] [] [] | wastesedge | () | wdiff | [] [] [] [] | wget | [] [] | xchat | [] [] [] [] [] [] | xkeyboard-config | | xpad | [] [] | +----------------------------------------------------+ af am ar az be bg bs ca cs cy da de el en en_GB eo 10 0 1 2 9 22 1 42 41 2 60 95 16 1 17 16 es et eu fa fi fr ga gl gu he hi hr hu id is it +--------------------------------------------------+ GNUnet | | a2ps | [] [] [] () | aegis | | ant-phone | [] | anubis | [] | ap-utils | [] [] | aspell | [] [] [] | bash | [] [] [] | batchelor | [] [] | bfd | [] | bibshelf | [] [] [] | binutils | [] [] [] | bison | [] [] [] [] [] [] | bison-runtime | [] [] [] [] [] | bluez-pin | [] [] [] [] [] | cflow | [] | clisp | [] [] | console-tools | | coreutils | [] [] [] [] [] [] | cpio | [] [] [] | cpplib | [] [] | cryptonit | [] | darkstat | [] () [] [] [] | dialog | [] [] [] [] [] [] [] [] | diffutils | [] [] [] [] [] [] [] [] [] | doodle | [] [] | e2fsprogs | [] [] [] | enscript | [] [] [] | error | [] [] [] [] [] | fetchmail | [] | fileutils | [] [] [] [] [] [] | findutils | [] [] [] [] | flex | [] [] [] | fslint | [] | gas | [] [] | gawk | [] [] [] [] | gbiff | [] | gcal | [] [] | gcc | [] | gettext-examples | [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] | gettext-tools | [] [] [] | gimp-print | [] [] | gip | [] [] [] | gliv | () | glunarclock | [] [] [] | gmult | [] [] [] | gnubiff | () () | gnucash | () () () | gnucash-glossary | [] [] | gnuedu | [] | gnulib | [] [] [] [] [] [] [] [] | gnunet-gtk | | gnutls | | gpe-aerial | [] [] | gpe-beam | [] [] | gpe-calendar | | gpe-clock | [] [] [] [] | gpe-conf | [] | gpe-contacts | [] [] | gpe-edit | [] [] [] [] | gpe-filemanager | [] | gpe-go | [] [] [] | gpe-login | [] [] [] | gpe-ownerinfo | [] [] [] [] [] | gpe-package | [] | gpe-sketchbook | [] [] | gpe-su | [] [] [] [] | gpe-taskmanager | [] [] [] | gpe-timesheet | [] [] [] [] | gpe-today | [] [] [] [] | gpe-todo | [] | gphoto2 | [] [] [] [] [] | gprof | [] [] [] [] | gpsdrive | () () [] () | gramadoir | [] [] | grep | [] [] [] [] [] [] [] [] [] [] [] [] | gretl | [] [] [] | gsasl | [] [] | gss | [] | gst-plugins | [] [] [] | gst-plugins-base | [] [] | gst-plugins-good | [] [] [] | gstreamer | [] [] [] | gtick | [] | gtkam | [] [] [] [] | gtkorphan | [] [] | gtkspell | [] [] [] [] [] [] | gutenprint | [] | hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | id-utils | [] [] [] [] [] | impost | [] [] | indent | [] [] [] [] [] [] [] [] [] [] | iso_3166 | [] [] [] | iso_3166_2 | [] | iso_4217 | [] [] [] [] | iso_639 | [] [] [] [] [] | jpilot | [] [] | jtag | [] | jwhois | [] [] [] [] [] | kbd | [] [] | keytouch | [] | keytouch-editor | [] | keytouch-keyboa... | [] | latrine | [] [] [] | ld | [] [] | leafpad | [] [] [] [] [] [] | libc | [] [] [] [] [] | libexif | [] | libextractor | [] | libgpewidget | [] [] [] [] [] | libgpg-error | | libgphoto2 | [] [] [] | libgphoto2_port | [] [] | libgsasl | [] [] | libiconv | [] [] | libidn | [] [] | lifelines | () | lilypond | [] | lingoteach | [] [] [] | lynx | [] [] [] | m4 | [] [] [] [] | mailutils | [] [] | make | [] [] [] [] [] [] [] [] | man-db | () | minicom | [] [] [] [] | mysecretdiary | [] [] [] | nano | [] [] [] [] [] [] | nano_1_0 | [] [] [] [] [] | opcodes | [] [] [] [] | parted | [] [] [] [] | pilot-qof | | psmisc | [] [] [] | pwdutils | | python | | qof | [] | radius | [] [] | recode | [] [] [] [] [] [] [] [] | rpm | [] [] | screem | | scrollkeeper | [] [] [] | sed | [] [] [] [] [] | sh-utils | [] [] [] [] [] [] [] | shared-mime-info | [] [] [] [] [] [] | sharutils | [] [] [] [] [] [] [] [] | shishi | | silky | [] | skencil | [] [] | sketch | [] [] | solfege | [] | soundtracker | [] [] [] | sp | [] | stardict | [] | system-tools-ba... | [] [] [] [] [] [] [] [] | tar | [] [] [] [] [] [] [] | texinfo | [] [] | textutils | [] [] [] [] [] | tin | [] () | tp-robot | [] [] [] [] | tuxpaint | [] [] | unicode-han-tra... | | unicode-transla... | [] [] | util-linux | [] [] [] [] [] [] [] | vorbis-tools | [] [] | wastesedge | () | wdiff | [] [] [] [] [] [] [] [] | wget | [] [] [] [] [] [] [] [] | xchat | [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] | xpad | [] [] [] | +--------------------------------------------------+ es et eu fa fi fr ga gl gu he hi hr hu id is it 88 22 14 2 40 115 61 14 1 8 1 6 59 31 0 52 ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no +-------------------------------------------------+ GNUnet | | a2ps | () [] [] () | aegis | () | ant-phone | [] | anubis | [] [] [] | ap-utils | [] | aspell | [] [] | bash | [] | batchelor | [] [] | bfd | | bibshelf | [] | binutils | | bison | [] [] [] | bison-runtime | [] [] [] | bluez-pin | [] [] [] | cflow | | clisp | [] | console-tools | | coreutils | [] | cpio | | cpplib | [] | cryptonit | [] | darkstat | [] [] | dialog | [] [] | diffutils | [] [] [] | doodle | | e2fsprogs | [] | enscript | [] | error | [] | fetchmail | [] [] | fileutils | [] [] | findutils | [] | flex | [] [] | fslint | [] [] | gas | | gawk | [] [] | gbiff | [] | gcal | | gcc | | gettext-examples | [] [] | gettext-runtime | [] [] [] | gettext-tools | [] [] | gimp-print | [] [] | gip | [] [] | gliv | [] | glunarclock | [] [] | gmult | [] [] | gnubiff | | gnucash | () () | gnucash-glossary | [] | gnuedu | | gnulib | [] [] [] [] | gnunet-gtk | | gnutls | | gpe-aerial | [] | gpe-beam | [] | gpe-calendar | [] | gpe-clock | [] [] [] | gpe-conf | [] [] | gpe-contacts | [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] | gpe-go | [] [] [] | gpe-login | [] [] [] | gpe-ownerinfo | [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] | gpe-su | [] [] [] | gpe-taskmanager | [] [] [] [] | gpe-timesheet | [] | gpe-today | [] [] | gpe-todo | [] | gphoto2 | [] [] | gprof | | gpsdrive | () () () | gramadoir | () | grep | [] [] [] [] | gretl | | gsasl | [] | gss | | gst-plugins | [] | gst-plugins-base | | gst-plugins-good | [] | gstreamer | [] | gtick | | gtkam | [] | gtkorphan | [] | gtkspell | [] [] | gutenprint | | hello | [] [] [] [] [] [] | id-utils | [] | impost | | indent | [] [] | iso_3166 | [] | iso_3166_2 | [] | iso_4217 | [] [] [] | iso_639 | [] [] | jpilot | () () () | jtag | | jwhois | [] | kbd | [] | keytouch | [] | keytouch-editor | | keytouch-keyboa... | | latrine | [] | ld | | leafpad | [] [] | libc | [] [] [] [] [] | libexif | | libextractor | | libgpewidget | [] | libgpg-error | | libgphoto2 | [] | libgphoto2_port | [] | libgsasl | [] | libiconv | | libidn | [] [] | lifelines | [] | lilypond | | lingoteach | [] | lynx | [] [] | m4 | [] [] | mailutils | | make | [] [] [] | man-db | () | minicom | [] | mysecretdiary | [] | nano | [] [] [] | nano_1_0 | [] [] [] | opcodes | [] | parted | [] [] | pilot-qof | | psmisc | [] [] [] | pwdutils | | python | | qof | | radius | | recode | [] | rpm | [] [] | screem | [] | scrollkeeper | [] [] [] [] | sed | [] [] | sh-utils | [] [] | shared-mime-info | [] [] [] [] [] | sharutils | [] [] | shishi | | silky | [] | skencil | | sketch | | solfege | | soundtracker | | sp | () | stardict | [] [] | system-tools-ba... | [] [] [] [] | tar | [] [] [] | texinfo | [] [] [] | textutils | [] [] [] | tin | | tp-robot | [] | tuxpaint | [] | unicode-han-tra... | | unicode-transla... | | util-linux | [] [] | vorbis-tools | [] | wastesedge | [] | wdiff | [] [] | wget | [] [] | xchat | [] [] [] [] | xkeyboard-config | [] | xpad | [] [] [] | +-------------------------------------------------+ ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no 52 24 2 2 1 3 0 2 3 21 0 15 1 97 5 1 nso or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta +------------------------------------------------------+ GNUnet | | a2ps | () [] [] [] [] [] [] | aegis | () () | ant-phone | [] [] | anubis | [] [] [] | ap-utils | () | aspell | [] [] | bash | [] [] [] | batchelor | [] [] | bfd | | bibshelf | [] | binutils | [] [] | bison | [] [] [] [] [] | bison-runtime | [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] [] | cflow | [] | clisp | [] | console-tools | [] | coreutils | [] [] [] [] | cpio | [] [] [] | cpplib | [] | cryptonit | [] [] | darkstat | [] [] [] [] [] [] | dialog | [] [] [] [] [] [] [] [] [] | diffutils | [] [] [] [] [] [] | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] [] | error | [] [] [] [] | fetchmail | [] [] [] | fileutils | [] [] [] [] [] | findutils | [] [] [] [] [] [] | flex | [] [] [] [] [] | fslint | [] [] [] [] | gas | | gawk | [] [] [] [] | gbiff | [] | gcal | [] | gcc | [] | gettext-examples | [] [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] [] [] | gettext-tools | [] [] [] [] [] [] [] | gimp-print | [] [] | gip | [] [] [] [] | gliv | [] [] [] [] | glunarclock | [] [] [] [] [] [] | gmult | [] [] [] [] | gnubiff | () | gnucash | () [] | gnucash-glossary | [] [] [] | gnuedu | | gnulib | [] [] [] [] [] | gnunet-gtk | [] | gnutls | [] [] | gpe-aerial | [] [] [] [] [] [] [] | gpe-beam | [] [] [] [] [] [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] [] [] [] [] | gpe-conf | [] [] [] [] [] [] [] | gpe-contacts | [] [] [] [] [] | gpe-edit | [] [] [] [] [] [] [] [] | gpe-filemanager | [] [] | gpe-go | [] [] [] [] [] [] | gpe-login | [] [] [] [] [] [] [] [] | gpe-ownerinfo | [] [] [] [] [] [] [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] [] [] [] [] [] [] | gpe-su | [] [] [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] [] | gpe-todo | [] [] [] [] | gphoto2 | [] [] [] [] [] | gprof | [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] | grep | [] [] [] [] [] [] [] [] | gretl | [] | gsasl | [] [] [] | gss | [] [] [] | gst-plugins | [] [] [] [] | gst-plugins-base | [] | gst-plugins-good | [] [] [] [] | gstreamer | [] [] [] | gtick | [] | gtkam | [] [] [] [] | gtkorphan | [] | gtkspell | [] [] [] [] [] [] [] [] | gutenprint | [] | hello | [] [] [] [] [] [] [] [] | id-utils | [] [] [] [] | impost | [] | indent | [] [] [] [] [] [] | iso_3166 | [] [] [] [] [] [] | iso_3166_2 | | iso_4217 | [] [] [] [] | iso_639 | [] [] [] [] | jpilot | | jtag | [] | jwhois | [] [] [] [] | kbd | [] [] [] | keytouch | [] | keytouch-editor | [] | keytouch-keyboa... | [] | latrine | [] [] | ld | [] | leafpad | [] [] [] [] [] [] | libc | [] [] [] [] [] | libexif | [] | libextractor | [] [] | libgpewidget | [] [] [] [] [] [] [] | libgpg-error | [] [] | libgphoto2 | [] | libgphoto2_port | [] [] [] | libgsasl | [] [] [] [] | libiconv | [] [] | libidn | [] [] () | lifelines | [] [] | lilypond | | lingoteach | [] | lynx | [] [] [] | m4 | [] [] [] [] [] | mailutils | [] [] [] [] | make | [] [] [] [] | man-db | [] [] | minicom | [] [] [] [] [] | mysecretdiary | [] [] [] [] | nano | [] [] [] | nano_1_0 | [] [] [] [] | opcodes | [] [] | parted | [] | pilot-qof | [] | psmisc | [] [] | pwdutils | [] [] | python | | qof | [] [] | radius | [] [] | recode | [] [] [] [] [] [] [] | rpm | [] [] [] [] | screem | | scrollkeeper | [] [] [] [] [] [] [] | sed | [] [] [] [] [] [] [] [] [] | sh-utils | [] [] [] | shared-mime-info | [] [] [] [] [] | sharutils | [] [] [] [] | shishi | [] | silky | [] | skencil | [] [] [] | sketch | [] [] [] | solfege | [] | soundtracker | [] [] | sp | | stardict | [] [] [] | system-tools-ba... | [] [] [] [] [] [] [] [] [] | tar | [] [] [] [] [] | texinfo | [] [] [] [] | textutils | [] [] [] | tin | () | tp-robot | [] | tuxpaint | [] [] [] [] [] | unicode-han-tra... | | unicode-transla... | | util-linux | [] [] [] [] | vorbis-tools | [] [] | wastesedge | | wdiff | [] [] [] [] [] [] | wget | [] [] [] [] | xchat | [] [] [] [] [] [] [] | xkeyboard-config | [] [] | xpad | [] [] [] | +------------------------------------------------------+ nso or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta 0 2 3 58 30 54 5 73 72 4 40 46 11 50 128 2 tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu +---------------------------------------------------+ GNUnet | [] | 2 a2ps | [] [] [] | 19 aegis | | 0 ant-phone | [] [] | 6 anubis | [] [] [] | 11 ap-utils | () [] | 4 aspell | [] [] [] | 15 bash | [] | 11 batchelor | [] [] | 9 bfd | | 1 bibshelf | [] | 7 binutils | [] [] [] | 9 bison | [] [] [] | 19 bison-runtime | [] [] [] | 15 bluez-pin | [] [] [] [] [] [] | 28 cflow | [] [] | 5 clisp | | 6 console-tools | [] [] | 5 coreutils | [] [] | 16 cpio | [] [] [] | 9 cpplib | [] [] [] [] | 11 cryptonit | | 5 darkstat | [] () () | 15 dialog | [] [] [] [] [] | 30 diffutils | [] [] [] [] | 28 doodle | [] | 6 e2fsprogs | [] [] | 10 enscript | [] [] [] | 16 error | [] [] [] [] | 18 fetchmail | [] [] | 12 fileutils | [] [] [] | 18 findutils | [] [] [] | 17 flex | [] [] | 15 fslint | [] | 9 gas | [] | 3 gawk | [] [] | 15 gbiff | [] | 5 gcal | [] | 5 gcc | [] [] [] | 6 gettext-examples | [] [] [] [] [] [] | 27 gettext-runtime | [] [] [] [] [] [] | 28 gettext-tools | [] [] [] [] [] | 19 gimp-print | [] [] | 12 gip | [] [] | 12 gliv | [] [] | 8 glunarclock | [] [] [] | 15 gmult | [] [] [] [] | 15 gnubiff | [] | 1 gnucash | () | 2 gnucash-glossary | [] [] | 9 gnuedu | [] | 2 gnulib | [] [] [] [] [] | 28 gnunet-gtk | | 1 gnutls | | 2 gpe-aerial | [] [] | 14 gpe-beam | [] [] | 14 gpe-calendar | [] | 3 gpe-clock | [] [] [] [] | 21 gpe-conf | [] [] | 14 gpe-contacts | [] [] | 10 gpe-edit | [] [] [] [] | 20 gpe-filemanager | [] | 6 gpe-go | [] [] | 15 gpe-login | [] [] [] [] [] | 21 gpe-ownerinfo | [] [] [] [] | 21 gpe-package | [] | 6 gpe-sketchbook | [] [] | 16 gpe-su | [] [] [] | 20 gpe-taskmanager | [] [] [] | 20 gpe-timesheet | [] [] [] [] | 18 gpe-today | [] [] [] [] [] | 21 gpe-todo | [] | 7 gphoto2 | [] [] [] [] | 20 gprof | [] [] | 11 gpsdrive | | 4 gramadoir | [] | 7 grep | [] [] [] [] | 34 gretl | | 4 gsasl | [] [] | 8 gss | [] | 5 gst-plugins | [] [] [] | 15 gst-plugins-base | [] [] [] | 9 gst-plugins-good | [] [] [] [] [] | 20 gstreamer | [] [] [] | 17 gtick | [] | 3 gtkam | [] | 13 gtkorphan | [] | 7 gtkspell | [] [] [] [] [] [] | 26 gutenprint | | 3 hello | [] [] [] [] [] | 37 id-utils | [] [] | 14 impost | [] | 4 indent | [] [] [] [] | 25 iso_3166 | [] [] [] [] | 16 iso_3166_2 | | 2 iso_4217 | [] [] | 14 iso_639 | [] | 14 jpilot | [] [] [] [] | 7 jtag | [] | 3 jwhois | [] [] [] | 13 kbd | [] [] | 12 keytouch | [] | 4 keytouch-editor | | 2 keytouch-keyboa... | [] | 3 latrine | [] [] | 8 ld | [] [] [] [] | 8 leafpad | [] [] [] [] | 23 libc | [] [] [] | 23 libexif | [] | 4 libextractor | [] | 5 libgpewidget | [] [] [] | 19 libgpg-error | [] | 4 libgphoto2 | [] | 8 libgphoto2_port | [] [] [] | 11 libgsasl | [] | 8 libiconv | [] | 7 libidn | [] [] | 10 lifelines | | 4 lilypond | | 2 lingoteach | [] | 6 lynx | [] [] [] | 15 m4 | [] [] [] | 18 mailutils | [] | 8 make | [] [] [] | 20 man-db | [] | 6 minicom | [] | 14 mysecretdiary | [] [] | 12 nano | [] [] | 17 nano_1_0 | [] [] [] | 18 opcodes | [] [] | 10 parted | [] [] [] | 10 pilot-qof | [] | 3 psmisc | [] | 10 pwdutils | [] | 3 python | | 0 qof | [] | 4 radius | [] | 6 recode | [] [] [] | 25 rpm | [] [] [] [] | 14 screem | [] | 2 scrollkeeper | [] [] [] [] | 26 sed | [] [] [] | 22 sh-utils | [] | 15 shared-mime-info | [] [] [] [] | 24 sharutils | [] [] [] | 23 shishi | | 1 silky | [] | 4 skencil | [] | 7 sketch | | 6 solfege | | 2 soundtracker | [] [] | 9 sp | [] | 3 stardict | [] [] [] [] | 11 system-tools-ba... | [] [] [] [] [] [] [] | 37 tar | [] [] [] [] | 20 texinfo | [] [] [] | 15 textutils | [] [] [] | 17 tin | | 1 tp-robot | [] [] [] | 10 tuxpaint | [] [] [] | 16 unicode-han-tra... | | 0 unicode-transla... | | 2 util-linux | [] [] [] | 20 vorbis-tools | [] [] | 11 wastesedge | | 1 wdiff | [] [] | 22 wget | [] [] [] | 19 xchat | [] [] [] [] | 29 xkeyboard-config | [] [] [] [] | 11 xpad | [] [] [] | 14 +---------------------------------------------------+ 77 teams tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu 170 domains 0 1 1 77 39 0 136 10 1 48 5 54 0 2028 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If October 2006 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'. 1.6 Using `gettext' in new packages =================================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle the use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `translation@iro.umontreal.ca' to make the `.pot' files available to the translation teams. pbbuttonsd-0.8.1a/AUTHORS0000644000175000017500000000014610641704553012044 00000000000000Matthias Grimm Sebastian Ritterbusch pbbuttonsd-0.8.1a/COPYING0000644000175000017500000004312210532451262012023 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. pbbuttonsd-0.8.1a/ChangeLog0000644000175000017500000021766710652444225012567 00000000000000 CHANGELOG ========== 2007-07-27 0.8.1a (public release) * remove hdparm option -p because the option does not do what it is supposed to and anyway the kernel does a good controlling the IDE speed settings. 2007-06-25 0.8.1 (public release) * fix typo in module_pmac.c that prevents pbbuttonsd from loading the trackpad mode from the config file. Thanks to Fernando J. Pereda for his patch. * apply a patch from ubuntu for module_cdrom to use eject in first approach and fall back to umount if eject fails. Thanks to Martin Pitt for his patch. * remove bash specific commands from the script files. Thanks to Colin Watson for his patch. * fixing some English texts. Tanks to Martin Pitt for his patch. 2007-02-10 0.8.0 (public release) * update program (doxygen) documentation 2007-02-09 0.7.9-37 * fix -Wextra warnings (except some unused variable warnings) * fix most of -pedantic warnings * implement support for TAG_LCDAUTOADJAC, TAG_LCDAUTOADJBAT, TAG_KBDAUTOADJAC and TAG_KBDAUTOADJBAT needed by PowerPrefs. * process_queue_single() ignored any error - fixed. * german language file updated 2007-02-08 0.7.9.36 * configure options --with-alsa and --with-oss produce linker errors - fixed * pbbuttonsd.cnf will be adapted to the machine now by configure 2007-02-07 0.7.9-35 * man pages updated * pbbuttonsd.cnf will be adapted by configure now 2007-02-05 0.7.9-34 * kernel 2.6.20 moved the keyboard fn_mode parameter to a new path in sysfs. Function changed to support both paths. Thanks to Joseph Jezak for his patch. 2007-02-04 0.7.9-33 (published as 0.8.0-rc4) * change model of ambient control. The characteristic curve will be defined by two points and a mode identifier. * the ambient controller calculates the curves in float now for more precise results. * The config options LCD_AutoAdjMin_* and LCD_AutoAdjMax_* and the corresponding tags TAG_AUTOADJMIN* and TAG_AUTOADJMAX* are obsolete and have been removed. They were replaced by the new ambient control model. 2007-01-30 0.7.9-32 * don't allow lcdfeedback values below zero anymore 2007-01-23 0.7.9-31 (published as 0.8.0-rc3) * acpi_event_handler didn't terminate read buffer - fixed * minimum brightness level for X1600 backlight set to 32. The display is unreadable at lower values. 2007-01-22 0.7.9-30 * laptop detection in configure didn't work properly - fixed * getMachineType in module_imac crashed if run as normal user - fixed. * module_acpi doesn't save the power source. The power source was once detected at startup but never changed again - fixed. 2007-01-21 0.7.9-29 (published as 0.8.0-rc2) * segfault in module_imac.c due to a bad ambient value in sysfs. various sanity checks implemented. 2007-01-19 0.7.9-28 * configure test for host architecture now and tries to preselects one of the supported machines. This decission can be overwritten with the LAPTOP environment variable. 2007-01-18 0.7.9-27 * images for doxygen documentation missed - fixed * extra index.html for doxygen documentation in ./doc added for convinience purposes. It's a forwarder to the doxygen index.html. * configure will abort now if libsmbios does not exist. 2007-01-16 0.7.9-26 (published as 0.8.0-rc1) * configure.in modernized. remove old macros and put in recommended replacements * borrow the little helper ccdv from the udev project and beautify the compile procedure. Warnings and error messages won't be covered anymore by millions of tons useless output from the autotools makefiles 2007-01-15 0.7.9-25 * some smaller code cleanups in display module * depricated tags TAG_KBDBRIGHTNESSMAX, TAG_LCDBRIGHTNESSMAX and TAG_REPLACE_PMUD removed 2007-01-14 0.7.9-24 * TAG_HW_BACKLIGHT removed. * The machine modules module_imac.c and module_pmac.c are no longer responsible for the lcdfeedback. The inteligence was moved to the display module. * New tag TAG_AMBIENTLIGHTMAX * new better ambient sensor model implemented (for debugging purposes only). 2007-01-02 0.7.9-23 * configure.in updated to be compatible with autoconf >2.60. due to this pbbuttonsd depends on gettext 0.16.1 now. pbbuttonsd should compile with autoconf <2.60 but this was not tested. 2007-01-01 0.7.9-22 * acpi events were discarded if more than one read operation is needed to get the complete event string - fixed. * rearranged debugging output in module_imac.c * add checks for ambient light sensor and keyboard illumination in module_imac.c * add check for machine type and improve machine identification. * add dependency to libsmbios (-lsmbios). This library is necessary to retrieve the model type on MacBooks. 2006-12-29 0.7.9-21 * Configuration of ADB trackpad and keyboard failed with new configuration system - fixed * key modifier weren't correctly parsed from configuration file - fixed * man pages updated 2006-12-28 0.7.9-20 * add function to poll cover status in module_acpi.c * optimize data polling in module_acpi.c. The file to read will only be searched once and saved for later direct reading. * acpi events 'ac_adapter' and 'button/lid' fully implemented. 2006-12-27 0.7.9-19 * backlight driver for Intels GMA950 added. This graphics card is used in Apple MacBooks. 2006-12-25 0.7.9-18 * add macbook model identification * add support for reading the ambient light sensor and the keyboard illumination on MacBooks from SysFS 2006-12-22 0.7.9-17 * some warnings fixed shown by -Wextra * bug fixed in module_display that makes it impossible for module_imac to keep track of LCD feedback. * removed some 32bit specific values that might cause trouble on 64bit machines. 2006-12-21 0.7.9-16 * division by zero bug in module_acpi.c - fixed * work around for built problem with gettext makefiles implemented 2006-12-16 0.7.9-15 * default values for dim and sleep time were corrupt - fixed 2006-12-14 0.7.9-14 * add support for acpid socketfile 2006-12-13 0.7.9-13 * some debugging options reorganized * bug in module_display fixed that leads to an annoying pump effect in brightness, when automatic ambient control was active. 2006-12-11 0.7.9-12 * fix some bugs in module_acpi.c * downgrade dynamic battery scanning to one initial battery scan. This assumes that ACPI doesn't add or remove battery entries on the fly. * move handling of tags TAG_POWERSOURCE, TAG_TIMEREMAINING and TAG_SLEEPSUPPORTED from module_imac.c to module_acpi.c 2006-12-10 0.7.9-11 * disable doxygen documentation by default * add module_acpi with basic battery and powersource support * add debug option SIMU_I386 in debug.h to make compiling possible on non-i386 architecture for testing. 2006-12-09 0.7.9-10 * disabling ibam leads to a compile error due to missing symbols - fixed * element list in driver_mixer_alsa not cleanly terminated - fixed 2006-12-03 0.7.9-9 * added doxygen support for pbbuttonsd. The target is named doxygen-docs. 2006-11-27 0.7.9-8 * fixed some typos in module_imac.c * changed X1600BRIGHTNESS from 256 to 255 * fixed a bug in configure.in so that module_imac.o and driver_brightness_x1600.c will only be built once. * The options LCD_AutoAdj** still use hardware dependent value ranges. Changed to percentage * Added TAG_POWERSOURCE and TAG_TIMEREMAINING handling in module_imac.c to trick battery checks in module_powersave.c This dummy code should be replaced with real functioning code as soon as possible. This functions could also be provided by an ACPI module. 2006-11-25 0.7.9-7 * added new backlight driver for ATIs X1600 which is used in Apples MacBooks. Thanks to Stefan Bruda for his code. * added new laptop model "MacBook". Call configure with LAPTOP=MACBOOK to configure pbbuttonsd for the new intel based machines from Apple. * makefiles updated. Source files not needed for the target system won't be compiled and linked anymore. They are excluded by the configure script and automake. * new module imac (intel mac) which contains code for reading ambiant light sensors and change the keyboard illumination level. It should work on new Intel based MacBooks. Thanks to Stefan Bruda for his code. * german language file updated 2006-11-24 0.7.9-6 * fix a small problem with a info message in class_config * update pbbuttonsd.cnf man page 2006-11-22 0.7.9-5 * TAG_CFGNAME deleted * config_manager fully replaced by class_config. The configuration file follows now a standardized format defined by freedesktop.org instead of an proprietary solution. This format uses sections and in that context some configuration options have been renamed and others were removed at all. * open() and close() functions removed from prginittab. Code in init.c reworked to work with changed prginittab * SIGHUP won't be supported any longer due to new configuration system. * obsolete defines removed from module_poversave.h and module_pmac.h * fix all -Wextra and nearly all -Wundef warnings. Some unused function arguments are remaining. 2006-11-21 0.7.9-4 * module_powersave moved to new configuration system * glib version required increased to 2.6 2006-11-20 0.7.9-3 * module_pmac moved to new configuration system * config_get_option() and config_set_option() added * configuration option dev_Framebuffer renamed to Device_FB * configuration option dev_PMU renamed to Device_PMU * configuration option dev_ADB renamed to Device_ADB 2006-11-19 0.7.9-2 * module_display changed to new configuration mechanism * class_backlight changed so that it could be called in init phase instead of open phase. * driver_backlight_pmu uses /dev/pmu and /dev/adb directly instead of reading the device names from configuration This might change again in future. * bugfix in module_display. The fadingspeed decreased every time the value was saved to configuration file. a bug in the formular was corrected to fix this behaviour. 2006-11-18 0.7.9-1 * introduced a new class mixer with drivers for oss and alsa * introduced a new configuration module that uses the glib keyfile functionality rather than building a proprietary module. * The mixer module will always be initalized at first use rather than at startup time. The option MIXER_INITDELAYED has been removed. * obsolete tags removed: dev_Mixer, MixerChannels, MixerCard * due to the changed configuration system only the active drivers could be configurated. The configuration of Inactive drivers must be changed in the configuration file directly. * tag SOUNDSYSTEM removed. Pbbuttonsd will choose the best soundsystem available on the system it has a driver for. * two new tags: TAG_BRIGHTNESSDRIVER and TAG_MIXERDRIVER to ask for the current active driver. The result is a string. 2006-10-01 0.7.9 (public release) * class backlight will always succeed, even if there is no backlight controller available. * PMU backlight driver checks for availibility now. 2006-09-30 0.7.8-6 * added chapter about pbbuttonsd's capabilities in man page * set debug.h back to default 2006-09-29 0.7.8-5 * ATTENTION: Configuration changed: The options LCD_FadingSpeed and KBD_FadingSpeed got a new meaning to make the configuration device independent. See man pages pbbuttonsd.conf.5 or pbbcmd.1 for details. * fix a bug in the pbbcmd man page. The decription of TAG_KBDMODE was outdated. * man pages updated. * german locale updated * TAG_SYSINFO got two new machine dependent flags: SYSINFO_PB_USB_KBD - machine has an USB keyboard SYSINFO_PB_USB_TPAD - machine has an USB trackpad This flags are only available on PowerBooks/iBooks and control certain elements in PowerPrefs. 2006-09-28 0.7.8-4 * SysFS backlight interface suported with kernel >= 2.6.18 * new class backlight: It got two low level backlight driver: sysfs and pmu with autodetection. If the Sysfs driver should be used it is recommended to compile the kernel without CONFIG_PMAC_BACKLIGHT_LEGACY to prevent interferences between ancient kernel code and the new sysfs interface. * ATTENTION: The client interface has changed: The following tags use values in percent now instead of the device dependent physical value: TAG_LCDBRIGHTNESS TAG_KBDBRIGHTNESS TAG_KBDONBRIGHTNESS The following tags are deprecated and shouldn't be used any longer: TAG_LCDBRIGHTNESSMAX TAG_KBDBRIGHTNESSMAX Clients have to be adapted to this changes. It is recommended to use new versions of GTKPbbuttons and PowerPrefs with this release. * ATTENTION: The change of the client interface has also an impact on the configuration file. According to the tags above following configuration options use percent values now: LCD_Brightness KBD_Brightness 2006-09-23 0.7.8-3 * set default status of option UseFBBlank to 'no' because it might collide with the backlight controll in recent kernels the man page pbbuttonsd.conf was updated accordingly. * rewind input handler change from 2006-07-30 because the code doesn't do the trick. 2006-09-06 0.7.8-2 * disabling optional packages often didn't unbound all dependencies. For example after disabling IBAM pbbuttonsd will still be compiled with libstdc++ even if it is not needed any longer. The compile scripts have been modified to handle this cleanly. Thanks to Luca Barbato for his patch. * configure.in cleaned up 2006-09-05 0.7.8-1 * laptopmode script parses fstab correctly now, even if it contains tabs instead of spaces. Thanks to S. Lockwood-Childs who found this patch in the gentoo bugtracker. * fix warnings reported by -Wextra 2006-07-31 0.7.8 (public release) 2006-07-30 0.7.7-1 * adding input handler for /dev/input/mice to work around the problem with synaptics trackpad driver. * fixing problem with unstable autoconf package 2006-07-29 0.7.7 (public release) 2006-07-28 0.7.6-4 * code cleanups 2006-07-22 0.7.6-3 * I2C address of LMU Controller is dynamically read from OF device-tree * The I2C device the LMU controller is connected to is retrieved with sysfs. Therefore kernel 2.6 is needed and the i2c-dev kernel module must be loaded for this to work. * remove some warnings from the code 2006-07-21 0.7.6-2 * machine identification improved. Any PowerBook or iBook model will be precisely identified. * machine identification is read now from /proc/device-tree/model instead of /proc/cpuinfo. * got rid of i2c-dev.h. Only I2C_SLAVE was used. This value is now defined in module_pmac.h 2006-07-16 0.7.6-1 * division by zero error fixed in power_read_cpu(). Thanks to Ren Nussbaumer . 2006-07-02 0.7.6 (public release) * increase KBD_BRIGHTNESS_MIN from 1 to 16 in respect of the new scale. Man page changed accordingly. 2006-06-30 0.7.5-6 * the static 10ms timer has been removed. The timer function will be dynamically created whenever it is needed and only for the time it is needed. This will permanently decrease context switches independent of configuration. * Despite of runing on bash only the script 'autogen.sh' referenced '/bin/sh' - fixed. * change keyboard illumination to use 255 brightness steps during fading. keyboard up/down still uses 16 steps. Thanks to Paul Collins . 2006-06-17 0.7.5-5 * moved low priority request functions in module_pmac.c like read battery status, read AC status and read Cover status into an one second timer routine. (debian bug #372760) * increase poll interval of IPC messages from 10ms to 100ms * module_display will only register a 10ms task if fading (LCD or KBD) is configured (fadingspeed > 0). Otherwise it will register a 100ms task. * The 10ms queue will terminate itself if it was found empty. This will decrease the count of context switches. (debian bug #372760) 2006-05-20 0.7.5-4 * Powerbooks before Pismo still weren't detected correctly because the field 'machine' from /proc/cpuinfo was used. This was changed to 'motherboard' and now it works. 2006-05-17 0.7.5-3 * bug in alsamixer caused a segfault - fixed. Reported to ubuntu. Thanks to John Steele Scott , who reported it to me :-) 2006-05-14 0.7.5-2 * bug in machine detection routine. PowerBooks before Pismo weren't detected correctly - fixed. * fix some warnings in module_pmac.c: keyboard_getconfig(), keyboard_setconfig() * added some debug code to track pbbuttonsd communication with the PMU in /var/log/pbbuttonsd. Set PMUTALK in debug.h to activate 2006-04-26 0.7.5-1 * PowerBook 6,7 has a USB Trackpad which was not correctly reported by pbbuttonsd - fixed. 2006-04-02 0.7.5 (public release) * default value for LCD_FadingSpeed in config file changed from 5 to 4 to make fading smoother. 2006-03-23 0.7.4-2 * SIMUABIENT code was broken - fixed * added sync() before calling any suspend mode. (debian bug #357595) * allow the user to dim the display until it's dark (brightness level zero) even if autoadjusting is active. The former minimum level was one. (debian bug #345314) 2006-03-20 0.7.4-1 * the vendor and product identifier from USB devices are not unique so that selecting input devices based on product/vendor will miss some devices. The code has been changed to use the device identifier instead. 2006-01-27 0.7.4 (public release) 2006-01-22 0.7.3-7g * fixed two minor bugs in module_pmac.c regarding USB keyboard configuration - Thanks to Michael Hanselmann 2006-01-21 0.7.3-6g (public beta) * added keyboard configuration of PowerBook USB keyboard. Needs kernel 2.6.16 or later. 2006-01-17 0.7.3-5g (public beta) * some small fixes regarding LMU * add Alluminum PowerBook to identity string 2006-01-16 0.7.3-4g * add support for ambient sensor and keyboard illumination connected to the PMU. Thanks to Ren Nussbaumer and Michael Hanselmann for their code. 2006-01-08 0.7.3-3g * add test for glib into configure.in * pbbuttonsd mainloop ported to glib mainloop * rewrite input source handling to fit into glib mainloop * rewrite signal handling to fit into glib main loop 2006-01-05 0.7.3.2 * bugfix in apm-compat script 2006-01-03 0.7.3-1 * new tag added: TAG_CHARGETIME this tag would deliver the time until the batteries are fully recharged, if IBaM support was compiled in. 2005-12-23 0.7.3 (public release) * compile with ibam by default * man page updated, typo's corrected 2005-12-18 0.7.2-10 * removed bug in module_pmac.c that would trigger sleep again immediately after wake-up under certain circumstances. Thanks to Stefan Bruda for reporting this problem. 2005-12-13 0.7.2-9 * install script creates data directory for IBaM * man pages revised 2005-12-05 0.7.2-8 * typo's in man-paged fixed 2005-12-02 0.7.3beta1 (public beta) * small data type fixes in IBAM code * man-page updated 2005-12-01 0.7.2-7 * libpbbipc: API of check_permissions() extended by required permissions * incomplete error handling in copy_path() - fixed * ibam stub won't create IBAM object at startup. Module_powersave will initialize it by calling ibam_init() * IBAM: object constructor gets the data path as argument now. The file operations regarding the data path have been removed. * IBAM: internal define VERSION renamed to IBAM_VERSION because the former name collide with autotools * IBAM: internal define DEBUG renamed to IBAM_DEBUG to be able to control IBAM debugging through pbbuttons debugging mechanisms * new configuration option 'IBAM_DataDir' added * new TAG_IBAMDATADIR added * IBAM: locale settings removed so that data files become locale sensitive. * default value for CmdTimeout increased from 4 to 8 seconds * apm-compat script: Fix arguments on calling apm scripts on resume. * man pages updated * default of option 'autorescan' changed to 'yes' in config file 2005-11-28 0.7.2-6 * documentation and man-page updated with IBAM 2005-11-18 0.7.2-5 * added SYSINFO flag for IBAM 2005-11-17 0.7.2-4 * spell error in conditional compile expression - fixed * timeremaining could be uninitialized after startup which leads to immediately entering sleep mode - fixed 2005-11-16 0.7.2-3 * move TAG_TIMEREMAINING to module_powersave if compiled with IBAM support * add some more #ifdef for IBAM in module_pmac.c 2005-11-15 0.7.2-2 * IBAM: Time = 0 must not be filtered out. 2005-11-13 0.7.2-1 * IBAM integrated in module_poversave.c. Support must be enabled at compile time with --with-ibam * sync display brightness with external after wakeup. Some user reported that the display was at minimum brightness after wakeup. 2005-10-04 0.7.2 (public release) 2005-10-01 0.7.1-7 * new action 'shutdown' completed, scripts modified accordingly * CFLAGS filter removed from configure.in and Makefile.am. Thanks to Frank Lichtenheld for his report * runlevel check in module_powersave added. Pbbuttonsd will not suspend the machine if a shutdown or reboot is in progress (runlevel 0 or 6). Thanks to Kristian Benoit for his patch. * source cleanup in module_powersave.h 2005-09-13 0.7.1-6 * implementation of new action "shutdown" started. 2005-09-06 0.7.1-5 * Code reorganized to prevent the left mouse button key event from breaking 'NoTapTyping' but reset the dim or sleep timer. * power source change during the cover is closed will follow the configured power profile (onX_CoverAction) now. (debian bug #306482) 2005-09-04 0.7.1-4 * memory leaks fixed in module_alsamixer: snd_mixer_free() replaced by snd_mixer_close(). * add command HIBERNATE to pbbuttonsd and pbbcmd. This applies a patch ubuntu maintainers have sent to debian. (debian bug #329369) * man pages updated. 2005-09-01 0.7.1-3 * module_mixer would return an error if the configured sound system couldn't be initialized. Now the sound system will be disabled but the daemon won't abort anymore. (debian bug #325309 and #321631) 2005-08-27 0.7.1-2 * module_cdrom: getmountpoint() terminates the wrong buffer - fixed * module_cdrom: Still problems with relative links - fixed. Thanks to Johannes Berg for his report and patch. * module_alsamixer: non-allocated memory freed - fixed * valgrind memcheck: - uninitialized ioctl parameter in scanEventDevices() - fixed - source and destination string of strncpy() might have overlapped under certain circumstances - fixed. - complains about some issues in libasound.so.2.0.0. Can't do anything about this :-(. - memory leak in module_alsamixer. snd_mixer_detach() wasn't called - fixed. 2005-08-09 0.7.1-1 * Check also device class to find trackpad device to prevent conflict with appletouch USB driver. Thanks to Luca Bigliardi for the patch. * Absolute position events will reset sleep and dim timer of powermanagement module now. This is needed to support the appletouch USB trackpad driver. 2005-07-18 0.7.1 (public release) 2005-07-17 0.7.0-4 * If the sound card supported more than 100 volume levels, the new volume fine tuning would not work - fixed 2005-07-15 0.7.0-3 * change volume control: volume up/down change volume always by 10% (hardware independent), shift + volume up/down change volume by 1 step (hardware dependent). 2005-07-11 0.7.0-2 * module_cdrom can't find the mountpoint if the link to the device is a relative link - fixed. * readlink buffer not correctly terminated - fixed. 2005-07-10 0.7.0-1 * event scripts redefine PATH which makes trouble with the definition in the PMCS master script. PATH definitions removed. 2005-07-10 0.7.0 (public release) 2005-07-04 0.7.0beta2-2 * catalan catalog updated. Thanks to Oriol Pellicer * added mouseemu comment to NoTapTyping option in pbbuttonsd.conf.5 man page 2005-07-03 0.7.0beta2-1 * volume of alsamixer can't be set correctly with TAG_VOLUME - fixed Thanks to Elimar Riesebieter for his report. 2005-07-01 0.7.0beta2 (public bets) * check for ADB keyboard and trackpad added. Configuration of the trackpad and/or keyboard is now restricted to PowerBooks which have an ADB trackpad and/or ADB keyboard. * Trackpad tap will be disabled at first key press and enabled again at first mouse movement. No changes inbetween. This reduces ADB messages significantly. * spanish language file updated. Thanks to Rudy Godoy * pbbcmd man page updated 2005-06-26 0.7.0beta1 (public beta) * reorganize debugging code in module_cdrom * add some comments to module_cdrom's functions * reorganize debugging code in module_pmac * add some comments to module_pmac * pbbcmd: pseudo 'cmd' removed. * pbbcmd: missing parameter checks added. * german translation file updated * pbbcmd man page updated 2005-06-24 0.6.10-7 * support for pbbuttonsd commands added to pbbcmd * pbbcmd now can print a list of clients * man pages updated * default for NoTapTyping set to 'no' due to freeze problems on some machines. 2005-06-23 0.6.10-6 * alsamixer unmute didn't work - fixed * alsamixer code cleanup * some comments in module_pmac updated 2005-06-21 0.6.10-5 * buffer overflow in input handler management. buffer functions will handle completely filled buffers correctly. Furthermore the maximun count of input devices has been increased. 2005-06-19 0.6.10-4 * the mountpoint is found in both directions now. For example: dev_cdrom = /dev/cdrom /dev/cdrom is a link to /dev/hdc /dev/hdc is mounted or dev_cdrom = /dev/hdc /dev/cdrom is a link to /dev/hdc /dev/cdrom is mounted 2005-06-18 0.6.10-3 * If the configured CDROM device is a link to another device and the CDROM is mounted trough this other device, pbbuttonsd couldn't eject the CDROM. This is fixed now because both devices are checked. * typo's in german language file corrected, thanks to Jens Seidel for his patch. 2005-06-17 0.6.10-2 * FBIOBLANK argument changed to highest vesa mode. New framebuffers support different modes with different impact on power consumption. 2005-06-10 0.6.10-1 * error in if statement in display module. It will never become true - fixed. * If user requested ACTION_BLANK on cover close this request would be sent twice - fixed. 2005-05-26 0.6.10 (public release) 2005-05-23 0.6.9-5 (public beta) * some code and documentation cleanup 2005-05-21 0.6.9-4 * filter BTN_LEFT as key event because it breaks 'NoTapTyping'. Problem with trackpad fixed. 2005-05-20 0.6.9-3 (public beta) * Tags TAG_MOUSEBUTTONS and TAG_MOUSEWHEEL removed * scan_for_kdbdevs() replaced by scanEventDevices() which will scan for all event devices, not only for keyboards. * New event input handler replacing the special input handlers for mouse and keyboard. * input handler return an error code now. If the input handler belong to an event device, this device will be disabled and scanEventDevices () is called. If the input handler belong to any other source, the daemon will quit due to a FATAL error. * evdev kernel module is no longer loaded if missing. The system must be set up accordingly before starting the daemon. 2005-04-27 0.6.9-2 * a pseudo keycode will be emitted if an power button interrupt is received. This is important for new aluminum powerbooks until the kernel supports the power button natively. 2005-04-13 0.6.9-1 * some error messages in module_alsamixer added * E_NOSUPPORT won't exit the program anymore 2005-04-06 0.6.9 (public release) 2005-04-05 0.6.8-3 * explain keycodes in man-page. This closed debian bug #280211 2005-04-04 0.6.8-2 * pmcs script bdflush logs a message if an external laptop-mode script is active. * errors during program initialisation didn't lead to program abortion - fixed * error messages uses more syslog levels for reporting (LOG_ERR, LOG_WARNING and LOG_INFO) instead of using only LOG_ERR. * Even if started as daemon error messages will be printed to stderr as long as the parent process recognises them. Warnings and info messages will be redirected into syslog as soon as the \'-d\' is detected in the command line arguments. This closes debian bug #188317 * language files updated 2005-04-01 0.6.8-1 * TAG_CLIENTPID added. The server recorded the client pid for internal use. Recommendation: Recompile all clients. * trackpad configurations has been downgraded from secure to normal function. * trackpad reconfiguration takes also place now when a key is constantly pressed (key repeatition function) * trackpad disable time decreased to 600 ms again. * script bdflush updated so that it look for a global laptop- mode script first before using the private one. This script is depreciated now and might be removed in future releases including the local copy of laptopmode.sh. This closes debian bug #290766 * a native pbbuttonsd script for laptop-mode-tools has been sent to the package maintainer of laptop-mode-tools. It will enter pbbuttonsd's CVS but never become part of a distribution package. * added current directory to PATH in pmcs-pbbuttonsd to make it work with other shells than bash too. Thanks to Jrg Sommer for his patch. This closes debian bug #295178. 2005-03-24 0.6.8 (public release) * keyboard scanner tested for EV_REP but some new button devices haven't this flag set and therefore aren't detected. To exclude pointing devices the keyboard scanner tests now for EV_KEY && !EV_REL to detect keyboards. 2005-03-22 0.6.7-9 * client list extended with name and flags. If a client wants to register it must provide a name and optional additional flags. ! Please pay attention to the changed ipc_init() interface. ! ! Clients linked with an old libpbb will work as usual but ! ! you should move to the extended interface with your next ! ! release. Future extensions will depend on the extra data. ! * libpbb IPC: servertags evaluation moved behind taglist processing. This has the advantage that strings in taglists provided with server action like register and unregister clients would be correctly relocated. * trackpad enable (notap) time increased to 0.8 seconds * registerflags CLIENT_EXCLUSIVE and CLIENT_REPLACEMENT added. With CLIENT_EXCLUSIVE only one client instance is allowed. Additional registrations will be rejected. With CLIENT_REPLACEMENT only one client instance is allowed too, but this time the existing instance will be closed and replaced by the new one. 2005-03-21 0.6.7-8 * list code moved to libpbb * static client array replaced by dynamic client list. Client count isn't limited anymore. * documentation updated 2005-03-20 0.6.7-7 * returned channels from ossmixer were filtered by supported channels which leads to wrong channels if the mixer module is not active. Solution: Mixer will always return user setting now even the mixer doesn't support the named channels. * automatic mixer detection fail if only one or no mixer module is compiled in - fixed * language files updated 2005-03-19 0.6.8beta1 (public beta) 2005-03-17 0.6.7-6 * improved error reporting in various modules * error in open functions of alsamixer and ossmixer - fixed * Following depreciated tags have been removed and won't be supported any longer: TAG_ONACPOLICY, TAG_ONACSLEEP, TAG_ONACCOVERSLEEP, TAG_ONACTIMESLEEP, TAG_ONACTIMEDIM, TAG_ONBATTERYPOLICY, TAG_ONBATTERYSLEEP, TAG_ONACDIM, TAG_ONBATTERYCOVERSLEEP, TAG_ONBATTERYTIMESLEEP, TAG_ONBATTERYTIMEDIM, TAG_ONBATTERYTIMEHDOFF, TAG_ONBATTERYDIM, TAG_ONBATTERYBLANK, TAG_ONACTIMEHDOFF, TAG_ONACBLANK, TAG_SCRIPTBATCRITICAL, TAG_SCRIPTPROFCHANGED, TAG_SCRIPTHDSETUP, ! If you use this tags in your program please change ! ! it and use the appropriate replacement tags. ! * added soundsystem autodetection code 2005-03-16 0.6.7-5 * all modules adapted to the config manager. Old configfile mechanism removed. * obsolete configuration file options removed. Old configuration files can't be used anymore. * new configuration options for ALSA and OSS specific options. ! Please update your configuration file to the new options. ! ! Some OSS related options have been renamed. ! * changed module initialization sequence: init - open - configure. * the mixer modules keep module specific configration options even the module is not active. This removes a bug from the BUGS file. * error reporting of module_cdrom improved * new command line option --quiet to suppress the welcome message * made trackpad reconfiguration while typing configurable. The tag TAG_NOTAPTYPING controls this feature. 2005-03-13 0.6.7-4 * introduce new config manager as replacement for configfile * dynamic handling of configuration options. Options will be registered by the modules now. 2005-03-06 0.6.7-3 * LMU device detection code returns wrong device number if it is below 4 - fixed. Thanks to Mark Ferry * trackpad reconfigured to 'notap' while typing (feature request from debian powerpc mailinglist). Mode will be restored 0.6 seconds after last key stroke. Function is not configurable yet. * trackpad mode has been lost after sleep - fixed 2005-02-05 0.6.7-2 * file descriptor leak in module_display - fixed. Thanks to Andreas Schwab for his patch. 2005-02-03 0.6.7a (bugfix release) 2005-02-02 0.6.7-1 * saveconfig command causes segfault - fixed * exitcode of alsamixer module causes segfault - fixed * module peep causes segfault in debug mode - fixed * module_mixer added as base for specialized OSS and ALSA mixer modules 2005-01-25 0.6.7 (public release) 2005-01-21 0.6.6-8 * alsamixer module revised. Thanks to John Steele Scott. * new tag TAG_MIXERCARD and configuration option MixerCard to support the alsamixer module * man-pages updated 2005-01-02 0.6.6-7 * seqfault in pbbcmd if string information was queried - fixed * if the display was dimmed and the first key pressed was the brightness up/down key the brightness level wouldn't recover correctly - fixed. 2004-12-12 0.6.6-6 * add soundsystem flags to TAG_SYSINFO * added query for the currently active soundsystem * added tag TAG_SOUNDSYSTEM to query active soundsystem * added tag TAG_SOUNDSYSTEMCFG to configure soundsystem. This configuration becomes active only after saving the configuration and restarting the server. 2004-12-10 0.6.6-5 * module_display checks current level of LCD brightness now before modifying it and keeps it synchron. This compensate brightness changes from other tools than pbbuttonsd. 2004-11-28 0.6.6-4 * function print_error in libpbb become UTF-8 safe. Error texts will be converted to local charset before printing to terminal or to logfile. Iconv must be available for this to work. * new spanish translation, thanks to Rudy Godoy 2004-11-25 0.6.6-3 * added m3mirror functionallity for ATI Rage128 and Radeon cards. It will support all cards the frambuffer supports. a new keycode was added to the display module to switch the external display on/off. 2004-11-21 0.6.6-2 * improved configure script: checks for ALSA now and prints a configuration summary at the end * add new configuration option 'SoundSystem' to set the used mixer at runtime * updated configuration man-page 2004-11-17 0.6.6-1 * updated debian directory in pbbuttonsd's repository * some quotings corrected discovered by debian maintainer Frank Lichtenheld. 2004-11-04 0.6.6 (public release) 2004-10-25 0.6.5-4 * Powerbook G3 lombard's PMU doesn't report the AC power flag in environment flags. Program changed to use /proc instead. 2004-09-24 0.6.5-3 * start LMU device detection now with /dev/i2c-4 to avoid errornous detection of device /dev/i2c-0. The devices 0 to 3 will be tested last. 2004-09-23 0.6.5-2 * separate getting power source from reading battery info. pmac_update_flags() falls automatically back to /proc/pmu/info if the pmu driver reports an error via ioctl. 2004-09-20 0.6.5-1 * fix bug in pmac_timer. cover and power source weren't updated correctly after sleep. 2004-09-10 0.6.5 (public release) 2004-09-09 0.6.4-6 * without backlight controller the bahaviour of the display module changed as follows: - LCD brightness only changes between 0 and MAX - clients will always get -1 as LCD brightness level This change recommends installation af latest clients - the framebuffer would be switched off before suspend-to-RAM if configured accordingly (mostly doesn't work) - display dimming, if activated, will switch the display off, if UseFBBlank=yes. (ATTENTION: Backlight might keep alit, check carefully before using display dimming this way) ATTENTION: Read file BUGS for more details. 2004-09-08 0.6.4-5 * The function getting the backlight level from the hardware checks now for errors. The new return value -1 indicates that no backlight controller is available. * documentation fine tuning * script setupenv.sh removed from distribution 2004-09-06 0.6.4-4 * extend module_cdrom.c to support closing the tray if open. Thanks to Alan Carvalho for his patch. * send message to clients if the CDROM tray will be closed. 2004-08-29 0.6.4-3 * PMCS-scripts modified to cope with the third argument * update documentation 2004-08-28 0.6.4-2 * add TAG_TAG_ONAC_POLICY, TAG_ONAC_TIMERACTION, TAG_ONAC_COVERACTION, TAG_ONAC_KEYACTION, TAG_ONAC_TIMESUSPEND, TAG_ONAC_TIMEDIM, TAG_ONBATT_POLICY, TAG_ONBATT_TIMERACTION, TAG_ONBATT_COVERACTION, TAG_ONBATT_KEYACTION, TAG_ONBATT_TIMESUSPEND and TAG_ONBATT_TIMEDIM This tags now support suspend-to-disk. * mark TAG_ONACSLEEP, TAG_ONACDIM, TAG_ONACTIMESLEEP, TAG_ONACTIMEDIM, TAG_ONACCOVERSLEEP, TAG_ONACPOLICY, TAG_ONBATTERYSLEEP, TAG_ONBATTERYDIM, TAG_ONBATTERYTIMESLEEP, TAG_ONBATTERYTIMEDIM, TAG_ONBATTERYCOVERSLEEP, TAG_ONBATTERYPOLICY and TAG_SLEEPKEYSLEEP as depreciated. Don't use them in your code. Use the replacements instead. * handle new tags in configfile.c, pbbcmd.c and module_peep.c * update man-page pbbcmd.1 * handle new tags in module_powersave.c * cover-scripts will only be called if no other script is going to be called. * on cover close the screen will always be blanked before the action set by the user is executed. * scripts calls for 'suspend' and 'resume' got a third parameter 'ram' or 'disk' * pbbuttonsd man-page and configuration file updated 2004-08-27 0.6.4-1 * new tag TAG_BATTERYPRESENT which reports which battery is present independently from /proc/pmu, which is not reliable under certain circumstances. * fixed command string for PCMCIA card command * extend PMCS Script from two to three arguments * PMCS script 'suspend' and 'resume' got 'ram' as third argument * PMCS script 'cover-open' got 'open' as third argument * PMCS script 'cover-close' got 'close' as third argument * code cleanup in module_peep.c 2004-08-22 0.6.4 (public release) 2004-08-08 0.6.3-6 * added function pmac_get_lcdbrightness(). Minor restructuring of module_pmac.c 2004-08-07 0.6.3-5 * keyboard illumination behaviour in conjunction with on/off key changed. If not in autoadjustment mode an initial brightness could now be defined with TAG_KBDONBRIGHTNESS. Thanks to Rodolfo Giometti for his patch. 2004-08-06 0.6.3-4 * new Tags TAG_BATLOG and TAG_BATCYCLE added. This control battery data logging during runtime. The compile time options --with-batlog and --with-batcycle have been removed. (closes debian bug #262544) Attention: The meaning of the Tags are not exactly the same as the compile time options. Read the man-page for details. 2004-08-03 0.6.3-3 * pbbcmd: added version to help text * pbbcmd: removed private tags from help list * pbbcmd: added parameter 'i' to force pbbcmd not to wait for servers answer after sending config commands. * pbbcmd: man-page updated * pbbcmd: decrease timeout time from 10 to 4 seconds 2004-07-30 0.6.3-2 * improved test for running deamon implemented. It detects now dead message ports and removes them at startup. With this Pbbuttonsd is able to cope with kill -9 wihout users help. 2004-07 29 0.6.3-1 * ac status in /proc/pmu/info is not reliable if no battery is pluged in. So from now on pbbuttons asks the PMU directly. 2004-07-22 0.6.3a (public release) * add script tags 'cover-open' and 'cover-close' * two spelling mistakes corrected in pbbuttonsd.conf * one spelling mistake corrected in configfile.c 2004-07-19 0.6.3 (public release) * fix a type in script bdflush 2004-07-17 0.6.2-4 * exit commands removed from scripts so that the exit codes of the subscripts survive. * The script child set his own process group so that it and all it's child could easily be terminated on error or timeout. * change the supervising code to send the SIGKILL not only to the pmcs-script child but to all childs of the same process group. Unfortunately this will only work in full with a patched run-parts version where all parts share the same process id. Debians run-parts creates a new process id with each running part so that this processes will remain in memory on error or timeout. A bug-report has been filed to debian. 2004-07-16 0.6.2-3 * some calls of open() especially in module_ossmixer didn't accept 0 as valid file handler. Due to this the mixer device may remain open after usage. After a suspend event the ALSA scrips stop all processes that uses sound devices including pbbuttonsd. This bug was fixed now. * module_powersave uses depreciated tags - cleaned up * old config options removed from configfile.c * launch_program() did't check for fork() and waitpid() error codes. A fork() failure might caused weird system reactions - fixed. * call_script() translates new error codes in human readable text. * the PMCS script 'bdflush' will only work for kernel 2.4. It was replaced by a more general one that now calls 'laptop_mode.sh' from the kernel tree. 2004-07-01 0.6.2-2 (version lost) 2004-06-30 0.6.2-1 (version lost) 2004-06-21 0.6.2 (public release) 2004-06-19 0.6.1-1 * Automatic keyboard brightness adjustment work against manual control due to bug in keyboard handler - fixed. * keyboard illumination can't be switched off completly. Copy & paste error from LCD code - fixed * Toggle keyboard illumination on/off increased the level by one each time. Collision with autoadjustment code - distangled. * added keycodes fr special keyboard illumination keys from the kernel patch from Andreas Jaggi. 2004-05-26 0.6.1 (public release) * cleanup modules could be skipped if signal handler setting failed - fixed * obsolete function detach_process() removed from libpbbipc. * bug in daemonize and ipc code of libpbbipc fixed. This bug could block message queue cleanup if an error occured during program initialization. Altough the daemon isn't running, this leads to the error message "pbbuttonsd already running, only one instance allowed". 2004-05-22 0.6.0-3 * /proc/cpufreq interface for kernel 2.4 missing in scripts.d/cpufreq - added. Thanks to Wolfgang Pfeifer * errornous address CPU #1 in scripts.d/cpufreq - fixed Thanks to Wolfgang Pfeifer * use /bin/sh in scripts instead of /bin/bash * get rid of wall, shutdown message will be sent by shutdown now. 2004-05-19 0.6.0-2 * Blanking the screen comming from dimmed display causes the original brightness value to be lost (debian bug #249782)- fixed. 2004-05-12 0.6.0-1 * scripts/config renamed in scripts/pmcs-config. * type in man page fixed (debian bug #249285) 2004-05-08 0.6.0 (public release) * New Script system introduced. Debian bug #249501 solved. 2004-04-29 0.5.11-6 * call PMCS script to set power policy after wakeup if power source has changed. * call PMCS script to set power policy after TAG_REINIT. * script PMac_G3 not longer necessary with 2.4 and 2.6 kernels - removed 2004-04-26 0.5.11-5 * directories in scripts renamed: active->event.d and storage->scripts.d. * some arguments of the pmcs script renamed: sleep->suspend and wakeup->resume. All scripts modified accordingly. * script apmd_compat added. Thanks to Guido Guenther . * added support for additional directories suspend.d and resume.d if existing. 2004-04-23 0.5.11-4 * man-pages updated * obsolete code fragments removed * TAG_REINIT added to restore hardware setting for example lost due to suspend to disc. This action could also triggered with SIGUSR1. * code cleanup in install_sighandler() * code cleanup in pbbuttonsd.c * changed script config variables to policy dependent names. 2004-04-21 0.5.11-3 * add TAG_ONACPOLICY and TAG_ONBATTERYPOLICY * add onAC_policy and onBattery_policy to configfile * make options with discrete arguments like tpmode, emergencyaction etc more robust against invalid values. * code cleanup in configfile.c * replace some #defines against enum{} in module_pmac.h and module_powersave.h. This simplifies code and improve error robustness. * added TAG_BRIGHTNESS again for compatibility reasons. Please be aware that this tag is DEPRECIATED and will be removed in future. Use TAG_LCDBRIGHTNESS instead. * add TAG_POLICY to set the current power policy. * TAG_SCRIPTHDSETUP, TAG_ONACHDTOFF and TAG_ONBATTERYHDTOFF removed. Hard disc setup will be done in pmcs script now. * TAG_SCRIPTBATCRITICAL removed. This job is also done by pmcs script now (first argument=emergency). * TAG_SCRIPTPROFCHANGED renamed in TAG_SCRIPTPMCS. * changed all script calls of script_profchanged, script_hdsetup and script_batcritical to script_pmcs. * pmcs-* scripts need a 'cd' to the target directory because all paths in the scripts are relative paths. * add example script named skeleton * describe script parameters in a README instead of inside each script header. * german translations updated * script path in pbbuttonsd.conf will now be adjusted by the configure script. 2004-04-20 0.5.11-2 * added missing variable for xgettext and fixed a bug in POTFILES.in * change main Makefile.am to handle new structure in scripts/ * introduce new pbbuttonsd script system * setting Tdim=0 will disable display dimming now. Therefore TAG_ONACDIM, TAG_ONBATTERYDIM and its corresponding config options onAC_dim and onBattery_dim were useless and have been removed. * setting Tsleep=0 will disable sleep when idle now. This feature is new. * The command GOTOSLEEP will always trigger sleep now, if possible. If sleep was not supported by the hardware the screen will be blanked instead. No configuration possible. * use sig_atomic_t datatype now instead of int for global variables used by the signal handler. 2004-04-19 0.5.11-1 * development version with special debugging output. 2004-04-18 0.5.11 (public release) 2004-04-17 0.5.10-4 * module_powersave.c: TAG_POWERCHANGED called power_awake to reset the sleeptime counter. This has bad side effects so that the sleeptime counter is reseted directly in power_handle_tags(). As result the mode (dim or sleep) will not change on switching the power source. * module_powersave.c: Keeps track of cover status now and disables keyboard and mouse input if cover is closed. This was a problem with external mice and keyboards in conjunction with screen blanking on sleep request (debian bug #249783). * module_display.c: Keeps track of cover status now and disables keyboard input if cover is closed. * libpbbipc: cleanup_buffer() handles quoting incorrectly - fixed. 2004-04-16 0.5.10-3 * added catalan catalog file. Thanks to David Riera and Oriol Pellicer 2004-04-06 0.5.10-2 * added support for DESTDIR in make files. Thanke to Giulivo Navigante 2004-04-05 0.5.10-1 * not initialized variable flags.status in module_display - fixed. * eject CDROM uses the mountpoint now instead of the device. This leads to less trouble ejecting mounted CDs. Thanks to Soeren Sonnenburg 2004-03-31 0.5.10 (public release) 2004-03-30 0.5.9-5 * added compile time switch --enable-batcycle which enables counting of battery cycles only. To additionally write the battery data use --enable-batlog. * configure doesn't create debian/Makefile anymore * libpbbipc was needlessly build with -DBATLOG - fixed * update man page * write configfile to /etc now. All the link stuff has been removed. 2004-03-25 0.5.9-4 * increase interval for ambient update timer in display module to 1 second. * option HeartbeatBeep set to 'no' by default. Make the man page explain this feature more clearly. This feature confuses the users. 2004-03-24 0.5.9-3 * remove debian directory from distribution package * fix bug in display module: Shift+brightness key doesn't work if LCD automatic adjustment is enabled 2004-03-13 0.5.9-2 * fix bug in libpbb: set_timeforcmd() accepted negative timeout values. Now values <= 0 will be converted to 1. * pbbuttonsd.conf man page updated. 2004-03-07 0.5.9-1 * check for include file initreq.h added in configure.in * module_powersave.c changed to compile with/without initreq.h Thanks to Nigel Horne for the hint. * module_pmac.c calculates feedback from LCD backlight to ambient light sensors and returns a compensated value now. * fix cosmetic bug in module_display.c on i386 machines. Thanks to Nigel Horne for reporting. * debug system modified to allow better control of debug output. 2004-03-04 0.5.9 (public release) * man-pages updated * pbbcmd and module_peep.c updated * added pwrctl-wrapper script to support debian apm scripts 2004-02-25 0.5.8-12 * add tags for automatic adjustment range. One for running on battery, one for running on AC. 2004-02-22 0.5.8-11 * change timing of client message from module_cdrom to get a more convenient behaviour. * German translations updated * man-pages updated * added some flags to Sysinfo tag: pmud support, sleep support 2004-02-21 0.5.8.10 * moved write configfile stuff to module_system. * added new info tag TAG_SYSINFO which holds a set of current server options. 2004-02-20 0.5.8-9 * bugfix in module_display.c regarding ambient light management. Thanks to Federico Gamio * initialize keyboard illumination at startup (switch it off). 2004-02-19 0.5.8-8 * tag AMBIENTTHRESHOLD renamed to KBDTHRESHOLD and the new tag LCDTHRESHOLD added. Configfile updated to reflect this * changed ambient light algorithm to that one used in lmud * removed kernel i2c include files and replaced them with that one from lmsensors. 2004-02-17 0.5.8-7 * module_pmac.c: lmu_get_ambient() changed to cope better with shadows and spot lights on one of the ambient light sensors. 2004-02-10 0.5.8-6 * README updated * german translations updated * debug messages cleanup 2004-02-09 0.5.8-5 * pbbcmd and pbbuttonsd.conf man-page updated * cdrom module now looks into /proc/mounts to check if the cdrom device is mounted or not. * cdrom module sends now the tag TAG_EJECTCD to clients on every eject CD event. The argument tells the client about the success of the eject process. * new tag TAG_TIMEFORCMD added for adjusting the timeout of scripts and helper programs. Tag also added in pbbcmd and module_peep.c * pbblib updated: The exit code of the last launched program can be read with the function get_lastrc() now. 2004-02-08 0.5.8-4 * restructured configuration options for display module * beautify saved config file * default config file updated * configuration man-page updated * scale of the ambient sensor changed to percent. * eject CD event sends now a signal to all clients. This signal is also sent, if eject has failed due to umount(). This will be fixed in the future. * with configure option --with-pmud the linker can't find pmac_cover_position() - fixed. * modified equations for automatically calculated brightness levels so that the user keeps in control. An offset shifts the characteristic curve according users will. 2004-02-07 0.5.8-3 * bug in scan_kbddevices() fixed. keyboards are correctly unregistered now. * support generic i386 laptops without laptop dependent features. Call ./configure LAPTOP=i386 to activate. * module_display.c reworked to fully support keyboard illumination and the ambient light sensor on aluminum PowerBooks. * some tags related to the display module renamed and some added. most of them regarding the hotkey definitions. see pbbtags.h for complete list. * module_peep.c and pbbcmd updated to support the new and the renamed tags. * some options of the config file added and some renamed to match the changes in module_display.c 2004-01-31 0.5.8-2 * modules_display.c updated. LCD Brightness will be adjusted automatically and keyboard illumination change smoothly. Thanks to Andreas Jaggi for his patch. 2004-01-23 0.5.8-1 * implemented some functions to access lmu (i2c device for the keyboard illumination and the ambient light sensors of new aluminium PowerBooks. Thanks for code fragments from Andreas Jaggi and Alexander Clausen. 2004-01-18 0.5.8 (public release) 2004-01-17 0.5.7-4 * check for root added in module loader code in input_manager.c. * autogen.sh modified to cope with gettext 0.11.3 and above and also with its predecessors. First update had problems. * Add new option 'HeartbeatBeep' in module powersave.c. Configfile and man-page updated. * New option also added to pbbcmd. * moved to gettext 0.13.1 2004-01-08 0.5.7-3 * added code to input_manager.c to load the kernel module evdev if necessary. Thanks to Wolfram Quester for the patch. * updated german language file 2003-12-29 0.5.7-2 * configure.in and /po changed to work also if GNU gettext version >0.11.3 is installed. New version of autogen.sh 2003-12-27 0.5.7-1 * After wake up with closed cover the machine didn't go to sleep again - fixed. This happens for example when USB devices are connected/disconnected during sleep. 2003-12-19 0.5.7 (public release) 2003-12-11 0.5.6-4 * libmisc.c uses C++ keywords that causes a compile conflict with C++ compilers - fixed. 2003-12-05 0.5.6-3 * the new options onXX_coversleep weren't read from configfile - fixed * timeout for scripts was to short - extended to four seconds. * scan_for_kbdevdevs() did't close all file handles - fixed. 2003-11-17 0.5.6-2 * module_pmac.c reads flags from /proc/pmu/battery_% as decimal instead of hexadecimal. This could lead to wrong charging detection - fixed. 2003-11-13 0.5.6-1 * configure flag --with-pmud added to decide at compile time to use pmud or not. * option 'replace_pmud' removed. pmud support have to compiled in now. Default is compiling without pmud support. 2003-11-12 0.5.6 (public release) 2003-11-09 0.5.5-7 * moved foreign code from inputhandler.c to new module_system.c * man pages updated * german language files updated 2003-11-08 0.5.5-6 * Added filter reset in module_pmac to prevent erroneous battery warning due to transient oscillation of the filtered time remaining. * added function to unregister inputhandler again. * extend keyboard event device scanning so that it becomes able to scan the devices to get changes. * connect scan of event devices to the HUP signal. * add option for enabling automatic scan every 5 seconds. 2003-11-04 0.5.5-5 * warnlevel 0 wasn't send if woke up with recharged battery - fixed. * add error message E_NOSUPPORT for requested but not supported functions. module_peep.c and pbbcmd updated. * setting EMA_SLEEP with no sleep support will cause an error message now. * TAG_DIMFULLYDARK in module_display added. * module_powersave: screen off instead of sleep didn't work correctly because a broken keyboard handler - fixed. * TAG_ONACCOVERSLEEP and TAG_ONBATTERYCOVERSLEEP added to make behaviour after cover closed independently configurable. * TAG_ONACBLANK and TAG_ONBATTERYBLANK removed. * play a beep every 30 seconds when the screen is dark so the user knows the machine is still alive. * allow sleepkey also if sleep is not supported (display will be switched off in this case). 2003-11-01 0.5.5-4 * update battery status and warnlevel in module poversave after wakeup. * Send battery warnlevel 0 to clients after we had a warnlevel greater than zero and the AC connector was plugged in. 2003-10-31 0.5.5-3 * insert 1s delay between sending 'going to sleep' signal and entering sleep mode to give clients enough time to process the signal. This delay only occur at sleep requests coming from the sleepkey. 2003-10-30 0.5.5-2 * New option 'FadingSpeed' and new Tag TAG_FADINGSPEED added for module_display. * added 10ms timer callback for module_display. * brightness could be faded up and down smoothly now. the timer callback is in control for that. 2003-10-29 0.5.5-1 * collect all keyboard event devices now not only the internal keyboard and the button device. * openeventdev() removed * moved open event devices to inputhandler.c * MAXINPUTS increased from 4 to 8 2003-10-06 0.5.5 (public release) * fix ipc_exit() to handle parent and child correctly 2003-10-02 0.5.4d * unused include file pbblib.h removed * artefacts from init.c removed * added optional pidfile argument for command line switch '-d' * ordered help text a little bit * rewrite the daemonize code. A welcome message will always be printed to console now and additionally written to the log file if running as daemon. * the pid of the daemon will be written to /var/run/. * updated debian startscript for server. 2003-10-01 0.5.4c * added two functions in libpbb: find_tagitem() and taglist_count() * update key & modifier functions in configfile.c * empty filename will be accepted now. Empty names for devices and symlinks are still not allowed. * implemented support for ejecting a CDROM. The external program 'eject' isn't necessary anymore. * trap empty script names in call_script() in support.c 2003-09-24 0.5.4b * processing the configuration at startup launches some empty scripts - fixed * launching the power changed script at startup broken - fixed. * got rid of system() call, replaced by more secure launch_program() in pbb_misc.c. * ordered some mess with fixed buffer length * use geteuid() for security checks instead of getuid() * remove TAG_SLEEPINSECONDS from pbbcmd.c 2003-09-23 0.5.4a * power profile did not change after changing powersource during sleep. Thanks to Stephan Helma * fix for Makefile.am. Thanks to Stephan Helma * preparations to handle more than Apple Laptops * strcmp_nocase() in pbb_misc.c replaced by strcasecmp() in libc. code cleanup in pbbcmd and pbbuttonsd. 2003-09-13 0.5.4 (public release) * some internationalizing in module_peep * package pbbcmd integrated in pbbuttonsd. Pbbcmd makes no sense as independent package. * config.h missing in some sourcefiles - fixed * problems with translating comment for configfile - fixed 2003-09-10 0.5.3g * after awake from sleep some data in module_poversave wasn't immediately updated. It operates up to 100ms with old data. This could have caused different strange behaviour like shutdown or sleep immediately after the machine has awaken or shutdown after last disentangled warning even though the AC connector has been plugged in recently (debian bug #183614) - fixed. * script arguments for SCRIPT_PROFCHANGED changed: the arguments 'ac' and 'battery' were replaced by 'profile'. A second argument containing the powersource was added. * TAG_TIMEREMAINING and TAG_POWERSOURCE disentangled, because config and query operations with this tags were done by two different modules, which causes responsibility problems. To keep compatibility to existing clients, the tag values weren't changed. But this have to be done in an later restructuring of the interfaces. 2003-09-09 0.5.3f * mark TAG_BRIGHTNESSOP and TAG_COVERSTATUS as private * some code cleanup in display module(5 to go) * some code cleanup in input manager (4 to go) * some code cleanup in module ossmixer (3 to go) * some code cleanup in module cdrom (2 to go) * some code cleanup in module pmac(1 to go) * some code cleanup in module poversave ( done ) * preventing TAG_TIMEREMAINING from sending if AC power is connected. In conjunction with changing default low battery emergency behaviour the 'laptop halted' problem (debian bug #183614) should be solved. 2003-09-08 0.5.3e * empty strings in configfile causes segfault - fixed. * typo in framebuffer device default setting - fixed * configfile could be saved now (/var/lib/pbbuttons/). 2003-09-07 0.5.3d * some code restructuring in input manager. moved some code from pbbuttonsd.c to input_manager.c to make custom input managers possible. * moved the timer code from pbbuttonsd.c to input_manager.c * some general code cleanup * work around for kernel problem: booting without batteries connected in module_pmac.c#pmac_update_batteryinfo() implemented. 2003-09-06 0.5.3c * bug in warning level calculation makes it impossible to step a warninglevel up again - fixed. * powerwait and powerokwait implemented. SIGPWR to the init process works. * IPC signals routed through the module_peep for debugging This is only active if compiled with DEBUG. * TAG_IDENTITY added. The identity string is printed to console at pbbuttonsd startup. * The profile-changed-script and HDSetup-script will now be started at pbbuttonsd startup to do initial settings. * removed default settings for script_batcritical. Default emergency behaviour is now sleep. No shutdown anymore unless it's explicit configured. * scripts were now checked for permissions and owner to improve security. 2003-09-05 0.5.3b * TAG_ONBATTERYCRITICALSLEEP removed and replaced by TAG_EMERGENCYACTION with four commands: EMA_SLEEP, EMA_SIGNAL and EMA_COMMAND. * Signal to INIT process integrated. It uses first the new method via /dev/initctl and second if that failed the old method via /etc/powerstatus. * Module_peep writes a battery profile in /var/lib/pbbuttons/xxx_battery.log. This is only active if compiled with DEBUG. 2003-09-04 0.5.3a * ToDo List updated * Changed to new Version of autoconf/automake. The header acconfig.h was removed 2003-04-13 0.5.3a * The CDROM device could be missing now. The check at startup has been adjusted. 2003-03-16 0.5.3 * sleepkeydelay works again * sleepkeydelay and ejectcdkeydelay changed to use time periods in milliseconds instead of counting repeating keys. (debian bug #164882). * typo in option EjectCDKeyDelay in configfile - fixed (debian bug #184323) * option MixerChannels added to control which channels should be controlled by the volume keys (debian bug #176000). * pbbuttonsd failed if the mixer device didn't exist even if mixer_delayed was set. This problem occurred with devfs. Now, if mixer_delayed was set, a missing mixer device wouldn't cause an error messages or hinder pbbuttonsd to startup (debian bug #182218). * EjectCDKey in default config file set again to 161. This is the correct value for iBooks. * option 'userallowed' added to imrove security of the ipc-interface (debian bug #164881). First step done. maybe further steps will follow. 2002-12-22 0.5.2b * config file option 'replace_pmud' did nothing, fixed. 2002-10-13 0.5.2a * new include file pbbinput.h to add brightness keys to make compiling with older kernels possible. 2002-10-03 0.5.2 * documentation updated * catalogs updated 2002-08-24 0.5.1a * code changed to use the new library libpbb * code cleanup regarding error messages * TAG_SLEEPINSECONDS was mistakenly marked as private -> fixed * Sleepmessages were sent to clients even though the machine doesn't support sleep mode -> fixed 2002-07-22 0.5.0p * powersave: changed 10ms functions to 100ms interval 10ms timer removed * effect of sleeplocks reorganised, priority reduced * display: added framebuffer blank and the Tags * TAG_FRAMEBUFFERDEVICE and TAG_BLANKFRAMEBUFFER to control this function. 2002-07-10 0.5.0p * implemented sleeplocks for cpuload and netload 2002-07-07 0.5.0p * implement new improved error management for Tags * the exitcode gives detailed information about the malfunction. 2002-07-05 0.5.0p * security improvement: scripts are only changeable by the effective process owner of pbbuttonsd. 2002-07-03 0.5.0p * pmac: fixed cover status and OHARE button level evaluation. 2002-07-02 0.5.0p * powersave: script for profile change implemented * powersave: script for HD setup implemented * powersave, pmac: TAG_PREPAREFORSLEEP and TAG_WAKEUPFROMSLEEP added * peep: TAG_PREPAREFORSLEEP, TAG_WAKEUPFROMSLEEP, TAG_SCRIPT_PROFCHANGED and TAG_SCRIPT_HDSETUP added 2002-06-30 0.5.0p * module test renamed to peep and bound to compile option DEBUG. * added TAG_SKIP to list in module_peep. 2002-06-25 0.5.0p * main loop changed. return code <0 from select() won't abort the program anymore. Signal handling is done instead. * SIGHUP implemented. * config table in read_configfile() set to static due to a segfault on receiving SIGHUP. * added filter for internal private tags in IPC-receive() 2002-05-06 0.5.0p * start of pbbuttonsd restructuring. 2002-05-05 0.4.9 * new IPC commands to support new PowerPrefs features 2002-05-01 0.4.8p * added check if sleep is supported * added option 'blank_screen' as alternative to sleep * cleanup sleep code 2002-04-28 0.4.8p * added feature to save the configuration via PowerPrefs * mouse input was ignored if started with sleep disabled and would be enabled later on. * added italian translation file, Thanks to Gioele Barabucci 2002-04-20 0.4.8 * public release 2002-04-17 0.4.7p * fixed a bad behaviour with manually set backlight level of zero. * fixed another problem in battery status routines and warning level calculation. 2002-04-14 0.4.7p * fixed a bug in time remaining calculation with more than one battery. Implemented an work-around for a kernel problem. Thanks to Michael G Schwern 2002-04-09 0.4.7 * another bugfix in calculation of battery warnlevels thanks to Vincent Katz * warning added if kernel doesn't support /proc/pmu * configfile will now be read from sysconfdir defined by ./configure rather than hard-coded from /etc * Makefile adapted to adjustable config file location thanks to Uwe Steinmann and to Ralf Ertzinger 2002-04-07 0.4.7 * added commands to get and set trackpad, keyboard and pbbuttonsd configuration. Preparation for new client PowerPrefs. 2002-04-03 0.4.6 * bugfix in calculation of battery warnlevels 2002-03-31 0.4.5 * swaped the configuration from command line to a configuration file. * tpmode and snooze keys are now configurable * the delay of the snooze key could be disabled now 2002-03-24 0.4.5 * some code cleanup in event.c * Test added in do_delayed_jobs() if user released any keys before perform trackpad configuration or trigger sleep mode. 2002-03-23 0.4.5 * If battery is critically low, the machine will be shut down. * The keyboard settings are now kept during sleep (only Powerbooks G3/G4 that support this) * The trackpad mode could now be toogled with alt+brightnesskeys (up/down). * with alt+mute the sleep mode could be triggered (delayed key, press 3-4 seconds). * problem with delayed keys fixed 2002-03-17 0.4.4 * If the machine is idle first the display will be dimmed and after some additional idle time it will go to sleep * add command line switch '-n (nosleep)' to disable the dim/sleep feature on user demand. 2002-03-15 0.4.3 * add the command line switch '-e' which causes that the eject key has to be constantly pressed for 3-4 seconds to react. * put some flags into an bitfield. 2002-03-08 0.4.3 * program returns now positive error codes * if started as daemon, error messages would be redirected to SYSLOG * pbbuttonsd reads battery states now from /proc/pmu. this should work on every supported machine. 2002-03-07 0.4.2a * fixed a problem with the exit code. * fixed serious bug that caused a segfault when the program exited (Thanks to Geof) 2002-03-06 0.4.2 * The server was put to a separate package. * removed package name from package data directory * adapt some texts to the new package name * update the documentation * open mixer device only if needed. Calculate hardware independent volume values by myself. ------------------------------------------------------------------------ 2002-03-03 * Server calculates battery warnlevels and sends alarm messages to clients. * little sequencing problem with detach option in client and server fixed. * Client displays battery warnings now. * Client got the option to play a sound during volume adjustment or play alarm sound at battery warnings. 2002-02-28 0.4.1 * Server sends exit-message to clients, when it exits. * Client exited, if it receives the exit-message. * Server polls the pmu and collects data about the cover, the states of the batteries, the volume and brightness buttons and pmu version. Pollcycle was reduced from 100ms to 10ms. 2002-02-26 0.4 * package divided into client and server. The server could run as root and the client could run as user. The communication is done via SystemV IPC messages. * low level IPC functions were exported to a static library. * the directory structure was reorganized * newly created and updated man pages for client and server 2002-02-22 0.3.3 * mixer code reworked to fix some problems with newer PowerMac sound hardware, especially iBook2 and new TiBooks. * changed lockfile name to a more conventional one. * backlight control adapted to new kernel features. Since 2.4.18-rc2-benh the PPC branch of the kernel allow backlight control trough user space programs. In this context the default keycodes for brightness control changed to new kernel defined values. Thanks to Ben Herrenschmidt 2002-02-21 0.3.2 * changed mixer code for verification trough beta testers. 2002-02-20 0.3.1 * added new comand line switch 'd --detach', so PBButtons could be started now as background process. * running PBButtons as daemon causes high CPU time consuming - fixed. Thanks to Uwe Steinmann . * PBButtons now would use alternative PMU and Mixer devices, if specified. exchanged hard wired device names with dynamic ones. * fixed some problems, if compiled with optimization switched on. 2002-02-18 0.3 * added I18N support with GNU gettext * added setup-script to check and setup used devices and directories with suitable user permissions. 2002-02-16 0.2.1 * PBButtons works now with ALSA 0.9.x via OSS emulation. The mixer device must not to be closed after each adjustment. If so the ALSA OSS-emu mixer would forget the device independent volume levels. The mixer device will now be kept open while the program is running. 2002-02-14 0.2 * program take care about multiply instances. * defined exit procedure via sighandlers. * improved error handling. * general code cleanup * work with ALSA stable (0.5.x) via OSS emulation * devices, keycodes and lockfile are now configurable via comand line 2002-02-06 0.1 * inital release pbbuttonsd-0.8.1a/INSTALL0000644000175000017500000002243210532451262012022 00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Here is a another example: /bin/bash ./configure CONFIG_SHELL=/bin/bash Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent configuration-related scripts to be executed by `/bin/bash'. `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. pbbuttonsd-0.8.1a/NEWS0000644000175000017500000000000010641704554011461 00000000000000pbbuttonsd-0.8.1a/TODO0000644000175000017500000000114110641704554011461 00000000000000 TODO ==== - some modules still missing for other architectures and laptop models - change libpbbipc so that clients could survive an daemon's exit and resyncronize after the daemon have reappeared. - move pbbuttonsd more towards kernel 2.6: - use hotplug or HAL to get informed about new input devices - IBaM data currently uses angloamerican locale by chance. This must be implemented more reliable. - make IPC interface asynchron so that messages could be processed while pbbuttonsd is waiting for an external process. - build a 1. pmu and OF lib 2. sysfs lib Good ideas are always welcome. pbbuttonsd-0.8.1a/config.guess0000755000175000017500000012626010466646770013335 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-07-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[3456]*) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T:Interix*:[3456]*) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: pbbuttonsd-0.8.1a/config.rpath0000755000175000017500000003744410641704556013322 00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2006 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's _LT_CC_BASENAME. for cc_temp in $CC""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; darwin*) case $cc_basename in xlc*) wl='-Wl,' ;; esac ;; mingw* | pw32* | os2*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; newsos6) ;; linux*) case $cc_basename in icc* | ecc*) wl='-Wl,' ;; pgcc | pgf77 | pgf90) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) wl='-Wl,' ;; esac ;; esac ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; sco3.2v5*) ;; solaris*) wl='-Wl,' ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) wl='-Wl,' ;; sysv4*MP*) ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we cannot use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; interix3*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' else ld_shlibs=no fi ;; esac ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then hardcode_libdir_flag_spec= fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if test "$GCC" = yes ; then : else case $cc_basename in xlc*) ;; *) ld_shlibs=no ;; esac fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd1*) ld_shlibs=no ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | kfreebsd*-gnu | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no ;; *) hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; openbsd*) hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. libname_spec='lib$name' case "$host_os" in aix3*) ;; aix4* | aix5*) ;; amigaos*) ;; beos*) ;; bsdi[45]*) ;; cygwin* | mingw* | pw32*) shrext=.dll ;; darwin* | rhapsody*) shrext=.dylib ;; dgux*) ;; freebsd1*) ;; kfreebsd*-gnu) ;; freebsd* | dragonfly*) ;; gnu*) ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac ;; interix3*) ;; irix5* | irix6* | nonstopux*) case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux*) ;; knetbsd*-gnu) ;; netbsd*) ;; newsos6) ;; nto-qnx*) ;; openbsd*) ;; os2*) libname_spec='$name' shrext=.dll ;; osf3* | osf4* | osf5*) ;; solaris*) ;; sunos4*) ;; sysv4 | sysv4.3*) ;; sysv4*MP*) ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) ;; uts4*) ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: pbbuttonsd-0.8.1a/depcomp0000755000175000017500000003710010532451263012345 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2005-07-09.11 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mecanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: pbbuttonsd-0.8.1a/install-sh0000755000175000017500000002202110532451262012767 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2005-05-14.22 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` shift IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit 1; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit 0 } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: pbbuttonsd-0.8.1a/missing0000755000175000017500000002540610532451262012374 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2005-06-08.21 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: pbbuttonsd-0.8.1a/mkinstalldirs0000755000175000017500000000370410641704560013603 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" 1>&2 exit 0 ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # End: # mkinstalldirs ends here pbbuttonsd-0.8.1a/ccdv.c0000644000175000017500000002304210641704555012061 00000000000000/* ccdv.c * * Copyright (C) 2002-2003, by Mike Gleason, NcFTP Software. * All Rights Reserved. * * Licensed under the GNU Public License. */ #include #include #include #include #include #include #include #include #include #define SETCOLOR_SUCCESS (gANSIEscapes ? "\033\1331;32m" : "") #define SETCOLOR_FAILURE (gANSIEscapes ? "\033\1331;31m" : "") #define SETCOLOR_WARNING (gANSIEscapes ? "\033\1331;33m" : "") #define SETCOLOR_NORMAL (gANSIEscapes ? "\033\1330;39m" : "") #define TEXT_BLOCK_SIZE 8192 #define INDENT 2 #define TERMS "vt100:vt102:vt220:vt320:xterm:xterm-color:ansi:linux:scoterm:scoansi:dtterm:cons25:cygwin" size_t gNBufUsed = 0, gNBufAllocated = 0; char *gBuf = NULL; int gCCPID; char gAction[200] = ""; char gTarget[200] = ""; char gAr[32] = ""; char gArLibraryTarget[64] = ""; int gDumpCmdArgs = 0; char gArgsStr[1000]; int gColumns = 80; int gANSIEscapes = 0; int gExitStatus = 95; static void DumpFormattedOutput(void) { char *cp; char spaces[8 + 1] = " "; char *saved; int curcol; int i; curcol = 0; saved = NULL; for (cp = gBuf + ((gDumpCmdArgs == 0) ? strlen(gArgsStr) : 0); ; cp++) { if (*cp == '\0') { if (saved != NULL) { cp = saved; saved = NULL; } else break; } if (*cp == '\r') continue; if (*cp == '\t') { saved = cp + 1; cp = spaces + 8 - (8 - ((curcol - INDENT - 1) % 8)); } if (curcol == 0) { for (i = INDENT; --i >= 0; ) putchar(' '); curcol = INDENT; } putchar(*cp); if (++curcol == (gColumns - 1)) { putchar('\n'); curcol = 0; } else if (*cp == '\n') curcol = 0; } free(gBuf); } /* DumpFormattedOutput */ /* Difftime(), only for timeval structures. */ static void TimeValSubtract(struct timeval *tdiff, struct timeval *t1, struct timeval *t0) { tdiff->tv_sec = t1->tv_sec - t0->tv_sec; tdiff->tv_usec = t1->tv_usec - t0->tv_usec; if (tdiff->tv_usec < 0) { tdiff->tv_sec--; tdiff->tv_usec += 1000000; } } /* TimeValSubtract */ static void Wait(void) { int pid2, status; do { status = 0; pid2 = (int) waitpid(gCCPID, &status, 0); } while (((pid2 >= 0) && (! WIFEXITED(status))) || ((pid2 < 0) && (errno == EINTR))); if (WIFEXITED(status)) gExitStatus = WEXITSTATUS(status); } /* Wait */ static int SlurpProgress(int fd) { char s1[71]; char *newbuf; int nready; size_t ntoread; ssize_t nread; struct timeval now, tnext, tleft; fd_set ss; fd_set ss2; const char *trail = "/-\\|", *trailcp; trailcp = trail; snprintf(s1, sizeof(s1), "%s%s%s... ", gAction, gTarget[0] ? " " : "", gTarget); printf("\r%-70s%-9s", s1, ""); fflush(stdout); gettimeofday(&now, NULL); tnext = now; tnext.tv_sec++; tleft.tv_sec = 1; tleft.tv_usec = 0; FD_ZERO(&ss2); FD_SET(fd, &ss2); for(;;) { if (gNBufUsed == (gNBufAllocated - 1)) { if ((newbuf = (char *) realloc(gBuf, gNBufAllocated + TEXT_BLOCK_SIZE)) == NULL) { perror("ccdv: realloc"); return (-1); } gNBufAllocated += TEXT_BLOCK_SIZE; gBuf = newbuf; } for (;;) { ss = ss2; nready = select(fd + 1, &ss, NULL, NULL, &tleft); if (nready == 1) break; if (nready < 0) { if (errno != EINTR) { perror("ccdv: select"); return (-1); } continue; } gettimeofday(&now, NULL); if ((now.tv_sec > tnext.tv_sec) || ((now.tv_sec == tnext.tv_sec) && (now.tv_usec >= tnext.tv_usec))) { tnext = now; tnext.tv_sec++; tleft.tv_sec = 1; tleft.tv_usec = 0; printf("\r%-71s%c%-7s", s1, *trailcp, ""); fflush(stdout); if (*++trailcp == '\0') trailcp = trail; } else { TimeValSubtract(&tleft, &tnext, &now); } } ntoread = (gNBufAllocated - gNBufUsed - 1); nread = read(fd, gBuf + gNBufUsed, ntoread); if (nread < 0) { if (errno == EINTR) continue; perror("ccdv: read"); return (-1); } else if (nread == 0) { break; } gNBufUsed += nread; gBuf[gNBufUsed] = '\0'; } snprintf(s1, sizeof(s1), "%s%s%s: ", gAction, gTarget[0] ? " " : "", gTarget); Wait(); if (gExitStatus == 0) { printf("\r%-70s", s1); printf("[%s%s%s]", ((gNBufUsed - strlen(gArgsStr)) < 4) ? SETCOLOR_SUCCESS : SETCOLOR_WARNING, "OK", SETCOLOR_NORMAL); printf("%-5s\n", " "); } else { printf("\r%-70s", s1); printf("[%s%s%s]", SETCOLOR_FAILURE, "ERROR", SETCOLOR_NORMAL); printf("%-2s\n", " "); gDumpCmdArgs = 1; /* print cmd when there are errors */ } fflush(stdout); return (0); } /* SlurpProgress */ static int SlurpAll(int fd) { char *newbuf; size_t ntoread; ssize_t nread; printf("%s%s%s.\n", gAction, gTarget[0] ? " " : "", gTarget); fflush(stdout); for(;;) { if (gNBufUsed == (gNBufAllocated - 1)) { if ((newbuf = (char *) realloc(gBuf, gNBufAllocated + TEXT_BLOCK_SIZE)) == NULL) { perror("ccdv: realloc"); return (-1); } gNBufAllocated += TEXT_BLOCK_SIZE; gBuf = newbuf; } ntoread = (gNBufAllocated - gNBufUsed - 1); nread = read(fd, gBuf + gNBufUsed, ntoread); if (nread < 0) { if (errno == EINTR) continue; perror("ccdv: read"); return (-1); } else if (nread == 0) { break; } gNBufUsed += nread; gBuf[gNBufUsed] = '\0'; } Wait(); gDumpCmdArgs = (gExitStatus != 0); /* print cmd when there are errors */ return (0); } /* SlurpAll */ static const char *Basename(const char *path) { const char *cp; cp = strrchr(path, '/'); if (cp == NULL) return (path); return (cp + 1); } /* Basename */ static const char * Extension(const char *path) { const char *cp = path; cp = strrchr(path, '.'); if (cp == NULL) return (""); // printf("Extension='%s'\n", cp); return (cp); } /* Extension */ static void Usage(void) { fprintf(stderr, "Usage: ccdv /path/to/cc CFLAGS...\n\n"); fprintf(stderr, "I wrote this to reduce the deluge Make output to make finding actual problems\n"); fprintf(stderr, "easier. It is intended to be invoked from Makefiles, like this. Instead of:\n\n"); fprintf(stderr, "\t.c.o:\n"); fprintf(stderr, "\t\t$(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) $< -c\n"); fprintf(stderr, "\nRewrite your rule so it looks like:\n\n"); fprintf(stderr, "\t.c.o:\n"); fprintf(stderr, "\t\t@ccdv $(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) $< -c\n\n"); fprintf(stderr, "ccdv 1.1.0 is Free under the GNU Public License. Enjoy!\n"); fprintf(stderr, " -- Mike Gleason, NcFTP Software \n"); exit(96); } /* Usage */ int main(int argc, char **argv) { int pipe1[2]; int devnull; char emerg[256]; int fd; int nread; int i; int cc = 0, pch = 0; const char *quote; if (argc < 2) Usage(); snprintf(gAction, sizeof(gAction), "Running %s", Basename(argv[1])); memset(gArgsStr, 0, sizeof(gArgsStr)); for (i = 1; i < argc; i++) { // printf("argv[%d]='%s'\n", i, argv[i]); quote = (strchr(argv[i], ' ') != NULL) ? "\"" : ""; snprintf(gArgsStr + strlen(gArgsStr), sizeof(gArgsStr) - strlen(gArgsStr), "%s%s%s%s%s", (i == 1) ? "" : " ", quote, argv[i], quote, (i == (argc - 1)) ? "\n" : ""); if ((strcmp(argv[i], "-o") == 0) && ((i + 1) < argc)) { if (strcasecmp(Extension(argv[i + 1]), ".o") != 0) { strcpy(gAction, "Linking"); snprintf(gTarget, sizeof(gTarget), "%s", Basename(argv[i + 1])); } } else if (strchr("-+", (int) argv[i][0]) != NULL) { continue; } else if (strncasecmp(Extension(argv[i]), ".c", 2) == 0) { cc++; snprintf(gTarget, sizeof(gTarget), "%s", Basename(argv[i])); // printf("gTarget='%s'\n", gTarget); } else if ((strncasecmp(Extension(argv[i]), ".h", 2) == 0) && (cc == 0)) { pch++; snprintf(gTarget, sizeof(gTarget), "%s", Basename(argv[i])); } else if ((i == 1) && (strcmp(Basename(argv[i]), "ar") == 0)) { snprintf(gAr, sizeof(gAr), "%s", Basename(argv[i])); } else if ((gArLibraryTarget[0] == '\0') && (strcasecmp(Extension(argv[i]), ".a") == 0)) { snprintf(gArLibraryTarget, sizeof(gArLibraryTarget), "%s", Basename(argv[i])); } } if ((gAr[0] != '\0') && (gArLibraryTarget[0] != '\0')) { strcpy(gAction, "Creating library"); snprintf(gTarget, sizeof(gTarget), "%s", gArLibraryTarget); } else if (pch > 0) { strcpy(gAction, "Precompiling"); } else if (cc > 0) { strcpy(gAction, "Compiling"); } if (pipe(pipe1) < 0) { perror("ccdv: pipe"); exit(97); } (void) close(0); devnull = open("/dev/null", O_RDWR, 00666); if ((devnull != 0) && (dup2(devnull, 0) == 0)) close(devnull); gCCPID = (int) fork(); if (gCCPID < 0) { (void) close(pipe1[0]); (void) close(pipe1[1]); perror("ccdv: fork"); exit(98); } else if (gCCPID == 0) { /* Child */ (void) close(pipe1[0]); /* close read end */ if (pipe1[1] != 1) { /* use write end on stdout */ (void) dup2(pipe1[1], 1); (void) close(pipe1[1]); } (void) dup2(1, 2); /* use write end on stderr */ execvp(argv[1], argv + 1); perror(argv[1]); exit(99); } /* parent */ (void) close(pipe1[1]); /* close write end */ fd = pipe1[0]; /* use read end */ gColumns = (getenv("COLUMNS") != NULL) ? atoi(getenv("COLUMNS")) : 80; gANSIEscapes = (getenv("TERM") != NULL) && (strstr(TERMS, getenv("TERM")) != NULL); gBuf = (char *) malloc(TEXT_BLOCK_SIZE); if (gBuf == NULL) goto panic; gNBufUsed = 0; gNBufAllocated = TEXT_BLOCK_SIZE; if (strlen(gArgsStr) < (gNBufAllocated - 1)) { strcpy(gBuf, gArgsStr); gNBufUsed = strlen(gArgsStr); } if (isatty(1)) { if (SlurpProgress(fd) < 0) goto panic; } else { if (SlurpAll(fd) < 0) goto panic; } DumpFormattedOutput(); exit(gExitStatus); panic: gDumpCmdArgs = 1; /* print cmd when there are errors */ DumpFormattedOutput(); while ((nread = read(fd, emerg, (size_t) sizeof(emerg))) > 0) (void) write(2, emerg, (size_t) nread); Wait(); exit(gExitStatus); } /* main */ pbbuttonsd-0.8.1a/autogen.sh0000755000175000017500000001134310641704555013000 00000000000000#!/bin/bash # Run this to generate all the initial makefiles, etc. srcdir=`dirname $0` PKG_NAME="the package." DIE=0 (autoconf --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`autoconf' installed to." echo "Download the appropriate package for your distribution," echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" DIE=1 } (grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && { (libtool --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`libtool' installed." echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz" echo "(or a newer version if it is available)" DIE=1 } } grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && { grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \ (gettext --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`gettext' installed." echo "Get ftp://alpha.gnu.org/gnu/gettext-X.XX.XX.tar.gz" DIE=1 } } # gettext's autopoint script checks for AM_GNU_GETTEXT_VERSION at the # first row of the line, so there could be problems differentiating between # gettext version with and without this script, because prior versions # don't know the AM_GNU_GETTEXT_VERSION macro (autopoint --version) < /dev/null > /dev/null 2>&1 && { grep "^AM_GNU_GETTEXT_VERSION" $srcdir/configure.in >/dev/null || { echo echo "**Error**: Set AM_GNU_GETTEXT_VERSION(x.yy.zz) in configure.in" echo " when using autopoint from gettext version >0.11.4" DIE=1 AUTOPOINT=no } AUTOPOINT=yes } GETTEXTIZE_OPTIONS=" --force --copy" # check if gettextize understand all options (gettestize --intl --version) < /dev/null > /dev/null 2>&1 && { GETTEXTITE_OPTIONS="$GETTEXTIZE_OPTIONS --intl" } (gettestize --no-changelog --version) < /dev/null > /dev/null 2>&1 && { GETTEXTITE_OPTIONS="$GETTEXTIZE_OPTIONS --no-changelog" } (automake --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`automake' installed." echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz" echo "(or a newer version if it is available)" DIE=1 NO_AUTOMAKE=yes } # if no automake, don't bother testing for aclocal test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: Missing \`aclocal'. The version of \`automake'" echo "installed doesn't appear recent enough." echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz" echo "(or a newer version if it is available)" DIE=1 } if test "$DIE" -eq 1; then exit 1 fi if test -z "$*"; then echo "**Warning**: I am going to run \`configure' with no arguments." echo "If you wish to pass any to it, please specify them on the" echo \`$0\'" command line." echo fi case $CC in xlc ) am_opt=--include-deps;; esac for coin in `find $srcdir -name configure.in -print` do dr=`dirname $coin` if test -f $dr/NO-AUTO-GEN; then echo skipping $dr -- flagged as no auto-gen else echo processing $dr macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin` ( cd $dr aclocalinclude="$ACLOCAL_FLAGS" for k in $macrodirs; do if test -d $k; then aclocalinclude="$aclocalinclude -I $k" ##else ## echo "**Warning**: No such directory \`$k'. Ignored." fi done if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then if grep "sed.*POTFILES" configure.in >/dev/null; then : do nothing -- we still have an old unmodified configure.in else echo "Creating $dr/aclocal.m4 ..." test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 # use appropiate gettext infrastructure service if [ "$AUTOPOINT" == "yes" ]; then echo "Running autopoint... " autopoint --force else echo "Running gettextize... Ignore non-fatal messages." echo "no" | gettextize $GETTEXTIZE_OPTIONS fi echo "Making $dr/aclocal.m4 writable ..." test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 fi fi if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then echo "Running libtoolize..." libtoolize --force --copy fi echo "Running aclocal $aclocalinclude ..." echo $aclocalinclude aclocal $aclocalinclude if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then echo "Running autoheader..." autoheader fi echo "Running automake --gnu $am_opt ..." automake --add-missing --gnu $am_opt echo "Running autoconf ..." autoconf ) fi done #conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c if test x$NOCONFIGURE = x; then echo Running $srcdir/configure $conf_flags "$@" ... $srcdir/configure $conf_flags "$@" \ && echo Now type \`make\' to compile $PKG_NAME else echo Skipping configure process. fi pbbuttonsd-0.8.1a/BUGS0000644000175000017500000000536710641704553011471 00000000000000 BUGS ==== - debian run-parts - There is a small problem with the debian run-parts program used for the script system. Usually pbbuttonsd set a timeout for the PMCS script to run. If this timeout was exceeded pbbuttonsd would terminate the script and ideally all its childs. But this will only work if all child processes share the same process group. Unfortunately the program run-parts creates a new process group for each running child script so that pbbuttonsd can't terminate this scripts. Pbbuttonsd will work as usual after a script error but the faulty script might remain in memory. To be save run-parts needs to be patched. Remove the function call setsid() from the source (There is only one) and recompile. A bug-report was sent to debian. This problem will only occour if your script don't work correctly. Check pbbuttonsd lock file if some of your scripts have been killed by the server and in this case check those scripts for errors. - framebuffer with no backlight controller support - If the framebuffer didn't support the LCD backlight, reading the current brightness level would result in an error. This error switch pbbuttonsd in a special emergency mode and it tries to sustain basic support and inform all clients that LCD brightness is not available. Nevertheless pbbuttonsd could be configured to switch of the framebuffer display but the result might not as expected. Depending on how good the framebuffer driver controlls the LCD backlight this basic support may show some strange side effects. This could be a sleeping machine with still illuminated LCD showing nice color patterns or the backlight won't be switched off at all (also it seems so and the display is dark). Sometimes it helps calling 'pbbcmd config lcdbacklight 0' before triggering sleep but there is no guarantee. The behaviour wouldn't change if the kernel was configured not to support the LCD backlight. I have no solution for this problems other than to fix the framebuffer driver that it supports the LCD backlight and provides a backlight controller. If you have such a machine where the LCD and mostly suspend-to-RAM also is not well supported, configure pbbuttonsd carefully and don't expect any behaviour for sure. Check it carefully and if in doubt, disable the feature. Don't use 'suspend-to-RAM' and 'blank screen' in this case. --- Be warned --- - since pbbuttons have been ported to glib, memory failures will cause immediate program termination without a chance to clean up properly. - Failing to install one or more sighandlers is only worth a warning rather than an error message. I think this won't be a problem at all because sigaction() has no real reason to fail. --- If you find other bugs or problems regarding pbbuttons, please email me. pbbuttonsd-0.8.1a/pbbcmd.10000644000175000017500000004667510641704560012324 00000000000000.\" hey, Emacs: -*- nroff -*- .\" pbbuttons is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; see the file COPYING. If not, write to .\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. .\" .TH PBBCMD 1 "February 07, 2007" .\" Please update the above date whenever this man page is modified. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins (default) .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME pbbcmd \- command line tool to communicate with pbbuttonsd. .SH SYNOPSIS .B pbbcmd .RI [\-hvi]\ .br .B pbbcmd .RI [\-hvi]\ query\ .br .B pbbcmd .RI [\-hvi]\ config\ \ .SH DESCRIPTION \fBpbbcmd\fP is a tool to communicate with pbbuttonsd. It is possible to send single commands to the daemon or ask it for certain information. It is useful for scripts or for debugging and therefore the results of queries and arguments for config operations are very basic and raw. Pbbcmd won't interpret the results for you. .SH OPTIONS \fBpbbcmd\fP accepts the following options: .TP .B \-h, \-\-help Show summary of options. .TP .B \-v, \-\-version Show version of \fBpbbcmd\fP. .TP .B \-i, \-\-ignore With this option given pbbcmd will not wait for answers from the server after a config command has been sent. It returns immediately. .PP The command tells pbbcmd what should be done. Only the commands \'query\' and \'config\' needs additional arguments. All other stand for themselves. Pbbcmd supports following commands: .TP .B query .br Reads parameters from the server and print them to terminal. This command needs the name of the desired parameter as argument. Multiple names are possible. See chapter TAGS for possible parameter names. .TP .B config .br Change server options on the fly. This command needs the parameter name and the new value as command. Multiple parameters can be changed at once. See chapter TAGS for possible parameter names. .TP .B listclients .br Receiving this command pbbuttonsd will return a list of currently attached clients. Pbbcmd will print a table containg useful information of these clients. .TP .B saveconfig .br Save current configuration to disc. This works only if all security conditions were fulfilled and pbbuttond has config writing enabled. .TP .B reinit .br This command triggers reinitialization setting of hardware components under control of pbbuttonsd (for example the trackpad and keyboard on PowerBooks). The PMCS script to set the power policy will also be lauched after this command. .TP .B ejectcd .br Eject the CDROM. .TP .B sleep .br Suspend the machine to RAM. .TP .B hibernate .br Suspend the machine to Disk. This will trigger the kernel to write the memory and all necessary process data to swap space on disk and shut the machine down. After next reboot, the system should be restored in state the system had at the time this command was triggered. This might not work on all machines. Please read the kernel documentation for more details. .SH "TAGS to use with \'config\' or \'query\'" Not every tag could be used with \fIconfig\fP and \fIquery\fP operations. The 'List of Tags' below shows how each tag could be used. The structure of this list is described as follows: .TP .br .PP The field shows what sort of data is returned or expected. Following datatypes are defined: .TP .B command This tag is a command and the argument wouldn't be evaluated. Nevertheless the config operation expected one and 0 would be ok in this cases. .TP .B string String of characters. The string must be quoted if it contains white spaces. .TP .B integer 32-bit integer values. The description would say if the value range was restricted. .TP .B bool A boolean value. A '0' means false and a '1' means true. Any other values are invalid. .TP .B keycode A keycode is an 8-bit integer. Each keycode has it's equivalent key on the keyboard. Don't confuse this with ASCII code. You could get keycodes with the program \fIshowkey\fP. .TP .B modifier A modifier is an bit-field with one bit for each modifier key: Bit 0 = 1 = shift, bit 1 = 2 = alt and bit 2 = 4 = ctrl. The three modifiers cold be combined through adding their single values. In result we get an value between 0 and 7. .SH "LIST OF TAGS" for query and config .TP TAG_AUTORESCAN bool config/query .br Enable or disable periodically scan of event devices to detect new or lost keyboards automatically. .TP TAG_VERSION string query .br Get version string of the server .TP TAG_TIMEFORCMD integer config/query .br Get or set the timeout for launched scripts or helper programs. .TP TAG_TIMEREMAINING integer query .br Get the current time in seconds the battery will last. .TP TAG_CHARGETIME integer query .br Get the time until the batteries are fully charged. .br This option would only be available, if pbbuttonsd was compiled with IBaM support. .TP TAG_POWERSOURCE bool query .br Get the current power source the machine is running on. '0' represents battery and '1' stands for AC. .TP TAG_SLEEPSUPPORTED bool query .br Check if the machine supports sleep mode. The result is '0' if not. .TP TAG_PMUDEVICE string config/query .br Get or set the pmu device. This is only useful on Apple PowerBooks and compatible. .TP TAG_ADBDEVICE string config/query .br Get or Set the ADB device. This is only useful on Apple PowerBooks and compatible. .TP TAG_TPMODEUPKEY keycode config/query .br Get or set keycode used for trackpad mode up. .TP TAG_TPMODEUPMOD modifier config/query .br Get or Set modifier used with TPMODEUPKEY. .TP TAG_TPMODEDOWNKEY keycode config/query .br Get or set keycode used for trackpad mode down. .TP TAG_TPMODEDOWNMOD modifier config/query .br Get or set modifier used with TPMODEDOWNKEY. .TP TAG_TPMODE integer config/query .br Get or set trackpad mode. Supported modes are: 0=notap, 1=tap, 2=drag. All other values are invalid. .TP TAG_NOTAPTYPING bool config/query .br Enable or disable trackpad configuration while typing. Normally the trackpad would stay in it's current mode if key on the keyboard were hit. With this option enabled the trackpad will be configured to \'notap\' while the keyboard is used. .TP TAG_KBDMODE integer config/query .br Get or set the keyboard mode. Supported values are 0=disabled, 1=fkeyslast and 2=fkeysfirst. All other values are invalid. .PP .in +7 Fn can only be disabled on PowerBooks with an USB keyboard. If you own a machine with a ADB keyboard you have to choose 'fkeyslast' or 'fkeysfirst'. \fBPBButtonsd\fP will force this setting to 'fkeyslast' if necessary. .TP TAG_BATLOG integer config/query .br Get or set the battery logging mode. Supported values are 0=none, 1=cycle and 2=log. See pbbuttonsd.cnf (5) man-page for detailed description. .TP TAG_BATCYCLE integer query .br Get the current battery cycle. A return value of \-1 shows that the battery cycle is not available. This happens if batlog has been disabled. .TP TAG_BATTERYPRESENT integer query .br Get the batteries currently present. The return value is bit-oriented. Bit 0 shows left battery and bit 1 shows the right battery. A value of 1 means only the left battery is plugged in, a value of 3 means both batteries are available. .TP TAG_LCDILLUMUPKEY keycode config/query .br Get or set keycode used for increasing display brightness. .TP TAG_LCDILLUMUPMOD modifier config/query .br Get or set modifier used with LCDILLUMUPKEY. .TP TAG_LCDILLUMDOWNKEY keycode config/query .br Get or set keycode used for decreasing display brightness. .TP TAG_LCDILLUMDOWNMOD modifier config/query .br Get or set modifier used with LCDILLUMDOWNKEY. .TP TAG_LCDBRIGHTNESS integer config/query .br Get or set current brightness level as percentage. .TP TAG_LCDAUTOADJUST integer config/query .br Enable or disable automatic brightness control for the display and set the operating mode. .TP TAG_KBDILLUMUPKEY keycode config/query .br Get or set keycode used for increasing keyboard brightness. .TP TAG_KBDILLUMUPMOD modifier config/query .br Get or set modifier used with KBDILLUMUPKEY. .TP TAG_KBDILLUMDOWNKEY keycode config/query .br Get or set keycode used for decreasing keyboard brightness. .TP TAG_KBDILLUMDOWNMOD modifier config/query .br Get or set modifier used with KBDILLUMDOWNKEY. .TP TAG_KBDILLUMONKEY keycode config/query .br Get or set keycode used to switch keyboard illumination on or off. .TP TAG_KBDILLUMONMOD modifier config/query .br Get or set modifier used with KBDILLUMONKEY. .TP TAG_KBDBRIGHTNESS integer config/query .br Get or set current brightness level as percentage. .TP TAG_KBDONBRIGHTNESS integer config/query .br Get or set default ON status brightness level as percentage. .TP TAG_KBDAUTOADJUST integer config/query .br Enable or disable automatic brightness control for the keyboard illumination and set the operating mode. .TP TAG_FRAMEBUFFERDEVICE string config/query .br Get or set the framebuffer device. .TP TAG_BLANKFRAMEBUFFER bool config/query .br Disable or enable framebuffer display blanking. If this option was enabled the framebuffer would be switched off when the backlight goes invisibly dark. .TP TAG_DIMFULLYDARK bool config/query .br Normally the display is dimmed down to minimum level. With this option set dimming goes down to complete darkness. .TP TAG_AMBIENTLIGHT integer query .br Get the raw value from the ambient light sensor. This works only on machines that have an ambient light sensor. .TP TAG_AMBIENTLIGHTMAX integer query .br Get the max value of the ambient light sensor. This works only on machines that have an ambient light sensor. .TP TAG_LCDFADINGSPEED integer config/query .br Set the time in miliseconds a full LCD backlight dim (from lowest to highest brightness level) should last. Pbbuttonsd will adjust its internal timing accordingly. A value of '0' disables smooth brightness changes. .PP .in +7 If this option is queried, pbbuttonsd will return the current setting of the internal timing. This value may differ from the originally set value because the timer could only be programmed with limited precision. .TP TAG_KBDFADINGSPEED integer config/query .br Set the time in miliseconds a full keyboard backlight dim (from lowest to highest brightness level) should last. Pbbuttonsd will adjust its internal timing accordingly. A value of '0' disables smooth brightness changes. .PP .in +7 If this option is queried, pbbuttonsd will return the current setting of the internal timing. This value may differ from the originally set value because the timer could only be programmed with limited precision. .TP TAG_MIXERDEVICE string config/query .br Get or set OSS or ASLA sound mixer device, depending on the currently active driver. .TP TAG_MIXERCHANNELS string config/query .br Get or set a comma separated list of OSS mixer channels or ALSA elements pbbuttonsd should control. Which one is expected depends on the currently active mixer driver. .PP .in +7 Every channel combination is valid nevertheless the setting makes sense. For possible ALSA element names ask amixer. .TP TAG_VOLUMEUPKEY keycode config/query .br Get or set keycode used for sound volume up. .TP TAG_VOLUMEUPMOD modifier config/query .br Get or set modifier used with VOLUMEUPKEY. .TP TAG_VOLUMEDOWNKEY keycode config/query .br Get or set keycode used for sound volume down. .TP TAG_VOLUMEDOWNMOD modifier config/query .br Get or set modifier used with VOLUMEDOWNKEY. .TP TAG_MUTEKEY keycode config/query .br Get or set keycode used for mute sound volume. .TP TAG_MUTEMOD modifier config/query .br Get or set modifier used with MUTEKEY. .TP TAG_MIXERINITDELAY bool config/query .br Disable or enable the soft start of the mixer. If this option was enabled the mixer device would be initialized with it's first use and not immediately after daemon's startup. .TP TAG_VOLUME integer config/query .br Get or set sound volume. The valid value range is from 0 (silent) to 100 (loud). Higher values will be clipped. .TP TAG_MUTE command config .br Mute/unmute the speakers. .TP TAG_CDROMDEVICE string config/query .br Get or set the CDROM device. .TP TAG_EJECTCDKEY keycode config/query .br Get or set keycode used for ejecting the CDROM. .TP TAG_EJECTCDMOD modifier config/query .br Get or set modifier used with EJECTCDKEY. .TP TAG_EJECTCDKEYDELAY bool config/query .br Disable or enable the eject key response delay. .TP TAG_SCRIPTPMCS string config/query .br Get or set the template for the script which would be called at certain events. This events are change of power policy, change of power source, change of suspend state and at emergency condition if battery is critically low. But the emergency call is only done, if configured. Up to two '%s' are allowed in the template and will be replaced by the action and the power source. .TP TAG_IBAMDATADIR string config/query .br Get or set the IBAM data directory where statistics about battery charge and discharge cycles are stored. .br This option would only be available, if pbbuttonsd was compiled with IBaM support. .TP TAG_SLEEPKEY keycode config/query .br Get or set the keycode used for triggering sleep mode. .TP TAG_SLEEPMOD modifier config/query .br Get or set the modifier used with SLEEPKEY .TP TAG_SLEEPKEYDELAY bool config/query .br Disable or enable the sleep key response delay. .TP TAG_BWLFIRST integer config/query .br Get or set time in seconds for the first battery warn level. .TP TAG_BWLSECOND integer config/query .br Get or set time in seconds for the second battery warn level. .TP TAG_BWLLAST integer config/query .br Get or set time in seconds for the last battery warn level. .TP TAG_CURRENTBWL integer query .br Get the current battery warn level. .TP TAG_CPULOADSLEEPLOCK bool config/query .br Disable or enable the CPU sleep lock. .TP TAG_CPULOADMIN integer config/query .br Get or set the minimum CPU load to activate the sleep lock. .TP TAG_CPULOADPERIOD integer config/query .br Get or set the time in seconds how long the CPU load have to be dropped below the minimum until the lock will be released. .TP TAG_NETLOADSLEEPLOCK bool config/query .br Disable or enable the net sleep lock. .TP TAG_NETLOADMIN integer config/query .br Get or set the minimum net load to activate the sleep lock. .TP TAG_NETLOADPERIOD integer config/query .br Get or set the time in seconds how long the net load have to be dropped below the minimum until the lock will be released. .TP TAG_NETLOADDEV string config/query .br Get or set the network device to be supervised for the net sleeplock. .TP TAG_EMERGENCYACTION integer config/query .br Get or set the emergency action that should be performed if battery was running low. Three values are valid: 0=sleep, 1=signal to init and 2=command. All other values are invalid. .TP TAG_ONAC_POLICY integer config/query .br Get or set the power policy that should be activated if power source changes to AC. Following values are valid: 0=nochange, 1=powersave, 2=custom and 3=performance. .TP TAG_ONAC_TIMERACTION integer config/query .br Get or set the action that should be performed if a timer event occurs with active AC profile. The timout value for this timer event could be set with TAG_ONAC_TIMESUSPEND. Following values are possible: 0=none, 1=suspend-to-ram, 2=suspend-to-disk, 3=blank screen .TP TAG_ONAC_COVERACTION integer config/query .br Get or set the action that should be performed if the cover of the laptop was closed with active AC profile. Following values are possible: 0=none, 1=suspend-to-ram, 2=suspend-to-disk, 3=blank screen .TP TAG_ONAC_KEYACTION integer config/query .br Get or set the action that should be performed if the sleepkey was triggered with active AC profile. Following values are possible: 0=none, 1=suspend-to-ram, 2=suspend-to-disk, 3=blank screen .TP TAG_ONAC_TIMESUSPEND integer config/query .br Get or set the time until suspend is triggered. This value will only be used if AC power profile is active. Set this value to 0 and suspend timeout is disabled. .TP TAG_ONAC_TIMEDIM integer config/query .br Get or set the time until the backlight would be dimmed. This value will only be used if AC power profile is active. Set this value to 0 and screen dimming is disabled. .TP TAG_ONBATT_POLICY integer config/query .br Get or set the power policy that should be activated if power source changes to BATTERY. Following values are valid: 0=nochange, 1=powersave, 2=custom and 3=performance. .TP TAG_ONBATT_TIMERACTION integer config/query .br Get or set the action that should be performed if a timer event occurs with active BATTERY profile. The timout value for this timer event could be set with TAG_ONBATTERY_TIMESUSPEND. Following values are possible: 0=none, 1=suspend-to-ram, 2=suspend-to-disk, 3=blank screen .TP TAG_ONBATT_COVERACTION integer config/query .br Get or set the action that should be performed if the cover of the laptop was closed with active BATTERY profile. Following values are possible: 0=none, 1=suspend-to-ram, 2=suspend-to-disk, 3=blank screen .TP TAG_ONBATT_KEYACTION integer config/query .br Get or set the action that should be performed if the sleepkey was triggered with active BATTERY profile. Following values are possible: 0=none, 1=suspend-to-ram, 2=suspend-to-disk, 3=blank screen .TP TAG_ONBATT_TIMESUSPEND integer config/query .br Get or set the time until suspend is triggered. This value will only be used if BATTERY power profile is active. Set this value to 0 and suspend timeout is disabled. .TP TAG_ONBATT_TIMEDIM integer config/query .br Get or set the time until the backlight would be dimmed. This value will only be used if BATTERY power profile is active. Set this value to 0 and screen dimming is disabled. .TP TAG_HEARTBEATBEEP boolean config/query .br Enable or disable the heartbeat beep if the computer is running with closed lid. 0=disable beep, 1=enable beep. .TP TAG_POLICY integer config/query .br Get or set the current power policy Following values are valid: 0=nochange, 1=powersave, 2=custom and 3=performance. .TP TAG_IDENTITY string query .br Get the machine's identity string. .SH "SEE ALSO" pbbuttons.cnf (5), showkey (1) .SH AUTHOR Matthias Grimm . pbbuttonsd-0.8.1a/pbbuttonsd.10000644000175000017500000005665210641704560013255 00000000000000.\" hey, Emacs: -*- nroff -*- .\" pbbuttons is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; see the file COPYING. If not, write to .\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. .\" .TH PBBUTTONSD 1 "February 07, 2007" .\" Please update the above date whenever this man page is modified. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins (default) .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME pbbuttonsd \- daemon to support Laptop specific functions .SH SYNOPSIS .B pbbuttonsd .RI [ options ] .SH DESCRIPTION .ad b \fBPBButtonsd\fP is a daemon which brings support for many Laptop specific functions to Linux. Basically it was designed to support Apple iBooks, Powerbooks or TiBooks but since version 0.5 the design has been changed to support any Notebook. .PP From its roots pbbuttons support Apple PowerBooks and iBooks by 100%. Support for the new Intel based MacBooks is very new but grows steadily. I would say we reached 70% by now. Also the support for other intel based notebooks jumped forward by adding the ACPI support to pbbuttonsd, but because laptop support is very hardware dependent, I guess we have only 30% on this machines. Help to build up support for more machines is always welcome. .PP Supported features: .PP Advanced Power Management: .ad l .in +2 .ti -2 \- puts the machine to sleep if idle to save energy, .ti -2 \- prevent the machine from entering sleep mode if CPU or Net is busy until the job is finished, .ti -2 \- send a warning if battery is running low, .ti -2 \- configurable emergency actions if battery is critically low, .ti -2 \- dims the display if user is passive to save energy .ti -2 \- puts machine to sleep if cover was closed, .ti -2 \- executes external scripts on certain power management events to allow most flexibility, .ti -2 \- is able to replace power management daemons like pmud, apmd, etc. .PP Support for laptop dependent hotkeys: .in +2 .ti -2 \- to adjust display brightness .ti -2 \- to adjust keyboard illumination, .ti -2 \- to adjust the sound volume, .ti -2 \- to mute/unmute the sound channels, .ti -2 \- to open/close the CDROM tray, .ti -2 \- to trigger sleep mode. .ti -2 \- to switch external video on/off .PP Support for laptop dependent specialities: .in +2 .ti -2 \- initializes trackpad and keyboard mode during startup, .ti -2 \- disables trackpad's mouse click emulation while typing on the keyboard .ti -2 \- keeps keyboard settings during sleep mode, .ti -2 \- cycles through the trackpad operating mode via hotkeys, .ti -2 \- support ambient light sensor and automatic adjustment of LCD and keyboard brightness on Apple PowerBooks and MacBook Pros. .SH USER INTERFACE .ad b The main input to \fBPBButtonsd\fP works through key codes. Certain keys ensure appropriate actions. This keys are widely user configurable in the configuration file. In detail following keys are supported: .PP .nf Config Option Modifier Description LCD_IllumUpKey \-\- Increase display brightness. shift Increase display brightness to maximum value. The shift modifier here is hard coded and can't be configured. LCD_IllumDownKey \-\- Decrease display brightness until complete darkness. shift Decrease display brightness to minimum value. The shift modifier here is hard coded and can't be configured. KBD_IllumUpKey \-\- Increase keyboard illumination brightness. shift Increase keyboard illumination brightness to maximum value. The shift modifier here is hard coded and can't be configured. KBD_IllumDownKey \-\- Decrease keyboard illumination brightness until complete darkness. shift Decrease keyboard illumination brightness to minimum value. The shift modifier here is hard coded and can't be configured. KBD_IllumOnKey \-\- Switch keyboard illumination on/off. The level won't change. CRT_MirrorKey \-\- Enable/disable external video output. SleepKey \-\- Trigger configured sleep action. VolumeUpKey \-\- Increase volume of configured channels by ten percent. This works on all sound hardware the same way. shift Increase volume level in fine steps. This function uses the volume scale the hardware supports so that small volume adjustment might not result in audible volume change. OSS always handle the volume level in percent so that this function will change the volume level by one percent. The shift modifier here is hard coded and can't be configured. VolumeDownKey \-\- Decrease volume of configured channels by ten percent. shift Decrease volume level in small steps. Smallest hardware supported step with ALSA and one percent with OSS. The shift modifier here is hard coded and can't be configured. MuteKey \-\- Disable/enable sound output. The volume level won't change. Pressing any other volume con\- trol key will automaticaly enable sound out\- put again. EjectCDKey \-\- Ejects a CDROM from CDROM drive. If necessary the device will be unmounted before. This would fail if the device was busy. TPModeUpKey \-\- Cycle trackpad mode forward (notap, tap, drag or lock). This function is only available on Apple PowerBooks. TPModeDownKey \-\- Cycle trackpad mode backward (lock, drag, tap or notap). This function is only available on Apple PowerBooks. .fi .PP .ad b Not all of this keys must work on your system. Most of them are hardware dependent and if your notebook doesn't have the required hardware the related function will not work. Read your notebook's manual and pbbuttonsd.cnf (5) to figure out what you could expect. .PP .SH COMMANDS AND SIGNALS \fBPBButtonsd\fP has an IPC interface (Inter Process Communication) and you could send commands to the server to trigger certain actions. Use the command line tool 'pbbcmd' with following syntax to send commands: .PP .ad c pbbcmd .PP .ad l Following commands are understood: .PP .in +15 .ti -15 SAVECONFIG saves the configuration if enabled by pbbuttonsd's security checks (see 'configuration file' section below) and you have the right permission. .br .ti -15 EJECTCD unmount and ejects the CDROM or closes the tray again, if already open. .br .ti -15 SLEEP puts the machine to sleep (also known as suspend to RAM) if possible. If sleep was not supported on this machine the screen will be blanked. Sleep is a kernel function and will only be triggered by pbbuttonsd. .br .ti -15 HIBERNATE saves the memory and the process information to disk (also known as suspend to Disk or Hibernate) if possible. If hibernate was not supported on this machine nothing will happen. Hibernate is a kernel function and will only be triggered by pbbuttonsd through a PMCS script usually placed in /etc/power/. .br .ti -15 REINIT This command triggers reinitialization of hardware under control of pbbuttonsd (for example trackpad and keyboard on powerbooks). The PMCS script to reinitialize the power policy will also be launched after receiving this command. This could be helpful when after a 'suspend to disc' all the hardware needs to be reinitialized. .PP Beside the IPC interface pbbuttonsd understands some signals: .PP .in +12 .ti -12 SIGHUP 1 pbbuttonsd scans for new input devices (see 'connecting/disconnecting new keyboards' section below). .br .ti -12 SIGINT 2 usually emitted by CTRL-C. pbbuttonsd will clean up used resources and terminates .ti -12 SIGUSR1 10 pbbuttonsd reinitializes hardware components under its control (for example trackpad and keyboard on powerbooks). Sending this signal is the same as sending the command REINIT except that IPC will not be used. This is for the complete paranoid guys ;-) .ti -12 SIGTERM 15 pbbuttonsd will clean up its resources and terminates .PP .SH KERNEL CONFIGURATION .ad b In kernels before 2.4.18-rc2-benh the brightness of the display was handled by the kernel itself. The brightness hotkeys were blocked by the kernel and there was no chance for a user space daemon like \fBPBButtonsd\fP to get the necessary information. .PP Nevertheless to get the brightness keys work with older kernels, a special kernel patch could be applied. Without this patch the daemon work as well with the little limitation not to control the display brightness. This is done by the kernel, so a possibly attached client wouldn't be informed on brightness level changes. .PP With kernel >= 2.6.18 a new SysFS interface to the backlight controller has been introduced. Unfortunately the kernel configuration become very confusing and misunderstanding. The Kernel has two options regarding the backlight in section "Device Drivers -> Macintosh Device Drivers": .PP .in +4 .ti -4 .B "Backlight control for LCD screens" .br .RI ( CONF_PMU_BACKLIGHT ) .PP .in +4 The help text says that this option enables generic backlight code. In fact without this option you won't get any backlight interface running, neither SysFS nor PMU, so say YES here. .PP .in +4 Unfortunately this option enables also code to control display brightness for older PowerBooks. That means the kernel itself controls the backlight brightness and interfere with any user space daemmon. The reference in the help text to use a user space daemon like pbbuttonsd is very kind, but The user space daemon is helpless if the kernel itself do the job. Nevertheless say \fBYES\fP to this option. .PP .in +4 .ti -4 .B "Provide legacy ioctl's on /dev/pmu for the backlight" .br .RI ( CONF_PMU_BACKLIGHT_LEGACY ) .PP .in +4 This option apears if backlight control has been enabled. This option adds some code to read and write the backlight level via the pmu driver (/dev/pmu). This interface was used by pbbuttonsd in the past and normaly it isn't needed any longer because the SysFS interface should make it redundant. .PP .in +4 Unfortunately the function to disable the direct kernel control of the backlight (for old PowerBooks, you remenber?) is part of the code added by this option. That means if you say YES to PMAC_BACKLIGHT but say NO to PMAC_BACKLIGHT_LEGACY, backlight will work but pbbuttonsd will never get the chance to gain control over the backlight controller. Kernel and user space daemon will interfere with eachother in an unacceptable way and that leads to unwanted results. .PP .in +4 This mixture of related but independent functions make it necessary to say \fBYES\fP to this option as well until the Kernel guys cleaned up this mess. .PP Finally your Kernel 2.6.18 configuration should look like this: .PP .ad l .in +4 [*] \fBB\fPacklight control for LCD screens .br .in +6 [*] \fBP\fProvide legacy ioctl's on /dev/pmu for the backlight .ad b .PP \fBPBButtonsd\fP will then automatically detect the best suited interface and use it. .SH GENERAL To get visual feedback from the adjustments a user made, a SystemV IPC interface is implemented to exchange messages with a client which for example displays the brightness and volume levels on a X Desktop. .PP If battery level is critically low pbbuttonsd has multiple mechanism to react on. The default behavior is to put the machine to sleep. Alternatively it is possible to send the init process the SIGPWR signal or to shut the machine down directly by a configurable script. Everything could be done to bring the machine down in a controlled way before the power management unit will switch the machine off the hard way due to lack of energy. This would prevent data losses and other problems. .PP To be able to shut down the machine pbbuttonsd must be running as 'root' because only the superuser is allowed to call the shutdown program or could send init requests to the init process. .PP .SH POWER POLICIES Since version 0.6 \fBPBButtonsd\fP supports so called power policies. With this policies the user can roughly define how the machine should handle the current load condition. If low current consumption, maximum performance or anything in between is most important at this time. Three policies are supported: 'powersave', 'custom' and 'performance'. .PP Each power source can be connected to a policy that becomes active as soon as the power source changes. Sometimes it may not desirable that the policy changes as soon as the power source changes. For this case the policy connected to this power source can be set to 'nochange'. .PP The pmcs script is responsible to put the set policy into practice. \fBPBButtonsd\fP will call this script among others every time the policy changes or has to be reset after periods of sleep or suspend. .PP .SH PBButtonsd AND SLEEP MODE (Suspend to RAM) \fBPBButtonsd\fP can't suspend the machine by its own. It uses kernel API functions for that. This means pbbuttonsd only asks the kernel: "Please suspend the machine". If the kernel do so and what happens after the request is up to the kernel. .PP Problems in this stage often occour due to old device drivers which don't support the suspend mode very well. The kernel API changed a lot here and it took a lot of time to adapt all the device drivers to the new interface. A solution could be to unload problematic device drivers before triggering sleep and reload them after wake up. \fBPBButtonsd\fP would support that via its Power Management Control Scripts (see /etc/power/). .PP The machine went to sleep after the main CPU has been switched off. Now, the computer is only controlled by the PMU which is a small (mostly 8bit) microprocessor with ROM (Read Only Memory) code. After the occourence of a dedicated event the PMU reactivates the main CPU and the machine wake up again. Those events could be: .PP .ad l .in +2 .ti -2 \- trigger a key on the keyboard .ti -2 \- open the cover (closing the cover doesn't wake up the machine) .ti -2 \- insert or remove an USB device .ti -2 \- timer .ti -2 \- other computers address the sleeping computer via LAN .ad b .PP The PMU needs to know which events should trigger a wake up procedure. The first two are explicitly enabled by the kernel before putting the machine to sleep. The third seems to be not maskable by the PMU, that means it will always wake up the computer. And the last two weren't supported at all yet on Linux. .PP While the key trigger event will unconditionally wake up the machine, the cover open event could be configured via the /proc/pmu/options interface. The following command will prevent your machine from waking up after the cover has been opened: .br .ad c echo > "lid_wakeup=0" > /proc/pmu/options .br .ad b .PP And the following command enable the wake up on "cover open" again: .br .ad c echo > "lid_wakeup=1" > /proc/pmu/options .br .ad b .PP Other wake up options are not foreseen by the kernel but may be added in the future. \fBPBButtonsd\fP is completely out of control until the kernel has finished its wake up procedure and gives control back to user space. .SH IBaM (Intelligent Battery Monitoring) IBaM is an advanced battery monitoring method, which uses statistical and adaptive linear methods to provide accurate estimations of battery time remaining or of the time needed until full recharge. .PP If IBaM is compiled into \fBpbbuttonsd\fP all internal time calculations based on kernel battery information would be replaced. Through the IPC signal TimeRemaining \fBpbbuttonsd\fP clients could benefit from accurate time estimations too. .PP Once started \fBPbbuttonsd\fP will collect battery data and saves them to disk for statistical analysis. The more data \fBpbbuttonsd\fP have to analyse the more accurate the time estimations will be. .PP Because at the very beginning \fBpbbuttonsd\fP has no data to analyse it is recommended to perform the initial procedure described below to fill the database with real data. If \fBpbbuttonsd\fP has to initialize IBaM's database during normal usage with arbitrary charge and discharge cycles, it might take longer to get reliable time predictions and accurate battery warnings. .SH IBaM INITIAL PROCEDURE This step is not necessary if you only update \fBPBButtonsd\fP. The updated version will continue to use the existing data. .PP At the very beginnig \fBpbbuttonsd\fP has no data to analyse and all estimations based on default values that won't be better than the kernel battery data. Therefore it is recommended to do one complete battery discharge/charge cycle after installing this version of \fBpbbuttonsd\fP with integrated IBaM to initially fill the database with real data. .PP Unplug AC power from your laptop. IBaM will now save the time intervals between changes in battery status. \fBPBButtonsd\fP will already use the data in this early stage and the battery warnings might be unreliable or won't occur at all. This is normal behaviour and will only happen during initial discharge cycle. .PP The most important time of a battery discharge cycle is the last minutes. During the last, let's say 20 minutes of battery time it is most important to get reliable and accurate battery warnings. But this aim could only be reached if the IBaM database contains data about the last minutes on battery. It is very important that the battery will be completely drained during the initial discharge cycle (until \fBpbbuttonsd\fP triggers sleep or the hardware switch off hardly, prepare for the second case to prevent data losses). .PP After your battery is completely drained, plug in your AC connector and continue working as usual. .PP IBaM is fully initialized now and it's prepared to show its full power and benefit. Depending on your load cases the time estimations will fluctuating a bit the first time. But after roundabout three battery charge/discharge cycles the predicted time and the battery warnings will be rather stable and reliable. .PP The database is updated continously so that any aging of the battery is taken into account. When \fBpbbuttons\fP tells you now, you still have 10 minutes left on battery, then you \fBwill\fP have 10 minutes left even if your battery is growing old and the capacity decreases. .SH IBaM and multiple batteries Currently IBaM is not able to handle multiple batteries seperatly. It always sums up all batteries in system and calculates with the result. Therefore the IBaM statistics will be influenced if you change your battery configuration (adding or removing batteries). .PP Battery warnings will be slightly inaccurate after changing the battery configuration. If you run a long time with a unchanged configuration this changes would hardly be significant or not seen at all. The scenario described in the paragraph below is only likely if you did only a few charge/discharge cycles. .PP After plugging in an additional battery pbbuttonsd might show low battery warnings too early and vica versa after you removed your second battery. Especially after you decreased overall battery capacity by removing a second battery, \fBpbbuttonsd\fP might get aware of low battery condition too late. As result the machine will switch off the hard way. To prevent data losses in this case you should not wait for the last warning before you plug in the AC connector. IBaM will resync itself automatically during the next charge/discharge cycles. .PP IBaM works best if you use always the same battery configuration (one or two batteries). .SH CONFIGURATION FILE \fBPBButtonsd\fP uses a configuration file for setting up all it's features. This file is usually located in \fIetc\fP. From version 0.5.4 on \fBPBButtonsd\fP is also able to write the current configuration to a file. .PP To make this solution as secure as possible a batch of security checks will be performed until configuration writing would be allowed: .PP .ad l .in +3 .ti -3 1. The owner of the writable configuration file must be the same as the owner of pbbuttonsd process. .ti -3 2. The configuration file is only writable by the owner. .ad b .PP If any of this conditions failed, writing of the configuration file would be disabled. .PP .SH CONNECTING / DISCONNECTING NEW INPUT DEVICES \fBPBButtonsd\fP uses for its input the event hander in /dev/input/event%, which handles also hot-plugable devices such as USB or ADB (Mac only) input devices. \fBPBButtonsd\fP scanns those devices at start time and work with the found devices. .PP Before Hotplug, the only way for pbbuttonsd to realize newly connected devices is to regularly scan the event devices. Unfortunately there is no summary keyboard device as there is for mice and hotplug isn't available for kernel 2.4 and before. Because external USB input devices become quite common, the autorescan feature is enabled by default. .PP If your hard disk is prevented from spinning down due to the regular event device scans, you might want to disable this feature. This could be done in the configuration file. In this case you have to trigger a rescan manually after connecting new input devices. Scanning is initiated by sending the HUP signal to the server: .PP .ad c kill \-HUP \`cat /var/run/pbbuttonsd.pid\` .PP .ad b Be aware that the configuration file will also be reloaded in this case. .PP .SH OPTIONS \fBPBButtonsd\fP accepts the following options: .TP \fB\-c\fR, \fB\-\-configfile\fR=\fICONFIGFILE\fR Use an alternative configuration file, default is /etc/pbbuttonsd.cnf. .TP .B \-h, \-\-help Show summary of options. .TP .B \-v, \-\-version Show version of \fBPBButtonsd\fP. .TP .B \-q, \-\-quiet Suppress the welcome message. Some startup scripts want to have full control about their output. .TP \fB\-d\fR, \fB\-\-detach\fR[=\fIPIDFILE\fR] Start \fBPBButtonsd\fP as background process. optional an alternative pidfile. The daemon writes it's pid into this file. .br In this mode we can't assume to have a valid terminal so all outputs will be blocked and no error message will be printed. .TP .in +7 If you don't use this flag and start \fBPBButtonsd\fP as background process by adding a \'&\' to the command line, please redirect \'stdout\' and \'stderr\' to a valid file as well (or at least to /dev/null if you don't need error output). If you don't do so \fBPBButtonsd\fP may be stopped by the shell because of using invalid file descriptors. .SH "SEE ALSO" pbbuttonsd.cnf (5), gtkpbbuttons (1) .SH AUTHOR Matthias Grimm. pbbuttonsd-0.8.1a/pbbuttonsd.cnf.50000644000175000017500000011341310641704560014013 00000000000000.\" hey, Emacs: -*- nroff -*- .\" pbbuttons is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; see the file COPYING. If not, write to .\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. .\" .TH PBBUTTONSD.CNF 5 "February 06, 2007" .\" Please update the above date whenever this man page is modified. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins (default) .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME pbbuttonsd.cnf \- configuration file for pbbuttonsd >= 0.8. .SH DESCRIPTION \fBpbbuttonsd.cnf\fP tells pbbuttonsd how the user wants it to work and is usually found as /etc/pbbuttons.cnf. .PP With Pbbuttonsd 0.8 the format of the configuratione file slightly changed. It uses now the keyfile format defined by the freedesktop organisation. It is very similar to the old format which was proprietary to pbbuttonsd but is not exactly the same. The main advantage of the new file format is that pbbuttonsd can now use code of the glib to pare it, instead doing everything by itself. .PP The file format could be found on http://freedesktop.org/Standards/desktop-entry-spec. A rough short form of the file formatcomes here. .PP An option looks always like this: .PP \fBkeyword\fR=\fIvalue\fR .PP Empty lines and lines starting with a number-sign (#) will be ignored. Comments behind options are not allowed and lead to unwanted results. .PP The \fIvalue\fR contains the whole rest of the line including any white spaces. So quoting is not necessary and forbidden. Quoted strings will be read as quoted strings and may cause unwanted results. The quotation marks won't be filtered out. .PP It isn't necessary to define every option or a configfile at all because there are useful default's built into the program. .PP The config file is split up into sections to group options which belong together. The section headlines are corresponding to the pbbuttonsd modules and group the options. It os allowed to have two options with the same name as long as they are in different sections. Each module has a config file section. The available options depends on the modules functionality. .SH KEYCODE DEFINITIONS Some of the options need \fBkey\fP definitions. A \fBkey\fP could be defined as follows. .PP The key definition could have multiple parts. The first is the keycode as it could be found in ..include/linux/input.h. This keycode at least must be given otherwise the built-in default value will be used. .PP The other parts are the optional modifiers that could be combined with the keycode to trigger the certain function. The \fIshift\fR, \fIalt\fR and \fIctrl\fR modifier are supported. They are added to the keycode with a plus-sign (+). The sequence doesn't matter. .PP .ad l .in +9 .ti -9 EXAMPLE: 225 + shift + ctrl .br This means the key 225 has to be pressed together with \fIshift\fR and \fIctrl\fR to trigger the function. .ad b .SH GENERAL .TP \fBuserallowed\fR = \fIusername\fR (default: none) Lets talk about security. PBButtonsd accepts messages through the kernel IPC-message protokoll without verification who sent the message. This doesn't seem to be a problem because IPC is only used locally and can't be accessed directly over network. Only those options which could be abused to get root rights were protected and could only be changed by the owner of pbbuttonsd's process. .PP .in +7 This didn't satisfy some users so I implemented this option to give those users more control who should be allowed to send messages to pbbuttonsd. If this option is set only the named user (only one possible at the moment) is allowed to change pbbuttonsd's options via the IPC-interface. Messages from all other users (root included) will be rejected. Query the current configuration is further possible for all users. .PP .in +7 To completely disable the possibility to change options via IPC name a user that doesn't exist. In this case no logged-in user is allowed to change options. Setting the option in the config file and 'kill \-HUP ' would then be the only way to change options on the fly then. .TP \fBautorescan\fR = \fI[yes | no]\fR (default: yes) \fBPBButtonsd\fP uses the kernel input layer and its event devices to get input from the keyboards and mice. This layer support all types of input devices also those which will be connected or removed later during operation. Normally \fBpbbuttonsd\fP scans the event devices once at startup and uses all keyboards and mice found at that time but most people wanted to be able to plug-in or remove external input devices at any time. .PP .in +7 With this option set to 'yes' \fBpbbuttonsd\fP would scan for new input devices on a regular time basis. Due to the continuous access to the /dev/input/event% device files, spin-down functions of hard disks might be influenced. If you have problems with this, you could disable this feature and trigger a rescan by hand when necessary. .TP \fBCmdTimeout\fR = \fItime in seconds\fR (default = 8) \fBPbbuttonsd\fR is able to launch user defined scripts and it uses some external helper utilities. This scripts and utilities were started as separate processes with their own environment independent from \fBpbbuttonsd\fR's. During a helper process is active \fBpbbuttonsd\fR's process is blocked and waits for the child process to end. Without security mechanism this could lead into an knocked out \fBpbbuttonsd\fR due to a hanging script. To prevent such a situation \fBpbbuttonsd\fR has an eye on its child processes and if they consume too much time they will be killed by the parent process. .PP .in +7 It was very difficult in the past to define a correct timeout value because of a huge amount of different scripts written and used by users. With this option the individual timeout value in seconds can be defined. Be careful with high values because an error in your script can block \fBpbbuttonsd\fR for a long time. The minimum value is 1 second. values below this will force a one second timeout. .SH MODULE POWERSAVE This module does all the hardware independent power saving stuff. .PP \fBonAC_Policy\fR = \fIpolicy\fR (default: performance) .br \fBonBattery_Policy\fR = \fIpolicy\fR (default: powersave) .in +7 This options set the power management policies that should become active after power source has changed. following policies were supported: .PP .in +9 'nochange' current policy won't be changed .br 'powersave' minimum power consumption .br 'custom' user defined .br 'performance' maximum system performance .PP .in +7 The pmcs script does all actions needed to activate the options according the selected power policy. .PP \fBonAC_TimerAction\fR = \fIaction\fR (default: suspend-to-ram) .br \fBonBattery_TimerAction\fR = \fIaction\fR (default: suspend-to-ram) .in +7 After some time without user action, so called idle time, the timer emits an event. Pbbuttonsd can connect an action to this event that would be executed when this event occours. Four actions are possible (see below). This option can independently configured for AC or battery power source. .PP .in +7 \fInone\fR .br Nothing will be done. If onXX_TimerAction was set to 'none' the timer event would be ignored. .PP .in +7 \fIsuspend-to-ram\fR .br This action suspends the machine and conserves the memory content in RAM. This mode is also known as 'sleep' and works only if it is supported by the hardware. .PP .in +7 \fIsuspend-to-disk\fR .br This action suspends the machine and save the memory content to hard disk. This mode is controlled by the kernel and is supported since kernel version 2.6. A backport for kernel 2.4 is also available. .PP .in +7 This action works a little bit different to suspend-to-ram. If the event suspend-to-ram occours the PMCS script will be executed to perform preliminary jobs. Suspend-to-ram is then triggered by pbbuttonsd. .PP .in +7 If the event suspend-to-disk occurs the PMCS script will also be executed but in contrast to suspend-to-ram it has also to initiate suspend mode after all preliminary jobs are done. Pbbuttonsd doesn't expect the script to return. .PP .in +7 \fIblankscreen\fR .br If this action was configured the screen would be switched off. The computer will continue to run. This could be helpful in some cases where for example the machine must be reachable over a network without anyone working with it directly. .PP .in +7 This mode is the fallback action if suspend-to-ram is not supported by the hardware. .PP .in +7 Attention: With a switched-off display you might not be able to see that the computer is still running but it continues to consume power. To give you a hint the computer will play a beep every 30 seconds as a reminder. .PP .in +7 \fIshutdown\fR .br This action triggers a machine shutdown. The PMCS script is called to initiate the shutdown. Usually this is done with the \'halt\' command. .PP \fBonAC_CoverAction\fR = \fIaction\fR (default: suspend-to-ram) .br \fBonBattery_CoverAction\fR = \fIaction\fR (default: suspend-to-ram) .br .in +7 This options define the action to perform if cover has been closed or opened. For possible actions and it's description please see onXX_TimerAction. It could independently configured for AC or battery power source. .PP .in +7 This options will only work if \fBpbbuttonsd\fP was compiled without pmud support so that \fBpbbuttonsd\fP has control over the cover. .PP .in +7 Attention: With a switched-off display you might not be able to see that the computer is still running but it continues to consume power. To give you a hint the computer will play a beep every 30 seconds as a reminder. .PP \fBonAC_KeyAction\fR = \fIaction\fR (default: suspend-to-ram) .br \fBonBattery_KeyAction\fR = \fIaction\fR (default: suspend-to-ram) .br .in +7 This options define the action to perform after the sleepkey has been triggered. For possible actions and it's decription please see onXX_TimerAction. It could be independently configured for AC and battery power source. .PP \fBonAC_SuspendTime\fR = \fIvalue\fR (default: 3000 = 5 minutes) .br \fBonBattery_SuspendTime\fR = \fIvalue\fR (default: 3000 = 5 minutes) .br .in +7 This option sets the idle time in 1/100 seconds after the machine should be put to sleep or the display should be switched off. It could independently controlled for AC or battery power source. .PP .in +7 Set this value to 0 to disable sleep when idle. .PP \fBonAC_DimTime\fR = \fIvalue\fR (default: 600 = 1 minutes) .br \fBonBattery_DimTime\fR = \fIvalue\fR (default: 600 = 1 minutes) .br .in +7 This option sets the idle time in 1/100 seconds after the display should be dimmed to minimum level. It could independently controlled for AC or battery power source. .PP .in +7 Set this value to 0 to disable display dimming. The display brightness won't change automatically and keep its value for unlimited time. .TP \fBSleepKey\fR = \fIkey\fR (default: 116) Key to trigger sleep mode or blank the screen, corresponding to the current configuration and the machine's abilities. .TP \fBSleepKeyDelay\fR = \fItime in milliseconds\fR (default: 0) This option sets the delay time used for an additional validity check of the sleep key to prevent unwillingly triggered sleeps due to small keyboards. The key must be pressed for longer than the given time period to trigger sleep. The value must be given in milliseconds, for example to set a delay time of 2 seconds set the delay time to 2000. If the given value is zero, sleep mode would be entered immediately. .PP .in +7 This option might be dangerous if the power key is used to trigger sleep mode, because the power key has a second hard-wired meaning. If you press the power key for a long time, the machine will be switched off completely. This is an emergency feature of the Macintosh hardware. Therefore it could be very tricky to press the power key long enough to trigger sleep and release the key just before the hardware switched power off. Use this option with care. .PP \fBBWL_First\fR = \fIminutes\fR (default: 20) .br \fBBWL_Second\fR = \fIminutes\fR (default: 10) .br \fBBWL_Last\fR = \fIminutes\fR (default: 3) .br .in +7 This options set the battery warn levels in minutes. If the remaining time on battery falls below one of the above values the appropriate battery warning would be displayed (gtkpbbuttons or something similar must be running to see them). .PP .in +7 If the time remaining reaches 'zero' the non-configurable battery warnlevel 4 is entered, which causes the machine to shutdown immediately. The clients will be noticed by a message about the coming shutdown. .PP .in +7 Defining new warn levels be aware that you fulfill following conditions: .ad l .in +2 .ti -2 \- BWL_First > BWL_Second > BWM_Last > 0 .ti -2 \- the difference of two adjacent warnlevels must be greater than 6 minutes. .ad b .PP .in +7 Violation of this conditions will result in an error message and fall back to default values. .TP \fBEmergencyAction\fR = \fI[action]\fR (default: sleep) If the battery is critically low the machine have to be set into a safe state. This could be done on different ways. Which way is the right for your system could be configured with this option. There are three actions possible: .PP .in +7 \fIsleep\fR - The machine would be forced to sleep mode. This action gives security only for a short period because also in sleep mode the computer consumes power and continue to discharge the battery but slower. This gives you enough time to plug in the AC connector to recharge the battery and go on with your work. .br This action could only be chosen if the machine supports sleep mode. If not this action defaults to \fIsignal\fR. .PP .in +7 \fIsignal\fR - A SIGPWR signal would be sent to the INIT process. The further actions depend on your system configuration in /etc/inittab. Please check your installation to be sure the SIGPWR does what you want. Pbbuttonsd won't do anything else to prevent data losses due to battery voltage collapse. .br Pbbuttons tried first to send the init process the signal with the new init request through /dev/initctl. If that fails it tried the old method through /etc/powerstatus. If that fails too and the machine supports sleep mode this action defaults to \fIsleep\fR, otherwise it defaults to \fIcommand\fR. .PP .in +7 \fIcommand\fR - This is the former standard action in case of critically battery power. a command would be executed which usually shut down the computer safely. The \fIscript_pmcs\fR (see below) will be called with argument 'emergency' in this case. .TP \fBHeartbeatBeep\fR = \fI[yes | no]\fR (default: yes) \fBPbbuttonsd\fR can be configured to switch off the display instead of entering sleep mode even though the lid was closed. As configured in such a way the machine only to switch off its display after sleep timeout and continue running on full power. If in this situation also the hard disk spun down, no sign of computer's life would exist anymore and the machine looks like a switched off computer. .PP .in +7 This may lead to unexpectedly drained batteries or needlessly long idle runs because the computer looks like already switched-off and you may then forget to switch it off really. Due to \fBpbbuttonsd\fR's smart power management functions nothing harmful can happen to the computer or to your valuable data. So this is a convenience option. .PP .in +7 To have always a sign of life from the computer \fBpbbuttonsd\fR will play a beep every roundabout 30 seconds if the computer was still running with switched-off display. Someone will take the risk to get rid of this nice little beep (others called it annoying). For those this option was implemented. It will switch off the heartbeat beep if set to 'no'. .PP .in +7 Usual cases when the heartbeat beep will occur are using your PowerBook with closed lid connected to an external keyboard and monitor or access your computer remotely via the network. In the second case the heartbeat beep will first occur with delay of the configured sleep timeout. .TP \fBScript_PMCS\fR = \fIcommand\fR (default: none) This option sets the script name that should be called at following events: change of power policy, change of power source, change of suspend state and if configured at low battery (emergency). For security reasons this script should only be readable by the user who runs pbbuttonsd (usually root) and not be writable at all. .PP .in +7 Up to three '%s' could be placed in the command string. The first '%s' will be replaced with the action (see etc/power/README for action list), the second with the current powersource ('ac' or 'battery') and the third with an action depending option. (for example the action 'suspend' may get the option 'ram'. This means suspend-to-ram). .TP \fBIBAM_DataDir\fR = \fIdirectory\fR (default: /var/lib/ibam) This directory is used to store statistical data measured during battery charge and discharge time. This data is used by the new IBAM algorithm for reliable and accurate battery and charge time predictions. .PP .in +7 This option would only be available if pbbuttonsd was compiled with IBAM support. .TP \fBCPULoad_sleeplock\fR = \fI[yes | no]\fR (default: no) With option enabled high CPU loads prevent the machine from entering sleep mode. Every second the current CPU load will be calculated and compared with a minimum level. Is the current CPU load below this level for a certain period of time the sleep lock will be opened and the machine is allowed to enter sleep mode. Jumps the CPU load over the border line the sleep lock will be closed immediately and the time measurement starts from the beginning. .TP \fBCPULoad_min\fR = \fIpercent\fR (default: 20) With this Tag the minimum CPU load level could be set. .TP \fBCPULoad_period\fR = \fIseconds\fR (default: 20) With this option the period of low CPU load time in seconds could be set. .TP \fBNETLoad_sleeplock\fR = \fI[yes | no]\fR (default: no) With option enabled high net loads prevent the machine from entering sleep mode. Every second the current net load will be calculated and compared with a minimum level. Is the transfer rate in bytes per second below this level for a certain period of time the sleep lock will be opened and the machine is allowed to enter sleep mode. Jumps the net load over the border line the sleep lock will be closed immediately and the time measurement starts from the beginning. .TP \fBNETLoad_min\fR = \fItraffic\fR (default: 4096 Bytes/s) With this Tag the minimum transfer rate in bytes per second could be set. .TP \fBNETLoad_period\fR = \fIseconds\fR (default: 20) With this Tag the period of low net load time in seconds could be set. .TP \fBNETLoad_device\fR = \fInetdevice\fR (default: eth0) With this option the network device to observe could be defined. Up to now only one network device could be set and observed. .SH MODULE DISPLAY This module controls the light sources inside the laptop. Mostly this is the LCD backlight but recent computers come with an additionally keyboard illumination which is also controlled by this module. The module works hardware independently. .TP \fBLCD_Brightness\fR = \fIvalue\fR (default: none) With this option the initial brightness level of the LCD backlight in percent could be set. This value becomes active during \fBpbbuttonsds\fP start up phase. .PP .in +7 Was this option commented out, pbbuttonsd wouldn't change the LCD brightness during start up. The display stays as bright as it has been before pbbuttonsd was started. Comment this option out if you want this behaviour. .TP \fBLCD_FadingSpeed\fR = \fIvalue\fR (default: 0) \fBPBButtonsd\fP is able to dim and recover the display brightness smoothly. Set the value to zero, blending would be disabled. In this case \fBPBButtonsd\fP would work as used to. .PP .in +7 With a value greater than null fading will be activated. Fill in the time a full dim (from lowest to highest brightness level or vica versa) should last. \fBPBButtonsd\fP will take into account that some backlight controllers are not as fine grained controlable as others and adjusts its internal timing to fulfill your request as best as possible. .PP .in +7 The time value must be given in miliseconds (1/1000th of a second). .PP \fBLCD_AutoAdjust\fR = \fImode\fR (default: linear) .br \fBKBD_AutoAdjust\fR = \fImode\fR (default: hysteresis) .br .in +7 Enable automatic LCD brightness and keyboard illumination adjustment and set the mode for the brightness contoller. the brightness level will be automatically adjusted depending on ambient light. Possible modes are: .PP .in +19 .ti -12 \fIoff\fR No automatic brightness adjustment .br .ti -12 \fIlinear\fR Linear dependency between ambient light and brightness level (see graph below) .br .ti -12 \fIhysteresis\fR Brightness level toggles dependent on ambient light thresholds (see graph below). .PP .in +7 lvel 2 lvel 2 | o------ | +--<--o----- | / | | | | / | | | |------o |------o-->--+ | 1 | 1 +------ambient-light-> +--------ambient-light-> linear hysteresis .PP .in +7 Point one and point two define the characteristic of the controller. Each point is an ambient light/brightness level pair. They could be defined with the AutoadjParm options (see description below). Both points must be given to make the controller work properly. .PP .in +7 This option work only on laptops with an ambient light sensor as for eg. the 17" Aluminum PowerBook or the MacBook from Apple. If such a sensor isn't present this option will be ignored. Furthermore not every machine have an illuminated keyboard. .PP \fBLCD_AutoAdjParm_onBattery\fR = \fIA1, L1, A2, L2\fR (default: 0%,1%,54%,100%) .br \fBLCD_AutoAdjParm_onAC\fR = \fIA1, L1, A2, L2\fR (default: 0%,1%,94%,100%) .br \fBKBD_AutoAdjParm_onBattery\fR = \fIA1, L1, A2, L2\fR (default: 0%,100%,28%,0%) .br \fBKBD_AutoAdjParm_onAC\fR = \fIA1, L1, A2, L2\fR (default: 0%,100%,28%,0%) .br .in +7 With this options the characteristic of the automatic brightness controller could be changed. Each option has four parameters which all four must be present to be accepted. .PP .in +7 Each paramerterset consists out of two ambient light/brightness level pairs called a point (A=\fIA\fRmbient light, L=brightness \fIL\fRevel). The meaning of this points depend on the operating mode that was set with AutoadjMode. All parameters must be given in percent (0-100%). .PP .in +7 \fILinear mode\fR .br In linear mode the brightness level will be smoothly changed from L1 to L2. The ambient light values set the start- and endpoint of this brightness change. The brightness level will be kept stable if the abmient light is below A1 or above A2. .PP .in +7 \fIHysteresis mode\fR .br In hysteresis mode the brigtness level toggles between L1 and L2. The ambient light values A1 and A2 define when this will happen. To prevent fast flickering the threshold changes depending on the curent brightness level. If the backlight is at L1 and the ambient lightbecomes brighter than A2 the brightness level will be switched to L2. If the ambient light level falls below A2 again the brightness level stick to L2. In order to switch the brightness level back to L1 the ambient light level must decrease below A1 (see sketch above). .PP .in +7 The behaviour of the automatic brightness controller can be individually defined for the LCD backlight and the keyboard illumination and might also set differently dependent on the power source. .PP .in +7 This options could be used to limit the working range of the automatic brightness controller in general or depending on the power source, which is very usefull most of the time. It might help to save energy when running on battery. .TP \fBLCD_IllumUpKey\fR = \fIkey\fR (default: KEY_BRIGHTNESSUP) Use alternative key to increase LCD illumination level. .PP .in +7 In conjunction with \fIshift\fR the brightness will be set to maximum level. This second function is statically bound to the modifier \fIshift\fR so that the key definition must not contain \fIshift\fR. It will be ignored, if mentioned. .TP \fBLCD_IllumDownKey\fR = \fIkey\fR (default: KEY_BRIGHTNESSDOWN) Use alternative key to decrease LCD illumination level. .PP .in +7 In conjunction with \fIshift\fR the brightness will be set to minimum level. This second function is statically bound to the modifier \fIshift\fR so that the key definition mustn't contain \fIshift\fR. It will be ignored, if mentioned. .TP \fBKBD_Brightness\fR = \fIvalue\fR (default: 0) With this option the initial brightness level of the keyboard illumination on percent could be set. The value becomes active during \fBpbbuttonsds\fP start up phase. Comment this option out if you don't want this behaviour. .PP .in +7 This option work only on machines that support keyboard illumination. .TP \fBKBD_OnBrightness\fR = \fIvalue\fR (default: 6%) If you switched on your keyboard illumination with the foreseen on/off key the keyboard illumination level would switch to 6% by default. With this option you could set a different start value in percent. .PP .in +7 This value is only valid during startup because the level will follow all manual and automatic brightness changes during program runtime. So if you set this option to 50% and press the keyboard-illumination-up key twice the on/off key would switch beween 62% and 0 because you manually modified the start value. The same happens if the automatic adjustment algorithm changes the keyboard brightness. .br The initial value will only have an effect if automatic keyboard illumination adjustment is disabled. .TP \fBKBD_FadingSpeed\fR = \fIvalue\fR (default: 0) \fBPBButtonsd\fP is able to dim and recover the keyboard illumination smoothly. Set the value to zero, blending would be disabled. .PP .in +7 With a value greater than null fading will be activated. Fill in the time a full dim (from lowest to highest brightness level or vica versa) should last. \fBPBButtonsd\fP will take into account that some backlight controllers might not as fine grained controlable as others and adjusts its internal timing to fulfill your request as best as possible. .PP .in +7 The time value must be given in miliseconds (1/1000th of a second). .PP .in +7 This option work only on machines that support keyboard illumination. .TP \fBKBD_IllumUpKey\fR = \fIkey\fR (default: KEY_KBDILLUMUP) Use alternative key to increase keyboard illumination level. .PP .in +7 In conjunction with \fIshift\fR the brightness will be set to maximum level. This second function is statically bound to the modifier \fIshift\fR so that the key definition must not contain \fIshift\fR. It will be ignored, if mentioned. .PP .in +7 This option work only on machines that support keyboard illumination. .TP \fBKBD_IllumDownKey\fR = \fIkey\fR (default: KEY_KBDILLUMDOWN) Use alternative key to decrease keyboard illumination level. .PP .in +7 In conjunction with \fIshift\fR the brightness will be set to minimum level. This second function is statically bound to the modifier \fIshift\fR so that the key definition mustn't contain \fIshift\fR. It will be ignored, if mentioned. .PP .in +7 This option work only on machines that support keyboard illumination. .TP \fBKBD_IllumOnKey\fR = \fIkey\fR (default: KEY_KBDILLUMTOGGLE) Use alternative key to switch keyboard illumination on/off. \fBPbbuttonsd\fR tried to remember the brightness level but on some machines the currently set level can't be evaluated so that the keyboard illumination may start with minimum level. .PP .in +7 This option work only on machines that support keyboard illumination. .TP \fBDevice_FB\fR = \fIdevice\fR (default: /dev/fb0) This option defines the framebuffer device to be used for blanking the screen. .TP \fBUseFBBlank\fR = \fI[yes | no]\fR (default: no) In the case only the display should be blanked instead of putting the machine into sleep mode, the framebuffer device could switch the whole display off. If you want that set this option to 'yes'. If not only the backlight will be switched off on blank. .PP .in +7 Recent kernel versions will do this automatically because the backlight controller is part of the framebuffer or graphics card driver. If you relialize any problems with the backlight, like the diplay remains dark after wakeup or cover open, set this option to \'no\'. .TP \fBDimFullyDark\fR = \fI[yes | no]\fR (default: no) Normally the display brightness will be dimmed to the lowest possible value if the machine is idle for some time. This will save a lot of power and keep the user able to loom what happened on the screen. .PP .in +7 With this option set to yes the display will be dimmed to fully darkness. This was requested by users who want to use this function as simple screensaver. .PP .in +7 Please keep in mind that switching the backlight of a laptop to often will decrease its lifetime so the author of pbbuttons doesn't recommend to use this option. Use it at your own risk. .TP \fBCRT_MirrorKey\fR = \fIkey\fR (default: KEY_F7 + CTRL) Set the key to switch the external video output on/off. This will only work if the framebuffer device of the used graphics card support this feature. \fBPbbuttonsd\fR will only send an IOCTL to the framebuffer like m3mirror from Ben Herrenschmidt does. .SH MODULE MIXER This module controls a mixer device. This module is able to automatically adapt itself to the underlying sound system. If more than one sound system is available on the computer, the mixer module will automatically decide which is the best to use. Currently two soundsystems are supported: .br \- Open Sound System (OSS) and .br \- Advanced Linux Sound Architecture (ALSA). .PP The mixer module will first probe ALSA and if that fails fall back to OSS. .PP If a sound module is loaded by the kernel additional hardware might be switched on and power consumption will increase. Especially on mobile computers this is mostly not wanted due to limited battery power. .PP \fBPbbuttonsd\fP will postpone the mixer initialization to the first use to prevent the kernel module loading from the beginning. The older versions of \fBpbbuttonsd\fP had an option "MixerInitDelay" to toggle this behaviour. The current version will always postpone the mixer initialization because it changes nothing and makes configuration of pbbuttonsd a bit easier because there is one option less to set. .PP .in +7 With the first trigger of a volume hotkey the mixer control will instantly be initialized and is ready to work. If any of the volume hotkeys were pressed without a working sound module, a kernel with the kernel module loader compiled in, would try to load the sound module automatically. If he succeeded, the volume control would work as usual, otherwise \fBpbbuttonsd\fP would try it again next time a volume hotkey is pressed. .TP \fBVolume\fR = \fIvalue\fR (default: 50) With this option the initial volume level could be set. Every time \fBpbbuttonsd\fP was started the volume level would be set to this value. Comment this option out if you did't want that. .TP \fBSpeakers_muted\fR = \fI[yes | no]\fR (default: no) If set to 'yes' the speakers would be muted at startup. .TP \fBvolumeupkey\fR = \fIkey\fR (default: KEY_VOLUMEUP) Use alternative key to increase volume. .PP .in +7 In conjunction with \fIshift\fR the volume will be increased by 10. This second function is statically bound to the modifier \fIshift\fR so that the key definition mustn't contain \fIshift\fR. It will be ignored, if mentioned. .TP \fBvolumedownkey\fR = \fIkey\fR (default: KEY_VOLUMEDOWN) Use alternative key to decrease volume. .PP .in +7 In conjunction with \fIshift\fR the volume will be decreased by 10. This second function is statically bound to the modifier \fIshift\fR so that the key definition mustn't contain \fIshift\fR. It will be ignored, if mentioned. .TP \fBmutekey\fR = \fIkey definition\fR (default: KEY_MUTE) Use alternative key to mute/unmute. . .SH MODULE MIXER OSS This section contains options only valid if OSS is chosen by the mixer module. .TP \fBDevice\fR = \fIdevicename\fR (default: /dev/mixer) Use an alternative mixer device. .PP .in +7 This device is used to control the sound volume or to mute/unmute the sound channels. .TP \fBChannels\fR = \flchannels\fR (default: volume) This option defines the OSS mixer channels which pbbuttonsd should control. Every combination is valid nevertheless if the combination makes sense or not. Valid channel names are: volume, bass, treble, synth, pcm, speaker, line, mic, cd, imix, altpcm, reclev, igain, ogain, line1, line2, line3, digital1, digital2, digital3, phonein, phoneout, video, radio and monitor. .PP .in +7 The first channel in the list is the master, all following are slaves. Only the volume level of the master channel is read back to adjust pbbuttonsd's internal volume reference. Slave channels will be set to master channel's volume on every volume change from pbbuttonsd. .SH MODULE MIXER ALSA This section contains options only valid if ALSA is chosen by the mixer module. .TP \fBALSA_Card\fR = \fIcardname\fR (default: "default") Use an alternative sound card. .PP .in +7 This card is used to control the sound volume or to mute/unmute the sound channels or elements as they are called from ALSA. .TP \fBALSA_Elements\fR = \flelements\fR (default: Master) This option defines the ALSA mixer elements (ALSA) which pbbuttonsd should control. Every combination is valid nevertheless if the combination makes sense or not. Valid element names for ALSA could be queried from the program amixer. .PP .in +7 The first element in the list is the master (not to confuse with the ALSA element \'Master\'), all following are slaves. Only the volume level of the master element is read back to adjust pbbuttonsd's internal volume reference. Slave elements will be set to master element's volume on every volume change. .TP .SH MODULE CDROM This module controls a CDROM drive. .TP \fBDevice\fR = \fIdevicename\fR (default: /dev/cdrom) Use an alternative cdrom device. The device will be checked but no error would be reported if it did't exist because of a possibly not plugged-in CDROM drive. .TP \fBejectcdkey\fR = \fIkey\fR (default: KEY_EJECTCD) Use alternative key to eject a CDROM. .TP \fBejectcdkeydelay\fR = \fItime in milliseconds\fR (default: 0) This option sets the delay time used for an additional validity check of the eject key to prevent ejects of the CD by mistake due to small keyboards. The key must be pressed for longer than the given time period to eject the CDROM. The value must be given in milliseconds, for example to set a delay time of 2 seconds set the delay time to 2000. If the given value is zero, the CD-Drive reacts immediatly. .SH MODULE PMAC This module contains all the hardware dependent stuff for Apple PowerBooks. .TP \fBDevice_ADB\fR = \fIdevicename\fR (default: /dev/adb) Use an alternative ADB device. .PP .in +7 This device is used to read battery status and some other information. It is also used to control the keyboard and trackpad settings. .TP \fBDevice_PMU\fR = \fIdevicename\fR (default: /dev/pmu) Use an alternative PMU device. .PP .in +7 This device is used to control sleep mode and the backlight device. .TP \fBTPModeUpKey\fR = \fIkey\fR (default: ALT+KEY_BRIGHTNESSUP) Use alternative key to cycle forward through the trackpad operating modes. These modes are: notap, tap, drag, lock. Please see your computer manual to learn what those modes mean and how they work. .TP \fBTPModeDownKey\fR = \fIkey\fR (default: ALT+KEY_BRIGHTNESSDOWN) Use alternative key to cycle backward through the trackpad operation modes. .TP \fBTPMode\fR = \fItrackpad mode\fR (default: none) If this option was set, the given trackpad mode will be setup during startup otherwise the current mode won't be changed. Following modes are supported: notap, tap, drag and lock. .TP \fBNoTapTyping\fR = \fI[yes | no]\fR (default: no) Usually the trackpad would stay in it's current mode if the keyboard was used. With this option set the trackpad would be configured in \'notap-mode\' as soon as the first key is hit. This will prevent cursor movement through accidently touching the trackpad while typing. .PP .in +7 \fBWARNING:\fR It was reported that computers using this option and recent kernels might freeze once and again. The reason is not known yet. Therefore please use this option with care. .PP .in +7 This option is only usefull if \fBmouseemu\fR is not running. \fBMouseemu\fR offer this and some more trackpad related functions. Set this option to \'no\', if you have \fBmouseemu\fR running. .TP \fBKBDMode\fR = \fIkeyboard mode\fR (default: none) If this option was set, the given keyboard mode will be setup during startup otherwise the current mode won't be changed. Following modes are supported: fkeysfirst and fkeyslast. .TP \fBbatlog\fR = \fIbattery log mode\fR (default: none) Setting this option to one of the following values activates some sort of battery data logging. .PP .ad l .in +13 .ti -6 \fBnone\fR disable battery data logging .PP .in +13 .ti -6 \fBcycle\fR Pbbuttonsd counts the battery cycles so that it would be possible to estimate batteries lifetime. Usually Li-Ion batteries allow 500 charge/discharge cycles. .PP .in +13 .ti -6 \fBlog\fR Pbbuttonsd writes detailed battery data like current charge, voltage, time remaining, etc. on a regularly time basis to a log file. Also charge/discharge cycles will be counted and displayed. Each charge/discharge cycle gets its own battery log file. This data should allow investigation of a battery ageing. This option includes the \fBcycle\fR option. .SH "SEE ALSO" pbbuttonsd (1) .SH AUTHOR Matthias Grimm. pbbuttonsd-0.8.1a/libpbbipc/0002777000175000017500000000000010652456416013013 500000000000000pbbuttonsd-0.8.1a/libpbbipc/pbb.h0000644000175000017500000000420110641705137013631 00000000000000#ifndef INCLUDE_PBB_H #define INCLUDE_PBB_H /* ---------------------------------------------------------------------------- * pbb.h * prototypes and definitions for pbbuttons library. * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #include "pbbipc.h" #include "pbberrno.h" #include "pbbmisc.h" #include "pbbtaglist.h" #include "pbbtags.h" #include "pbblist.h" #define MAXPROTECTEDTAGS 20 #define MODE_QUERY 0 /* modes for new handle_tags routines */ #define MODE_CONFIG 1 #define PBBDF_NONE 0 /* Flags for deamonise functions */ #define PBBDF_FORCE 1 enum {PBBDS_NONE, PBBDS_PREPARE, PBBDS_CHILD, PBBDS_PARENT}; /* --- private module data structure of libpbbuttons --- */ struct libbase { int serverport; int msgport; struct tagitem ptags[MAXPROTECTEDTAGS]; int ptagcount; int mode; /* client or server */ int daemon; /* deamon status, possible values see PBBDS_* */ char pidfile[80]; /* name of the pidfile to write the child pid to */ int filtermode; /* = 0: IPC-filtering off = 1: no IPC-Messages will be accepted = 2: only IPC-messages from 'uid' will be accepted */ uid_t uid; /* user-id for IPC-filter */ int rc; /* return code of last launched program */ int timeforcmd; /* timeout value for lauched programs */ struct listhead clients; /* list of registered clients for IPC messages */ }; struct pbbclient { int port; int pid; unsigned int flags; char *name; }; /* prototypes */ /* main initialisation function, call before using any other function */ void init_libpbb(); /* this should be the nearly last function you called in your program */ void exit_libpbb (); int prepare_daemon (char *name, char *pidfile, int flags); int create_daemon (); #endif /* INCLUDE_PBB_H */ pbbuttonsd-0.8.1a/libpbbipc/pbbmisc.h0000644000175000017500000000252210641705140014503 00000000000000#ifndef INCLUDE_PBBMISC_H #define INCLUDE_PBBMISC_H /* ---------------------------------------------------------------------------- * pbbmisc.h * prototypes and definitions for misc functions in pbb library. * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #define STDBUFFERLEN 120 #define MAXARGS 10 /* maximum args for command */ #define MAXCMDLEN 150 /* maximum length of command + args */ /* testtypes for check_devorfile() */ #define TYPE_FILE 0 #define TYPE_BLKDEV 1 #define TYPE_CHARDEV 2 #define TYPE_SYMLINK 3 #define TYPE_DIR 4 /* prototypes */ int check_devorfile(char *file, int type); int launch_program (char* maskstr, ...); int get_lastrc(); int get_timeforcmd(); void set_timeforcmd(int timeout); int check_permissions (char *file, uid_t uid, mode_t perms, int mask); int get_owner (char *file); int get_permissions (char *file); int keydelayms (struct timeval *start, int value, int delay); void cleanup_buffer(char *buffer); int axtoi (char *arg); #endif /* INCLUDE_PBBMISC_H */ pbbuttonsd-0.8.1a/libpbbipc/pbbipc.h0000644000175000017500000000524010641705140014323 00000000000000#ifndef INCLUDE_PBBIPC_H #define INCLUDE_PBBIPC_H /* ---------------------------------------------------------------------------- * pbbipc.h * definitions for client/server inter process communication. * * Copyright 2002-2004 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * * Best view with tabwidth=4 * ----------------------------------------------------------------------------*/ #include #include #include #include "pbbtaglist.h" #define CHUNK(a,b,c,d) ((a)<<24 | (b)<<16 | (c)<<8 | (d)) #define SERVERPORTKEY CHUNK('P', 'B', 'B', 'S') #define MESSAGETYPE CHUNK('P', 'B', 'B', 'M') #define MSGMAX 8192 /* from */ #define LIBMODE_SERVER 1 #define LIBMODE_CLIENT 0 /* action codes */ #define REGISTERCLIENT 1 /* arg = msgport */ #define UNREGISTERCLIENT 2 /* arg = msgport */ #define REGFAILED 3 /* no args */ #define CLIENTEXIT 4 /* no args */ #define GETCLIENTLIST 5 /* no args */ #define CHANGEVALUE 10 /* arg = taglist */ #define CHANGEERROR 11 /* arg = taglist */ #define WARNING 12 /* arg = taglist */ #define READVALUE 13 /* arg = taglist */ struct pbbmessage { long messagetype; int returnport; int action; struct tagitem taglist[1]; }; /* public prototypes */ int ipc_init (char *name, int mode, int reg); void ipc_exit (); int ipc_send (int mp, int action, struct tagitem *taglist); int ipc_receive (void *buffer, size_t bufferlen); /* client only functions */ int singletag_to_server (int action, tag_t tag, tag_t data); /* server only functions */ int register_client (int cmsgport, struct tagitem *taglist); int unregister_client (int cmsgport); void singletag_to_clients (int action, tag_t tag, tag_t data); void distribute_to_clients (int action, struct tagitem *taglist); int ipc_protect_tag (tag_t tag); void ipc_filteruser (uid_t uid); void ipc_filterall (); void ipc_filterclear (); /* private prototypes */ int ipc_serverinit (); int ipc_clientinit (char *name, int flags); int ipc_createport (key_t keyval); int ipc_findport (key_t keyval); int ipc_removeport (int mp); int ipc_putmessage (int mp, struct pbbmessage *msg, size_t len); int ipc_getmessage (int mp, long type, struct pbbmessage *msg, size_t len); int ipc_getmessagepart (int mp, long type, struct pbbmessage *msg, size_t len); uid_t ipc_getportowner (int mp); void ipc_sendclientlist (int port); /*debug */ void peep_ipc (struct tagitem *taglist); #endif /* INCLUDE_PBBIPC_H */ pbbuttonsd-0.8.1a/libpbbipc/pbbtaglist.h0000644000175000017500000000534010641705140015220 00000000000000#ifndef INCLUDE_PBBTAGLIST_H #define INCLUDE_PBBTAGLIST_H /** * @brief prototypes and generic definitions for taglists * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file libpbbipc/pbbtaglist.h * @author Matthias Grimm */ #define TAG_END 0 #define TAG_SKIP 1 #define FLG_STRING 0x8000 #define FLG_PRIVATE 0x4000 #define FLG_ERROR 0x2000 #define FLG_NOPEEP 0x1000 /* for pbbuttonsd internal use only */ #define FLG_DEPRECIATED 0x0800 /* for pbbuttonsd internal use only */ /** * This mask removes all control bits from a tag identifier so that * the pure identifier is the result. It should always be used before * comparing any tag identifiers. */ #define TAGMASK ~(FLG_ERROR | FLG_NOPEEP | FLG_DEPRECIATED) /* Flags for TAG_SYSINFO */ #define SYSINFO_CONFIGWRITABLE (1<<1) #define SYSINFO_HAVELMU (1<<2) #define SYSINFO_SLEEPSUPPORTED (1<<3) #define SYSINFO_PMUDSUPPORT (1<<4) #define SYSINFO_HAVEOSS (1<<5) #define SYSINFO_HAVEALSA (1<<6) #define SYSINFO_HAVEIBAM (1<<7) #define SYSINFO_PB_USB_TPAD (1<<8) #define SYSINFO_PB_USB_KBD (1<<9) /* Flags for TAG_CLIENTFLAGS */ #define CLIENT_REGISTER (1<<0) /* register client at server */ #define CLIENT_EXCLUSIVE (1<<1) /* only one instance allowed */ #define CLIENT_REPLACEMENT (1<<2 | CLIENT_EXCLUSIVE) /* new instance replaces old one */ typedef unsigned long tag_t; /** * @brief tag structure - type independent parameter / value pair * * This structure is able to hold a parameter and its value. The tag is * the identifier of the following data. So the parameter, its data type * and meaning are defined through the tag, which from the other side * identifies the parameter. * * If multiple tag-items were queued in an array, we would get a tag-list. * This tag-list could hold any amount of parameters. To mark the end of a * tag-list the last tag is a special value TAG_END defined in taglist.h. */ struct tagitem { /** * @brief parameter name also called tag */ tag_t tag; /** * @brief data value. The data type is defined through tag */ tag_t data; }; /* prototypes */ tag_t tagfind (struct tagitem *taglist, tag_t tag, tag_t val); struct tagitem* find_tagitem (struct tagitem *taglist, tag_t tag); void tagskip (struct tagitem *taglist, tag_t tag); int tagerror (struct tagitem *tag, int error); void taglist_init (struct tagitem *taglist); void taglist_add (struct tagitem *taglist, tag_t tag, tag_t val); int taglist_count (struct tagitem *taglist); #endif /* INCLUDE_PBBTAGLIST_H */ pbbuttonsd-0.8.1a/libpbbipc/pbbtags.h0000644000175000017500000001654610641705140014521 00000000000000#ifndef INCLUDE_TAGS_H #define INCLUDE_TAGS_H /* --------------------------------------------------------------- * tags.h * definitions of TAGS, functions and structures are defined in * pbbtaglist.h and pbbtaglist.c * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * * ATTENTION: Don't use tags marked as "depreciated". They will * be removed in future. * * optimized for tabwith=4 * ---------------------------------------------------------------*/ #include "pbbtaglist.h" #define PBBLIB 1 << 24 #define TAG_CLIENTNAME PBBLIB | FLG_STRING | 1 #define TAG_CLIENTFLAGS PBBLIB | 2 #define TAG_CLIENTPID PBBLIB | 3 #define TAG_CLIENTPORT PBBLIB | 4 /* Pri0 Tags */ #define MOD_SYSTEM 1 << 16 #define TAG_KEYCODE MOD_SYSTEM | FLG_PRIVATE | 1 #define TAG_KEYREPEAT MOD_SYSTEM | FLG_PRIVATE | 2 #define TAG_MODIFIER MOD_SYSTEM | FLG_PRIVATE | 3 #define TAG_MOUSERELX MOD_SYSTEM | FLG_PRIVATE | 5 #define TAG_MOUSERELY MOD_SYSTEM | FLG_PRIVATE | 6 #define TAG_USERALLOWED MOD_SYSTEM | FLG_PRIVATE | FLG_STRING | 8 #define TAG_SAVECONFIG MOD_SYSTEM | 9 #define TAG_VERSION MOD_SYSTEM | FLG_STRING | 10 #define TAG_AUTORESCAN MOD_SYSTEM | 11 #define TAG_TIMEFORCMD MOD_SYSTEM | 12 #define TAG_SYSINFO MOD_SYSTEM | 13 #define TAG_REINIT MOD_SYSTEM | 15 #define TAG_SYSINFOSLAVE MOD_SYSTEM | FLG_PRIVATE | 16 /* Pri1 tags */ #define MOD_LAPTOP 2 << 16 #define TAG_BACKLIGHTMAX MOD_LAPTOP | FLG_PRIVATE | 1 #define TAG_BACKLIGHTLEVEL MOD_LAPTOP | FLG_PRIVATE | 2 #define TAG_COVERSTATUS MOD_LAPTOP | FLG_PRIVATE | 3 #define TAG_POWERCHANGED MOD_LAPTOP | FLG_PRIVATE | 5 #define TAG_REQUESTSLEEP MOD_LAPTOP | FLG_PRIVATE | 6 #define TAG_SLEEPSUPPORTED MOD_LAPTOP | 7 #define TAG_PREPAREFORSLEEP MOD_LAPTOP | FLG_PRIVATE | 8 #define TAG_WAKEUPFROMSLEEP MOD_LAPTOP | FLG_PRIVATE | 9 #define TAG_TIMECHANGED MOD_LAPTOP | FLG_PRIVATE | 10 #define MOD_PMAC 3 << 16 #define TAG_PMUDEVICE MOD_PMAC | FLG_STRING | 1 #define TAG_ADBDEVICE MOD_PMAC | FLG_STRING | 2 #define TAG_TPMODEUPKEY MOD_PMAC | 3 #define TAG_TPMODEUPMOD MOD_PMAC | 4 #define TAG_TPMODEDOWNKEY MOD_PMAC | 5 #define TAG_TPMODEDOWNMOD MOD_PMAC | 6 #define TAG_TPMODE MOD_PMAC | 7 #define TAG_KBDMODE MOD_PMAC | 8 #define TAG_IDENTITY MOD_PMAC | FLG_STRING | 10 #define TAG_POWERSOURCE MOD_PMAC | 11 #define TAG_TIMEREMAINING MOD_PMAC | 12 #define TAG_AMBIENTLIGHT MOD_PMAC | 13 #define TAG_KEYBLIGHTLEVEL MOD_PMAC | FLG_PRIVATE | 14 #define TAG_KEYBLIGHTMAX MOD_PMAC | FLG_PRIVATE | 15 #define TAG_BATLOG MOD_PMAC | 16 #define TAG_BATCYCLE MOD_PMAC | 17 #define TAG_BATTERYPRESENT MOD_PMAC | 18 #define TAG_NOTAPTYPING MOD_PMAC | 19 #define TAG_AMBIENTLIGHTMAX MOD_PMAC | 20 /* Pri2 Tags */ #define MOD_DISPLAY 4 << 16 #define TAG_LCDILLUMUPKEY MOD_DISPLAY | 1 #define TAG_LCDILLUMUPMOD MOD_DISPLAY | 2 #define TAG_LCDILLUMDOWNKEY MOD_DISPLAY | 3 #define TAG_LCDILLUMDOWNMOD MOD_DISPLAY | 4 #define TAG_KBDILLUMUPKEY MOD_DISPLAY | 15 #define TAG_KBDILLUMUPMOD MOD_DISPLAY | 16 #define TAG_KBDILLUMDOWNKEY MOD_DISPLAY | 17 #define TAG_KBDILLUMDOWNMOD MOD_DISPLAY | 18 #define TAG_KBDILLUMONKEY MOD_DISPLAY | 19 #define TAG_KBDILLUMONMOD MOD_DISPLAY | 20 #define TAG_LCDAUTOADJUST MOD_DISPLAY | 12 #define TAG_BRIGHTNESS TAG_LCDBRIGHTNESS /* depreciated */ #define TAG_LCDBRIGHTNESS MOD_DISPLAY | 5 #define TAG_LCDFADINGSPEED MOD_DISPLAY | 10 #define TAG_LCDTHRESHOLD MOD_DISPLAY | 24 /* deprecated */ #define TAG_LCDAUTOADJMINBAT MOD_DISPLAY | 25 /* deprecated */ #define TAG_LCDAUTOADJMAXBAT MOD_DISPLAY | 26 /* deprecated */ #define TAG_LCDAUTOADJMINAC MOD_DISPLAY | 27 /* deprecated */ #define TAG_LCDAUTOADJMAXAC MOD_DISPLAY | 28 /* deprecated */ #define TAG_KBDAUTOADJUST MOD_DISPLAY | 13 #define TAG_KBDBRIGHTNESS MOD_DISPLAY | 21 #define TAG_KBDONBRIGHTNESS MOD_DISPLAY | 29 #define TAG_KBDFADINGSPEED MOD_DISPLAY | 23 #define TAG_KBDTHRESHOLD MOD_DISPLAY | 14 /* deprecated */ #define TAG_BRIGHTNESSOP MOD_DISPLAY | FLG_PRIVATE | 6 #define TAG_FRAMEBUFFERDEVICE MOD_DISPLAY | FLG_STRING | 8 #define TAG_BLANKFRAMEBUFFER MOD_DISPLAY | 9 #define TAG_DIMFULLYDARK MOD_DISPLAY | 11 #define TAG_CRTMIRROR MOD_DISPLAY | 30 #define TAG_CRTMIRRORKEY MOD_DISPLAY | 31 #define TAG_CRTMIRRORMOD MOD_DISPLAY | 32 #define TAG_BACKLIGHTDRIVER MOD_DISPLAY | FLG_STRING | 33 #define TAG_LCDAUTOADJBAT MOD_DISPLAY | 34 #define TAG_LCDAUTOADJAC MOD_DISPLAY | 35 #define TAG_KBDAUTOADJBAT MOD_DISPLAY | 36 #define TAG_KBDAUTOADJAC MOD_DISPLAY | 37 #define MOD_MIXER 5 << 16 #define TAG_MIXER MOD_MIXER | FLG_STRING | 1 #define TAG_MIXERDEVICE TAG_MIXER /* deprecated */ #define TAG_VOLUMEUPKEY MOD_MIXER | 2 #define TAG_VOLUMEUPMOD MOD_MIXER | 3 #define TAG_VOLUMEDOWNKEY MOD_MIXER | 4 #define TAG_VOLUMEDOWNMOD MOD_MIXER | 5 #define TAG_MUTEKEY MOD_MIXER | 6 #define TAG_MUTEMOD MOD_MIXER | 7 #define TAG_MIXERINITDELAY MOD_MIXER | 8 /* deprecated */ #define TAG_VOLUME MOD_MIXER | 9 #define TAG_MUTE MOD_MIXER | 10 #define TAG_MIXERCHANNELS MOD_MIXER | FLG_STRING | 11 #define TAG_SOUNDSYSTEM MOD_MIXER | 12 /* deprecated */ #define TAG_SOUNDSYSTEMCFG MOD_MIXER | 13 /* deprecated */ #define TAG_MIXERCARD MOD_MIXER | FLG_STRING | 14 /* deprecated */ #define TAG_MIXERELEMENTS MOD_MIXER | FLG_STRING | 15 /* deprecated */ #define TAG_MIXERDRIVER MOD_MIXER | FLG_STRING | 16 #define MOD_CDROM 6 << 16 #define TAG_CDROMDEVICE MOD_CDROM | FLG_STRING | 1 #define TAG_EJECTCDKEY MOD_CDROM | 2 #define TAG_EJECTCDMOD MOD_CDROM | 3 #define TAG_EJECTCDKEYDELAY MOD_CDROM | 4 #define TAG_EJECTCD MOD_CDROM | 5 #define MOD_POWER 7 << 16 #define TAG_SCRIPTPMCS MOD_POWER | FLG_STRING | 2 #define TAG_SLEEPKEY MOD_POWER | 7 #define TAG_SLEEPMOD MOD_POWER | 8 #define TAG_SLEEPKEYDELAY MOD_POWER | 9 #define TAG_GOTOSLEEP MOD_POWER | 10 #define TAG_BWLFIRST MOD_POWER | 11 #define TAG_BWLSECOND MOD_POWER | 12 #define TAG_BWLLAST MOD_POWER | 13 #define TAG_CURRENTBWL MOD_POWER | 14 #define TAG_SLEEPINSECONDS MOD_POWER | 15 #define TAG_CPULOADSLEEPLOCK MOD_POWER | 16 #define TAG_CPULOADMIN MOD_POWER | 17 #define TAG_CPULOADPERIOD MOD_POWER | 18 #define TAG_NETLOADSLEEPLOCK MOD_POWER | 19 #define TAG_NETLOADMIN MOD_POWER | 20 #define TAG_NETLOADPERIOD MOD_POWER | 21 #define TAG_NETLOADDEV MOD_POWER | FLG_STRING | 22 #define TAG_EMERGENCYACTION MOD_POWER | 23 #define TAG_HEARTBEATBEEP MOD_POWER | 24 #define TAG_POLICY MOD_POWER | 26 #define TAG_GOTOHIBERNATE MOD_POWER | 27 #define TAG_IBAMDATADIR MOD_POWER | FLG_STRING | 28 #define TAG_CHARGETIME MOD_POWER | 29 #define TAG_ONAC_POLICY MOD_POWER | 50 #define TAG_ONAC_TIMERACTION MOD_POWER | 51 #define TAG_ONAC_COVERACTION MOD_POWER | 52 #define TAG_ONAC_KEYACTION MOD_POWER | 53 #define TAG_ONAC_TIMESUSPEND MOD_POWER | 54 #define TAG_ONAC_TIMEDIM MOD_POWER | 55 #define TAG_ONBATT_POLICY MOD_POWER | 60 #define TAG_ONBATT_TIMERACTION MOD_POWER | 61 #define TAG_ONBATT_COVERACTION MOD_POWER | 62 #define TAG_ONBATT_KEYACTION MOD_POWER | 63 #define TAG_ONBATT_TIMESUSPEND MOD_POWER | 64 #define TAG_ONBATT_TIMEDIM MOD_POWER | 65 #endif /* INCLUDE_TAGS_H */ pbbuttonsd-0.8.1a/libpbbipc/pbberrno.h0000644000175000017500000000270110641705137014702 00000000000000#ifndef INCLUDE_PBBERRNO_H #define INCLUDE_PBBERRNO_H /* ---------------------------------------------------------------------------- * errorcodes.h * definitions of errorcodes used in pbbuttonsd and its modules * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #define E_OK 0 #define E_PERM 1 #define E_PRIVATE 2 #define E_NOEXIST 3 #define E_NOCHAR 4 #define E_NOBLK 5 #define E_NOFILE 6 #define E_NOLINK 7 #define E_BUFOVL 8 #define E_OPEN 9 #define E_FORMAT 10 #define E_MSGPORT 11 #define E_TWICE 12 #define E_INFO 13 #define E_NOSERVER 14 #define E_REGISTER 15 #define E_USER 16 #define E_RIGHTS 17 #define E_NOWRITE 18 #define E_NOREAD 19 #define E_CLDKILL 20 #define E_CLDEXIT 21 #define E_CLDSIG 22 #define E_NOMEM 23 #define E_NOSUPPORT 24 #define E_INVALID 25 #define E_CLDFAIL 26 #define E_OLDPORT 27 #define E_OPTEXISTS 28 #define E_NODIR 29 enum pbberrtype { PBB_ERR, PBB_WARN, PBB_INFO }; /* prototypes */ void print_error (char *msg, ...); void print_msg (enum pbberrtype type, char *msg, ...); void print_message (enum pbberrtype type, char *msg, va_list args); #endif /* INCLUDE_PBBERRNO_H */ pbbuttonsd-0.8.1a/libpbbipc/pbblist.h0000644000175000017500000000243010641705142014523 00000000000000#ifndef INCLUDE_PBBLIST_H #define INCLUDE_PBBLIST_H /* ---------------------------------------------------------------------------- * pbblist.h * prototypes and definitions for double linked lists * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ struct listnode { struct listnode *next; struct listnode *pred; int datalen; /* length of buffer behind node structure */ }; struct listhead { struct listnode *first; struct listnode *tail; /* always NULL */ struct listnode *tailpred; }; /* prototypes */ void initListHeader (struct listhead *lh); void appendListNode (struct listhead *lh, struct listnode *ln); struct listnode *removeListNode (struct listnode *ln); void freeListNode (struct listnode *ln); void freeList (struct listhead *lh); struct listnode *newListNode (int datalen); void *getNodeData (struct listnode *ln); void *getNodeDataEnd (struct listnode *ln); int getNodeCount (struct listhead *lh); #endif /* INCLUDE_PBBLIST_H */ pbbuttonsd-0.8.1a/libpbbipc/Makefile.am0000644000175000017500000000056010641705140014747 00000000000000## Process this file with automake to produce Makefile.in ## INCLUDES = -I/lib/modules/`uname -r`/build/include lib_LIBRARIES = libpbb.a include_HEADERS = pbb.h pbbmisc.h pbbipc.h pbbtaglist.h pbbtags.h pbberrno.h pbblist.h libpbb_a_SOURCES = pbb_lib.c pbb_ipc.c pbb_errno.c pbb_misc.c pbb_taglist.c pbb_list.c gettext_macros.h if DEBUG AM_CFLAGS = -DDEBUG endif pbbuttonsd-0.8.1a/libpbbipc/Makefile.in0000644000175000017500000003543510652444336015002 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libpbbipc DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" libLIBRARIES_INSTALL = $(INSTALL_DATA) LIBRARIES = $(lib_LIBRARIES) AR = ar ARFLAGS = cru libpbb_a_AR = $(AR) $(ARFLAGS) libpbb_a_LIBADD = am_libpbb_a_OBJECTS = pbb_lib.$(OBJEXT) pbb_ipc.$(OBJEXT) \ pbb_errno.$(OBJEXT) pbb_misc.$(OBJEXT) pbb_taglist.$(OBJEXT) \ pbb_list.$(OBJEXT) libpbb_a_OBJECTS = $(am_libpbb_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libpbb_a_SOURCES) DIST_SOURCES = $(libpbb_a_SOURCES) includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEBUG_FALSE = @DEBUG_FALSE@ DEBUG_TRUE = @DEBUG_TRUE@ DEFS = @DEFS@ DOT = @DOT@ DOT_PATH = @DOT_PATH@ DOXYGEN = @DOXYGEN@ DOXYGEN_DOCS_ENABLED_FALSE = @DOXYGEN_DOCS_ENABLED_FALSE@ DOXYGEN_DOCS_ENABLED_TRUE = @DOXYGEN_DOCS_ENABLED_TRUE@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GENCAT = @GENCAT@ GLIBC2 = @GLIBC2@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_ASPRINTF = @HAVE_ASPRINTF@ HAVE_DOT = @HAVE_DOT@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ HAVE_SNPRINTF = @HAVE_SNPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ HAVE_WPRINTF = @HAVE_WPRINTF@ HOSTCC = @HOSTCC@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ KBD_AUTOADJMODE = @KBD_AUTOADJMODE@ KBD_AUTOADJPARMAC = @KBD_AUTOADJPARMAC@ KBD_AUTOADJPARMBAT = @KBD_AUTOADJPARMBAT@ KBD_FADINGSPEED = @KBD_FADINGSPEED@ LCD_AUTOADJMODE = @LCD_AUTOADJMODE@ LCD_AUTOADJPARMAC = @LCD_AUTOADJPARMAC@ LCD_AUTOADJPARMBAT = @LCD_AUTOADJPARMBAT@ LCD_FADINGSPEED = @LCD_FADINGSPEED@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPTH = @LIBPTH@ LIBS = @LIBS@ LIBTHREAD = @LIBTHREAD@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ PACKAGE_LIBS = @PACKAGE_LIBS@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PB_LIBS = @PB_LIBS@ PB_OBJECTS = @PB_OBJECTS@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ QUIET = @QUIET@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WOE32DLL = @WOE32DLL@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ lib_LIBRARIES = libpbb.a include_HEADERS = pbb.h pbbmisc.h pbbipc.h pbbtaglist.h pbbtags.h pbberrno.h pbblist.h libpbb_a_SOURCES = pbb_lib.c pbb_ipc.c pbb_errno.c pbb_misc.c pbb_taglist.c pbb_list.c gettext_macros.h @DEBUG_TRUE@AM_CFLAGS = -DDEBUG all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps libpbbipc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu --ignore-deps libpbbipc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLIBRARIES: $(lib_LIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(libLIBRARIES_INSTALL) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(libLIBRARIES_INSTALL) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done @$(POST_INSTALL) @list='$(lib_LIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ p=$(am__strip_dir) \ echo " $(RANLIB) '$(DESTDIR)$(libdir)/$$p'"; \ $(RANLIB) "$(DESTDIR)$(libdir)/$$p"; \ else :; fi; \ done uninstall-libLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(libdir)/$$p'"; \ rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLIBRARIES: -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) libpbb.a: $(libpbb_a_OBJECTS) $(libpbb_a_DEPENDENCIES) -rm -f libpbb.a $(libpbb_a_AR) libpbb.a $(libpbb_a_OBJECTS) $(libpbb_a_LIBADD) $(RANLIB) libpbb.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLIBRARIES mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includeHEADERS install-exec-am: install-libLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-info-am \ uninstall-libLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am \ install-includeHEADERS install-info install-info-am \ install-libLIBRARIES install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-includeHEADERS uninstall-info-am \ uninstall-libLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pbbuttonsd-0.8.1a/libpbbipc/pbb_lib.c0000644000175000017500000000553010641705140014452 00000000000000/* ---------------------------------------------------------------------------- * pbb_lib.c * main funtions of pbb library * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #include #include #include #include "pbb.h" struct libbase libdata; /* library basic data */ /*--------------------------------------------------------------------- * void init_libpbbuttons () * * This function initialises the basic library structure and * have to be called before any library funcion is used. *---------------------------------------------------------------------*/ void init_libpbb () { struct libbase *base = &libdata; base->serverport = 0; base->msgport = 0; base->ptagcount = 0; base->daemon = PBBDS_NONE; /* don't detach by default */ base->filtermode = 0; /* no filtering by default */ base->uid = geteuid(); /* uid from current process */ base->pidfile[0] = '\0'; base->rc = 0; base->timeforcmd = 10; /* 10 seconds by default */ taglist_init (base->ptags); initListHeader (&base->clients); } void exit_libpbb () { struct libbase *base = &libdata; freeList (&base->clients); if (base->daemon == PBBDS_CHILD) unlink (base->pidfile); } /* This function is for compatibility reasons. It should * be called as early as possible to show the library that * this process becomes a daemon so that error messages * could be redirected into a logfile instead of printing * them to console. It also saves the pidfile name for * later use. */ int prepare_daemon (char *name, char *pidfile, int flags) { struct libbase *base = &libdata; int err; err = check_devorfile(pidfile, TYPE_FILE); /* If the caller set PBBDF_FORCE, it wouldn't matter if the pidfile already exists. The caller takes care about it. */ if (err == 0 && flags == PBBDF_FORCE) err = E_NOEXIST; if (err == E_NOEXIST) { strncpy (base->pidfile, pidfile, sizeof(base->pidfile)); base->daemon = PBBDS_PREPARE; openlog (name, 0, LOG_DAEMON); } return err; } int create_daemon () { struct libbase *base = &libdata; int pid = 0; FILE *fh; if (base->daemon == PBBDS_PREPARE) { if ((pid = fork()) == 0) { base->daemon = PBBDS_CHILD; /* this is the child now */ fclose(stdin); fclose(stdout); fclose(stderr); chdir("/"); setsid(); } else { base->daemon = PBBDS_PARENT; /* this is the parent now */ /* the parent process have to save the pid */ if ((fh = fopen (base->pidfile, "w")) != 0) { fprintf (fh, "%i\n", pid); fclose (fh); } } } return pid; } pbbuttonsd-0.8.1a/libpbbipc/pbb_ipc.c0000644000175000017500000003513010641705140014456 00000000000000/* ---------------------------------------------------------------------------- * pbbuttons_ipc.c * functions for client/server inter process communication * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include "pbb.h" extern struct libbase libdata; /* Init function called by the program init procedure. Function is known by the prginitab. It does module data initialisation */ int ipc_init (char *name, int mode, int flags) { if (mode == LIBMODE_SERVER) return ipc_serverinit (); else return ipc_clientinit (name, flags); } int ipc_serverinit () { struct libbase *base = &libdata; struct pbbmessage pbbmsg; /* includes empty taglist */ int sPort, i; base->mode = LIBMODE_SERVER; if ((sPort = ipc_findport(SERVERPORTKEY)) < 0) { if ((base->msgport = ipc_createport(SERVERPORTKEY)) < 0) { return E_MSGPORT; } } else { if ((base->msgport = ipc_createport( (key_t) getpid() )) >= 0) { ipc_send(sPort, READVALUE, NULL); /* send test message */ for (i=10; i > 0; i--) { usleep(100); /* timeout loop for the answer */ if (ipc_getmessage (base->msgport, 0, &pbbmsg, sizeof(struct pbbmessage)) >= 0) break; } ipc_removeport(base->msgport); if (i == 0) { ipc_removeport(sPort); /* remove stall pbbuttonsd msgport */ ipc_serverinit(); /* try again */ return E_OLDPORT; /* tell calling function that an old * port has been found and removed */ } } return E_TWICE; } base->serverport = base->msgport; return 0; } int ipc_clientinit (char *name, int flags) { struct libbase *base = &libdata; struct tagitem taglist[4]; base->mode = LIBMODE_CLIENT; taglist_init (taglist); taglist_add (taglist, TAG_CLIENTFLAGS, (long) flags); if (name) taglist_add (taglist, TAG_CLIENTNAME, (long) name); taglist_add (taglist, TAG_CLIENTPID, (long) getpid()); if ((base->serverport = ipc_findport(SERVERPORTKEY)) < 0) { return E_NOSERVER; } else if ((base->msgport = ipc_createport( (key_t) getpid() )) < 0) { return E_MSGPORT; } else if (flags & CLIENT_REGISTER) if ((ipc_send (0, REGISTERCLIENT, taglist)) < 0) { return E_REGISTER; } return 0; } /* Exit function called by the program exit procedure. Function is known by the prginitab. It does module data cleanup. */ void ipc_exit () { struct libbase *base = &libdata; if (base->mode == LIBMODE_SERVER) if (base->daemon == PBBDS_PARENT) base->msgport = -1; /* let messageport to child process */ else distribute_to_clients (CLIENTEXIT, NULL); /* send all clients 'good bye' */ else ipc_send (0, UNREGISTERCLIENT, NULL); if (base->msgport >= 0) ipc_removeport(base->msgport); } /* Function to send a ipc message to a given messageport. if the library was in client mode the message would be sent to the server and the parameter 'mp' will be ignored. if the pointer 'taglist' was NULL, an empty taglist would be created and sent to the receiver. */ int ipc_send (int mp, int action, struct tagitem *taglist) { struct libbase *base = &libdata; char msgbuffer[MSGMAX], *strptr, *strdata, *nullstr = ""; struct pbbmessage *pbbmsg; int n = 0; if (base->mode == LIBMODE_CLIENT) mp = base->serverport; pbbmsg = (struct pbbmessage *) msgbuffer; pbbmsg->returnport = base->msgport; pbbmsg->action = action; if (taglist == NULL) { pbbmsg->taglist[n].tag = TAG_END; pbbmsg->taglist[n].data = 0; } else do { pbbmsg->taglist[n].tag = taglist[n].tag; pbbmsg->taglist[n].data = taglist[n].data; } while (taglist[n++].tag != TAG_END); strptr = (char *) &pbbmsg->taglist[n]; n = 0; while (pbbmsg->taglist[n].tag) { /* copy and reloc stringdata in tags */ if ( !(pbbmsg->taglist[n].tag & FLG_ERROR) && (pbbmsg->taglist[n].tag & FLG_STRING)) { strdata = (char*) pbbmsg->taglist[n].data; if (strdata == NULL) strdata = nullstr; if (strptr + strlen (strdata) + 1 >= msgbuffer + sizeof (msgbuffer)) return -1; strcpy (strptr, strdata); pbbmsg->taglist[n].data = (tag_t) (strptr - msgbuffer); strptr += strlen (strdata) + 1 ; } n++; } if ((ipc_putmessage (mp, pbbmsg, (size_t) (strptr - msgbuffer))) == 0) return 0; /* message sent */ return -1; /* message not sent */ } /* This funcion will check it there are messages pending at the messageport. If so the message would be received and returned. In this case all string pointers in the buffer are adjusted and zero is returned. If it was something wrong with the message or no message was pending, -1 would be returned and the contents of the buffer is invalid. If REGISTERCLIENT or UNREGISTERCLIENT were received, the messages would be processed here directly. the returncode in this case is also -1. */ int ipc_receive (void *buffer, size_t bufferlen) { struct libbase *base = &libdata; struct pbbmessage *pbbmsg = (struct pbbmessage *) buffer; int n; uid_t owner; if (ipc_getmessage (base->msgport, 0, pbbmsg, bufferlen) < 0) { if (errno == -E2BIG) ipc_getmessagepart (base->msgport, 0, pbbmsg, bufferlen); } else if (pbbmsg->messagetype == MESSAGETYPE) { owner = ipc_getportowner (pbbmsg->returnport); n = 0; while (pbbmsg->taglist[n].tag) { if ((pbbmsg->action == CHANGEVALUE) && (base->filtermode == 1)) tagerror (&pbbmsg->taglist[n], E_PERM); else if ((pbbmsg->action == CHANGEVALUE) && (base->filtermode == 2) && (owner != base->uid)) tagerror (&pbbmsg->taglist[n], E_PERM); else if ((pbbmsg->action == CHANGEVALUE) && (base->filtermode == 0) && (tagfind (base->ptags, pbbmsg->taglist[n].tag, 0)) && (owner != geteuid())) /* protected tags are only changable by */ tagerror (&pbbmsg->taglist[n], E_PERM); /* the processowner of pbbuttonsd */ else if ((pbbmsg->taglist[n].tag & FLG_PRIVATE)) /* filter private tags */ tagerror (&pbbmsg->taglist[n], E_PRIVATE); else if ( !(pbbmsg->taglist[n].tag & FLG_ERROR) && (pbbmsg->taglist[n].tag & FLG_STRING)) /* reloc stringdata in tags */ pbbmsg->taglist[n].data += (long) buffer; n++; } if (base->mode == LIBMODE_SERVER) { if (pbbmsg->action == REGISTERCLIENT) { if (register_client (pbbmsg->returnport, pbbmsg->taglist)) ipc_send (pbbmsg->returnport, REGFAILED, NULL); return -1; /* message evaluated */ } else if (pbbmsg->action == UNREGISTERCLIENT) { unregister_client (pbbmsg->returnport); return -1; /* message evaluated */ } else if (pbbmsg->action == GETCLIENTLIST) { ipc_sendclientlist(pbbmsg->returnport); return -1; /* message evaluated */ } } return 0; /* message received */ } return -1; /* no message pending or ignore it */ } /* This function adds a client message port to the list. This client will get event messages * from the server in the future. If the client was successfull added, the return value * would be 0, otherwise -1 */ #ifdef DEBUG void printClients () { struct libbase *base = &libdata; struct listnode *it = base->clients.first; struct pbbclient *client; printf ("\nClients:\n\n"); printf (" PID | Name | Port | Flags\n"); printf (" ------+----------------------+---------+-----------\n"); while ((it = it->next)) { client = (struct pbbclient *) getNodeData (it->pred); printf (" %5d | %-20s | %7d | %08x\n", client->pid, (client->name) ? client->name : "", client->port, client->flags); } printf ("\n"); } #endif void ipc_sendclientlist (int port) { struct libbase *base = &libdata; struct listnode *it = base->clients.first; struct pbbclient *client; struct tagitem *taglist; int cnt; cnt = getNodeCount(&base->clients); if ((taglist = (struct tagitem *) malloc (sizeof(struct tagitem) * (cnt*4 + 1)))) { taglist_init (taglist); while ((it = it->next)) { client = (struct pbbclient *) getNodeData (it->pred); taglist_add (taglist, TAG_CLIENTPID, client->pid); taglist_add (taglist, TAG_CLIENTNAME, (tag_t) client->name); taglist_add (taglist, TAG_CLIENTPORT, client->port); taglist_add (taglist, TAG_CLIENTFLAGS, client->flags); } ipc_send (port, CHANGEVALUE, taglist); free (taglist); } } struct listnode * getPBBClientName (struct listhead *lh, char *name) { struct listnode *it = lh->first; struct pbbclient *client; if (name) { while ((it = it->next)) { client = (struct pbbclient *) getNodeData (it->pred); if (client->name) if (strcmp (name, client->name) == 0) return it->pred; } } return NULL; } int register_client (int cmsgport, struct tagitem *taglist) { struct libbase *base = &libdata; struct listnode *oldnode, *newnode; struct pbbclient *client; long flags; char *name; int len, pid; name = (char *) tagfind (taglist, TAG_CLIENTNAME, (long) NULL); flags = tagfind (taglist, TAG_CLIENTFLAGS, 0); pid = (int) tagfind (taglist, TAG_CLIENTPID, 0); oldnode = getPBBClientName (&base->clients, name); if ((oldnode) && (flags & CLIENT_EXCLUSIVE)) { if (flags & CLIENT_REPLACEMENT) { /* new client replaces old one. So wave old existing * client good bye */ client = (struct pbbclient *) getNodeData (oldnode); ipc_send (client->port, CLIENTEXIT, NULL); freeListNode (oldnode); } else /* client already exists, registration denied */ return -1; } len = (name) ? strlen (name) + 1 : 0; if ((newnode = newListNode (sizeof (struct pbbclient) + len))) { client = (struct pbbclient *) getNodeData (newnode); client->port = cmsgport; client->flags = flags; client->pid = pid; if (name) { client->name = (char*) client + sizeof (struct pbbclient); strcpy (client->name, name); } else client->name = NULL; appendListNode (&base->clients, newnode); #ifdef DEBUG printClients(); #endif return 0; } return -1; } /* This function removes a client message port from the list and reorganizes the * list so that gaps would be eliminated. This client won't get further messages from * the server. If the client was successfull removed, the return value would be 0, * otherwise -1 */ int unregister_client (int cmsgport) { struct libbase *base = &libdata; struct listnode *it = base->clients.first; struct pbbclient *client; while ((it = it->next)) { client = (struct pbbclient *) getNodeData (it->pred); if (client->port == cmsgport) { freeListNode (it->pred); #ifdef DEBUG printClients(); #endif return 0; } } return -1; } /* This function distributes a single tag to all clients. Most of the distribution tasks are single tag transmissions. */ void singletag_to_clients (int action, tag_t tag, tag_t data) { struct tagitem taglist[2]; taglist_init (taglist); taglist_add (taglist, tag, data); distribute_to_clients (action, taglist); } /* This function distributes a single tag to the server. */ int singletag_to_server (int action, tag_t tag, tag_t data) { struct tagitem taglist[2]; taglist_init (taglist); taglist_add (taglist, tag, data); return ipc_send (0, action, taglist); } /* This function sends a message with given code and value to every registered * client. If an error with a client occured, that client would be unregistered */ void distribute_to_clients (int action, struct tagitem *taglist) { struct libbase *base = &libdata; struct listnode *it = base->clients.first; struct pbbclient *client; #ifdef DEBUG peep_ipc (taglist); #endif while ((it = it->next)) { client = (struct pbbclient *) getNodeData (it->pred); if ((ipc_send (client->port, action, taglist)) != 0) unregister_client (client->port); } } int ipc_protect_tag (tag_t tag) { struct libbase *base = &libdata; if (base->ptagcount < (MAXPROTECTEDTAGS - 1)) { taglist_add (base->ptags, tag, 1); return 0; } return -1; } void ipc_filteruser (uid_t uid) { struct libbase *base = &libdata; base->filtermode = 2; base->uid = uid; } void ipc_filterall () { struct libbase *base = &libdata; base->filtermode = 1; } void ipc_filterclear () { struct libbase *base = &libdata; base->filtermode = 0; } /* ---------------------- LOW LEVEL MESSAGE FUNCTIONS ----------------------- */ /* This function create an new message port with world read/write permissions. The result is an errorcode or an IPC identifier for the messageport */ int ipc_createport (key_t keyval) { int mp; int perm = 0622; /* permissions for the messageport */ if ((mp = msgget(keyval, IPC_CREAT | IPC_EXCL | perm)) == -1) { return -errno; } return mp; } /* This function look up a message port. If it was found the IPC identifier would be returned. Otherwise an errorcode will be returned. */ int ipc_findport (key_t keyval) { int mp; if ((mp = msgget(keyval, 0)) == -1) return -errno; return mp; } /* This function removed a messageport from the kernel list. */ int ipc_removeport (int mp) { if( msgctl( mp, IPC_RMID, 0) == -1) return -errno; return 0; } /* This function puts a message to a given IPC messagequeue */ int ipc_putmessage (int mp, struct pbbmessage *msg, size_t len) { msg->messagetype = MESSAGETYPE; if (msgsnd (mp, msg, len - sizeof(long), 0) == -1) return -errno; return 0; } /* This function polls the next message from the given IPC message queue. if there is no new message pending it returns immediately with a corresponding return code. */ int ipc_getmessage (int mp, long type, struct pbbmessage *msg, size_t len) { if (msgrcv (mp, msg, len, type, IPC_NOWAIT) == -1) return -errno; return 0; } /* This function polls the next message from the given IPC message queue. if there is no new message pending it returns immediately with a corresponding return code. This function gets also messages that are to big for the buffer. In this case the buffer is filled to its end and the rest of the message is lost. */ int ipc_getmessagepart (int mp, long type, struct pbbmessage *msg, size_t len) { if (msgrcv (mp, msg, len, type, IPC_NOWAIT | MSG_NOERROR) == -1) return -errno; return 0; } /* This function reads the creator-id of an given port. This is needed to verify permissions. The creator-id is used because the owner-id of a messageport could be changed by the owner, not so the creator-id. */ uid_t ipc_getportowner (int mp) { struct msqid_ds qbuf; if (msgctl (mp, IPC_STAT, &qbuf) != -1) return qbuf.msg_perm.cuid; return -1; } pbbuttonsd-0.8.1a/libpbbipc/pbb_errno.c0000644000175000017500000000620310641705140015027 00000000000000/* ---------------------------------------------------------------------------- * pbb_errno.c * libpbb funtions to handle error messages * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #if defined(HAVE_ICONV) && defined(HAVE_LANGIINFO_CODESET) && defined(ENABLE_NLS) # include # include # include #endif #include "pbb.h" #include "gettext_macros.h" extern struct libbase libdata; /* This function is depreciated and should not be used in new developments or * changes of existing clients. Use replacement function print_msg() instead. */ void print_error (char *msg, ...) { va_list args; va_start (args, msg); print_message (PBB_ERR, msg, args); va_end (args); } void print_msg (enum pbberrtype type, char *msg, ...) { va_list args; va_start (args, msg); print_message (type, msg, args); va_end (args); } void print_message (enum pbberrtype type, char *msg, va_list args) { struct libbase *base = &libdata; va_list targs; char inbuffer[200], *inptr = inbuffer; int offset, level; #if defined(HAVE_ICONV) && defined(HAVE_LANGIINFO_CODESET) && defined(ENABLE_NLS) iconv_t cvh; char outbuffer[200], *outptr = outbuffer; size_t count, inidx, outidx; #endif va_copy (targs, args); switch (type) { case PBB_ERR: snprintf (inbuffer, sizeof(inbuffer) - 1, "%s: ", _("ERROR")); level = LOG_ERR; break; case PBB_WARN: snprintf (inbuffer, sizeof(inbuffer) - 1, "%s: ", _("WARNING")); level = LOG_WARNING; break; case PBB_INFO: snprintf (inbuffer, sizeof(inbuffer) - 1, "%s: ", _("INFO")); default: level = LOG_INFO; } offset = strlen (inbuffer); vsnprintf (&inbuffer[offset], sizeof(inbuffer) - offset - 1, msg, targs); va_end (targs); #if defined(HAVE_ICONV) && defined(HAVE_LANGIINFO_CODESET) && defined(ENABLE_NLS) inidx = strlen(inbuffer); outidx = sizeof(outbuffer); if ((cvh = iconv_open (nl_langinfo(CODESET), bind_textdomain_codeset(textdomain(NULL), NULL))) != (iconv_t) -1) { count = iconv (cvh, &inptr, &inidx, &outptr, &outidx); inptr = count == -1 ? inbuffer : outbuffer; *outptr = '\0'; /* iconv doesn't terminate strings with '\0' */ iconv_close (cvh); } #endif /* PBB_ERR PBB_WARN PBB_INFO * (LOG_ERR) (LOG_WARNING) (LOG_INFO) * PBBDS_NONE stderr stderr stderr * PBBDS_PREPARE stderr + syslog syslog syslog * PBBDS_PARENT stderr + syslog syslog syslog * PBBDS_CHILD syslog syslog syslog */ if (base->daemon != PBBDS_NONE) { if (type == PBB_ERR && base->daemon != PBBDS_CHILD) fprintf(stderr, inptr); syslog(level, inptr); } else fprintf(stderr, inptr); } pbbuttonsd-0.8.1a/libpbbipc/pbb_misc.c0000644000175000017500000001613610641705140014643 00000000000000/** * @brief usefull misceanlous functions * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file libpbbipc/pbb_misc.c * @author Matthias Grimm */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "pbb.h" /** * @brief Prototype for getpgid() * * The prototype for getpgid() should be in unistd.h but although it is * included above the compiler complains with "implicit declaration for * getpgid" if this line is missing. This must be further investigated. */ extern pid_t getpgid (pid_t pid); extern struct libbase libdata; /** * @brief Checks a filetype of a file * * This function checks the existance and the filetype of a given * file and returns the result. The result is '0' if the given file * exists and matches the desired filetype. Otherwise an error code * is returned. * * @param *file Name of the file to check * @param type required file type. Possible are TYPE_SYMLINK, * TYPE_CHARDEV, TYPE_BLKDEV, TYPE_FILE and * TYPE_DIR. * @return '0' if the the file exists and is of the required file type * '1' otherwise. */ int check_devorfile (char *file, int type) { struct stat stat_buf; int rc; if (type == TYPE_SYMLINK) rc = lstat(file, &stat_buf); /* don't follow symlinks */ else rc = stat(file, &stat_buf); /* follow symlinks */ if (rc) return E_NOEXIST; else switch (type) { case TYPE_CHARDEV: if(!S_ISCHR(stat_buf.st_mode)) return E_NOCHAR; break; case TYPE_BLKDEV: if(!S_ISBLK(stat_buf.st_mode)) return E_NOBLK; break; case TYPE_SYMLINK: if (!S_ISLNK(stat_buf.st_mode)) return E_NOLINK; break; case TYPE_FILE: if (!S_ISREG(stat_buf.st_mode)) return E_NOFILE; break; case TYPE_DIR: if (!S_ISDIR(stat_buf.st_mode)) return E_NODIR; break; } return 0; } /* This function runs a program in an separate process and waits for * it's return. If the program haven't returned after base->timeforcmd * seconds, it will be killed. The child process closes all open * handles and switches STDIN, STDOUT and STDERR to /dev/null so * that the program can't process any input or output. */ int launch_program (char* maskstr, ...) { struct libbase *base = &libdata; int pid, pgrp, status, i, n, rc, maxfiles; struct rlimit l; char *argv[MAXARGS+1], script[MAXCMDLEN+1]; va_list list; va_start(list, maskstr); vsnprintf (script, MAXCMDLEN, maskstr, list); script[MAXCMDLEN] = '\0'; va_end (list); i = n = rc = maxfiles = 0; do { argv[i++] = &script[n]; /* put argument in argv[] array */ while (script[n] != ' ' && script[n] != '\0') n++; if (script[n] == ' ') { script[n] = '\0'; /* terminate argument */ while (script[++n] == ' '); /* remove leading spaces */ } } while (i < MAXARGS && script[n] != '\0'); argv[i] = NULL; /* terminate argv[] array */ if((rc = check_permissions (argv[0], geteuid(), 0700, 022))) return rc; if (!getrlimit(RLIMIT_NOFILE, &l)) maxfiles = l.rlim_cur; /* get max count of file handles */ pid = fork(); switch (pid) { case 0: /* child */ for (i=0; i < maxfiles; i++) close(i); /* close all possible file handles */ open("/dev/null", O_RDONLY); /* STDIN */ open("/dev/null", O_WRONLY); /* STDOUT */ open("/dev/null", O_WRONLY); /* STDERR */ setsid(); /* opens its own process group */ execv(argv[0], argv); /* execute command */ exit(99); /* will only be executed if execv fails */ break; case -1: /* fork failed, no child created */ rc = E_CLDFAIL; break; default: /* parent */ rc = 0; for (i=base->timeforcmd * 10; i > 0; i--) { usleep(100000); /* sleep 100ms */ if (waitpid (pid, &status, WNOHANG)) { if (WIFEXITED(status)) { if ((base->rc = WEXITSTATUS(status))) rc = E_CLDEXIT; } else if (WIFSIGNALED(status)) rc = E_CLDSIG; /* else: If the child have not exited normally * and was not terminated by a signal then it * has to be stopped. In this case the lopp will * continue and after the timeout is over the * stopped child will be killed */ break; } } if (i == 0) { pgrp = getpgid(pid); /* get childs process group */ kill (-pgrp, SIGKILL); /* kill child and his childs */ waitpid (pid, &status, 0); /* clean up zombie */ rc = E_CLDKILL; } } return rc; } int get_lastrc() { struct libbase *base = &libdata; return base->rc; } int get_timeforcmd() { struct libbase *base = &libdata; return base->timeforcmd; } void set_timeforcmd(int timeout) { struct libbase *base = &libdata; if (timeout <= 0) timeout = 1; base->timeforcmd = timeout; } int check_permissions (char *file, uid_t uid, mode_t perms, int mask) { struct stat stat_buf; if(stat(file, &stat_buf)) return E_NOEXIST; if (stat_buf.st_uid != 0 && stat_buf.st_uid != uid) return E_USER; if (stat_buf.st_mode & mask) return E_RIGHTS; if ((stat_buf.st_mode & perms) != perms) return E_PERM; return 0; } int get_owner (char *file) { struct stat stat_buf; if(stat(file, &stat_buf)) return -1; return stat_buf.st_uid; return 0; } int get_permissions (char *file) { struct stat stat_buf; if(stat(file, &stat_buf)) return -1; return stat_buf.st_mode & 0777; } int keydelayms (struct timeval *start, int value, int delay) { struct timeval tv; long ms; if (value == 1) /* key pressed for the first time */ gettimeofday (start, 0); if (value == 2) { gettimeofday(&tv, 0); ms = (tv.tv_sec - start->tv_sec) * 1000000 + tv.tv_usec - start->tv_usec; if (ms > (delay * 1000)) return 1; } return 0; } /* This function removes all whitespaces from the buffer except * quoted ones. */ void cleanup_buffer(char *buffer) { char *buf2 = buffer, quotchar = 0; while (*buffer != 0) { *buf2 = *buffer++; if (quotchar == 0) { /* no quoting active */ if ((*buf2 == '"') || (*buf2 == '\'')) quotchar = *buf2; else if ((*buf2 != ' ') && (*buf2 != '\t')) buf2++; } else if (*buf2 == quotchar) /* qouting active */ quotchar = 0; else buf2++; } *buf2 = 0; /* terminate cleaned-up buffer again */ } /* This function converts a string to an integer. Additionally to * atoi() it converts also hexadecimal values */ int axtoi (char *arg) { int val, pwr = 1, rc = 0; size_t n, m; char hex[9], c; for (n=0,m=0; n < strlen(arg); n++) if (arg[n] != ' ') { hex[m++] = c = toupper(arg[n]); if (m == sizeof(hex) || c < '0' || c > 'F') return 0; /* overflow or invalid */ } hex[m] = '\0'; /* terminate string */ for (n=0; n < m; n++) { c = hex[m-n-1]; if ((c >= 'A') && (c <= 'F')) { val = c -'A' + 10; } else { val = c - '0'; } rc = rc + val * pwr; pwr *= 16; } return rc; } pbbuttonsd-0.8.1a/libpbbipc/pbb_taglist.c0000644000175000017500000001152310641705140015352 00000000000000/** * @brief Taglist functions * * This file contains the functions to handle taglists. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file libpbbipc/pbb_taglist.c * @author Matthias Grimm * * @page taglist Taglists - PBButtonsds basic data exchange concept * * Each of pbbuttonsd modules need parameters from outside to work * efficiently and many of them have information other modules are * interested in. Furthermore pbbuttonsd need to exchange data with * its clients. So a flexible data transportation layer is needed, * where its users must not know the receivers identity. * * In pbbuttonsd this task is solved by so called tags. A * tagitem is a small structure with following contents. It is defined * in @ref pbbtaglist.h. * *
 *   struct tagitem {
 *       long    tag;     Identifier
 *       long    data;    Argument
 *   }
 * 
* * The tag is the identifier of the attached data. So the parameter, * its data type and meaning are defined through the tag, which on * the other side identifies the parameter. * * If multiple tag-items were queued in an array, we would get a * tag-list. This tag-list could hold any count of parameters. The * end of a tag-list is markes with TAG_END and is defined in * taglist.h. * * Any data type which is short enough to fit into a long, could be * stored into a tag-item. In any other case tag-data could contain a * pointer to the data. But be careful, because of the strict borders * between processes those pointers couldn't be sent to clients, which * are usually other processes with a own address space. PBButtonsd IPC * module takes care of strings and transports them correctly to and * from clients, but all other pointers will be invalid on client side. * * The libpbbipc contains a whole bunch of functions to cope with * taglists. The interface is defined in @ref pbb_taglist.c */ #include "pbbtaglist.h" /** * @brief Find a tag and returns its value * * This function searches for a given 'tag' in 'taglist'. If * the tag was found its data otherwise 'val' would be returned. * * @param *taglist Array of tagitems to search in * @param tag tag value to look for * @param val default value. This value will be returned, if the * tag can't be found in taglist. * @return the data of the tag or the default value 'val' */ tag_t tagfind (struct tagitem *taglist, tag_t tag, tag_t val) { while (taglist->tag != TAG_END) { if (taglist->tag == tag) { val = taglist->data; break; } else taglist++; } return val; } /** * @brief Mark a tag as invalid * * This function looks for a tag in taglist and mark it as invalid. * In fact the tag value will be replaced by TAG_SKIP. As result * the original tag is removed from the taglist and can't be used * anymore. * * If taglist doesn't contain Tag, nothing will be changed. * * @param *taglist Array of tagitems to search in * @param tag tag value to mark as invalid */ void tagskip (struct tagitem *taglist, tag_t tag) { while (taglist->tag != TAG_END) { if (taglist->tag == tag) { taglist->data = taglist->tag; taglist->tag = TAG_SKIP; break; } else taglist++; } } /** * @brief Mark a tagitem as error and store an error code * * If an module can't use a tagitem because its data is invalid, the * module can use this function to return an error code to the sender * of the tagitem. * * The tag will be marked as error and the data field will be replaced * with an error code. * * @param *tag Tagitem to store the error in * @param error error code * @return a copy of error */ int tagerror (struct tagitem *tag, int error) { tag->data = (tag_t) error; tag->tag |= FLG_ERROR; return error; } /* This function initializes a taglist. */ void taglist_init (struct tagitem *taglist) { taglist->tag = TAG_END; taglist->data = 0; } /* This function adds a tagitem to an existing taglist. The taglist must be long enough for the new tag. No boundary checks are performed. */ void taglist_add (struct tagitem *taglist, tag_t tag, tag_t val) { while (taglist->tag != TAG_END) taglist++; /* find end of taglist */ taglist->tag = tag; /* add tagitem */ taglist->data = val; taglist++; taglist->tag = TAG_END; /* mark end of taglist again */ taglist->data = 0; } struct tagitem* find_tagitem (struct tagitem *taglist, tag_t tag) { while (taglist->tag != TAG_END && taglist->tag != tag) taglist++; if (taglist->tag == TAG_END) return 0; else return taglist; } int taglist_count (struct tagitem *taglist) { int n = 0; while (taglist->tag != TAG_END) { n++; taglist++; } return n; } pbbuttonsd-0.8.1a/libpbbipc/pbb_list.c0000644000175000017500000000476510641705141014671 00000000000000/* ---------------------------------------------------------------------------- * pbb_list.c * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include "pbblist.h" /* +--------+ * +-> |first | --+ * | |tail | <-+ tail is always NULL: no predecessor (pred) * +-- |tailpred| for 'first' and no successor (next) for 'tail' * +--------+ The header is first and last node of the list. */ void initListHeader (struct listhead *lh) { lh->first = (struct listnode *) &lh->tail; lh->tail = NULL; lh->tailpred = (struct listnode *) &lh->first; } void freeList (struct listhead *lh) { struct listnode *it = lh->first; while ((it = it->next)) free (it->pred); initListHeader (lh); } /* append new node to the end of the list */ void appendListNode (struct listhead *lh, struct listnode *ln) { ln->next = lh->tailpred->next; ln->pred = lh->tailpred; lh->tailpred->next = ln; lh->tailpred = ln; } /* remove node from list */ struct listnode* removeListNode (struct listnode *ln) { if (ln) { ln->pred->next = ln->next; ln->next->pred = ln->pred; ln->next = NULL; ln->pred = NULL; } return ln; } /* remove node from list if it is still part of one * and free memory */ void freeListNode (struct listnode *ln) { if (ln->next) /* is node part of a list? */ ln = removeListNode (ln); /* then remove node from list */ free (ln); } /* get memory for a new list node and extend the allocation by * datalen. This buffer behind the node structure is for user * data. */ struct listnode* newListNode (int datalen) { struct listnode *newnode; if ((newnode = malloc (sizeof (struct listnode) + datalen))) { bzero (newnode, sizeof (struct listnode) + datalen); newnode->datalen = datalen; } return newnode; } void * getNodeData (struct listnode *ln) { return (char *) ln + sizeof (struct listnode); } void * getNodeDataEnd (struct listnode *ln) { return (char *) ln + sizeof (struct listnode) + ln->datalen; } int getNodeCount (struct listhead *lh) { struct listnode *it = lh->first; int n = 0; while ((it = it->next)) n++; return n; } pbbuttonsd-0.8.1a/libpbbipc/gettext_macros.h0000644000175000017500000000221710641705142016117 00000000000000#ifndef INCLUDE_GETTEXT_MACROS_H #define INCLUDE_GETTEXT_MACROS_H /* ---------------------------------------------------------------------------- * gettext:macros.h * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef ENABLE_NLS # include #endif /* Standard gettext macros */ #ifdef ENABLE_NLS # include # undef _ # define _(String) dgettext (PACKAGE, String) # ifdef gettext_noop # define N_(String) gettext_noop (String) # else # define N_(String) (String) # endif #else # define textdomain(String) (String) # define gettext(String) (String) # define dgettext(Domain,Message) (Message) # define dcgettext(Domain,Message,Type) (Message) # define bindtextdomain(Domain,Directory) (Domain) # define _(String) (String) # define N_(String) (String) #endif #endif /* INCLUDE_GETTEXT_MACROS_H */ pbbuttonsd-0.8.1a/pbbcmd/0002777000175000017500000000000010652456416012314 500000000000000pbbuttonsd-0.8.1a/pbbcmd/Makefile.am0000644000175000017500000000052210641705146014254 00000000000000## Process this file with automake to produce Makefile.in INCLUDES = -I$(top_srcdir)/intl -I$(top_srcdir)/libpbbipc @PACKAGE_CFLAGS@ bin_PROGRAMS = pbbcmd pbbcmd_SOURCES = pbbcmd.c pbbcmd.h gettext_macros.h pbbcmd_LDADD = -lpbb $(INTLLIBS) @PACKAGE_LIBS@ pbbcmd_LDFLAGS = -L$(top_srcdir)/libpbbipc if DEBUG AM_CFLAGS = -DDEBUG endif pbbuttonsd-0.8.1a/pbbcmd/Makefile.in0000644000175000017500000003302310652444337014273 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = pbbcmd$(EXEEXT) subdir = pbbcmd DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_pbbcmd_OBJECTS = pbbcmd.$(OBJEXT) pbbcmd_OBJECTS = $(am_pbbcmd_OBJECTS) am__DEPENDENCIES_1 = pbbcmd_DEPENDENCIES = $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(pbbcmd_SOURCES) DIST_SOURCES = $(pbbcmd_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEBUG_FALSE = @DEBUG_FALSE@ DEBUG_TRUE = @DEBUG_TRUE@ DEFS = @DEFS@ DOT = @DOT@ DOT_PATH = @DOT_PATH@ DOXYGEN = @DOXYGEN@ DOXYGEN_DOCS_ENABLED_FALSE = @DOXYGEN_DOCS_ENABLED_FALSE@ DOXYGEN_DOCS_ENABLED_TRUE = @DOXYGEN_DOCS_ENABLED_TRUE@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GENCAT = @GENCAT@ GLIBC2 = @GLIBC2@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_ASPRINTF = @HAVE_ASPRINTF@ HAVE_DOT = @HAVE_DOT@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ HAVE_SNPRINTF = @HAVE_SNPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ HAVE_WPRINTF = @HAVE_WPRINTF@ HOSTCC = @HOSTCC@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ KBD_AUTOADJMODE = @KBD_AUTOADJMODE@ KBD_AUTOADJPARMAC = @KBD_AUTOADJPARMAC@ KBD_AUTOADJPARMBAT = @KBD_AUTOADJPARMBAT@ KBD_FADINGSPEED = @KBD_FADINGSPEED@ LCD_AUTOADJMODE = @LCD_AUTOADJMODE@ LCD_AUTOADJPARMAC = @LCD_AUTOADJPARMAC@ LCD_AUTOADJPARMBAT = @LCD_AUTOADJPARMBAT@ LCD_FADINGSPEED = @LCD_FADINGSPEED@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPTH = @LIBPTH@ LIBS = @LIBS@ LIBTHREAD = @LIBTHREAD@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ PACKAGE_LIBS = @PACKAGE_LIBS@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PB_LIBS = @PB_LIBS@ PB_OBJECTS = @PB_OBJECTS@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ QUIET = @QUIET@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WOE32DLL = @WOE32DLL@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ INCLUDES = -I$(top_srcdir)/intl -I$(top_srcdir)/libpbbipc @PACKAGE_CFLAGS@ pbbcmd_SOURCES = pbbcmd.c pbbcmd.h gettext_macros.h pbbcmd_LDADD = -lpbb $(INTLLIBS) @PACKAGE_LIBS@ pbbcmd_LDFLAGS = -L$(top_srcdir)/libpbbipc @DEBUG_TRUE@AM_CFLAGS = -DDEBUG all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps pbbcmd/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu --ignore-deps pbbcmd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) pbbcmd$(EXEEXT): $(pbbcmd_OBJECTS) $(pbbcmd_DEPENDENCIES) @rm -f pbbcmd$(EXEEXT) $(LINK) $(pbbcmd_LDFLAGS) $(pbbcmd_OBJECTS) $(pbbcmd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pbbuttonsd-0.8.1a/pbbcmd/pbbcmd.c0000644000175000017500000003746210643746130013630 00000000000000/* ---------------------------------------------------------------------------- * pbbcmd.c * command line control tool for pbbuttonsd * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include "gettext_macros.h" #include "pbbcmd.h" #define BUFFERLEN 200 int config_no_answer = 0; static struct tagtable cmdtab[] = { { "saveconfig", TAG_SAVECONFIG}, { "reinit", TAG_REINIT}, { "ejectcd", TAG_EJECTCD }, { "sleep", TAG_GOTOSLEEP }, { "hibernate", TAG_GOTOHIBERNATE }}; static struct tagtable tagtab[] = { { "TAG_AUTORESCAN", TAG_AUTORESCAN}, { "TAG_TIMEFORCMD", TAG_TIMEFORCMD}, { "TAG_VERSION", TAG_VERSION}, { "TAG_KEYCODE", TAG_KEYCODE}, { "TAG_KEYREPEAT", TAG_KEYREPEAT}, { "TAG_MODIFIER", TAG_MODIFIER}, { "TAG_MOUSERELX", TAG_MOUSERELX}, { "TAG_MOUSERELY", TAG_MOUSERELY}, { "TAG_SYSINFO", TAG_SYSINFO}, { "TAG_BACKLIGHTMAX", TAG_BACKLIGHTMAX}, { "TAG_BACKLIGHTLEVEL", TAG_BACKLIGHTLEVEL}, { "TAG_COVERSTATUS", TAG_COVERSTATUS}, { "TAG_TIMEREMAINING", TAG_TIMEREMAINING}, { "TAG_POWERSOURCE", TAG_POWERSOURCE}, { "TAG_TIMECHANGED", TAG_TIMECHANGED}, { "TAG_POWERCHANGED", TAG_POWERCHANGED}, { "TAG_REQUESTSLEEP", TAG_REQUESTSLEEP}, { "TAG_SLEEPSUPPORTED", TAG_SLEEPSUPPORTED}, { "TAG_PREPAREFORSLEEP", TAG_PREPAREFORSLEEP}, { "TAG_WAKEUPFROMSLEEP", TAG_WAKEUPFROMSLEEP}, { "TAG_PMUDEVICE", TAG_PMUDEVICE}, { "TAG_ADBDEVICE", TAG_ADBDEVICE}, { "TAG_TPMODEUPKEY", TAG_TPMODEUPKEY}, { "TAG_TPMODEUPMOD", TAG_TPMODEUPMOD}, { "TAG_TPMODEDOWNKEY", TAG_TPMODEDOWNKEY}, { "TAG_TPMODEDOWNMOD", TAG_TPMODEDOWNMOD}, { "TAG_TPMODE", TAG_TPMODE}, { "TAG_NOTAPTYPING", TAG_NOTAPTYPING}, { "TAG_KBDMODE", TAG_KBDMODE}, { "TAG_BATLOG", TAG_BATLOG}, { "TAG_BATTERYPRESENT", TAG_BATTERYPRESENT}, { "TAG_BATCYCLE", TAG_BATCYCLE}, { "TAG_AMBIENTLIGHT", TAG_AMBIENTLIGHT }, { "TAG_KEYBLIGHTLEVEL", TAG_KEYBLIGHTLEVEL }, { "TAG_KEYBLIGHTMAX", TAG_KEYBLIGHTMAX }, { "TAG_LCDILLUMUPKEY", TAG_LCDILLUMUPKEY}, { "TAG_LCDILLUMUPMOD", TAG_LCDILLUMUPMOD}, { "TAG_LCDILLUMDOWNKEY", TAG_LCDILLUMDOWNKEY}, { "TAG_LCDILLUMDOWNMOD", TAG_LCDILLUMDOWNMOD}, { "TAG_KBDILLUMUPKEY", TAG_KBDILLUMUPKEY}, { "TAG_KBDILLUMUPMOD", TAG_KBDILLUMUPMOD}, { "TAG_KBDILLUMDOWNKEY", TAG_KBDILLUMDOWNKEY}, { "TAG_KBDILLUMDOWNMOD", TAG_KBDILLUMDOWNMOD}, { "TAG_KBDILLUMONKEY", TAG_KBDILLUMONKEY}, { "TAG_KBDILLUMONMOD", TAG_KBDILLUMONMOD}, { "TAG_LCDBRIGHTNESS", TAG_LCDBRIGHTNESS}, { "TAG_LCDFADINGSPEED", TAG_LCDFADINGSPEED}, { "TAG_LCDAUTOADJUST", TAG_LCDAUTOADJUST }, #ifdef DEBUG { "TAG_LCDAUTOADJAC", TAG_LCDAUTOADJAC }, { "TAG_LCDAUTOADJBAT", TAG_LCDAUTOADJBAT }, #endif { "TAG_KBDBRIGHTNESS", TAG_KBDBRIGHTNESS}, { "TAG_KBDONBRIGHTNESS", TAG_KBDONBRIGHTNESS}, { "TAG_KBDFADINGSPEED", TAG_KBDFADINGSPEED}, { "TAG_KBDAUTOADJUST", TAG_KBDAUTOADJUST }, #ifdef DEBUG { "TAG_KBDAUTOADJAC", TAG_KBDAUTOADJAC }, { "TAG_KBDAUTOADJBAT", TAG_KBDAUTOADJBAT }, #endif { "TAG_BRIGHTNESSOP", TAG_BRIGHTNESSOP}, { "TAG_FRAMEBUFFERDEVICE", TAG_FRAMEBUFFERDEVICE}, { "TAG_BLANKFRAMEBUFFER", TAG_BLANKFRAMEBUFFER}, { "TAG_DIMFULLYDARK", TAG_DIMFULLYDARK}, { "TAG_CRTMIRROR", TAG_CRTMIRROR}, { "TAG_CRTMIRRORKEY", TAG_CRTMIRRORKEY}, { "TAG_CRTMIRRORMOD", TAG_CRTMIRRORMOD}, { "TAG_SOUNDSYSTEM", TAG_SOUNDSYSTEM}, { "TAG_SOUNDSYSTEMCFG", TAG_SOUNDSYSTEMCFG}, { "TAG_MIXERDEVICE", TAG_MIXERDEVICE}, { "TAG_MIXERCARD", TAG_MIXERCARD}, { "TAG_VOLUMEUPKEY", TAG_VOLUMEUPKEY}, { "TAG_VOLUMEUPMOD", TAG_VOLUMEUPMOD}, { "TAG_VOLUMEDOWNKEY", TAG_VOLUMEDOWNKEY}, { "TAG_VOLUMEDOWNMOD", TAG_VOLUMEDOWNMOD}, { "TAG_MUTEKEY", TAG_MUTEKEY}, { "TAG_MUTEMOD", TAG_MUTEMOD}, { "TAG_MIXERINITDELAY", TAG_MIXERINITDELAY}, { "TAG_VOLUME", TAG_VOLUME }, { "TAG_MUTE", TAG_MUTE }, { "TAG_MIXERCHANNELS", TAG_MIXERCHANNELS }, { "TAG_MIXERELEMENTS", TAG_MIXERELEMENTS }, { "TAG_CDROMDEVICE", TAG_CDROMDEVICE }, { "TAG_EJECTCDKEY", TAG_EJECTCDKEY }, { "TAG_EJECTCDMOD", TAG_EJECTCDMOD }, { "TAG_EJECTCDKEYDELAY", TAG_EJECTCDKEYDELAY }, { "TAG_SCRIPTPMCS", TAG_SCRIPTPMCS}, { "TAG_SLEEPKEY", TAG_SLEEPKEY }, { "TAG_SLEEPMOD", TAG_SLEEPMOD }, { "TAG_SLEEPKEYDELAY", TAG_SLEEPKEYDELAY }, { "TAG_BWLFIRST", TAG_BWLFIRST }, { "TAG_BWLSECOND", TAG_BWLSECOND }, { "TAG_BWLLAST", TAG_BWLLAST }, { "TAG_CURRENTBWL", TAG_CURRENTBWL }, { "TAG_CPULOADSLEEPLOCK", TAG_CPULOADSLEEPLOCK }, { "TAG_CPULOADMIN", TAG_CPULOADMIN }, { "TAG_CPULOADPERIOD", TAG_CPULOADPERIOD }, { "TAG_NETLOADSLEEPLOCK", TAG_NETLOADSLEEPLOCK }, { "TAG_NETLOADMIN", TAG_NETLOADMIN }, { "TAG_NETLOADPERIOD", TAG_NETLOADPERIOD }, { "TAG_NETLOADDEV", TAG_NETLOADDEV }, #ifdef WITH_IBAM { "TAG_IBAMDATADIR", TAG_IBAMDATADIR }, { "TAG_CHARGETIME", TAG_CHARGETIME }, #endif { "TAG_POLICY", TAG_POLICY }, { "TAG_ONAC_POLICY", TAG_ONAC_POLICY }, { "TAG_ONAC_TIMERACTION", TAG_ONAC_TIMERACTION }, { "TAG_ONAC_COVERACTION", TAG_ONAC_COVERACTION }, { "TAG_ONAC_KEYACTION", TAG_ONAC_KEYACTION }, { "TAG_ONAC_TIMESUSPEND", TAG_ONAC_TIMESUSPEND }, { "TAG_ONAC_TIMEDIM", TAG_ONAC_TIMEDIM }, { "TAG_ONBATT_POLICY", TAG_ONBATT_POLICY }, { "TAG_ONBATT_TIMERACTION",TAG_ONBATT_TIMERACTION }, { "TAG_ONBATT_COVERACTION",TAG_ONBATT_COVERACTION }, { "TAG_ONBATT_KEYACTION", TAG_ONBATT_KEYACTION }, { "TAG_ONBATT_TIMESUSPEND",TAG_ONBATT_TIMESUSPEND }, { "TAG_ONBATT_TIMEDIM", TAG_ONBATT_TIMEDIM }, { "TAG_EMERGENCYACTION", TAG_EMERGENCYACTION }, { "TAG_HEARTBEATBEEP", TAG_HEARTBEATBEEP }, { "TAG_IDENTITY", TAG_IDENTITY }}; static struct tagtable errortab[] = { { N_("Permission denied"), E_PERM}, { N_("Private Tag"), E_PRIVATE}, { N_("File doesn't exist"), E_NOEXIST}, { N_("File not a character device"),E_NOCHAR}, { N_("File not a block device"), E_NOBLK}, { N_("File not a file"), E_NOFILE}, { N_("Buffer overflow"), E_BUFOVL}, { N_("open error"), E_OPEN}, { N_("format error"), E_FORMAT}, { N_("Messageport not available"), E_MSGPORT}, { N_("Server already running"), E_TWICE}, { N_("Help or version info"), E_INFO}, { N_("Server not found"), E_NOSERVER}, { N_("Registration failed"), E_REGISTER}, { N_("Insecure script owner"), E_USER}, { N_("Script must be write-only by owner"), E_RIGHTS}, { N_("read-only value"), E_NOWRITE}, { N_("write-only value"), E_NOREAD}, { N_("argument invalid"), E_INVALID}, { N_("function not supported"), E_NOSUPPORT}}; void print_usage (char *prgname) { printf(_("%s (version %s) - control client for pbbuttonsd.\n"), prgname, VERSION); printf(_("Usage:\n")); printf(" %s [-%s] \n", prgname, ARG_ALL); printf(" %s [-%s] query \n", prgname, ARG_ALL); printf(" %s [-%s] config \n\n", prgname, ARG_ALL); printf (_("Options:\n" " -%c, --help display this help and exit\n" " -%c, --version display version information and exit\n" " -%c, --ignore ignore config return and error values\n"), ARG_HELP, ARG_VERSION, ARG_IGNORE); print_cmds (); print_tags (); } void print_cmds () { printf ("\n"); printf (_("Supported commands:\n")); printf (" "); printf (_("%-14s - prints a list of clients attached\n"), "listclients"); printf (" "); printf (_("%-14s - save the current configuration to disk\n"), "saveconfig"); printf (" "); printf (_("%-14s - reinitialising the keyboard and the trackpad\n"), "reinit"); printf (" "); printf (_("%-14s - eject the CDROM\n"), "ejectcd"); printf (" "); printf (_("%-14s - suspend to RAM\n"), "sleep"); printf (" "); printf (_("%-14s - suspend to Disk\n"), "hibernate"); printf (" "); printf (_("%-14s - reconfigure server parameters\n"), "config"); printf (" "); printf (_("%-14s - queries the server for certain parameters\n"), "query"); } void print_tags () { size_t n, z; printf ("\n"); printf (_("Supported tags:\n")); printf (" "); for (n=1,z=1; n <= (sizeof(tagtab) / sizeof(struct tagtable)); n++) { if (tagtab[n-1].tag & FLG_PRIVATE) continue; else printf ("%-23s", tagtab[n-1].tagname); if ((z++ % 3) == 0) printf ("\n "); } printf ("\n\n "); printf (_("The leading 'TAG_' could be omited.\n")); } int evaluate_args(int argc, char *argv[], struct tagitem *taglist) { struct option const long_options[] = { {"help", no_argument, 0, ARG_HELP}, {"version", no_argument, 0, ARG_VERSION}, {"ignore", no_argument, 0, ARG_IGNORE}, {NULL, 0, NULL, 0} }; char *prgname; long tag; int c, n; if((prgname = strrchr(argv[0],'/')) == NULL) prgname = argv[0]; else prgname++; /* ignore first slash*/ while ((c = getopt_long (argc, argv, ARG_ALL, long_options, (int *) 0)) != EOF) { switch (c) { case ARG_VERSION: printf(_("pbbcmd, version %s"), VERSION); printf(", (c) 2002-2005 Matthias Grimm\n"); return CMD_FLAGS; case ARG_IGNORE: config_no_answer = 1; break; case ARG_HELP: default: print_usage (prgname); return CMD_FLAGS; } } if (argc - optind >= 1) { if ((strcasecmp (argv[optind], "query")) == 0) { if (argc - optind < 2) { printf (_("ERROR: Missing arguments\n")); return 0; } for (n=optind+1; n < argc; n++) { if ((tag = identifytag (argv[n])) != 0) { taglist_add (taglist, tag, (tag & FLG_STRING) ? 0 : -1); } else { printf (_("WARNING: tag %s not supported.\n"), argv[n]); print_tags (); return 0; } } return CMD_QUERY; } else if ((strcasecmp (argv[optind], "config")) == 0) { if (argc - optind < 3) { printf (_("ERROR: Missing arguments\n")); return 0; } else if ((argc - optind - 1) % 2 == 1) { printf (_("ERROR: tag/data pairs not complete.\n")); return 0; } for (n=optind+1; n < argc; n++) { if ((tag = identifytag (argv[n])) != 0) { if (tag & FLG_STRING) taglist_add (taglist, tag, (long) argv[++n]); else taglist_add (taglist, tag, (long) atoi (argv[++n])); } else { printf (_("WARNING: tag %s not supported.\n"), argv[n]); print_tags (); return 0; } } return CMD_CONFIG; } else if (strcasecmp (argv[optind], "listclients") == 0) { return CMD_LISTCLIENTS; } else if ((tag = identifycmd (argv[optind])) != 0) { taglist_add (taglist, tag, 0); return CMD_CONFIG; } } print_usage (prgname); return 0; } int read_message (char *buffer, int bufferlen) { int timeout = 40; /* 4 seconds timeout */ while (timeout > 0) { if ((ipc_receive (buffer, bufferlen)) >=0) { return 0; /* ok */ } usleep (100000); /* wait for 100ms */ timeout--; } printf (_("Server didn't send an answer and timed out.\n")); return 1; /* fail */ } long identifytag (char *name) { int n; for (n=(sizeof(tagtab) / sizeof(struct tagtable) - 1); n >= 0; n--) if (!strcasecmp (tagtab[n].tagname, name)) return tagtab[n].tag; else if (!strcasecmp ((tagtab[n].tagname) + 4, name)) return tagtab[n].tag; return 0; } long identifycmd (char *name) { int n; for (n=(sizeof(cmdtab) / sizeof(struct tagtable) - 1); n >= 0; n--) if (!strcasecmp (cmdtab[n].tagname, name)) return cmdtab[n].tag; return 0; } char * identifytagname (long tag, char *defname) { int n; for (n=(sizeof(tagtab) / sizeof(struct tagtable) - 1); n >= 0; n--) if (tagtab[n].tag == tag) return tagtab[n].tagname; return defname; } char * identifyerror (long error, char *deferror) { int n; for (n=(sizeof(errortab) / sizeof(struct tagtable) - 1); n >= 0; n--) if (errortab[n].tag == error) return errortab[n].tagname; return deferror; } int main(int argc, char *argv[]) { char buffer[BUFFERLEN]; struct pbbmessage *pbbmsg; struct tagitem *taglist, *tags; char *tagname, *errname; int cmd, rc = 1; #ifdef ENABLE_NLS setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, PACKAGE_LOCALE_DIR); textdomain(PACKAGE); #endif init_libpbb (); if ((taglist = (struct tagitem *) malloc (argc * sizeof (struct tagitem))) != NULL) { taglist_init (taglist); if ((cmd = evaluate_args (argc, argv, taglist)) != 0) { if (ipc_init ("pbbcmd", LIBMODE_CLIENT, 0) == 0) { switch (cmd) { case CMD_FLAGS: /* for command line flags -h and -v */ rc = 0; /* they are no errors */ break; case CMD_QUERY: ipc_send (0, READVALUE, taglist); if ((rc = read_message (buffer, BUFFERLEN)) == 0) { tags = ((struct pbbmessage *) buffer)->taglist; while (tags->tag != TAG_END) { if (tags->tag & FLG_ERROR) { tagname = identifytagname (tags->tag & TAGMASK, "???"); errname = identifyerror (tags->data, "???"); printf (_("Sorry, Couldn't get data for %s: %s."), tagname, _(errname)); rc = 1; } else if (tags->tag & FLG_STRING) printf ("%s ", (char *) tags->data); else printf ("%ld ", tags->data); tags++; } printf ("\n"); } break; case CMD_CONFIG: ipc_send (0, CHANGEVALUE, taglist); if (config_no_answer) rc = 0; else if ((rc = read_message (buffer, BUFFERLEN)) == 0) { pbbmsg = (struct pbbmessage *) buffer; if (pbbmsg->action == CHANGEERROR) { tags = pbbmsg->taglist; while (tags->tag != TAG_END) { tagname = identifytagname (tags->tag & TAGMASK, "???"); errname = identifyerror (tags->data, "???"); printf (_("Setting of %s failed: %s.\n"), tagname, _(errname)); tags++; rc = 1; } } else printf (_("ERROR: Unexpected answer from server, actioncode %ld.\n"), (long) pbbmsg->action); } break; case CMD_LISTCLIENTS: ipc_send(0, GETCLIENTLIST, NULL); if ((rc = read_message (buffer, BUFFERLEN)) == 0) { pbbmsg = (struct pbbmessage *) buffer; if (pbbmsg->action == CHANGEVALUE) { printf ("\n"); printf (_(" PID | Name | Port | Flags\n" " ------+----------------------+---------+-----------\n")); tags = pbbmsg->taglist; while (tags->tag != TAG_END) { switch (tags->tag) { case TAG_CLIENTPID: printf (" %5d |", (int) tags->data); break; case TAG_CLIENTNAME: printf (" %-20s |", (tags->data) ? (char*) tags->data : _("")); break; case TAG_CLIENTPORT: printf (" %7d |", (int) tags->data); break; case TAG_CLIENTFLAGS: printf (" %08x\n", (int) tags->data); break; } tags++; } printf ("\n"); } } break; } ipc_exit(); } else printf (_("ERROR: Problems with IPC, maybe server is not running.\n")); } free (taglist); } else printf (_("ERROR: Not enough memory for buffer.\n")); return rc; } void peep_ipc (struct tagitem *taglist) { } pbbuttonsd-0.8.1a/pbbcmd/pbbcmd.h0000644000175000017500000000240410641705147013622 00000000000000#ifndef INCLUDE_PBBCMD_H #define INCLUDE_PBBCMD_H /* ---------------------------------------------------------------------------- * pbbcmd.h * prototypes and definitions for pbbcmd * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include /* short options for optarg */ #define ARG_ALL "hvi" #define ARG_HELP 'h' #define ARG_VERSION 'v' #define ARG_IGNORE 'i' #define CMD_FLAGS 1 #define CMD_QUERY 2 #define CMD_CONFIG 3 #define CMD_LISTCLIENTS 4 struct tagtable { char *tagname; long tag; }; /* public prototypes */ /* private prototypes */ void print_usage (char *prgname); void print_cmds (); void print_tags (); int evaluate_args(int argc, char *argv[], struct tagitem *taglist); int read_message (char *buffer, int bufferlen); long identifytag (char *name); long identifycmd (char *name); char *identifytagname (long tag, char *defname); char *identifyerror (long error, char *deferror); #endif /* INCLUDE_PBBCMD_H */ pbbuttonsd-0.8.1a/pbbcmd/gettext_macros.h0000644000175000017500000000221710641705147015425 00000000000000#ifndef INCLUDE_GETTEXT_MACROS_H #define INCLUDE_GETTEXT_MACROS_H /* ---------------------------------------------------------------------------- * gettext:macros.h * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef ENABLE_NLS # include #endif /* Standard gettext macros */ #ifdef ENABLE_NLS # include # undef _ # define _(String) dgettext (PACKAGE, String) # ifdef gettext_noop # define N_(String) gettext_noop (String) # else # define N_(String) (String) # endif #else # define textdomain(String) (String) # define gettext(String) (String) # define dgettext(Domain,Message) (Message) # define dcgettext(Domain,Message,Type) (Message) # define bindtextdomain(Domain,Directory) (Domain) # define _(String) (String) # define N_(String) (String) #endif #endif /* INCLUDE_GETTEXT_MACROS_H */ pbbuttonsd-0.8.1a/src/0002777000175000017500000000000010652456422011651 500000000000000pbbuttonsd-0.8.1a/src/Makefile.am0000644000175000017500000000262010641705161013612 00000000000000## Process this file with automake to produce Makefile.in INCLUDES = -I$(top_srcdir)/intl -I$(top_srcdir)/libpbbipc @PACKAGE_CFLAGS@ bin_PROGRAMS = pbbuttonsd pbbuttonsd_SOURCES = \ pbbuttonsd.c \ init.c init.h systems.h \ input_manager.c input_manager.h \ support.c support.h \ class_config.c class_config.h \ module_system.c module_system.h \ module_powersave.c module_powersave.h \ module_display.c module_display.h \ module_cdrom.c module_cdrom.h \ class_backlight.c class_backlight.h \ driver_backlight_sysfs.c driver_backlight_sysfs.h \ class_mixer.c class_mixer.h \ gettext_macros.h pbbinput.h EXTRA_pbbuttonsd_SOURCES = ibam_stub.cpp ibam_stub.h ibam.hpp ibam.inl \ module_pmac.c module_pmac.h \ module_acpi.c module_acpi.h \ module_imac.c module_imac.h \ driver_backlight_pmu.c driver_backlight_pmu.h \ driver_backlight_x1600.c driver_backlight_x1600.h \ driver_backlight_gma950.c driver_backlight_gma950.h \ driver_mixer_oss.c driver_mixer_oss.h \ driver_mixer_alsa.c driver_mixer_alsa.h \ module_peep.c module_peep.h debug.h \ tcp.c tcp.h pbbuttonsd_LDADD = -lpbb $(INTLLIBS) $(PB_OBJECTS) $(PB_LIBS) @PACKAGE_LIBS@ pbbuttonsd_LDFLAGS = -L$(top_srcdir)/libpbbipc pbbuttonsd_DEPENDENCIES = $(PB_OBJECTS) if DEBUG AM_CFLAGS1 = -DDEBUG AM_CXXFLAGS = -DDEBUG endif AM_CFLAGS = $(AM_CFLAGS1) $(ALSA_CFLAGS) pbbuttonsd-0.8.1a/src/Makefile.in0000644000175000017500000003633610652444340013637 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = pbbuttonsd$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_pbbuttonsd_OBJECTS = pbbuttonsd.$(OBJEXT) init.$(OBJEXT) \ input_manager.$(OBJEXT) support.$(OBJEXT) \ class_config.$(OBJEXT) module_system.$(OBJEXT) \ module_powersave.$(OBJEXT) module_display.$(OBJEXT) \ module_cdrom.$(OBJEXT) class_backlight.$(OBJEXT) \ driver_backlight_sysfs.$(OBJEXT) class_mixer.$(OBJEXT) pbbuttonsd_OBJECTS = $(am_pbbuttonsd_OBJECTS) am__DEPENDENCIES_1 = DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ SOURCES = $(pbbuttonsd_SOURCES) $(EXTRA_pbbuttonsd_SOURCES) DIST_SOURCES = $(pbbuttonsd_SOURCES) $(EXTRA_pbbuttonsd_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEBUG_FALSE = @DEBUG_FALSE@ DEBUG_TRUE = @DEBUG_TRUE@ DEFS = @DEFS@ DOT = @DOT@ DOT_PATH = @DOT_PATH@ DOXYGEN = @DOXYGEN@ DOXYGEN_DOCS_ENABLED_FALSE = @DOXYGEN_DOCS_ENABLED_FALSE@ DOXYGEN_DOCS_ENABLED_TRUE = @DOXYGEN_DOCS_ENABLED_TRUE@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GENCAT = @GENCAT@ GLIBC2 = @GLIBC2@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_ASPRINTF = @HAVE_ASPRINTF@ HAVE_DOT = @HAVE_DOT@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ HAVE_SNPRINTF = @HAVE_SNPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ HAVE_WPRINTF = @HAVE_WPRINTF@ HOSTCC = @HOSTCC@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ KBD_AUTOADJMODE = @KBD_AUTOADJMODE@ KBD_AUTOADJPARMAC = @KBD_AUTOADJPARMAC@ KBD_AUTOADJPARMBAT = @KBD_AUTOADJPARMBAT@ KBD_FADINGSPEED = @KBD_FADINGSPEED@ LCD_AUTOADJMODE = @LCD_AUTOADJMODE@ LCD_AUTOADJPARMAC = @LCD_AUTOADJPARMAC@ LCD_AUTOADJPARMBAT = @LCD_AUTOADJPARMBAT@ LCD_FADINGSPEED = @LCD_FADINGSPEED@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPTH = @LIBPTH@ LIBS = @LIBS@ LIBTHREAD = @LIBTHREAD@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ PACKAGE_LIBS = @PACKAGE_LIBS@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PB_LIBS = @PB_LIBS@ PB_OBJECTS = @PB_OBJECTS@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ QUIET = @QUIET@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WOE32DLL = @WOE32DLL@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ INCLUDES = -I$(top_srcdir)/intl -I$(top_srcdir)/libpbbipc @PACKAGE_CFLAGS@ pbbuttonsd_SOURCES = \ pbbuttonsd.c \ init.c init.h systems.h \ input_manager.c input_manager.h \ support.c support.h \ class_config.c class_config.h \ module_system.c module_system.h \ module_powersave.c module_powersave.h \ module_display.c module_display.h \ module_cdrom.c module_cdrom.h \ class_backlight.c class_backlight.h \ driver_backlight_sysfs.c driver_backlight_sysfs.h \ class_mixer.c class_mixer.h \ gettext_macros.h pbbinput.h EXTRA_pbbuttonsd_SOURCES = ibam_stub.cpp ibam_stub.h ibam.hpp ibam.inl \ module_pmac.c module_pmac.h \ module_acpi.c module_acpi.h \ module_imac.c module_imac.h \ driver_backlight_pmu.c driver_backlight_pmu.h \ driver_backlight_x1600.c driver_backlight_x1600.h \ driver_backlight_gma950.c driver_backlight_gma950.h \ driver_mixer_oss.c driver_mixer_oss.h \ driver_mixer_alsa.c driver_mixer_alsa.h \ module_peep.c module_peep.h debug.h \ tcp.c tcp.h pbbuttonsd_LDADD = -lpbb $(INTLLIBS) $(PB_OBJECTS) $(PB_LIBS) @PACKAGE_LIBS@ pbbuttonsd_LDFLAGS = -L$(top_srcdir)/libpbbipc pbbuttonsd_DEPENDENCIES = $(PB_OBJECTS) @DEBUG_TRUE@AM_CFLAGS1 = -DDEBUG @DEBUG_TRUE@AM_CXXFLAGS = -DDEBUG AM_CFLAGS = $(AM_CFLAGS1) $(ALSA_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .cpp .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu --ignore-deps src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) pbbuttonsd$(EXEEXT): $(pbbuttonsd_OBJECTS) $(pbbuttonsd_DEPENDENCIES) @rm -f pbbuttonsd$(EXEEXT) $(CXXLINK) $(pbbuttonsd_LDFLAGS) $(pbbuttonsd_OBJECTS) $(pbbuttonsd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` .cpp.o: $(CXXCOMPILE) -c -o $@ $< .cpp.obj: $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pbbuttonsd-0.8.1a/src/pbbuttonsd.c0000644000175000017500000000447310641705154014120 00000000000000/** * @brief Pbbuttonsd main program file * * PBButtonsd is a system deamon for mobile computers. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/pbbuttonsd.c * @author Matthias Grimm */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include "init.h" #include "input_manager.h" #include "gettext_macros.h" #include "class_config.h" int main(int argc, char *argv[]) { struct serverdata sdata, *sd = &sdata; gint timerid100, timerid1000; int rc = 1; long tval; #ifdef ENABLE_NLS setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, PACKAGE_LOCALE_DIR); textdomain(PACKAGE); #endif init_libpbb(); /* initialising pbblib */ init_serverdata (sd); /* fill serverdata structure with default values */ if ((rc = evaluate_args(sd, argc, argv)) == 0) { /* evaluate command line */ config_new (sd->configfile); if ((rc = init_modules (sd)) == 0) { /* call known modules for initialisation */ tval = process_queue_single (QUERYQUEUE, TAG_IDENTITY, 0); if (!sd->quiet && tval) printf ("%s %s: %s\n", PACKAGE, VERSION, (char*) tval); if ((create_daemon ()) == 0) { if (tval) syslog (LOG_INFO, "INFO: %s %s: %s\n", PACKAGE, VERSION, (char*) tval); tval = process_queue_single (QUERYQUEUE, TAG_POWERSOURCE, 0); process_queue_single (CONFIGQUEUE, TAG_POWERCHANGED, tval); /* start profile changed script */ sd->mainloop = g_main_loop_new (NULL, TRUE); installSigHandler (sd); timerid100 = g_timeout_add (100, cb_timer100, NULL); timerid1000 = g_timeout_add (1000, cb_timer1000, NULL); g_main_loop_run (sd->mainloop); g_source_remove (timerid100); g_source_remove (timerid1000); g_main_loop_unref (sd->mainloop); } exit_modules (sd); /* let modules cleanup their stuff */ config_destroy (); rc = 0; } } exit_libpbb(); /* cleanup library */ if (rc == E_INFO) rc = 0; /* E_INFO isn't a real error */ exit (rc); } pbbuttonsd-0.8.1a/src/init.c0000644000175000017500000002724110641705154012675 00000000000000/** * @brief Initialization code for pbbuttonsd * * This file contains basic functions to initialize the daemon * pbbuttonsd. This starts with filling basic data structures, * evaluating command line arguments and does not end with signal * handlers. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/init.c * @author Matthias Grimm */ #ifdef HAVE_CONFIG_H # include #endif #include "systems.h" #include #include #include #include #include #include #include #include #include #include "init.h" #include "gettext_macros.h" #include "input_manager.h" #ifdef WITH_MODULE_PMAC # include "module_pmac.h" #endif #ifdef WITH_MODULE_ACPI # include "module_acpi.h" #endif #ifdef WITH_MODULE_IMAC # include "module_imac.h" #endif #include "class_backlight.h" #include "class_mixer.h" #include "class_config.h" #include "module_system.h" #include "module_powersave.h" #include "module_display.h" #include "module_cdrom.h" #ifdef DEBUG # include "module_peep.h" #endif /** * @brief Initialize the main data structure * * This function is the main initialization function of pbbuttonsd. * It sets up tha main data structure. This data structure contains * a list of all modules. The sequence to initialize the modules is * defined with this list. * * @param *sd pointer to the main data structure */ void init_serverdata (struct serverdata *sd) { int n = 0; sd->prgname = NULL; sd->quiet = 0; sd->configfile = DEFAULT_CONFIG; sd->mainloop = NULL; sd->module[n].initfunc = inputmanager_init; sd->module[n++].exitfunc = inputmanager_exit; /* pri 0 */ sd->module[n].initfunc = ipc_init_stub; sd->module[n++].exitfunc = ipc_exit; /* pri 0 */ sd->module[n].initfunc = system_init; sd->module[n++].exitfunc = system_exit; /* pri 1 */ sd->module[n].initfunc = backlight_init; sd->module[n++].exitfunc = backlight_exit; /* pri 1 */ #ifdef WITH_MODULE_PMAC sd->module[n].initfunc = pmac_init; sd->module[n++].exitfunc = pmac_exit; /* pri 1 */ #endif #ifdef WITH_MODULE_ACPI sd->module[n].initfunc = acpi_init; sd->module[n++].exitfunc = acpi_exit; /* pri 1 */ #endif #ifdef WITH_MODULE_IMAC sd->module[n].initfunc = imac_init; sd->module[n++].exitfunc = imac_exit; /* pri 1 */ #endif sd->module[n].initfunc = power_init; sd->module[n++].exitfunc = power_exit; /* pri 2 */ sd->module[n].initfunc = display_init; sd->module[n++].exitfunc = display_exit; /* pri 2 */ sd->module[n].initfunc = cdrom_init; sd->module[n++].exitfunc = cdrom_exit; /* pri 2 */ sd->module[n].initfunc = mixer_init; sd->module[n++].exitfunc = mixer_exit; /* pri 2 */ #ifdef DEBUG sd->module[n].initfunc = peep_init; sd->module[n++].exitfunc = peep_exit; /* pri 3 */ #endif for (; n < MODULECOUNT; n++) { sd->module[n].initfunc = NULL; sd->module[n].exitfunc = NULL; } } /** * @brief initializes all pbbuttonsd modules * * This function calls every registered module to initialize * themselves. If the initialization of a module failed, all * already loaded modules would be cleaned up. * * @param sd pointer to system data pool, that contains the * module list * @return error code or zero if everything went well */ int init_modules(struct serverdata *sd) { int n, rc = 0; for (n=0; n < MODULECOUNT; n++) if (sd->module[n].initfunc != NULL) if ((rc = sd->module[n].initfunc ())) { for (--n; n >= 0; n--) /* cleanup already initialized modules */ if (sd->module[n].exitfunc != NULL) sd->module[n].exitfunc (); break; /* critical error - program abortion */ } return rc; } /** * @brief free all allocated ressources and cleanup the modules * * This funcion calls the exit funcion of every know modules. The sequence * is from last to first, that means the module that was initialized first * will be cleaned up last. * * @param sd pointer to system data pool, that contains the * module list */ void exit_modules (struct serverdata *sd) { int n; for (n = MODULECOUNT-1; n >= 0; n--) if (sd->module[n].exitfunc != NULL) sd->module[n].exitfunc (); } /** * @brief evaluate command line arguments * * This function read additional options from the command line, parse * them and fill the data into the system data pool. * * @param sd pointer to system data pool * @param argc count of given command line arguments * @param argv[] null-terminated array of command line arguments * @return error code or zero if everthing went well */ int evaluate_args(struct serverdata *sd, int argc, char *argv[]) { struct option const long_options[] = { {"help", no_argument, 0, ARG_HELP}, {"version", no_argument, 0, ARG_VERSION}, {"detach", optional_argument, 0, ARG_DETACH}, {"quiet", no_argument, 0, ARG_QUIET}, {"configfile", required_argument, 0, ARG_CONFIG}, {NULL, 0, NULL, 0} }; int c, err; char *optarg2; if((sd->prgname = strrchr(argv[0],'/')) == NULL) sd->prgname = argv[0]; else sd->prgname++; /* ignore first slash*/ argv[0] = sd->prgname; while ((c = getopt_long (argc, argv, ARG_ALL, long_options, (int *) 0)) != EOF) { switch (c) { case ARG_VERSION: printf(_("%s, version %s"), PACKAGE, VERSION); printf(", (c) 2002-2006 Matthias Grimm\n"); return E_INFO; case ARG_DETACH: optarg2 = (optarg) ? optarg : argv[optind]; if (optarg2 == NULL || optarg2[0] == '-') optarg2 = DEFAULT_PIDFILE; prepare_daemon (sd->prgname, optarg2, PBBDF_FORCE); break; case ARG_QUIET: sd->quiet = 1; break; case ARG_CONFIG: if ((err = check_devorfile(sd->configfile = optarg, TYPE_FILE))) { printf (_("ERROR: Have problems reading configuration file [%s]: %s\n"), sd->configfile, strerror(errno)); return err; } break; case ARG_HELP: default: printf(_("%s - daemon to support special features of laptops and notebooks.\n"), sd->prgname); printf(_("Usage: %s [OPTION]... \n"), sd->prgname); printf (_("Options:\n" " -%c, --help display this help text and exit\n" " -%c, --version display version information and exit\n" " -%c, --quiet suppress welcome message\n" " -%c, --detach[=PIDFILE] start %s as background process and\n" " optional use an alternative pid-file\n" " (default: %s)\n" " -%c, --configfile=CONFIG use alternative configuration file\n" " (default: %s)\n" "see configuration file for more options.\n"), ARG_HELP, ARG_VERSION, ARG_QUIET, ARG_DETACH, sd->prgname, DEFAULT_PIDFILE, ARG_CONFIG, sd->configfile); return E_INFO; } } return 0; } /** * @brief Static pipe to connect the two-part signal handler * * Pipe must be global because there is no other way for the * signal handler to access this data * * @static SigHandlerPipe[] */ static int SigHandlerPipe[2]; /** * @brief Generic signal handler for all catched signals * * This handler is a generic signal handler which is set up to * all catched signals. The handler sends the signal numnber * through a pipe to a other signal handler which is running * in the program context. With this techique the signal handler * is very fast and the real signal handler can do things a * signal handler can't. * * @param signum signal number */ void cbSigHandlerTX (int signum) { write (SigHandlerPipe[1], &signum, sizeof(int)); } /** * @brief Second part of the signal handler * * This function is the other end of the pipe. This signal handler * received the signal numbers from the signal handler, interpretes * the signal and perform the appropriate action. * * @param fd file handle of the signal pipe * @param user_data pointer to main data structure * @return TRUE, if the handler should be kept active or * FALSE when the handler should terminate. */ gboolean cbSigHandlerRD (int fd, gpointer user_data) { struct serverdata *base = user_data; int signum; gboolean rc = FALSE; if ((read (fd, &signum, sizeof(int))) == sizeof(int)) { switch (signum) { case SIGHUP: /* reload config file and reconfigure the modules */ scanEventDevices (); /* look which HID are available */ rc = TRUE; break; case SIGUSR1: /* reset hardware configuration */ process_queue_single (CONFIGQUEUE, TAG_REINIT, 0); rc = TRUE; break; case SIGINT: case SIGTERM: /* cleanup and exit the program */ close (SigHandlerPipe[0]); close (SigHandlerPipe[1]); g_main_loop_quit (base->mainloop); break; } } return rc; } /** * @brief Install signal handlers for some signals * * This function creates the pipe to connect the two-part * signal handler and installs signal handlers for the * signals SIGINT, SIGTERM, SIGHUP and SIGUSR1. * * The initialized pipe is stored in the global variable * SigHandlerPipe[]. * * @param *base pointer to main data structure */ void installSigHandler (struct serverdata *base) { struct sigaction sa = { {cbSigHandlerTX}, {{0}}, SA_RESTART, 0 }; InputSource *src; int n = 0; if ((pipe(SigHandlerPipe)) == 0) { src = addInputSource (SigHandlerPipe[0], cbSigHandlerRD, base, FALSE); if (!sigaction (SIGINT, &sa, NULL)) n++; if (!sigaction (SIGTERM, &sa, NULL)) n++; if (!sigaction (SIGHUP, &sa, NULL)) n++; if (!sigaction (SIGUSR1, &sa, NULL)) n++; if (n == 0) { g_source_remove (src->watch); close (SigHandlerPipe[0]); close (SigHandlerPipe[1]); } else if (n < 4) print_msg (PBB_WARN, _("Not all signal handlers could be installed.\n")); } else print_msg (PBB_WARN, _("Can't install any signal handler\n")); return; } /** * @brief Set up IPC server interface * * Clients connect to the server through a System V IPC interface. * This interface is a message port interface wich allows different * processes to communicate. * * This function opens the server port and installs a timer handler * to handle requests from clients. * * The System V IPC interface has no own authentification system. * To prevent unauthorized users to send IPC requests to pbbuttonsd, * the access could be limited to a priviledged user. This function * reads the user name from the global configuration file and sets * up a user filter for this user in the IPC backend. * * The IPC filter restricts write access to IPC but still allows * reading of IPC messages. */ int ipc_init_stub () { int err; char *username; struct passwd *pwddata = NULL; err = ipc_init (NULL, LIBMODE_SERVER, 0); switch (err) { case E_MSGPORT: print_msg (PBB_ERR, _("Can't create message port for server: %s.\n"), strerror(errno)); break; case E_TWICE: print_msg (PBB_ERR, _("Server is already running. Sorry, only one instance allowed.\n")); break; case E_OLDPORT: print_msg (PBB_WARN, _("Orphaned server port found and removed. All running clients have to be restarted.\n")); err = 0; case 0: if (config_has_key ("SYSTEM", "userallowed") == TRUE) { username = config_get_string ("SYSTEM", "userallowed", "paranoid"); if ((pwddata = getpwnam(username))) ipc_filteruser(pwddata->pw_uid); else ipc_filterall(); /* switch off IPC-receive */ g_free(username); } break; } register_function (T100QUEUE, ipc_handler); /* input via IPC messages */ return err; } pbbuttonsd-0.8.1a/src/init.h0000644000175000017500000000320610641705157012700 00000000000000#ifndef INCLUDE_INIT_H #define INCLUDE_INIT_H /** * @brief Definitions and prototypes for main program initialization * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/init.h * @author Matthias Grimm */ #include /* short options for optarg */ #define ARG_ALL "hvqd::c:" #define ARG_HELP 'h' #define ARG_VERSION 'v' #define ARG_DETACH 'd' #define ARG_CONFIG 'c' #define ARG_QUIET 'q' #define DEFAULT_CONFIG SYS_CONF_DIR "/pbbuttonsd.cnf" #define DEFAULT_PIDFILE "/var/run/" PACKAGE ".pid" #define MODULECOUNT 15 /** * @brief main server data structure * * This structure contains major server data. * * Main part of this structure is the module list. */ struct serverdata { char *prgname; /** * @brief Name and path of configuration file * configfile to read: eg. /etc/pbbuttonsd.cnf * Writing the configfile will be controlled by module_system. */ char *configfile; GMainLoop *mainloop; int quiet; struct { int (*initfunc)(); void (*exitfunc)(); } module[MODULECOUNT]; }; /* prototypes */ void init_serverdata (struct serverdata *sd); int init_modules(struct serverdata *sd); void exit_modules(struct serverdata *sd); int evaluate_args(struct serverdata *sd, int argc, char *argv[]); void cbSigHandlerTX (int signum); gboolean cbSigHandlerRD (int fd, gpointer user_data); void installSigHandler (struct serverdata *base); int ipc_init_stub (); #endif /* INCLUDE_INIT_H */ pbbuttonsd-0.8.1a/src/systems.h0000644000175000017500000000161010641705161013434 00000000000000#ifndef INCLUDE_SYSTEMS_H #define INCLUDE_SYSTEMS_H /* ---------------------------------------------------------------------------- * systems.h * definitions for different laptop models. * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #ifdef SYS_POWERBOOK # define WITH_MODULE_PMAC # define WITH_BACKLIGHT_PMU #endif #ifdef SYS_MACBOOK # define WITH_MODULE_ACPI # define WITH_MODULE_IMAC # define WITH_BACKLIGHT_PCI #endif #ifdef SYS_I386_ACPI #endif #ifdef SYS_I386_GENERIC #endif #endif /* INCLUDE_SYSTEMS_H */ pbbuttonsd-0.8.1a/src/input_manager.c0000644000175000017500000004754110641705154014570 00000000000000/** * @brief Input Manager - handles internal and external data exchange * * This module contains the input manager. The input manager supports * the modules with communication functions to the outer world or * between eachother. It is the router of information in pbbuttonsd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/input_manager.c * @author Matthias Grimm * * @page inputmanager Input Manager * * The input manager is the spider in the information web. It collects * data from various sources and transmit it to receivers who are * interested in them. * * The basic mechanism to distribute information are message queues. * Following queues are available: * * * * * * * * * * * * * * * * * *
Queue-IDType of information/event
KBDQUEUEThis queue distributes keyboard events. Each module which is * interested in receiving keystrokes should register for this queue. * Also laptop-specific hot keys would be sent here.
MOUSEQUEUEThis queue distributes mouse events.
T100QUEUEAll modules registered for this queue would be called every 100ms.
T1000QUEUEAll modules registered for this queue would be called every second.
QUERYQUEUEThis queue is used to collect data from modules.
CONFIGQUEUEThis queue is used to configure modules or to change certain runtime * variables.
SECUREQUEUEA module subscribed in this queue would only be called, if the user * was idle. That means no key on the keyboard is currently pressed. This * queue should only be used for tasks that would not work correctly if a * key is still pressed on execution. On PowerMacs for example this queue * is used for triggering sleep mode and configuring input devices like * the keyboard itself. Pressed keys would interfere with the reconfiguration * process so it would only be done if no key was pressed.
* * A module could request information from this queue by registering a callback * function which will be called as soon as a message is queued: * * @li register_function() * * Each time the queue queueid was processed the callback will be called. * Arguments will be handed over in a taglist. The callback could now interpret * the taglist but shouldn't modify any tag, except it is especially asked for, * because the same taglist is subsequently passed to all registered callback * functions. * * At the moment there is no way to unregister a function from a queue. * *

Module <-> Module data transfer

* * If a module wanted to send data to other modules, it can use the following * functions: * @li process_queue(), if multiple properties should be transfered * @li process_queue_single(), if only a single property should be transfered * * To send properties to other modules the CONFIGQUEUE msut be used. If a * module needs information it asks other modules through the QUERYQUEUE. * *

Other Input Sources

* * Traditionally the input manager handles all input devices like keyboards, * mice, trackpads, etc. Events from these devices were read, preprocessed * and passed over to the interested receivers via queue described above. * * Since glib is used as basic library the input manager offers a highly * flexible system to handle any input stream comming from a file handle. * * For example if a module needs input from a socket, it could open and * initialize the socket and register it as InputSource. The input handler * will take care about the socket and inform the module when there is * something to read. * * File handles will be registered as input source with * @li addInputSource(); * *

Input Handler

* * The input manager has four predefined input handler to process * incomming events: * * @li input_event_handler(), process input events from kernel * @li ipc_handler(), process input from pbbuttonsd clients * @li cb_timer100(), process timer event every 100ms * @li cb_timer1000(), process timer event every second * * Please see the handler documentation for detailed information about * the function. * */ #ifdef HAVE_CONFIG_H # include #endif #include "debug.h" #include #include #include #include #include #include #include #include #include "pbbinput.h" #include #include #include "gettext_macros.h" #include "systems.h" #include "init.h" #include "input_manager.h" extern volatile sig_atomic_t prgexit; /** * @brief Private data of module input manager */ struct moddata_inputmanager { GList *inputsources; /* list of input sources */ struct { unsigned int shift:1; unsigned int ctrl:1; unsigned int alt:1; unsigned int :0; } flags; unsigned short lastkey; inputqueue_t *iqueues[QUEUECOUNT]; inputqueue_t kbdqueue[MODULECOUNT]; inputqueue_t mousequeue[MODULECOUNT]; inputqueue_t t100queue[MODULECOUNT]; inputqueue_t t1000queue[MODULECOUNT]; inputqueue_t queryqueue[MODULECOUNT]; inputqueue_t configqueue[MODULECOUNT]; inputqueue_t securequeue[MODULECOUNT]; } modbase_inputmanager; /** * @name Private Functions * @{ */ /** * @brief Initalization of the Input manager * * This function sets up the internal strutures of the input manager. * * @return error code, but this function can't fail and always returns * zero. */ int inputmanager_init () { struct moddata_inputmanager *base = &modbase_inputmanager; int x, y; base->inputsources = NULL; scanEventDevices(); #if 0 /* see mice_handler for comment */ if ((fd = open("/dev/input/mice", O_RDONLY)) >= 0) /* open mouse device */ addInputSource (fd, mice_handler, NULL, TRUE); #endif base->flags.shift = 0; base->flags.ctrl = 0; base->flags.alt = 0; base->lastkey = 0; base->iqueues[KBDQUEUE] = base->kbdqueue; base->iqueues[MOUSEQUEUE] = base->mousequeue; base->iqueues[T100QUEUE] = base->t100queue; base->iqueues[T1000QUEUE] = base->t1000queue; base->iqueues[QUERYQUEUE] = base->queryqueue; base->iqueues[CONFIGQUEUE] = base->configqueue; base->iqueues[SECUREQUEUE] = base->securequeue; for (y=0; y < QUEUECOUNT; y++) for (x=0; x < MODULECOUNT; x++) base->iqueues[y][x] = NULL; return 0; } /** * @brief Callback to free an Glib input source * * This function removed a input source from the main context. * That means the attached file handle is no longer monitored. * * The function addInputSource() has already reduced the reference * counter of the IOChannel so that it will automatically removed * too after this action. At the end the complete InputSource was * freed. * * @see addInputSource() * * @param data Pointer to a InputSource structure * @param user_data Standard callback parameter. Not used in * this function. */ void cbFreeInputSource (gpointer data, gpointer user_data) { InputSource *src = data; g_source_remove (src->watch); } /** * @brief Frees all ressources allocated by the input manager */ void inputmanager_exit () { struct moddata_inputmanager *base = &modbase_inputmanager; g_list_foreach (base->inputsources, cbFreeInputSource, NULL); } /** * @brief Track the status of the modifier keys * * Pbbuttonsd reads keyboard events directly from the kernel * input layer. Each key will trigger an event containing the * keycode and the key status (pressed, released or repeat). * Two or more keys pressed together will result in two or more * events in sequence, even one of the keys is a modifier key. * * Because 'A' is not equal shift-'A', pbbuttonsd has to remember * which modifier keys were pressed when an 'A'-key event is * received. This function does this. It filters modifier keys out * of the event stream and stores their current status. * * @param code keycode from the event * @param value key status, * @li 0 = released, * @li 1 = pressed, * @li 2 = repeat * @return modifier mask * @li Bit 0 = shift is pressed * @li Bit 1 = alt is pressed * @li Bit 2 = ctrl is pressed * One or more bits could be set. */ int track_modifier(unsigned short code, unsigned int value) { struct moddata_inputmanager *base = &modbase_inputmanager; if (value > 1) value = 1; /* key repeated = pressed */ switch (code) { case KEY_RIGHTSHIFT: case KEY_LEFTSHIFT: base->flags.shift = value; break; case KEY_RIGHTCTRL: case KEY_LEFTCTRL: base->flags.ctrl = value; break; case KEY_RIGHTALT: case KEY_LEFTALT: base->flags.alt = value; break; } return (base->flags.ctrl << 2) | (base->flags.alt << 1) | (base->flags.shift << 0); } /** * @brief Returns the current modifier mask * * This function returns the currently saved modifier mask. * * @return modifier mask */ int get_modifier() { struct moddata_inputmanager *base = &modbase_inputmanager; return (base->flags.ctrl << 2) | (base->flags.alt << 1) | (base->flags.shift << 0); } /* --- event handler management --- */ gint cbEventDevices (gconstpointer a, gconstpointer venprod) { const InputSource *src = a; if (src->user_data == venprod) return 0; return 1; } /* * The Input Manager will keep the list of input devices up-to-date and * connect any input device which is able to send the supported events * with it. */ void scanEventDevices () { struct moddata_inputmanager *base = &modbase_inputmanager; int n, fd, fcnt = 0; char filename[20]; gpointer evdevid; for (n = 0; n < EVDEVCOUNT; n++) { sprintf(filename, "/dev/input/event%d", n); if ((fd = open(filename, O_RDONLY)) >= 0) { evdevid = (gpointer) (0x45460000 | n); if ((g_list_find_custom (base->inputsources, evdevid, cbEventDevices)) == NULL) addInputSource (fd, input_event_handler, evdevid, TRUE); else close(fd); } else fcnt++; /* count number of event devices that could not be opened */ } if (fcnt == EVDEVCOUNT) /* none of the 32 devices can be opened */ print_msg (PBB_WARN, _("No event devices available. Please check your configuration.\n")); } /* --- input source --- */ void destroyInputSource (gpointer data) { struct moddata_inputmanager *base = &modbase_inputmanager; InputSource *src = data; #ifdef DEBUG print_msg (PBB_INFO, "DBG: InputSource removed: %08x\n", src->user_data); #endif base->inputsources = g_list_remove (base->inputsources, src); g_free (src); } gboolean handleInputSource (GIOChannel *io, GIOCondition condition, gpointer data) { InputSource *src = data; gboolean rc = TRUE; if (condition & G_IO_IN) { /* call the appropriate handler. We assume that io = src->io. * In case of an error the InputSource will be removed to * prevent further problems reading invalid devices. */ rc = src->handler (g_io_channel_unix_get_fd (io), src->user_data); } else /* GIOChannel reported an error */ rc = FALSE; #ifdef DEBUG if (rc == FALSE) { print_msg (PBB_INFO, "DBG: InputSource received %s %s %s\n", (condition & G_IO_IN) ? "G_IO_IN" : "", (condition & G_IO_ERR) ? "G_IO_ERR" : "", (condition & G_IO_HUP) ? "G_IO_HUP" : ""); } #endif return rc; } /* @} */ /** * @name Public API * @{ */ InputSource* addInputSource (int fd, int (*handler)(), gpointer user_data, gboolean close_on_exit) { struct moddata_inputmanager *base = &modbase_inputmanager; InputSource *src; src = g_new0 (InputSource, 1); src->io = g_io_channel_unix_new (fd); /* set channel encoding to binary */ g_io_channel_set_encoding (src->io, NULL, NULL); /* Bound the file handle to the IOChannel. The file handle will be * closed as soon as this IOChannel got obsolete. If this shouldn't * happen, give 'close_on_exit' = FALSE. */ if (close_on_exit == TRUE) g_io_channel_set_close_on_unref (src->io, TRUE); src->handler = handler; src->user_data = user_data; src->watch = g_io_add_watch_full (src->io, G_PRIORITY_DEFAULT, G_IO_IN | G_IO_ERR | G_IO_HUP, handleInputSource, src, destroyInputSource); /* g_io_channel_unix_new() and g_io_add_watch both increment the * ref counter but we want to get rid of the IOchannel too, when * the source was removed. */ g_io_channel_unref (src->io); /* Attach the newly created InputSource to the global list */ base->inputsources = g_list_append (base->inputsources, src); #ifdef DEBUG print_msg (PBB_INFO, "DBG: InputSource added: %08x\n", src->user_data); #endif return src; } /* --- queue managers --- */ int register_function (int queueid, void (*func)()) { struct moddata_inputmanager *base = &modbase_inputmanager; inputqueue_t *queue = base->iqueues[queueid]; int n; for (n=0; n < MODULECOUNT; n++) if (queue[n] == NULL) { queue[n] = (inputqueue_t) func; return 0; } return -1; } long process_queue_single (int queueid, long tag, long data) { struct tagitem taglist[2]; taglist_init (taglist); taglist_add (taglist, tag, data); process_queue (queueid, taglist); return taglist->tag & FLG_ERROR ? data : taglist->data; } int process_queue (int queueid, struct tagitem *taglist) { struct moddata_inputmanager *base = &modbase_inputmanager; inputqueue_t *queue = base->iqueues[queueid]; int n=0; if (queueid == KBDQUEUE) { if ((tagfind (taglist, TAG_KEYREPEAT, 0))) { base->lastkey = tagfind (taglist, TAG_KEYCODE, 0); } else base->lastkey = 0; } while ((queue[n] != NULL) && (n < MODULECOUNT)) { queue[n++] (taglist); } return n; } /* @} */ /** * @name Input Handlers * @{ */ /** * @brief Process IPC messaged from pbbuttonsd clients * * This input handler is called every 100ms (from timer handler) and checks * if there are messages from clients pending. If so, the message would be * polled and according the action code in the message decides the message * splitter to route it either through the query queue or through the config * queue. * * In case of a query message it collects all data and sends it back to the * clients. If a config message was sent, nothing would be returned. The * client has to query the tags again to be sure that all configurations * were successful. */ void ipc_handler () { struct pbbmessage *msg; struct tagitem *source, *dest; char msgbuffer[8192]; if ((ipc_receive (msgbuffer, sizeof(msgbuffer))) == 0) { msg = (struct pbbmessage *) msgbuffer; switch (msg->action) { case READVALUE: process_queue (QUERYQUEUE, msg->taglist); ipc_send (msg->returnport, CHANGEVALUE, msg->taglist); break; case CHANGEVALUE: process_queue (CONFIGQUEUE, msg->taglist); source = dest = msg->taglist; while (source->tag != TAG_END) { if ((source->tag & FLG_ERROR)) { dest->tag = source->tag; dest->data = source->data; dest++; } source++; } dest->tag = TAG_END; dest->data = 0; ipc_send (msg->returnport, CHANGEERROR, msg->taglist); break; } } } /** * @brief Process input events from kernel input system * * The input_event_handler() process events comming from /dev/input/event%. * Currently supported events are: * @li keyboard events * @li relative mouse events * @li absolute mouse events * * The input event handler will be called as soon as new events are available. * * From key events the key code, the repeat indicator and the current * modifier mask is evaluated and sended them through the keyboard queue to * the modules. Furthermore the modifier keys shift, alt and * ctrl will be tracked. * * From relative mouse events the relative X and Y coordinates are * sent through the mouse queue to the modules. Mouse buttons are treated * as key events and handled by the keyboard section of the event handler. * * Absolute mouse events are only used to send a trigger signal to * the modules. No information from the event is used. * * @param fd file handle to read the event from. It must be a open * filehandle to a /dev/input/event% device file. * @param user_data not used in this function * * @return TRUE, if the event handler should be called again or FALSE if an * error ocoured and the event file can't be read. In this case the * event file will be removed from the input list and not used anymore. */ gboolean input_event_handler (int fd, gpointer user_data) { struct input_event inp; struct tagitem taglist[10]; gboolean rc = FALSE; taglist_init(taglist); if (read(fd, &inp, sizeof(inp)) == sizeof(inp)) { switch (inp.type) { case EV_KEY: taglist_add (taglist, TAG_KEYCODE, (long) inp.code); taglist_add (taglist, TAG_KEYREPEAT,(long) inp.value); taglist_add (taglist, TAG_MODIFIER, (long) track_modifier (inp.code, inp.value)); process_queue (KBDQUEUE, taglist); break; case EV_REL: /* TAG_MOUSERELx are currently not used. Only the occourence * of this events will be used */ if (inp.code) taglist_add (taglist, TAG_MOUSERELY, (long) inp.value); else taglist_add (taglist, TAG_MOUSERELX, (long) inp.value); process_queue (MOUSEQUEUE, taglist); break; case EV_ABS: /* Mouse events are not used. Only the occurence of this events * will currently be used */ process_queue (MOUSEQUEUE, taglist); break; default: break; /* catch unknown event types */ } rc = TRUE; } return rc; } /* This function is a tribute to the buggy Xorg synaptics driver. * This driver blocks the event device of the trackpad for exclusive * use so pbbuttonsd won't get any events from the trackpad. This * function uses /dev/input/mice in parallel to the event device * so we hopefully tick the synaptics driver. * * Unfortunately the synaptics driver pushed the mouse events read * from the event device directly to X and doesn't mirrot them to * /dev/event/mice. This makes it impossible to work around this * problem and make the following handler useless. (2006-09-23 MG) */ #if 0 gboolean mice_handler (int fd, gpointer user_data) { signed char buffer[] = {0, 0, 0 ,0}; struct tagitem taglist[3]; int count; taglist_init(taglist); if ((count = read(fd, buffer, sizeof(buffer))) >= 3) { taglist_add (taglist, TAG_MOUSERELX, (long) buffer[1]); taglist_add (taglist, TAG_MOUSERELY, (long) buffer[2]); process_queue (MOUSEQUEUE, taglist); } return TRUE; } #endif /** * @brief Process timer event every 100ms * * There are two regulary timer functions: * @li cb_timer100(), called every 100ms * @li cb_timer1000(), called every second * * If a module need a faster timer, it is up to the module to install one * with the glib g_timeout_add() function. The module is responsible to * free any allocated ressources after the timer is no longer needed. * * The regulary timer functions send trigger signals through the timer * queues to the modules. * * @see cb_timer1000() * * @param data Standard callback parameter, not used in this function * @return Always TRUE. This guarantee that glib continues to call this * handler. */ gboolean cb_timer100 (gpointer data) { struct moddata_inputmanager *base = &modbase_inputmanager; struct tagitem taglist[] = { { TAG_END, 0 } }; int mod; process_queue (T100QUEUE, taglist); mod = get_modifier(); if ((mod == 0) && (base->lastkey == 0)) process_queue (SECUREQUEUE, taglist); return TRUE; } /** * @brief Process timer event every second * * @see cb_timer100() * * @param data Standard callback parameter, not used in this function * @return Always TRUE. This guarantee that glib continues to call this * handler. */ gboolean cb_timer1000 (gpointer data) { struct tagitem taglist[] = { { TAG_END, 0 } }; process_queue (T1000QUEUE, taglist); return TRUE; } /* @} */ pbbuttonsd-0.8.1a/src/input_manager.h0000644000175000017500000000525610641705157014575 00000000000000#ifndef INCLUDE_INPUTMANAGER_H #define INCLUDE_INPUTMANAGER_H /* ---------------------------------------------------------------------------- * input_manager.h * prototypes and definitions for input_manager.c. * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #include typedef void (*inputqueue_t)(); #define MAXINPUTS 16 #define TIMERCOUNT 3 /* ATTENTION: keep an eye on the init routine */ #define EVDEVCOUNT 32 /* queue identifier */ #define KBDQUEUE 0 /* keyboard events */ #define MOUSEQUEUE 1 /* mouse events */ #define T100QUEUE 2 /* timer tic every 100ms */ #define T1000QUEUE 3 /* timer tic every second */ #define QUERYQUEUE 4 /* ask for properties */ #define CONFIGQUEUE 5 /* set properties */ #define SECUREQUEUE 6 /* called if user is idle */ #define QUEUECOUNT 7 #define MOD_NONE 0 #define MOD_SHIFT 1 /* 001 */ #define MOD_ALT 2 /* 010 */ #define MOD_SHIFTALT 3 #define MOD_CTRL 4 /* 100 */ #define MOD_SHIFTCTRL 5 #define MOD_ALTCTRL 6 #define MOD_SHIFTALTCTRL 7 #define BITS_PER_LONG (sizeof(long) * 8) #define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1) #define OFF(x) ((x)%BITS_PER_LONG) #define LONG(x) ((x)/BITS_PER_LONG) #define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1) typedef struct inputsource { GIOChannel *io; guint watch; int (*handler)(int fd, gpointer user_data); gpointer user_data; } InputSource; /* public prototypes */ int inputmanager_init (); void cbFreeInputSource (gpointer data, gpointer user_data); void inputmanager_exit (); int track_modifier(unsigned short code, unsigned int value); int get_modifier(); gint cbEventDevices (gconstpointer a, gconstpointer b); void scanEventDevices (); void destroyInputSource (gpointer data); gboolean handleInputSource (GIOChannel *io, GIOCondition condition, gpointer data); InputSource *addInputSource (int fd, int (*handler)(), gpointer user_data, gboolean close_on_exit); int register_function (int queueid, void (*func)()); long process_queue_single (int queueid, long tag, long data); int process_queue (int queueid, struct tagitem *taglist); void ipc_handler (); gboolean input_event_handler (int fd, gpointer user_data); /*gboolean mice_handler (int fd, gpointer user_data);*/ gboolean cb_timer100 (gpointer data); gboolean cb_timer1000 (gpointer data); #endif /* INCLUDE_INPUTMANAGER_H */ pbbuttonsd-0.8.1a/src/support.c0000644000175000017500000001654010641705155013447 00000000000000/* ---------------------------------------------------------------------------- * support.c * funtions usefull for everybody * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include #include "support.h" #include "gettext_macros.h" /* the prototype for getpgid() should be in unistd.h but although it is * included above the compiler complains with "implicit declaration for * getpgid" if this line is missing. This must be further investigated. */ extern pid_t getpgid (pid_t pid); gboolean check_path (char *source, int type, int flags) { char *whitespace = NULL; int rc = 0, perms = 0600; if (type == TYPE_DIR) perms = 0700; if ((whitespace = strchr (source, ' ')) != NULL) *whitespace = 0; rc = check_devorfile (source, type); if ((rc == 0) && (flags & CPFLG_PBBONLY)) rc = check_permissions (source, geteuid(), perms, 022); if ((rc == E_NOEXIST) && (flags & CPFLG_MAYBEMISSED)) rc = 0; if (type == TYPE_FILE && strlen(source) == 0) rc = 0; /* empty _file_names are acceptable */ switch (rc) { case E_NOEXIST: print_msg (PBB_ERR, _("The object '%s' doesn't exist.\n"), source); break; case E_NOFILE: print_msg (PBB_ERR, _("The object '%s' is not a file.\n"), source); break; case E_NODIR: print_msg (PBB_ERR, _("The object '%s' is not a directory.\n"), source); break; case E_NOCHAR: print_msg (PBB_ERR, _("The object '%s' is not a character device.\n"), source); break; case E_NOBLK: print_msg (PBB_ERR, _("The object '%s' is not a block device.\n"), source); break; case E_USER: print_msg (PBB_WARN, _("SECURITY: %s must be owned by the same owner as pbbuttonsd.\n"), source); break; case E_RIGHTS: print_msg (PBB_WARN, _("SECURITY: %s must only be writable by the owner of pbbuttonsd.\n"), source); break; case E_PERM: print_msg (PBB_ERR, _("Insufficient permissions for object %s, at least '0%o' needed.\n"), source, perms); break; } if (whitespace != NULL) *whitespace = ' '; return rc; } void replace_string (char **oldstr, char *newstr) { GString *tmp; if (*oldstr) g_free (*oldstr); tmp = g_string_new (newstr); *oldstr = tmp->str; g_string_free (tmp, FALSE); } #if 0 /* lauching of external programs with glib functions. The program will be * executed asynchron but some applications in pbbuttond don't work with * asynchron calls. Synchron calls won't neither work because in some * cases the IPC system will be blocked. To make this work, a major * redesign of pbbuttonsd internal structure would be necessary. */ void cbChildSetup (gpointer data) { /* open own session so that pbbuttonsd can terminate the * script cleanly on error without killing itself */ setsid(); } void cbChildCleanup (gpointer data) { struct ChildData *cd = data; #ifdef DEBUG print_msg (PBB_INFO, "DBG: Child %d cleaned up (ref=%d), exitcode=%d.\n", cd->pid, cd->ref, cd->rc); #endif if (g_atomic_int_dec_and_test (&cd->ref)) { /* free resources */ g_spawn_close_pid(cd->pid), g_strfreev (cd->argv); g_free (cd); #ifdef DEBUG print_msg (PBB_INFO, "DBG: Resources freed.\n"); #endif } } gboolean cbChildTimeout (gpointer data) { struct ChildData *cd = data; int pgrp, status; gchar *cmd; #ifdef DEBUG print_msg (PBB_INFO, "DBG: Child %d, timeout handler called.\n", cd->pid); #endif /* remove child watch */ g_source_remove (cd->cwatch); pgrp = getpgid(cd->pid); /* get childs process group */ kill (-pgrp, SIGKILL); /* kill child and his childs */ waitpid (cd->pid, &status, 0); /* clean up zombie */ cmd = g_strjoinv (" ", cd->argv); print_msg (PBB_INFO, _("Script '%s' lauched but killed after %d seconds.\n"), cmd, get_timeforcmd()); g_free (cmd); /* remove timeout watch */ return FALSE; } void cbChildExit (GPid pin, gint status, gpointer data) { struct ChildData *cd = data; gchar *cmd; #ifdef DEBUG print_msg (PBB_INFO, "DBG: Child %d, exit handler called.\n", cd->pid); #endif /* remove timeout watch */ g_source_remove (cd->twatch); cmd = g_strjoinv (" ", cd->argv); if (WIFEXITED(status)) { if ((cd->rc = WEXITSTATUS(status))) print_msg (PBB_INFO, _("Script '%s' lauched but exitcode is %d.\n"), cmd, cd->rc); else print_msg (PBB_INFO, _("Script '%s' launched and exited normally.\n"), cmd); } else if (WIFSIGNALED(status)) print_msg (PBB_INFO, _("Script '%s' lauched but exited by signal.\n"), cmd); g_free (cmd); } /* struct ChildData* */ int call_script (char* template, ...) { GError *err = NULL; char cmd[MAXCMDLEN+1]; struct ChildData *cd; va_list list; int rc = 0; if (strlen(template) == 0) /* do nothing, if template is empty */ return 0; cd = g_new0 (struct ChildData, 1); cd->rc = -1; va_start(list, template); vsnprintf (cmd, MAXCMDLEN, template, list); cmd[MAXCMDLEN] = '\0'; cd->argv = g_strsplit (cmd, " ", 0); va_end (list); if ((rc = check_permissions (cd->argv[0], geteuid(), 0700, 022)) == 0) { g_spawn_async ("/", cd->argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD|G_SPAWN_STDOUT_TO_DEV_NULL|G_SPAWN_STDERR_TO_DEV_NULL, cbChildSetup, (gpointer) cd, &cd->pid, &err); if (err == NULL) { g_atomic_int_inc (&cd->ref); cd->twatch = g_timeout_add_full (G_PRIORITY_DEFAULT, get_timeforcmd() * 1000, cbChildTimeout, (gpointer) cd, cbChildCleanup); g_atomic_int_inc (&cd->ref); cd->cwatch = g_child_watch_add_full (G_PRIORITY_DEFAULT, cd->pid, cbChildExit, (gpointer) cd, cbChildCleanup); /* return cd; */ return rc; } else { print_msg (PBB_INFO, _("Script '%s' can't be launched - fork() failed.\n"), cmd); g_error_free (err); } } else if (rc == E_NOEXIST) { print_msg (PBB_INFO, _("Script '%s' doesn't exist.\n"), cmd); } else { /* E_PERM or E_RIGHTS or E_USER */ print_msg (PBB_INFO, _("Script '%s' skipped because it's not secure.\n"), cmd); } g_strfreev (cd->argv); g_free (cd); /* return NULL; */ return rc; } #endif int call_script (char* template, ...) { int rc; char script[MAXCMDLEN+1], *ftext, buffer[STDBUFFERLEN]; va_list list; if (strlen(template) == 0) /* do nothing, if template is empty */ return 0; va_start(list, template); vsnprintf (script, MAXCMDLEN, template, list); script[MAXCMDLEN] = '\0'; va_end (list); rc = launch_program (script); switch (rc) { case 0: ftext = _("launched and exited normally"); break; case E_NOEXIST: ftext =_("doesn't exist"); break; case E_RIGHTS: case E_USER: case E_PERM: ftext =_("skipped because it's not secure"); break; case E_CLDKILL: snprintf (buffer, STDBUFFERLEN, _("lauched but killed after %d seconds"), get_timeforcmd()); ftext = buffer; break; case E_CLDEXIT: ftext =_("lauched but exitcode is not null"); break; case E_CLDFAIL: ftext =_("can't be launched - fork() failed"); break; case E_CLDSIG: ftext =_("lauched but exited by signal"); break; default: ftext =_("failed - unknown error code"); } print_msg (PBB_INFO, _("Script '%s' %s\n"), script, ftext); return rc; } pbbuttonsd-0.8.1a/src/support.h0000644000175000017500000000176410641705161013453 00000000000000#ifndef INCLUDE_SUPPORT_H #define INCLUDE_SUPPORT_H /* ---------------------------------------------------------------------------- * support.h * prototypes and definitions for support.c. * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #define CPFLG_NONE 0 #define CPFLG_MAYBEMISSED 1 #define CPFLG_PBBONLY 2 struct ChildData { char **argv; GPid pid; gint twatch; gint cwatch; gint ref; /* reference count */ gint rc; /* child's return code, or -1 */ }; /* prototypes */ gboolean check_path (char *source, int type, int flags); void replace_string (char **oldstr, char *newstr); int call_script (char* template, ...); #endif /* INCLUDE_SUPPORT_H */ pbbuttonsd-0.8.1a/src/class_config.c0000644000175000017500000006260110641705162014362 00000000000000/** * @brief Class Config - controls loading and saving of configuartion options. * * This class contains the interface to access the global configuration * file. This file uses the data format of freedesktop.org as described * in folowing file: http://freedesktop.org/Standards/desktop-entry-spec. * * The file is loaded into memory at pbbuttonsd startup and any module * can then ask for configuration options and change them if needed. At * the end or on special request the configuration file will be written * back to hard disk. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/class_config.c * @author Matthias Grimm */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include "gettext_macros.h" #include "input_manager.h" #include "class_config.h" /** * @brief private data of class config */ struct class_config { GKeyFile *config; GString *configfile; } modbase_config; /** * @brief Constructor of class config * * This function initializes a new config file and loads its * contents into memory. If the configfile does not exists, * it creates a new one. The configfile will be held in memory * only until it is written to hard disk with the function * config_save(). * * When the config file is not longer in use, free its ressources * with config_destroy(). * * @see config_save(), config_destroy() * * @param configfile a full pathname of the configuration file * @return TRUE, if the configuration file was loaded successfully * or FALSE if something went wrong. If a new configuration * file should be created, the result is always FALSE. */ gboolean config_new (char *configfile) { struct class_config *base = &modbase_config; GError *error = NULL; gboolean success; base->configfile = g_string_new (configfile); base->config = g_key_file_new (); g_key_file_set_list_separator (base->config, ','); success = g_key_file_load_from_file (base->config, configfile, G_KEY_FILE_KEEP_COMMENTS, &error); if (success) return TRUE; g_key_file_set_comment (base->config, NULL, NULL, _(" Configuration file for pbbuttonsd >= version 0.8.0\n" " For complete list of options please see pbbuttonsd.cnf man-page.\n" " For description of the file format please see\n" " http://freedesktop.org/Standards/desktop-entry-spec.\n"), NULL); print_msg (PBB_WARN, _("Can't load config file: %s, using defaults.\n"), error->message); g_error_free (error); return FALSE; } /** * @brief Frees all allocated ressources and destroys the g_key_file object * * This function frees all ressources that are used by this module. * Finally the g_key_file object is destroyed. All changed to the * configuration file, that are not saved until calling this function, * are lost. */ void config_destroy () { struct class_config *base = &modbase_config; if (base->configfile) g_string_free (base->configfile, TRUE); if (base->config) g_key_file_free (base->config); } /** * @brief Save the configuration file to disk * * This function writes the configuration array to disk. During program * execution any module was able to read, change and create configuration * options. All this options will be collected in the g_key_file object * in memory until the user request it to write it back to disk. * * Each time the configuration file should be written, this function * checks if it is athorized to write the cconfiguration file to disk. * Various security checks are done to protect the configuration file * already on disk against corruption. See also config_iswritable(). * * @see config_iswritable() * * @return TRUE, if the configuration file was sucessfully written or * FALSE, if something went wrong. */ gboolean config_save () { struct class_config *base = &modbase_config; gchar *stream; gsize length; FILE *fd; gboolean rc = FALSE; if (config_iswritable()) { stream = g_key_file_to_data (base->config, &length, NULL); if ((fd = fopen(base->configfile->str, "w"))) { fwrite (stream, length, 1, fd); fclose (fd); print_msg (PBB_INFO, _("Configuration saved to %s.\n"), base->configfile->str); rc = TRUE; } else print_msg (PBB_ERR, _("Can't write config file %s\n"), base->configfile->str); g_free (stream); } return rc; } /** * @brief Check if the configuration file can be written * * This function checks, if the configuration file can be written. * Multiple security checks are done on the file to be safe that * no harm could happen to the configuration. * * The configuration file can be written, if * @li the process owner of pbbuttonsd is also owner of the * configuration file * @li only the owner has write permissions to the configuration * file * @li the file is not write protected * * If the configuration file is not writable, the reason for that * will be written into the log file. * * @return TRUE, if the file could be written and FALSE if not. */ gboolean config_iswritable () { struct class_config *base = &modbase_config; unsigned int perms, owner; owner = get_owner(base->configfile->str); perms = get_permissions(base->configfile->str); if (owner != getuid() || (perms & 022)) print_msg (PBB_WARN, _("Configuration file [%s] is insecure, saving denied.\n"), base->configfile->str); else if (owner == getuid() && !(perms & 0200)) print_msg (PBB_WARN, _("Configuration file [%s] is not writable, saving not possible.\n"), base->configfile->str); else return TRUE; return FALSE; } /** * @brief Checks if a section/key is present in the configuration file * * This function checks if a specific option inside a specific section * is present or not. The return value is a boolean. * * @return TRUE if the option is present, FALSE if not. */ gboolean config_has_key (const char *group, const char *key) { struct class_config *base = &modbase_config; GError *error = NULL; gboolean rc; rc = g_key_file_has_key (base->config, group, key, &error); if (error) { g_error_free (error); return FALSE; } return rc; } /** * @brief Read an integer from the configuration file * * This function checks if the given 'key' exists in section 'group' * and returns the value of the key as integer value. If the key * does not exist the default_value will be returned. * * @see config_set_int() * * @param *group section name to look at * @param *key key name * @param default_value return value, if the key does not exist * @return the key value as integer or the default_value */ int config_get_int (const char *group, const char *key, int default_value) { struct class_config *base = &modbase_config; GError *error = NULL; int value; value = g_key_file_get_integer (base->config, group, key, &error); if (error) { g_error_free (error); return default_value; } return value; } /** * @brief Write an integer to the configuration file * * This function writes an integer under the key 'key' into the * section 'group'. If the key or the group does not exist it will * be created * * @see config_get_int() * * @param *group section name to place key in * @param *key key name * @param value new value for 'key' */ void config_set_int (const char *group, const char *key, int value) { struct class_config *base = &modbase_config; g_key_file_set_integer (base->config, group, key, value); } /** * @brief read a configuration key and return its value as percentage * * This function reads the value of a given key from the configuration * file and treat it as percentage value. Only the read value will be * checked for percentage bounds and clipped as necessary. The default * value will be returned as is. This allows to pass invalid values to * check for errors. * * If the key doesn't exists in the configuration file the given default * value will be returned. * * @see config_set_percent() * * @param group Configuration section where should be looked * for 'key' * @param key The key which value should be read * @param default_value The value that should be returned if 'key' can't * be read for any reason. * @return The value for 'key' or the default_value on error, clipped * to percentage bounds if necessary. */ int config_get_percent (const char *group, const char *key, int default_value) { struct class_config *base = &modbase_config; GError *error = NULL; int value; value = g_key_file_get_integer (base->config, group, key, &error); if (error) { g_error_free (error); return default_value; } return value > 100 ? 100 : value < 0 ? 0 : value; } /** * @brief write a percentage value to the configuration file * * This function writes a new value to a given key in the configuration * file. The given value will be checked for percentage bounds and clipped * as necessary. * * If the key doesn't exists it will be created. * * @see config_get_percent() * * @param group Configuration section where the key/value pair should * be changed/created. * @param key The key which value should be changed * @param value The new value for 'key' */ void config_set_percent (const char *group, const char *key, int value) { struct class_config *base = &modbase_config; value = value > 100 ? 100 : value < 0 ? 0 : value; g_key_file_set_integer (base->config, group, key, value); } /** * @brief Read a string value from the configuration file * * This function reads a string value of a given key from the * configuration file. If the key doesn't exists in the configuration * file the given default value will be returned. * * The string from the configuration file or the default value * will be copied to a newly allocated memory. This memory should * be freed with g_free() after usage. * * @see config_set_string() * * @param group Configuration section where should be looked * for 'key' * @param key The key which value should be read * @param default_value The value that should be returned if 'key' can't * be read for any reason. * @return Pointer to a allocated string. */ char * config_get_string (const char *group, const char *key, const char *default_value) { struct class_config *base = &modbase_config; GString *arg2; gchar *arg1; arg1 = g_key_file_get_string (base->config, group, key, NULL); if (arg1 == NULL) { arg2 = g_string_new (default_value); arg1 = arg2->str; g_string_free (arg2, FALSE); } return arg1; } /** * @brief Write a string value to the configuration file * * This function writes a string value of a given key to the * configuration file. If the key doesn't exists it will be * created. * * @see config_get_string() * * @param group Configuration section where the new 'key' * should be placed. * @param key The name of the 'key' * @param value The new value to set */ void config_set_string (const char *group, const char *key, const char *value) { struct class_config *base = &modbase_config; g_key_file_set_string (base->config, group, key, value); } /** * @brief Read a keycode from the configuration file * * Keyboard definitions consits always of the keycode and none or * more modifier keys, that must pressed together to trigger the * keyboard action. * * This function reads the keycode portion from a keyboard key definition. * If the 'key' doesn't exists in the configuration file the given * default value will be returned. * * @see config_get_modmask(), config_set_keymod() * * @param group Configuration section where should be looked * for 'key' * @param key The key which value should be read * @param default_value The value that should be returned if 'key' can't * be read for any reason. * @return The keycode. */ int config_get_keycode (const char *group, const char *key, int default_value) { struct class_config *base = &modbase_config; gchar *arg; int keycode, modmask; if ((arg = g_key_file_get_string (base->config, group, key, NULL))) { decode_key_and_modifier (arg, &keycode, &modmask); g_free (arg); } else keycode = default_value; return keycode; } /** * @brief Read a modifier mask from the configuration file * * Keyboard definitions consits always of the keycode and none or * more modifier keys, that must pressed together to trigger the * keyboard action. * * This function reads the modifier portion from a keyboard key definition. * If the 'key' doesn't exists in the configuration file the given * default value will be returned. * * Supported modifier keys are Shift, Ctrl and Alt. Each modifier key * is represented by a bit in the mask. Use the defined values MOD_SHIFT, * MOD_ALT and MOD_CTRL to test for a specific modifier key. * * @see config_get_keycode(), config_set_keymod() * * @param group Configuration section where should be looked * for 'key' * @param key The key which value should be read * @param default_value The value that should be returned if 'key' can't * be read for any reason. * @return The modifier mask. */ int config_get_modmask (const char *group, const char *key, int default_value) { struct class_config *base = &modbase_config; gchar *arg; int keycode, modmask; if ((arg = g_key_file_get_string (base->config, group, key, NULL))) { decode_key_and_modifier (arg, &keycode, &modmask); g_free (arg); } else modmask = default_value; return modmask; } /** * @brief Writes a keycode and a modifier mask to the configuration file * * Keyboard definitions consits always of the keycode and none or * more modifier keys, that must pressed together to trigger the * keyboard action. * * This function take a keycode and a modifier mask and writes it as a * valid keyboard definition to the configuration file. * * @see config_get_keycode(), config_get_modmask() * * @param group Configuration section where the keycode should be * placed. * @param key Name of the key which keycode should be changed * @param keycode The new keycode (from linux/input.h) * @param modmask New Mask of the modifier keys */ void config_set_keymod (const char *group, const char *key, int keycode, int modmask) { struct class_config *base = &modbase_config; GString *arg; /* TODO: following check necessary ? */ if (keycode == -1) keycode = 0; if (modmask == -1) modmask = 0; arg = g_string_new (NULL); g_string_printf (arg, "%d", (keycode & 255)); if (modmask & MOD_SHIFT) arg = g_string_append (arg, " + shift"); if (modmask & MOD_ALT) arg = g_string_append (arg, " + alt"); if (modmask & MOD_CTRL) arg = g_string_append (arg, " + ctrl"); g_key_file_set_string (base->config, group, key, arg->str); g_string_free (arg, TRUE); } /** * @brief Read a boolean value from the configuration file * * This function reads a boolean value of a given key from the * configuration file. If the key doesn't exists in the configuration * file the given default value will be returned. * * A boolean value is expressed by the strings "yes" for true and * "no" for false. * * @see config_set_boolean() * * @param group Configuration section where should be looked * for 'key' * @param key The key which value should be read * @param default_value The value that should be returned if 'key' can't * be read for any reason. * @return boolean value of 'key' or the default value */ gboolean config_get_boolean (const char *group, const char *key, gboolean default_value) { struct class_config *base = &modbase_config; GError *error = NULL; gboolean value; value = g_key_file_get_boolean (base->config, group, key, &error); if (error) { g_error_free (error); return default_value; } return value; } /** * @brief Write a boolean value to the configuration file * * This function writes a boolean value under the key 'key' into * the section 'group'. If the key or the group does not exist * it will be created * * @see config_get_boolean() * * @param *group section name to place key in * @param *key key name * @param value new value for 'key' */ void config_set_boolean (const char *group, const char *key, gboolean value) { struct class_config *base = &modbase_config; g_key_file_set_boolean (base->config, group, key, value); } /** * @brief Read a string list from the configuration file * * This function reads a string list from a given key in the * configuration file. If the key doesn't exists in the configuration * file the given default value will be returned. The default * value will be converted in a string list. If multiple values * are given as default value, they must be seperated by a comma. * * The strings must be seperated with commas. No other delimiter * is allowed. * * The string list from the configuration file or the default value * will be copied to a newly allocated memory. This memory should * be freed with g_strfreev() after usage. * * @see config_set_strlist() * * @param group Configuration section where should be looked * for 'key' * @param key The key which value should be read * @param default_values The values that should be returned if 'key' can't * be read for any reason. * @return Pointer to a allocated string list. */ gchar ** config_get_strlist (const char *group, const char *key, char *default_values) { struct class_config *base = &modbase_config; GError *error = NULL; gchar **values, **tmp; values = g_key_file_get_string_list (base->config, group, key, NULL, &error); if (error) { g_error_free (error); values = g_strsplit (default_values, ",", 0); } tmp = values; while (*tmp) { g_strstrip (*tmp); /* remove leading and trailing whitespaces */ tmp++; } return values; } /** * @brief Write a string list to the configuration file * * This function writes a string list to the configuration * file. If the key doesn't exists it will be created. * * @see config_set_strlist() * * @param group Configuration section where the new 'key' * should be placed. * @param key The name of the 'key' * @param values The new string list to set */ void config_set_strlist (const char *group, const char *key, const char *values[]) { struct class_config *base = &modbase_config; g_key_file_set_string_list (base->config, group, key, values, g_strv_length ((char **) values)); } /** * @brief Read a integer list from the configuration file * * This function reads list of integers from a given key in the * configuration file. This function will fail under following * circumstances: * @li the key doesn't exists in the configuration file * @li the key has less integers as requested * @li one ore more list elements can't be trensformed to intergers * * In all those cases the default value will be returned. A single * default value will be converted to an integer list. If multiple * values are given as default value, they must be seperated by a * comma. * * The integers must be seperated with commas. No other delimiter * is allowed. * * The integer list from the configuration file or the default value * will be copied to a newly allocated memory. This memory should * be freed with g_free() after usage. * * @param group Configuration section where should be looked * for 'key' * @param key The key which value should be read * @param count How many integers should be read from the list * @param ... The values that should be returned if 'key' can't * be read for any reason. Exactly 'count' integers * must be given here. * @return Pointer to a allocated integer list. */ gint * config_get_intlist (const char *group, const char *key, unsigned int count, ...) { struct class_config *base = &modbase_config; unsigned int n; va_list list; GError *error = NULL; gsize num_ints; gint *values; values = g_key_file_get_integer_list (base->config, group, key, &num_ints, &error); if (error || num_ints != count) { if (error) { if (g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_INVALID_VALUE)) print_msg (PBB_WARN, _("config error: %s/%s contains non-integers - using defaults.\n"), group, key); g_error_free (error); } else if (num_ints != count) { print_msg (PBB_WARN, _("config error: %s/%s needs exactly %d arguments - using defaults.\n"), group, key, count); g_free (values); } values = g_new0 (gint, count); va_start (list, count); for (n=0; n < count; n++) values[n] = va_arg (list, gint); va_end (list); } return values; } /** * @brief Write a list of integers to the configuration file * * This function writes a list of integers to the configuration * file. If the key doesn't exists it will be created. * * @param group Configuration section where the new 'key' * should be placed. * @param key The name of the 'key' * @param count count of integers to be written * @param ... integers for the list. Exactly 'count' integers * must be given. */ void config_set_intlist (const char *group, const char *key, unsigned int count, ...) { struct class_config *base = &modbase_config; unsigned int n; va_list list; gint *values; values = g_new0 (gint, count); va_start (list, count); for (n=0; n < count; n++) values[n] = va_arg (list, gint); va_end (list); g_key_file_set_integer_list (base->config, group, key, values, count); g_free (values); } /** * @brief read a string from the configuration file and return an appropriate enum value * * This function reads the value of a given key from the configuration * file and treat it as percentage value. Only the read value will be * checked for percentage bounds and clipped as necessary. The default * value will be returned as is. This allows to pass invalid values to * check for errors. * * If the key doesn't exists in the configuration file the given default * value will be returned. * * @param group Configuration section where should be looked * for 'key' * @param key The key which value should be read * @param optionlist Null terminated array of allowed options. The * position of an option string in this array defines * its return value. * @param default_value The value that should be returned if 'key' can't * be read for any reason. * @return The value for 'key' or the default_value on error, clipped * to percentage bounds if necessary. */ int config_get_option (const char *group, const char *key, const char *optionlist[], int default_value) { struct class_config *base = &modbase_config; gchar *arg; int n, rc = default_value; arg = g_key_file_get_string (base->config, group, key, NULL); if (arg) { for (n=0; optionlist[n] != NULL; n++) { if (strcasecmp (arg, optionlist[n]) == 0) { rc = n; break; } } g_free (arg); } return rc; } /** * @brief transform an enum to a string and write it to the configuration file * * This function gets a enum value and a null terminated array of options writes a new value to a given key in the configuration * file. The given value will be checked for percentage bounds and clipped * as necessary. * * If the key doesn't exists it will be created. * * @param group Configuration section where the key/value pair * should be changed/created. * @param key The key which value should be changed * @param optionlist Null-terminated array of options * @param value The enum value which string of optionlist should be * written to the configuration file */ void config_set_option (const char *group, const char *key, const char *optionlist[], int value) { struct class_config *base = &modbase_config; int n; for (n=0; optionlist[n] != NULL; n++); if (value <= n) g_key_file_set_string (base->config, group, key, optionlist[value]); } /** * @brief parse a string and extract keycode and modifier mask * * This function parses a string and extract a keycode and a modifier * mask from it. * * The keycode is an integer in the range of 0..255. All values in * linux/input.h are valid. The keycode will be found at any position * in the string. * * Valid modifier keys are 'shift', 'ctrl' and 'alt'. None or more * modifiers could be attached to a keycode. The glue is a '+' sign. * * @param *arg String to be parsed * @param *key Pointer to an integer where the keycode should be * written to * @param *mod Pointer to an integer where the modifier mask * should be written to */ void decode_key_and_modifier(char *arg, int *key, int *mod) { char *tag; int k; *mod = 0; *key = 0; cleanup_buffer(arg); /* remove all whitespaces */ tag = strtok(arg, "+\n"); while (tag) { k = atoi (tag); if (k == 0) { if (!strncmp("shift", tag, 5)) *mod |= MOD_SHIFT; else if (!strncmp("alt", tag, 3)) *mod |= MOD_ALT; else if (!strncmp("ctrl", tag, 4)) *mod |= MOD_CTRL; } else *key = k; tag = strtok(NULL, "+\n"); } } pbbuttonsd-0.8.1a/src/class_config.h0000644000175000017500000000433610641705162014370 00000000000000#ifndef INCLUDE_CLASS_CONFIG_H #define INCLUDE_CLASS_CONFIG_H /** * @brief Prototypes and definitions for configuration class * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/class_config.h * @author Matthias Grimm */ #include /* public prototypes class config*/ gboolean config_new (char *configfile); void config_destroy (); gboolean config_save (); gboolean config_iswritable (); gboolean config_has_key (const char *group, const char *key); int config_get_int (const char *group, const char *key, int default_value); void config_set_int (const char *group, const char *key, int value); int config_get_percent (const char *group, const char *key, int default_value); void config_set_percent (const char *group, const char *key, int value); char *config_get_string (const char *group, const char *key, const char *default_value); void config_set_string (const char *group, const char *key, const char *value); int config_get_keycode (const char *group, const char *key, int default_value); int config_get_modmask (const char *group, const char *key, int default_value); void config_set_keymod (const char *group, const char *key, int keycode, int modmask); gboolean config_get_boolean (const char *group, const char *key, gboolean default_value); void config_set_boolean (const char *group, const char *key, gboolean value); gchar **config_get_strlist (const char *group, const char *key, char *default_values); void config_set_strlist (const char *group, const char *key, const char *values[]); gint *config_get_intlist (const char *group, const char *key, unsigned int count, ...); void config_set_intlist (const char *group, const char *key, unsigned int count, ...); int config_get_option (const char *group, const char *key, const char *optionlist[], int default_value); void config_set_option (const char *group, const char *key, const char *optionlist[], int value); /* private prototypes class config*/ void decode_key_and_modifier(char *arg, int *key, int *mod); #endif /* INCLUDE_CLASS_CONFIG_H */ pbbuttonsd-0.8.1a/src/module_system.c0000644000175000017500000001035610641705155014623 00000000000000/** * @brief Module System - Generic system support functions * * This module contains generic functions to support the system and * don't belong to any other module. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/module_system.c * @author Matthias Grimm */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include "gettext_macros.h" #include "input_manager.h" #include "module_system.h" #include "class_config.h" #include "support.h" #define SECTION "SYSTEM" struct moddata_system { char *userallowed; /* remember system tag for config file saving */ int autorescan; int rescantimer; } modbase_system; int system_init () { struct moddata_system *base = &modbase_system; int val; base->rescantimer = 0; base->userallowed = config_get_string (SECTION, "userallowed", ""); base->autorescan = config_get_boolean (SECTION, "autorescan", TRUE); val = config_get_int (SECTION, "CmdTimeout", 8); set_timeforcmd(val); ipc_protect_tag (TAG_SAVECONFIG); /* tags only for privileged use */ register_function (T1000QUEUE, system_timer1000); register_function (QUERYQUEUE, system_query); register_function (CONFIGQUEUE, system_configure); return 0; } void system_exit () { struct moddata_system *base = &modbase_system; g_free (base->userallowed); } void system_query (struct tagitem *taglist) { system_handle_tags (MODE_QUERY, taglist); } void system_configure (struct tagitem *taglist) { system_handle_tags (MODE_CONFIG, taglist); } void system_handle_tags (int cfgure, struct tagitem *taglist) { struct moddata_system *base = &modbase_system; struct tagitem args[] = {{ TAG_AMBIENTLIGHT, 0 }, { TAG_SLEEPSUPPORTED, 0 }, { TAG_SYSINFOSLAVE, 0 }, { TAG_END, 0 }}; static char *version = VERSION; int val; while (taglist->tag != TAG_END) { switch (taglist->tag) { case TAG_SAVECONFIG: if (cfgure) { if (!config_save ()) tagerror (taglist, E_NOSUPPORT); } else tagerror (taglist, E_NOREAD); break; case TAG_USERALLOWED: /* private tag */ if (cfgure) { replace_string (&base->userallowed, (char *) taglist->data); config_set_string (SECTION, "userallowed", base->userallowed); } else if (strlen (base->userallowed) > 0) taglist->data = (long) base->userallowed; break; case TAG_VERSION: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = (long) version; break; case TAG_AUTORESCAN: if (cfgure) { base->autorescan = taglist->data; config_set_boolean (SECTION, "autorescan", taglist->data); } else taglist->data = (long) base->autorescan; break; case TAG_TIMEFORCMD: if (cfgure) { set_timeforcmd(taglist->data); config_set_int (SECTION, "CmdTimeout", taglist->data); } else taglist->data = (long) get_timeforcmd(); break; case TAG_SYSINFO: if (cfgure) tagerror (taglist, E_NOWRITE); else { val = 0; if (config_iswritable()) val |= SYSINFO_CONFIGWRITABLE; process_queue (QUERYQUEUE, args); if (tagfind (args, TAG_AMBIENTLIGHT, -1) != (tag_t) -1) val |= SYSINFO_HAVELMU; if (tagfind (args, TAG_SLEEPSUPPORTED, -1) != (tag_t) -1) val |= SYSINFO_SLEEPSUPPORTED; /* TAG_SYSINFOSLAVE asks other modules if there are additiononal * machine dependent information that should be added. Currently * only module_pmac react to that. * */ val |= tagfind (args, TAG_SYSINFOSLAVE, 0); #ifdef WITH_PMUD val |= SYSINFO_PMUDSUPPORT; #endif #ifdef WITH_OSS val |= SYSINFO_HAVEOSS; #endif #ifdef WITH_ALSA val |= SYSINFO_HAVEALSA; #endif #ifdef WITH_IBAM val |= SYSINFO_HAVEIBAM; #endif taglist->data = val; } break; } taglist++; } } void system_timer1000 (struct tagitem *taglist) { struct moddata_system *base = &modbase_system; if (base->autorescan) { base->rescantimer++; if (base->rescantimer > RESCANTIME) { base->rescantimer = 0; scanEventDevices (); } } } pbbuttonsd-0.8.1a/src/module_system.h0000644000175000017500000000175610641705160014630 00000000000000#ifndef INCLUDE_MODULE_SYSTEM_H #define INCLUDE_MODULE_SYSTEM_H /* ---------------------------------------------------------------------------- * module_system.h * prototypes and definitions for general system functions. * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #define RESCANTIME 5 /* in seconds */ /* public prototypes */ int system_init (); void system_exit (); /* private prototypes */ void system_configure (struct tagitem *taglist); void system_query (struct tagitem *taglist); void system_handle_tags (int cfgure, struct tagitem *taglist); void system_timer1000 (struct tagitem *taglist); #endif /* INCLUDE_MODULE_SYSTEM_H */ pbbuttonsd-0.8.1a/src/module_powersave.c0000644000175000017500000010261410641705155015311 00000000000000/** * @brief Powermanagement module * * This module contains the powermanagement logic. It connects multiple * sources and uses this information to serve the user best regarding * battery monitoring, power saving, data security and much more. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/module_powersave.c * @author Matthias Grimm */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include #include #include "pbbinput.h" #ifdef HAVE_INITREQ_H # include #endif #include #include "gettext_macros.h" #include "input_manager.h" #include "module_powersave.h" #include "module_display.h" #include "support.h" #include "debug.h" #include "class_config.h" #ifdef WITH_IBAM # include "ibam_stub.h" #endif #define SECTION "MODULE POWERSAVE" /* --- private module data structure of module powermanagement --- */ struct moddata_power { struct modflags_power flags; struct powerprofile onAC; struct powerprofile onBattery; struct powerprofile *activeProfile; int policy; /* current power policy */ int powersource; /* REDUNDANT copy from module pmac */ int timeremaining; /* REDUNDANT copy from module pmac or filled by IBaM */ int mode; /* module mode: awake, sleep, dim. */ unsigned int sleeptime; /* counter */ int sleepcountdown; /* another counter */ int warnlevel; /* current battery warnlevel */ struct timeval tv; /* time of key press */ int sleepkeydelaytime; /* delay in ms */ unsigned short keysleep; /* keycode for sleepfunction */ unsigned short modsleep; /* modifier for sleepfunction */ int BWL1; int BWL2; int BWL3; int emergency; /* emergency action at low battery condition */ int cpuload_min; /* cpuload minimum level to lock sleep */ int cpuload_period; /* period of time for that cpu activity mut be below cpuload */ int netload_min; /* netload minimum level to lock sleep */ int netload_period; /* period of time for that net activity mut be below netload */ char *netload_dev; /* device to observe for netload sleeplock */ char *script_pmcs; /* command to call at certain event */ #ifdef WITH_IBAM char *ibam_datadir; int chargetime; /* time until battery is fully charged */ #endif } modbase_power; static const char *PolicyList[] = { "nochange", "powersave", "custom", "performance", NULL }; static const char *ActionList[] = { "none", "suspend-to-ram", "suspend-to-disk", "blankscreen", "shutdown", NULL }; static const char *EmergencyList[] = { "sleep", "signal", "command", NULL }; /* --- interface functions of module powermanagement --- */ /* Init function called by the program init procedure. Function is known by the prginitab. It does module data initialisation and registers the module at the needed input queues. */ int power_init () { struct moddata_power *base = &modbase_power; int err; power_sync(); /* synchronise some data with module_pmac */ base->mode = MODE_AWAKE; base->policy = POLICY_PERFORMANCE; base->sleepcountdown = SLEEPCOUNTDOWN; /* counter for last 5 seconds before sleep */ base->sleeptime = 0; /* counter for time till sleep */ base->warnlevel = 0; /* current battery warnlevel */ base->flags.sigpwr_sent = 0; /* currently no sigpwr in progress */ base->flags.sleeplock_cpu = 0; /* cpu sleeplock open */ base->flags.sleeplock_net = 0; /* net sleeplock open */ base->flags.heartbeat = 0; /* heartbeat beep disabled */ base->flags.coveropen = 1; /* cover open by default same as in laptop module */ /* profile for running on AC power */ base->onAC.policy = config_get_option (SECTION, "onAC_Policy", PolicyList, POLICY_PERFORMANCE); base->onAC.timeraction = config_get_option (SECTION, "onAC_TimerAction", ActionList, ACTION_TORAM); base->onAC.coveraction = config_get_option (SECTION, "onAC_CoverAction", ActionList, ACTION_TORAM); base->onAC.keyaction = config_get_option (SECTION, "onAC_KeyAction", ActionList, ACTION_TORAM); base->onAC.suspendtime = config_get_int (SECTION, "onAC_SuspendTime", AC_TIME_SLEEP); base->onAC.dimtime = config_get_int (SECTION, "onAC_DimTime", AC_TIME_DIM); /* profile for running on battery */ base->onBattery.policy = config_get_option (SECTION, "onBattery_Policy", PolicyList, POLICY_POWERSAVE); base->onBattery.timeraction = config_get_option (SECTION, "onBattery_TimerAction", ActionList, ACTION_TORAM); base->onBattery.coveraction = config_get_option (SECTION, "onBattery_CoverAction", ActionList, ACTION_TORAM); base->onBattery.keyaction = config_get_option (SECTION, "onBattery_KeyAction", ActionList, ACTION_TORAM); base->onBattery.suspendtime = config_get_int (SECTION, "onBattery_SuspendTime", BATTERY_TIME_SLEEP); base->onBattery.dimtime = config_get_int (SECTION, "onBattery_DimTime", BATTERY_TIME_DIM); base->keysleep = config_get_keycode (SECTION, "SleepKey", KEY_POWER); base->modsleep = config_get_modmask (SECTION, "SleepKey", MOD_NONE); base->BWL1 = config_get_int (SECTION, "BWL_First", BAT_WARNLEVEL1); base->BWL2 = config_get_int (SECTION, "BWL_Second", BAT_WARNLEVEL2); base->BWL3 = config_get_int (SECTION, "BWL_Last", BAT_WARNLEVEL3); base->emergency = config_get_option (SECTION, "EmergencyAction", EmergencyList, EMA_SLEEP); base->sleepkeydelaytime = config_get_int (SECTION, "SleepKeyDelay", 0); base->flags.cpuload_enable = config_get_boolean (SECTION, "CPULoad_sleeplock", FALSE); base->cpuload_min = config_get_percent (SECTION, "CPULoad_min", 20); base->cpuload_period = config_get_int (SECTION, "CPULoad_period", 60); base->flags.netload_enable = config_get_boolean (SECTION, "NETLoad_sleeplock", FALSE); base->netload_min = config_get_int (SECTION, "NETLoad_min", 4096); base->netload_period = config_get_int (SECTION, "NetLoad_period", 60); base->flags.heartbeat_enable= config_get_boolean (SECTION, "HeartbeatBeep", TRUE); base->script_pmcs = config_get_string (SECTION, "Script_PMCS", ""); base->netload_dev = config_get_string (SECTION, "NETLoad_device", DEFAULT_NETLOAD_DEV); /* HACK: The pmcs script sould be started at startup but it will only * start if the status has changed (policy or powersource). We set an * impossible value here and pbbuttonsd.c will send a TAG_POWERCHANGE * to correct it and start the script. Not elegant but works */ base->powersource = 2; #ifdef WITH_IBAM base->ibam_datadir = config_get_string (SECTION, "IBAM_DataDir", DEFAULT_IBAM_DATADIR); base->timeremaining = -1; /* will be updated from timer1000 */ base->chargetime = -1; if ((err = check_path (base->ibam_datadir, TYPE_DIR, CPFLG_PBBONLY))) return err; if (!ibam_init(base->ibam_datadir)) { /* create ibam object */ print_msg (PBB_ERR, _("Can't create IBaM object, out of memory.\n")); return E_NOMEM; } ipc_protect_tag (TAG_IBAMDATADIR); #endif ipc_protect_tag (TAG_SCRIPTPMCS); /* tags only for privileged use */ register_function (QUERYQUEUE, power_query); register_function (CONFIGQUEUE, power_configure); register_function (KBDQUEUE, power_keyboard); register_function (MOUSEQUEUE, power_mouse); register_function (T100QUEUE, power_timer); register_function (T1000QUEUE, power_timer1000); return 0; } void power_exit () { struct moddata_power *base = &modbase_power; #ifdef WITH_IBAM ibam_exit(); g_free (base->ibam_datadir); #endif g_free (base->script_pmcs); g_free (base->netload_dev); } void power_mouse (struct tagitem *taglist) { struct moddata_power *base = &modbase_power; if (base->flags.coveropen) power_awake (); /* call only if cover is open */ } void power_keyboard (struct tagitem *taglist) { struct moddata_power *base = &modbase_power; int code, value, mod; code = (int) tagfind (taglist, TAG_KEYCODE, 0); value = (int) tagfind (taglist, TAG_KEYREPEAT, 0); mod = (int) tagfind (taglist, TAG_MODIFIER, 0); if (value && base->flags.coveropen) if (value == 1) { power_awake (); base->flags.sleeptriggered = 0; } if ((code == base->keysleep) && (mod == base->modsleep)) if ((base->sleepkeydelaytime == 0) || (keydelayms(&base->tv, value, base->sleepkeydelaytime))) if (base->flags.sleeptriggered == 0) { base->flags.sleeptriggered = 1; /* sleep should be triggered only once */ power_suspend (base->activeProfile->keyaction); } } /* This function will be called on every keyboard or mouse action. With other words the user is active if this function is called so sleeptimer is reset here. */ void power_awake () { struct moddata_power *base = &modbase_power; if (base->mode != MODE_AWAKE) { process_queue_single (CONFIGQUEUE, TAG_BRIGHTNESSOP, OP_DIM_RECOVER); base->flags.heartbeat = 0; /* disable heartbeat beep */ base->mode = MODE_AWAKE; } base->sleeptime = 0; } void power_sync () { struct moddata_power *base = &modbase_power; struct tagitem args[4]; taglist_init (args); taglist_add (args, TAG_SLEEPSUPPORTED, 0); taglist_add (args, TAG_POWERSOURCE, 0); #ifndef WITH_IBAM taglist_add (args, TAG_TIMEREMAINING, -1); #endif process_queue (QUERYQUEUE, args); base->flags.sleep_supported = tagfind (args, TAG_SLEEPSUPPORTED, 0); base->powersource = tagfind (args, TAG_POWERSOURCE, 0); #ifndef WITH_IBAM base->timeremaining = tagfind (args, TAG_TIMEREMAINING, -1); #endif base->activeProfile = base->powersource ? &base->onAC : &base->onBattery; } void power_query (struct tagitem *taglist) { power_handle_tags (MODE_QUERY, taglist); } void power_configure (struct tagitem *taglist) { power_handle_tags (MODE_CONFIG, taglist); } void power_handle_tags (int cfgure, struct tagitem *taglist) { struct moddata_power *base = &modbase_power; int err, val; while (taglist->tag != TAG_END) { switch (taglist->tag) { case TAG_REINIT: /* set power policy again after resume from suspend * to disk. */ power_setpolicy(taglist->data, base->powersource); break; case TAG_SCRIPTPMCS: if (cfgure) { if ((check_script ((char *) taglist->data, "sss")) == 0) { if ((err = check_path ((char *) taglist->data, TYPE_FILE, CPFLG_PBBONLY))) tagerror (taglist, err); else { replace_string (&base->script_pmcs, (char *) taglist->data); config_set_string (SECTION, "Script_PMCS", base->script_pmcs); } } else { print_msg (PBB_ERR, _("Too many formatsigns. Max three %%s allowed in TAG_SCRIPTPMCS.\n")); tagerror (taglist, E_FORMAT); } } else taglist->data = (long) base->script_pmcs; break; #ifdef WITH_IBAM case TAG_IBAMDATADIR: if (cfgure) { if ((err = check_path ((char *) taglist->data, TYPE_DIR, CPFLG_PBBONLY))) tagerror (taglist, err); else { replace_string (&base->ibam_datadir, (char *) taglist->data); config_set_string (SECTION, "IBAM_DataDir", base->ibam_datadir); } } else taglist->data = (long) base->ibam_datadir; break; #endif /* Tags for power profiles */ case TAG_ONAC_POLICY: if (cfgure) { if (taglist->data <= POLICY_LAST) { base->onAC.policy = taglist->data; if (&base->onAC == base->activeProfile && !base->flags.usersetpolicy) power_setpolicy(taglist->data, base->powersource); config_set_option (SECTION, "onAC_Policy", PolicyList, taglist->data); } else tagerror(taglist, E_INVALID); } else taglist->data = base->onAC.policy; break; case TAG_ONAC_TIMERACTION: if (cfgure) { if (taglist->data <= ACTION_LAST) { base->onAC.timeraction = taglist->data; config_set_option (SECTION, "onAC_TimerAction", ActionList, taglist->data); } else tagerror(taglist, E_INVALID); } else taglist->data = base->onAC.timeraction; break; case TAG_ONAC_COVERACTION: if (cfgure) { if (taglist->data <= ACTION_LAST) { base->onAC.coveraction = taglist->data; config_set_option (SECTION, "onAC_CoverAction", ActionList, taglist->data); } else tagerror(taglist, E_INVALID); } else taglist->data = base->onAC.coveraction; break; case TAG_ONAC_KEYACTION: /* sleepkey */ if (cfgure) { if (taglist->data <= ACTION_LAST) { base->onAC.keyaction = taglist->data; config_set_option (SECTION, "onAC_KeyAction", ActionList, taglist->data); } else tagerror(taglist, E_INVALID); } else taglist->data = base->onAC.keyaction; break; case TAG_ONAC_TIMESUSPEND: if (cfgure) { base->onAC.suspendtime = taglist->data; config_set_int (SECTION, "onAC_SuspendTime", taglist->data); } else taglist->data = base->onAC.suspendtime; break; case TAG_ONAC_TIMEDIM: if (cfgure) { base->onAC.dimtime = taglist->data; config_set_int (SECTION, "onAC_DimTime", taglist->data); } else taglist->data = base->onAC.dimtime; break; case TAG_ONBATT_POLICY: if (cfgure) { if (taglist->data <= POLICY_LAST) { base->onBattery.policy = taglist->data; if (&base->onBattery == base->activeProfile && !base->flags.usersetpolicy) power_setpolicy(taglist->data, base->powersource); config_set_option (SECTION, "onBattery_Policy", PolicyList, POLICY_POWERSAVE); } else tagerror(taglist, E_INVALID); } else taglist->data = base->onBattery.policy; break; case TAG_ONBATT_TIMERACTION: if (cfgure) { if (taglist->data <= ACTION_LAST) { base->onBattery.timeraction = taglist->data; config_set_option (SECTION, "onBattery_TimerAction", ActionList, taglist->data); } else tagerror(taglist, E_INVALID); } else taglist->data = base->onBattery.timeraction; break; case TAG_ONBATT_COVERACTION: if (cfgure) { if (taglist->data <= ACTION_LAST) { base->onBattery.coveraction = taglist->data; config_set_option (SECTION, "onBattery_CoverAction", ActionList, taglist->data); } else tagerror(taglist, E_INVALID); } else taglist->data = base->onBattery.coveraction; break; case TAG_ONBATT_KEYACTION: /* sleepkey */ if (cfgure) { if (taglist->data <= ACTION_LAST) { base->onBattery.keyaction = taglist->data; config_set_option (SECTION, "onBattery_KeyAction", ActionList, taglist->data); } else tagerror(taglist, E_INVALID); } else taglist->data = base->onBattery.keyaction; break; case TAG_ONBATT_TIMESUSPEND: if (cfgure) { base->onBattery.suspendtime = taglist->data; config_set_int (SECTION, "onBattery_SuspendTime", taglist->data); } else taglist->data = base->onBattery.suspendtime; break; case TAG_ONBATT_TIMEDIM: if (cfgure) { base->onBattery.dimtime = taglist->data; config_set_int (SECTION, "onBattery_DimTime", taglist->data); } else taglist->data = base->onBattery.dimtime; break; /* Tags for power profiles end */ case TAG_SLEEPKEY: if (cfgure) { base->keysleep = taglist->data; config_set_keymod (SECTION, "SleepKey", taglist->data, base->modsleep); } else taglist->data = base->keysleep; break; case TAG_SLEEPMOD: if (cfgure) { base->modsleep = taglist->data; config_set_keymod (SECTION, "SleepKey", base->keysleep, taglist->data); } else taglist->data = base->modsleep; break; case TAG_SLEEPKEYDELAY: if (cfgure) { base->sleepkeydelaytime = taglist->data; config_set_int (SECTION, "SleepKeyDelay", taglist->data); } else taglist->data = base->sleepkeydelaytime; break; case TAG_BWLFIRST: if (cfgure) { base->BWL1 = taglist->data; config_set_int (SECTION, "BWL_First", taglist->data); } else taglist->data = base->BWL1; break; case TAG_BWLSECOND: if (cfgure) { base->BWL2 = taglist->data; config_set_int (SECTION, "BWL_Second", taglist->data); } else taglist->data = base->BWL2; break; case TAG_BWLLAST: if (cfgure) { base->BWL3 = taglist->data; config_set_int (SECTION, "BWL_Last", taglist->data); } else taglist->data = base->BWL3; break; case TAG_CURRENTBWL: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = base->warnlevel; break; case TAG_CPULOADSLEEPLOCK: if (cfgure) { base->flags.cpuload_enable = taglist->data; base->flags.sleeplock_cpu = taglist->data; config_set_boolean (SECTION, "CPULoad_sleeplock", taglist->data); } else taglist->data = base->flags.cpuload_enable; break; case TAG_CPULOADMIN: if (cfgure) { base->cpuload_min = taglist->data; config_set_percent (SECTION, "CPULoad_min", taglist->data); } else taglist->data = base->cpuload_min; break; case TAG_CPULOADPERIOD: if (cfgure) { base->cpuload_period = taglist->data; config_set_int (SECTION, "CPULoad_period", taglist->data); } else taglist->data = base->cpuload_period; break; case TAG_NETLOADSLEEPLOCK: if (cfgure) { base->flags.netload_enable = taglist->data; base->flags.sleeplock_net = taglist->data; config_set_boolean (SECTION, "NETLoad_sleeplock", taglist->data); } else taglist->data = base->flags.netload_enable; break; case TAG_NETLOADMIN: if (cfgure) { base->netload_min = taglist->data; config_set_int (SECTION, "NETLoad_min", taglist->data); } else taglist->data = base->netload_min; break; case TAG_NETLOADPERIOD: if (cfgure) { base->netload_period = taglist->data; config_set_int (SECTION, "NetLoad_period", taglist->data); } else taglist->data = base->netload_period; break; case TAG_NETLOADDEV: if (cfgure) { replace_string (&base->netload_dev, (char *) taglist->data); config_set_string (SECTION, "NETLoad_device", base->netload_dev); } else taglist->data = (long) base->netload_dev; break; case TAG_EMERGENCYACTION: if (cfgure) { if (taglist->data <= EMA_LAST) { if (taglist->data == EMA_SLEEP && !base->flags.sleep_supported) { tagerror (taglist, E_NOSUPPORT); /* otherwise send error */ break; } base->emergency = taglist->data; config_set_option (SECTION, "EmergencyAction", EmergencyList, taglist->data); } else tagerror(taglist, E_INVALID); } else taglist->data = (long) base->emergency; break; case TAG_HEARTBEATBEEP: if (cfgure) { base->flags.heartbeat_enable = taglist->data; config_set_boolean (SECTION, "HeartbeatBeep", taglist->data); } else taglist->data = base->flags.heartbeat_enable; break; case TAG_POWERCHANGED: /* private tag */ if (cfgure) { if (taglist->data) base->activeProfile = &base->onAC; else base->activeProfile = &base->onBattery; power_setpolicy(base->activeProfile->policy, taglist->data); base->flags.usersetpolicy = 0; /* Due to changed timeout values of sleeping and * dimming the sleeptime counter have to be adjusted * to prevent unexpected jumps in behaviour. Depending * on the current mode the sleeptime counter will be * resetted to the begining of the current mode. */ if (base->mode == MODE_AWAKE) base->sleeptime = 0; else if (base->mode == MODE_DIM) base->sleeptime = base->activeProfile->dimtime; power_check_battery (base->timeremaining, base->powersource); /* If the power source changed during the cover is closed * the machine should follow the active profile. */ if (!base->flags.coveropen) power_suspend (base->activeProfile->coveraction); } break; #ifndef WITH_IBAM case TAG_TIMECHANGED: /* private tag */ if (cfgure) { base->timeremaining = taglist->data; power_check_battery (base->timeremaining, base->powersource); } break; #else case TAG_TIMEREMAINING: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = base->timeremaining; break; case TAG_CHARGETIME: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = base->chargetime; break; #endif case TAG_PREPAREFORSLEEP: /* private tag */ /* PMCS-script will be called in power_suspend() so that it's nothing left to do here */ break; case TAG_WAKEUPFROMSLEEP: /* private tag */ if (cfgure) { power_awake (); val = base->powersource; power_sync (); /* syncronise redundant data from module_pmac */ power_check_battery (-1, base->powersource); call_script (base->script_pmcs, "resume", base->powersource ? "ac" : "battery", "ram"); /* if power source changed during sleep call PMCS script * again to set power policy */ if (val != base->powersource) power_setpolicy(base->activeProfile->policy, base->powersource); } break; case TAG_COVERSTATUS: /* private tag */ if (cfgure) { base->flags.coveropen = taglist->data & 1; val = base->activeProfile->coveraction; if (val == ACTION_BLANK || ((val == ACTION_TORAM) && !base->flags.sleep_supported)) call_script (base->script_pmcs, base->flags.coveropen ? "cover-open" : "cover-close", base->powersource ? "ac" : "battery", base->flags.coveropen ? "open" : "close"); if (base->flags.coveropen) power_awake (); else { if (val != ACTION_BLANK) power_suspend (ACTION_BLANK); /* always blank screen if cover has been closed */ power_suspend (val); /* then follow user's will */ } } break; case TAG_GOTOSLEEP: if (cfgure) power_suspend (ACTION_TORAM); else tagerror (taglist, E_NOREAD); break; case TAG_GOTOHIBERNATE: if (cfgure) power_suspend (ACTION_TODISK); else tagerror (taglist, E_NOREAD); break; case TAG_POLICY: if (cfgure) { if (taglist->data == POLICY_NONE || taglist->data > POLICY_LAST) tagerror(taglist, E_INVALID); else { power_setpolicy(taglist->data, base->powersource); base->flags.usersetpolicy = 1; } } else taglist->data = base->policy; break; } taglist++; } } /* This routine will be called every 10ms */ void power_timer (struct tagitem *taglist) { struct moddata_power *base = &modbase_power; int n; base->sleeptime++; switch (base->mode) { case MODE_AWAKE: if ((base->activeProfile->dimtime) && (base->sleeptime > base->activeProfile->dimtime)) { /* time to dim the display? */ process_queue_single (CONFIGQUEUE, TAG_BRIGHTNESSOP, OP_DIM_LIGHT); /* then dim */ base->mode = MODE_DIM; } case MODE_DIM: if ((base->activeProfile->suspendtime) && (base->sleeptime > base->activeProfile->suspendtime) && !base->flags.sleeplock_cpu && !base->flags.sleeplock_net) { /* time to sleep? */ base->mode = MODE_DOZY; base->sleepcountdown = 60; } break; case MODE_DOZY: if (base->activeProfile->timeraction != ACTION_NONE) { n = --base->sleepcountdown / 10; /* time left in seconds */ if (n == 0) power_suspend (base->activeProfile->timeraction); else singletag_to_clients(WARNING, TAG_SLEEPINSECONDS, n); } case MODE_SUSPEND: base->sleeptime--; break; } } void power_timer1000 (struct tagitem *taglist) { struct moddata_power *base = &modbase_power; static int cputimer = 0, nettimer = 0, beeptimer = 0; int cpuload = 0, netload = 0; #ifdef WITH_IBAM int time; #endif if (base->flags.cpuload_enable) { cpuload = power_read_cpu (); if (cpuload < base->cpuload_min) { if (base->flags.sleeplock_cpu) { /* skip following if lock is already open */ cputimer++; if (cputimer > base->cpuload_period) base->flags.sleeplock_cpu = 0; /* open lock */ } } else { cputimer = 0; base->flags.sleeplock_cpu = 1; /* close lock */ } } else cputimer = 0; if (base->flags.netload_enable) { netload = power_read_net (base->netload_dev); if (netload < base->netload_min) { if (base->flags.sleeplock_net) { /* skip following if lock is already open */ nettimer++; if (nettimer > base->netload_period) base->flags.sleeplock_net = 0; /* open lock */ } } else { nettimer = 0; base->flags.sleeplock_net = 1; /* close lock */ } } else nettimer = 0; if (base->flags.heartbeat_enable) { /* user wants heartbeat beep ? */ if (base->flags.heartbeat) { beeptimer++; if (beeptimer > BEEPINTERVAL) { power_beep(); beeptimer = 0; } } else beeptimer = 0; } else beeptimer = 0; #ifdef WITH_IBAM ibam_recordProfile(); /* keep battery statistics up-to-date */ time = ibam_getBatteryTimeAdaptive() * 60; /* IBAM delivers minutes, we need seconds */ if (time != base->timeremaining) { base->timeremaining = time; power_check_battery (base->timeremaining, base->powersource); } base->chargetime = ibam_getChargeTimeAdaptive() * 60; # if defined(DEBUG) && IBAM int ctime = base->chargetime; printf("DBG: %s: Charge adaptive time: %2d:%2d, discharging adaptive time: %2d:%02d\r", base->powersource ? "AC " : "BAT", ctime/3600, (ctime%3600)/60, time/3600, (time%3600)/60); fflush(stdout); # endif #endif #if defined(DEBUG) && SLEEPLOCKS printf ("cpu: "); if (base->flags.cpuload_enable) printf ("%2d%% (lock %s)", cpuload, base->flags.sleeplock_cpu ? "closed" : "open "); else printf ("disabled"); printf (", net: "); if (base->flags.netload_enable) printf ("%8d B/s (lock %s)", netload, base->flags.sleeplock_net ? "closed" : "open "); else printf ("disabled"); printf ("\r"); fflush(stdout); #endif } void power_check_battery (int time, int psource) { struct moddata_power *base = &modbase_power; struct tagitem taglist[3]; int warnlevel[10], n, wl; warnlevel[0] = 1200; warnlevel[1] = base->BWL1 + BAT_HYSTERESIS; warnlevel[2] = base->BWL1; warnlevel[3] = base->BWL2 + BAT_HYSTERESIS; warnlevel[4] = base->BWL2; warnlevel[5] = base->BWL3 + BAT_HYSTERESIS; warnlevel[6] = base->BWL3; warnlevel[7] = 1; warnlevel[8] = 1; warnlevel[9] = 0; /* if pbbuttons was started with AC plugged in, timeleft would * remain at -1 and after AC pulled out the value wasn't changed * quick enough so that the warning level 4 was set due to * -1 / 60 = 0 -> wl = 4 -> shutdown. To prevent this the timeleft * value of -1 is filtered out here */ if (psource || time == -1) { /* if battery is charging or time is invalid */ wl = 0; /* we don't need to calculate warnlevels */ if (base->warnlevel) { /* but maybe have to inform clients */ taglist_init (taglist); taglist_add (taglist, TAG_CURRENTBWL, wl); distribute_to_clients(WARNING, taglist); } } else { time /= 60; /* calculate minutes */ wl = base->warnlevel; if (time >= 0) { for (n=4; n >= 0; n--) if (time < warnlevel[2*n]) if (time >= warnlevel[2*n+1]) { wl = n; break; } if (wl > base->warnlevel) { /* warnlevel increased ? */ taglist_init (taglist); taglist_add (taglist, TAG_CURRENTBWL, wl); taglist_add (taglist, TAG_TIMEREMAINING, time); distribute_to_clients(WARNING, taglist); if (wl == 4) { /* oh oh, battery is realy low */ switch (base->emergency) { case EMA_SLEEP: process_queue_single (CONFIGQUEUE, TAG_REQUESTSLEEP, 0); break; case EMA_SIGNAL: if ((send_sigpwr('F')) != 0) { /* send init a SIGPWR signal */ if (base->flags.sleep_supported) { /* fallback to sleep if possible */ base->emergency = EMA_SLEEP; process_queue_single (CONFIGQUEUE, TAG_REQUESTSLEEP, 0); } else { /* otherwise use the last way out */ base->emergency = EMA_COMMAND; call_script (base->script_pmcs, "emergency", base->powersource ? "ac" : "battery", ""); sleep (10); } } else { base->flags.sigpwr_sent = 1; /* sigpwr in progress */ sleep(5); /* give INIT a chance to react */ } break; case EMA_COMMAND: call_script (base->script_pmcs, "emergency", base->powersource ? "ac" : "battery", ""); sleep(10); /* give the script a chance to work */ break; } } } else if (wl < base->warnlevel && base->flags.sigpwr_sent) { /* battery has recovered */ send_sigpwr('O'); /* abort sigpwr action */ base->flags.sigpwr_sent = 0; /* sigpwr no longer in progress */ } } } base->warnlevel = wl; } int power_shutdown_in_progress () { struct utmp *ut; int runlevel=-1; setutent(); while ((ut = getutent()) != NULL) { if (ut->ut_type == RUN_LVL) { runlevel = ut->ut_pid % 256; break; } } endutent(); if (runlevel == '0' || runlevel == '6') return 1; /* shutdown or reboot in progress */ return 0; } /* This function requests sleep mode and take user configurations * like enable_blank into account. */ void power_suspend (int action) { struct moddata_power *base = &modbase_power; if (action == ACTION_NONE) /* no action, mode will not change */ return; /* If a shutdown is in progress allow only ACTION_BLANK * and reject all other actions. */ if (power_shutdown_in_progress() && action != ACTION_BLANK) return; base->mode = MODE_SUSPEND; sync(); switch (action) { case ACTION_TODISK: singletag_to_clients(WARNING, TAG_SLEEPINSECONDS, 0); call_script (base->script_pmcs, "suspend", base->powersource ? "ac" : "battery", "disk"); break; case ACTION_TORAM: if (base->flags.sleep_supported) { singletag_to_clients(WARNING, TAG_SLEEPINSECONDS, 0); call_script (base->script_pmcs, "suspend", base->powersource ? "ac" : "battery", "ram"); process_queue_single (CONFIGQUEUE, TAG_REQUESTSLEEP, 0); break; } /* else ACTION_BLANK */ case ACTION_BLANK: process_queue_single (CONFIGQUEUE, TAG_BRIGHTNESSOP, OP_DIM_OFF); if (base->flags.heartbeat_enable) { /* user wants heartbeat beep ? */ base->flags.heartbeat = 1; /* enable heartbeat beep */ power_beep(); } break; case ACTION_SHUTDOWN: /* action currently disabled */ singletag_to_clients(WARNING, TAG_SLEEPINSECONDS, 0); call_script (base->script_pmcs, "shutdown", base->powersource ? "ac" : "battery", ""); sleep (10); break; } } /* This function updates the power policy and the powersource * in the base data structure. If one of them changes the * pmcs script will be executed. The illegal POLICY_NONE will * be filtered. */ void power_setpolicy (int policy, int powersource) { struct moddata_power *base = &modbase_power; char *powersrc[] = {"battery", "ac"}; int change = 0; if (policy != POLICY_NONE && base->policy != policy) { base->policy = policy; change = 1; } if (base->powersource != powersource) { base->powersource = powersource; change = 1; } if (change) call_script (base->script_pmcs, PolicyList[base->policy], powersrc[base->powersource], ""); } int check_script (char *name, char *allowed) { while (*name != 0) { if (*name++ == '%') if ((*allowed == 0) || (*name++ != *allowed++)) return -1; } return 0; } int send_sigpwr (char mode) { FILE *fd; int err = -1; #ifdef HAVE_INITREQ_H struct init_request initreq; initreq.magic = INIT_MAGIC; initreq.cmd = mode == 'F' ? INIT_CMD_POWERFAIL : INIT_CMD_POWEROK; initreq.sleeptime = 5; if ((fd = fopen(INIT_FIFO, "r+")) != NULL) { err = 0; if ((fwrite(&initreq, sizeof(initreq), 1, fd)) != 1) err = -1; fclose(fd); } #endif if (err == -1) { if ((fd = fopen("/etc/powerstatus", "w")) != NULL) { err = 0; if ((fwrite(&mode, 1, 1, fd)) != 1) err = -1; fclose(fd); } err = kill(1, SIGPWR); /* send SIGPWR to the INIT process */ } return err; } /* This function reads /proc/stat and calculates the current * cpuload. If an error occured, the return value would be * '0', so that no program features especially sleep will * be blocked. */ int power_read_cpu (void) { static ulong pvalue = 0, ptotal = 0; char buffer[1024], *token; ulong value, total, user, nice, sys, idle, usn; FILE *fd; if ((fd = fopen ("/proc/stat","r"))) { while (fgets (buffer, sizeof (buffer), fd)) if ((token = strtok (buffer," \t\n"))) { if (!strncmp ("cpu", token, 3)) { sscanf(strtok (0, "\n"), "%lu %lu %lu %lu", &user, &nice, &sys, &idle); break; } else strtok (0,"\n"); } fclose(fd); usn = user + sys + nice; value = usn - pvalue; pvalue = usn; total = usn + idle - ptotal; ptotal = usn + idle; if (total) return (int) (value * 100 / total); } return 0; } /* This function reads /proc/net/dev and calculates the current trafic to and from net. Only the given network device will be observed and incomming and outgoing trafic would be combined to one single bytes/second value. If an error occured, the return value would be '0', so that no program features espacially sleep will be blocked. */ int power_read_net (char *dev) { static ulong ptrafic = 0; char buffer[1024], *token; ulong dummy, bytesread = 0, byteswrite = 0, trafic = 0; FILE *fd; if ((fd = fopen ("/proc/net/dev","r"))) { while (fgets (buffer, sizeof (buffer), fd)) if ((token = strtok (buffer,":\n"))) { cleanup_buffer (token); if (!strncmp (dev, token, strlen (dev))) { sscanf(strtok (0, "\n"), "%lu %lu %lu %lu %lu %lu %lu %lu %lu", &bytesread, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &byteswrite); break; } else strtok (0,"\n"); } fclose(fd); if (ptrafic) trafic = bytesread + byteswrite - ptrafic; ptrafic = bytesread + byteswrite; return (int) trafic; } return 0; } void power_beep() { int arg, fd; unsigned int ms = 150; unsigned int freq = 5000; if ((fd = open("/dev/console", O_RDWR)) >= 0) { arg = (ms << 16) | freq; ioctl(fd, KDMKTONE, arg); usleep(ms*1000); close (fd); } } pbbuttonsd-0.8.1a/src/module_powersave.h0000644000175000017500000000733310641705160015314 00000000000000#ifndef INCLUDE_MODULE_POWERSAVE_H #define INCLUDE_MODULE_POWERSAVE_H /* ---------------------------------------------------------------------------- * module_powersave.h * prototypes and definitions for the module powermanagement. * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include /* power management policies */ enum {POLICY_NONE, POLICY_POWERSAVE, POLICY_USER, POLICY_PERFORMANCE, POLICY_LAST=POLICY_PERFORMANCE}; /* power management actions */ enum {ACTION_NONE, ACTION_TORAM, ACTION_TODISK, ACTION_BLANK, ACTION_SHUTDOWN, ACTION_LAST=ACTION_SHUTDOWN}; /* emergency action codes */ enum {EMA_SLEEP, EMA_SIGNAL, EMA_COMMAND, EMA_LAST=EMA_COMMAND}; #define DEFAULT_NETLOAD_DEV "ppp0" #define AC_TIME_DIM 600 /* 600=1 minutes, in 10th of a second */ #define AC_TIME_SLEEP 3000 /* 3000=5 minutes, in 10th of a second */ #define BATTERY_TIME_DIM 600 /* 600=1 minutes, in 10th of a second */ #define BATTERY_TIME_SLEEP 3000 /* 3000=5 minutes, in 10th of a second */ #define SLEEPCOUNTDOWN 60 /* (seconds + 1) * 10 */ #define BEEPINTERVAL 30 /* seconds */ /* Battery levels to check battery and signal warnings to the clients */ #define BAT_WARNLEVEL1 21 /* time remaining until shutdown*/ #define BAT_WARNLEVEL2 11 /* in minutes */ #define BAT_WARNLEVEL3 4 /* This value defined a hysteresis for the warnlevels. That means if for eg. the remaining time falls below BAT_WARNLEVEL2 the daemon switchs to warnlevel 2 and the time has to be raised above BAT_WARNLEVEL2 + this value to return to warnlevel 1. This reduces frequent battery warning popup windows around the BAT_WARNLEVELs due to power fluctuation. The hysteresis must not be greater than the lowest difference between two BAT_WARNLEVELs. */ #define BAT_HYSTERESIS 3 #define DEFAULT_IBAM_DATADIR "/var/lib/ibam" enum {MODE_AWAKE, MODE_DIM, MODE_DOZY, MODE_SUSPEND}; struct modflags_power { unsigned int sleep_supported:1; /* REDUNDANT copy from module pmac */ unsigned int sleeptriggered:1; unsigned int cpuload_enable:1; unsigned int netload_enable:1; unsigned int sleeplock_cpu:1; unsigned int sleeplock_net:1; unsigned int sigpwr_sent:1; unsigned int heartbeat_enable:1; unsigned int heartbeat:1; unsigned int coveropen:1; /* tracked signal from TAG_COVERSTATUS */ unsigned int usersetpolicy:1; unsigned int :0; }; struct powerprofile { unsigned int policy; unsigned int timeraction; unsigned int coveraction; unsigned int keyaction; /* sleepkey */ unsigned int suspendtime; unsigned int dimtime; }; /* public prototypes */ int power_init (); void power_exit (); /* private prototypes */ void power_keyboard (struct tagitem *taglist); void power_mouse (struct tagitem *taglist); void power_awake (); void power_sync (); void power_query (struct tagitem *taglist); void power_configure (struct tagitem *taglist); void power_handle_tags (int cfgure, struct tagitem *taglist); void power_timer (struct tagitem *taglist); void power_timer1000 (struct tagitem *taglist); void power_check_battery (int time, int psource); int power_shutdown_in_progress (); void power_suspend (int action); void power_setpolicy (int policy, int powersource); int check_script (char *name, char *allowed); int send_sigpwr (char mode); int power_read_cpu (void); int power_read_net (char *dev); void power_beep(); #endif /* INCLUDE_MODULE_POWERSAVE_H */ pbbuttonsd-0.8.1a/src/module_display.c0000644000175000017500000014231310641705154014742 00000000000000/** * @brief Module to control Display Brightness and Keyboard Illumination * * This module contains the machine independent logic to control the * display brightness and the keyboard illumination. If an ambient light * sensor is available in the system, it is taken into account too. * * This module does not access the display or sensors directly. This is * done by the hardware abstraction layer of the current machine which * contains appropriate driver for the display and the sensors. The * display module sends all hardware requests to this hardware drivers. * * The display module has several properties that could be accessed from * the outside. The properties could be accessed through the function * display_handle_tags(). The properties are described there. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published * by the Free Software Foundation (http://www.gnu.org/licenses/gpl.html) * * @file src/module_display.c * @author Matthias Grimm */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include "pbbinput.h" #include #include "input_manager.h" #include "module_display.h" #include "support.h" #include "gettext_macros.h" #include "class_config.h" #include #include "debug.h" #define VAL2PERCENT(x,max) (x * 100 / max) #define PERCENT2VAL(x,max) (x * max / 100) /** * @brief Section name for the configuration file */ #define SECTION "MODULE DISPLAY" /** * @brief Private module data structure */ struct moddata_display { char *fbdev; /* pathname of the framebuffer device */ struct display_flags flags; struct display_light lcdlight; /* structures for LCD light control */ struct display_light kbdlight; /* structures for keyboard light control */ int lcdfeedback; /* feedback of the LCD on the ambient sensor */ int kbdon_brightness; /* keyboard brightness after switch on */ unsigned short keylcdup; /* keycodes and modifiers */ unsigned short modlcdup; /* for LCD backlight controls */ unsigned short keylcddn; unsigned short modlcddn; unsigned short keykbdup; /* keycodes and modifiers */ unsigned short modkbdup; /* for keyboard illumination controls */ unsigned short keykbddn; unsigned short modkbddn; unsigned short keykbdon; unsigned short modkbdon; unsigned short keymirror; /* keycode for CRT mirror key */ unsigned short modmirror; } modbase_display; static const char *AutoadjModeList[] = { "off", "linear", "hysteresis", NULL }; /** * @brief Initialize the display module * * This function does everything to get the display module up. It initializes * the private module data, read and store the module configuration, check * for hardware and path names and finally register some callbacks at the * pbbuttonsd framework. * * @return Zero if everything went well or the error code. Only really fatal * errors throw an error code here because if one of the initialization * functions fail, pbbuttonsd will quit. */ int display_init () { struct moddata_display *base = &modbase_display; struct tagitem args[] = {{ TAG_BACKLIGHTMAX, 0 }, { TAG_BACKLIGHTLEVEL, -1 }, { TAG_KEYBLIGHTMAX, 0 }, { TAG_AMBIENTLIGHT, -1 }, { TAG_END, 0 }}; int level, ambient; base->fbdev = config_get_string (SECTION, "Device_FB", DEFAULT_FB_DEVICE); /* get some information from hardware module */ process_queue (QUERYQUEUE, args); /* if no backlight controller was registered TAG_BACKLIGHTLEVEL * would return -1 which must be converted to be in brightness * range. furtheron a flag saves this information. */ base->flags.nobacklight = 0; if ((level = (int) tagfind (args, TAG_BACKLIGHTLEVEL, -1)) == -1) { level = (int) tagfind (args, TAG_BACKLIGHTMAX, 0); base->flags.nobacklight = 1; } base->lcdlight.current = level; base->lcdlight.target = level; base->lcdlight.max = (int) tagfind (args, TAG_BACKLIGHTMAX, 0); base->lcdlight.backup = level; base->lcdlight.offset = 0; base->lcdlight.isrunning = 0; display_set_fading (&base->lcdlight, config_get_int (SECTION, "LCD_FadingSpeed", 0)); base->lcdlight.autoadj_mode = config_get_option (SECTION, "LCD_AutoadjMode", AutoadjModeList, AUTOADJ_LIN); base->lcdlight.autoadj_hyst_out = 0; display_set_autoadj_parameter (&base->lcdlight, BATTERY, config_get_intlist (SECTION, "LCD_AutoadjParm_onBattery", 4, 0, 1, 94, 54)); display_set_autoadj_parameter (&base->lcdlight, AC, config_get_intlist (SECTION, "LCD_AutoadjParm_onAC", 4, 0, 1, 94, 100)); base->kbdlight.current = 0; base->kbdlight.target = 0; base->kbdlight.max = (int) tagfind (args, TAG_KEYBLIGHTMAX, 0); base->kbdlight.backup = 0; base->kbdlight.offset = 0; base->kbdlight.isrunning = 0; display_set_fading (&base->kbdlight, config_get_int (SECTION, "KBD_FadingSpeed", 0)); base->kbdlight.autoadj_mode = config_get_option (SECTION, "KBD_AutoadjMode", AutoadjModeList, AUTOADJ_HYS); base->kbdlight.autoadj_hyst_out = 0; display_set_autoadj_parameter (&base->kbdlight, BATTERY, config_get_intlist (SECTION, "KBD_AutoadjParm_onBattery", 4, 10, 100, 28, 0)); display_set_autoadj_parameter (&base->kbdlight, AC, config_get_intlist (SECTION, "KBD_AutoadjParm_onAC", 4, 10, 100, 28, 0)); process_queue_single (CONFIGQUEUE, TAG_KEYBLIGHTLEVEL, base->kbdlight.current); base->flags.status = STATUS_NORMAL; base->flags.coveropen = 1; /* cover open by default same as in laptop module */ /* If we have an Ambient light sensor in this Laptop, we must measure the LCD * feedback to this sensor in current state. To do this we switch the backlight * off for a moment and measure the real ambient light level. */ ambient = tagfind(args, TAG_AMBIENTLIGHT, -1); base->flags.lmu_enable = ambient == -1 ? 0 : 1; base->lcdfeedback = 0; if (base->flags.lmu_enable) { print_msg (PBB_INFO, _("Ambient light sensor found.\n")); process_queue_single (CONFIGQUEUE, TAG_BACKLIGHTLEVEL, 0); base->lcdfeedback = ambient - process_queue_single (QUERYQUEUE, TAG_AMBIENTLIGHT, 0); process_queue_single (CONFIGQUEUE, TAG_BACKLIGHTLEVEL, base->lcdlight.current); #if defined(DEBUG) && AMBIENT printf("Init: Ambient = %d, LCD feedback = %d\n", ambient, base->lcdfeedback); #endif } /* change the current brightness levels for LCD backlight and keyboard * illumination if there are some set in the configuration file. */ if ((level = config_get_percent (SECTION, "LCD_Brightness", -1)) != -1) display_set_lcdbrightness (PERCENT2VAL(level, base->lcdlight.max)); if ((level = config_get_percent (SECTION, "KBD_Brightness", -1)) != -1) display_set_kbdbrightness (PERCENT2VAL(level, base->kbdlight.max)); base->keylcdup = config_get_keycode (SECTION, "LCD_IllumUpKey", KEY_BRIGHTNESSUP); base->modlcdup = config_get_modmask (SECTION, "LCD_IllumUpKey", MOD_NONE); base->keylcddn = config_get_keycode (SECTION, "LCD_IllumDownKey", KEY_BRIGHTNESSDOWN); base->modlcddn = config_get_modmask (SECTION, "LCD_IllumDownKey", MOD_NONE); base->keykbdup = config_get_keycode (SECTION, "KBD_IllumUpKey", KEY_KBDILLUMUP); base->modkbdup = config_get_modmask (SECTION, "KBD_IllumUpKey", MOD_NONE); base->keykbddn = config_get_keycode (SECTION, "KBD_IllumDownKey", KEY_KBDILLUMDOWN); base->modkbddn = config_get_modmask (SECTION, "KBD_IllumDownKey", MOD_NONE); base->keykbdon = config_get_keycode (SECTION, "KBD_IllumOnKey", KEY_KBDILLUMTOGGLE); base->modkbdon = config_get_modmask (SECTION, "KBD_IllumOnKey", MOD_NONE); base->keymirror = config_get_keycode (SECTION, "CRT_MirrorKey", KEY_F7); base->modmirror = config_get_modmask (SECTION, "CRT_MirrorKey", MOD_CTRL); /* Saved brightness for kbd on/off key * The KBD_OnBrightness value is configured as percentage and must * be transformed to a real backlight level the display module work * with. This is done here and also in the function handle_tags() */ level = config_get_percent (SECTION, "KBD_OnBrightness", 0); base->kbdon_brightness = PERCENT2VAL(level, base->kbdlight.max); if (base->kbdon_brightness < KBD_BRIGHTNESS_MIN) base->kbdon_brightness = KBD_BRIGHTNESS_MIN; /* framebuffer disabled by default */ base->flags.ctrl_fb = config_get_boolean (SECTION, "UseFBBlank", FALSE); /* don't dim to complete darkness by default */ base->flags.dimfullydark = config_get_boolean (SECTION, "DimFullyDark", FALSE); /* This value must be set to 1 if the initial value of kbd_onbrightness should * take effect but this will block KBD autoadjustment mode. In KBD autoadjustement * mode the initial value makes no sense so we set the flag dependent of the * users autoadjustment settings. * In case somebody set the keyboard brightness from extern the kbd_switchedoff * flag will always be 0 except the current brightness is zero (dark). This flag * status is set by display_handle_tags(), TAG_KBDBRIGHTNESS. */ if (base->kbdlight.current == 0) base->flags.kbd_switchedoff = base->kbdlight.autoadj_mode == AUTOADJ_OFF ? 1 : 0; register_function (KBDQUEUE, display_keyboard); register_function (QUERYQUEUE, display_query); register_function (CONFIGQUEUE, display_configure); register_function (T1000QUEUE, display_ambienttimer); return 0; } /** * @brief Frees all ressources allocated by this module */ void display_exit () { struct moddata_display *base = &modbase_display; g_free (base->fbdev); } /** * @brief Handles keyboard events * * This function is called whenever keyboard events need * processing. It looks for certain keys and if they are * found predefined actions will take place. * * Special keys catched by this function are: * @li LCD brightness up/down * @li Keyboard brightness up/down * @li Keyboard illumination on/off * @li CRT Mirror on/off (switch the external video output) * * The appropritate keys change their meaning in autoadjust mode. * Instead of modifying the brightness directly the keys now modify * an offset that will shift the characteristic curve for automatic * brightness adjustment up or down a bit. Although automatic * adjustment ist enable the user keep control over the brightness. * * Because the brightness range could be very big, the change step * for each key trigger is calculated automatically in that way * that always 16 key strokes are needed to switch from lowest to * highest brightness level. * * Functions using the shift modifier is disabled during automatic * control. * * @param taglist taglist containing the key information */ void display_keyboard (struct tagitem *taglist) { struct moddata_display *base = &modbase_display; int code, value, mod, lcdstep, kbdstep, tmp; int level = 0, changed = 0; code = (int) tagfind (taglist, TAG_KEYCODE, 0); value = (int) tagfind (taglist, TAG_KEYREPEAT, 0); mod = (int) tagfind (taglist, TAG_MODIFIER, 0); if (value && base->flags.coveropen) { lcdstep = (base->lcdlight.max >> 4) + 1; kbdstep = (base->kbdlight.max >> 4) + 1; /* key for video mirroring */ if ((code == base->keymirror) && (mod == base->modmirror)) if ((tmp = display_switchmirror ()) != -1) singletag_to_clients(CHANGEVALUE, TAG_CRTMIRROR, tmp); /* keys for LCD brightness control */ if ((code == base->keylcdup) && ((mod & ~MOD_SHIFT) == base->modlcdup)) { /* somebody might have changed the brightness level directly so * check if we are still synchron here */ display_sync_lcdbrightness (); /* .target and .current will normally be the same value synchronized * by the display_timer() function. We use .target here because the * powersave module might have given an order to change brightness. * In case fading was activated this order would not be fullfilled * yet (only .target has been set accordingly) and if we used * .current here we would overwrite it. */ level = mod & MOD_SHIFT ? base->lcdlight.max : base->lcdlight.target + lcdstep; changed = 1; } else if ((code == base->keylcddn) && ((mod & ~MOD_SHIFT) == base->modlcddn)) { display_sync_lcdbrightness (); /* same as brightness up */ level = mod & MOD_SHIFT ? LCD_BRIGHTNESS_MIN : base->lcdlight.target - lcdstep; changed = 1; } /* keys for KBD illumination control */ if ((code == base->keykbdup) && ((mod & ~MOD_SHIFT) == base->modkbdup)) { if (base->flags.kbd_switchedoff) { base->kbdlight.current = base->kbdon_brightness; base->flags.kbd_switchedoff = 0; } level = mod & MOD_SHIFT ? base->kbdlight.max : base->kbdlight.current + kbdstep; changed = 2; } else if ((code == base->keykbddn) && ((mod & ~MOD_SHIFT) == base->modkbddn)) { if (base->flags.kbd_switchedoff) { base->kbdlight.current = base->kbdon_brightness; base->flags.kbd_switchedoff = 0; } level = mod & MOD_SHIFT ? KBD_BRIGHTNESS_MIN : base->kbdlight.current - kbdstep; changed = 2; } else if (base->flags.lmu_enable && (code == base->keykbdon) && (mod == base->modkbdon)) { if (base->flags.kbd_switchedoff) { level = base->kbdon_brightness; base->flags.kbd_switchedoff = 0; } else { base->kbdon_brightness = base->kbdlight.current; base->flags.kbd_switchedoff = 1; level = KBD_BRIGHTNESS_OFF; } level = display_set_kbdbrightness(level); singletag_to_clients(CHANGEVALUE, TAG_KBDBRIGHTNESS, VAL2PERCENT(level, base->kbdlight.max)); } switch (changed) { case 1: /* LCD brightness level changed by keys */ if (base->flags.lmu_enable && base->lcdlight.autoadj_mode != AUTOADJ_OFF) { if (mod & MOD_SHIFT) break; /* shift modifier disabled in automatic mode */ tmp = base->lcdlight.current - base->lcdlight.offset; base->lcdlight.offset += (level - base->lcdlight.current) > 0 ? lcdstep : -lcdstep; if (tmp + base->lcdlight.offset > base->lcdlight.max) base->lcdlight.offset = base->lcdlight.max - tmp; if (tmp + base->lcdlight.offset < 1) base->lcdlight.offset = -tmp; level = tmp + base->lcdlight.offset; } #if defined (DEBUG) && AMBIENT printf (" Offset: %3d, level: %3d\n", base->lcdlight.offset, level); #endif level = display_set_lcdbrightness(level); singletag_to_clients(CHANGEVALUE, TAG_LCDBRIGHTNESS, VAL2PERCENT(level, base->lcdlight.max)); break; case 2: /* Keyboard illumination level changed by keys */ if (base->flags.lmu_enable) { if (base->kbdlight.autoadj_mode != AUTOADJ_OFF) { if (mod & MOD_SHIFT) break; /* shift modifier disabled in automatic mode */ tmp = base->kbdlight.current - base->kbdlight.offset; base->kbdlight.offset += (level - base->kbdlight.current) > 0 ? kbdstep : -kbdstep; if (tmp + base->kbdlight.offset > base->kbdlight.max) base->kbdlight.offset = base->kbdlight.max - tmp; if (tmp + base->kbdlight.offset < 0) base->kbdlight.offset = -tmp; level = tmp + base->kbdlight.offset; } level = display_set_kbdbrightness(level); singletag_to_clients(CHANGEVALUE, TAG_KBDBRIGHTNESS, VAL2PERCENT(level, base->kbdlight.max)); } break; } } } /** * @brief LCD brightness timer function * * The following two timer functions will set the brightness * level for the LCD and keyboard backlight. The timer will * be dynamically configured to be able to switch the brightness * hard or smooth from one level to another. * * When no further change requests are pending the timer disables * itself. A new brightness change request will launch another * timer. * * To track the influence of the LCD on the ambient light sensors, * the raw sensor values, before and after the new backlight level * has been set, are read. if one of the ambient values is invalid, * the lcdfeedback won't change. In this case lcdfeedback become * slightly out of sync but will be synchronized again the next time * the display will be switched off. * * @see display_kbdtimer() * * @param data standard callback parameter not used in this function * @return TRUE, if the timer should be called again or FALSE if the * job has been finished. */ gboolean display_lcdtimer (gpointer data) { struct moddata_display *base = &modbase_display; struct display_light *illu = &base->lcdlight; int preambient, postambient; if (illu->current != illu->target) { if (illu->fading && abs(illu->current - illu->target) >= illu->fadingstep) { if (illu->current > illu->target) /* target is darker as current */ illu->current -= illu->fadingstep; else /* target is brighter as current */ illu->current += illu->fadingstep; } else illu->current = illu->target; preambient = process_queue_single (QUERYQUEUE, TAG_AMBIENTLIGHT, -1); #if defined(DEBUG) && FADING printf ("LCD timer: Target=%3d, Current=%3d, RawAmbient (%4d) - LCD feedback (%4d) = Ambient (%d)\n", illu->target, illu->current, preambient, base->lcdfeedback, preambient - base->lcdfeedback); #endif process_queue_single (CONFIGQUEUE, TAG_BACKLIGHTLEVEL, illu->current); display_framebuffer (illu->current ? 1: 0); postambient = process_queue_single (QUERYQUEUE, TAG_AMBIENTLIGHT, -1); if (preambient != -1 && postambient != -1) { if (illu->current) { base->lcdfeedback += postambient - preambient; if (base->lcdfeedback < 0) base->lcdfeedback = 0; /* lower than zero is not valid */ } else base->lcdfeedback = 0; } #if defined(DEBUG) && FADING printf (" RawAmbient (%4d) - LCD feedback (%4d) = Ambient (%d)\n", postambient, base->lcdfeedback, postambient - base->lcdfeedback); #endif return TRUE; } #if defined(DEBUG) && DISPLAYTIMER struct timeval endtime; double time; gettimeofday (&endtime, NULL); time = (endtime.tv_sec - illu->start.tv_sec) * 1000 + (endtime.tv_usec - illu->start.tv_usec) / 1000; print_msg (PBB_INFO, "DBG: LCD Display total time: %fms, time per step: %fms\n", time, time / illu->steps); print_msg (PBB_INFO, "DBG: LCD Display Timer stopped.\n"); #endif illu->isrunning = 0; return FALSE; } /** * @brief Keyboard illumination brightness timer * * This timer function will be called whenever the brightness * of the keyboard illumination should be changed. It is * sililar to display_lcdtimer() which does the same for the * LCD backlight. * * @see display_lcdtimer() * * @param data standard callback parameter not used in this function * @return TRUE, if the timer should be called again or FALSE if the * job has been finished. */ gboolean display_kbdtimer (gpointer data) { struct moddata_display *base = &modbase_display; struct display_light *illu = &base->kbdlight; if (base->flags.lmu_enable) { if (illu->current != illu->target) { if (illu->fading && abs(illu->current - illu->target) >= illu->fadingstep) { if (illu->current > illu->target) /* target is darker as current */ illu->current -= illu->fadingstep; else /* target is brighter as current */ illu->current += illu->fadingstep; } else illu->current = illu->target; #if defined(DEBUG) && FADING printf ("KBD Timer: Target=%3d, Current=%3d\n", illu->target, illu->current); #endif process_queue_single (CONFIGQUEUE, TAG_KEYBLIGHTLEVEL, illu->current); return TRUE; } #if defined(DEBUG) && DISPLAYTIMER struct timeval endtime; double time; gettimeofday (&endtime, NULL); time = (endtime.tv_sec - illu->start.tv_sec) * 1000 + (endtime.tv_usec - illu->start.tv_usec) / 1000; print_msg (PBB_INFO, "DBG: KBD Display total time: %fms, time per step: %fms\n", time, time / illu->steps); print_msg (PBB_INFO, "DBG: KBD Display Timer stopped.\n"); #endif } illu->isrunning = 0; return FALSE; } /** * @brief Automatic brightness adjustment timer * * This timer function is called every second and it performs * the automatic brighness adjustments for LCD and keyboard * illumination. * * The LCD brightness should change in parallel to the ambient * light. That means the brighter the environment the brighter * the LCD backlight. This way the display stays readable in * bright environments. * * The equation for the automatic brightness adjustment is: * brightness level = s * a * ambient level + offset * * @li s is the scaling factor that depends on the * ambient light sensor and the brightness range of the * LCD backlight. * @li a is an additional amplification. This factor * modifies the gradient of the curve so that for example * the maximum brightness level will be reached before the * ambient light sensor is at its maximum or vica versa. * This factor is usually could be configured with the * "LCD_Threshold" option: v = 100 / LCD_Threshold * @li offset is the brightness shift caused by manual * level adjustment with the brightness up/down keys. * * The automatic brightness adjustment algorithm can be limited to * a certain working range. That means the user can configure * the controller not to use the full brightness range but a special * part of it. He can set a lower and upper brightness limits the * controller must stay between. Then It won't calculate brightness * levels behind this limits dependend on ambient light. * * The keyboard illumination should be switched on and become * brighter when the environmental light becomes too dark to * see the letters on the keys. The keyboard illumination works * antiparallel to the ambient light level. * * The equation for the keyboard brightness adjustment looks like this: * brightness level = -s * a * ambient level + offset + max keylight * * The equations to calculate the new values allow values * generated out of range. This doesn't matter as long as * the function display_set_lcdbrightness() clip them to the * valid range. */ void display_ambienttimer (struct tagitem *taglist) { struct moddata_display *base = &modbase_display; struct display_light *illu; int ambient, ambientmax, level, pwrsource; struct tagitem args[] = {{ TAG_AMBIENTLIGHT, -1 }, { TAG_AMBIENTLIGHTMAX, 0 }, { TAG_POWERSOURCE, 1 }, { TAG_END, 0 }}; if (base->flags.lmu_enable && base->flags.status == STATUS_NORMAL) { /* process this code only if an ambient light sensor was found * and the display is not dimmed or switched off */ process_queue (QUERYQUEUE, args); if ((ambient = tagfind (args, TAG_AMBIENTLIGHT, -1)) > -1) { ambient -= base->lcdfeedback; ambientmax = tagfind (args, TAG_AMBIENTLIGHTMAX, 0); pwrsource = tagfind (args, TAG_POWERSOURCE, 1); illu = &base->kbdlight; if (illu->autoadj_mode != AUTOADJ_OFF && !base->flags.kbd_switchedoff) { level = display_calc_brightness (illu, pwrsource, ambient, ambientmax); if (level + illu->offset > illu->max) illu->offset = illu->max - level; if (level + illu->offset < 1) illu->offset = -level; display_set_kbdbrightness(level + illu->offset); } /* skip the autoadjustment if the current brightness level is zero. * It's users will and we don't want to interfere with it */ illu = &base->lcdlight; if (illu->autoadj_mode != AUTOADJ_OFF && illu->current != 0) { level = display_calc_brightness (illu, pwrsource, ambient, ambientmax); if (level + illu->offset > illu->max) illu->offset = illu->max - level; if (level + illu->offset < 1) illu->offset = -level + 1; display_set_lcdbrightness(level + illu->offset); } } } } /** * @brief Query properties from the display module * * This function is a stub for display_handle_tags(). * * It will be called whenever other modules or one of the * clients needs information from this module. The properties * are given in form of a taglist and the function * display_configure() fill in the data. * * @see display_configure(), display_handle_tags() * * @param taglist taglist containing the properties to be queried */ void display_query (struct tagitem *taglist) { display_handle_tags (MODE_QUERY, taglist); } /** * @brief Change properties of the display module * * This function is a stub for display_handle_tags(). * * It will be called whenever other modules or one of the * clients wants to change one or more properties of this * module. The properties are given in form of a taglist. * The function display_configure() take the data from it, * do some sanity checks and change the module property. * The change become instantly active. * * @see display_query(), display_handle_tags() * * @param taglist taglist containing the properties to be changed */ void display_configure (struct tagitem *taglist) { display_handle_tags (MODE_CONFIG, taglist); } /** * @brief Read or write of module properties * * This function handles external access to module properties. If * another module or a client wants to read or change a propertiy, * this function will do it. There is no other way to access module * properties from outside this module. * * Two groups of properties are known: * @li private - properties can be used only inside pbbuttonsd, * @li public - properties can be used also by clients. * * Public Properties (tags) * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
PropertyDataDDescription
LCDBRIGHTNESS level<>This command will get or set the display brightness level. * Level is a value in percent (100% = full display brightness). * If an error occoured tag data is set to -1.
LCDFADINGSPEED <>
KBDBRIGHTNESS level<>This command will get or set the brightness level of the * keyboard illumination (if the computer has one). Level is a * value in percent (100% = full keyboard brightness). If an error * occoured tag data is set to -1.
KBDONBRIGHTNESS <>
KBDFADINGSPEED <>
LCDILLUMUPKEY key code<>Key code to increase the display brightness.
LCDILLUMUPMOD modifier flags<>Modifier for the LCD-brightness-up key. The modifier shift * is used internally and can't be used as key modifier.
LCDILLUMDOWNKEY key code<>Key code to decrease the display brightness.
LCDILLUMDOWNMOD modifier flags<>Modifier for the LCD-brightness-down key. The modifier shift * is used internally and can't be used as key modifier.
KBDILLUMUPKEY key code<>Key code to increase the keyboard illumination brightness.
KBDILLUMUPMOD modifier flags<>Modifier for the keyboard-brightness-down key. The modifier shift * is used internally and can't be used as key modifier.
KBDILLUMDOWNKEY key code<>Key code to decrease the keyboard illumination brightness.
KBDILLUMDOWNMOD modifier flags<>Modifier for the keyboard-brightness-down key. The modifier shift * is used internally and can't be used as key modifier.
KBDILLUMONKEY key code<>Key code to toggle the keyboard illumination on or off.
KBDILLUMONMOD modifier flags<>Modifier for the keyboard-brightness-on/off key.
CRTMIRRORKEY key code<>
CRTMIRRORMOD modifier flags<>
FRAMEBUFFERDEVICEdevice name<>This property set the frame buffer device that should be used to * switch the display on or off.
BLANKFRAMEBUFFER bool<>If this property is set to 1, the display will be additionally * switched on or off by the frame buffer device. Without this only * the backlight will be switched off. The display is then still * working although nothing could be seen.
DIMFULLYDARK <>
LCDAUTOADJUST <>
KBDAUTOADJUST <>
LCDAUTOADJBAT <>
LCDAUTOADJAC <>
KBDAUTOADJBAT <>
KBDAUTOADJAC <>
* * Private Properties (tags) * * * * * * * * * * * *
PropertyDataDDescription
BRIGHTNESSOP opcode>This command will change the display and keyboard brightness * relative to its current value. The opcode defines the action and * is processed by display_change_brightness(). If an error occoured * tag data is set to -1.
COVERSTATUS status>
PREPAREFORSLEEPnone >
WAKEUPFROMSLEEPnone >
* * @see display_query(), display_configure() * * @param cfgure MODE_CONFIG or MODE_QUERY. Sets the operating * mode of display_handle_tags() * @param taglist taglist containing the properties and data */ void display_handle_tags (int cfgure, struct tagitem *taglist) { struct moddata_display *base = &modbase_display; int err, level; while (taglist->tag != TAG_END) { switch (taglist->tag) { case TAG_BRIGHTNESSOP: /* private tag */ if (cfgure) display_change_brightness (taglist->data); break; case TAG_LCDBRIGHTNESS: if (cfgure) { level = taglist->data > 100 ? 100 : taglist->data; /* level in percent */ level = display_set_lcdbrightness (PERCENT2VAL(level, base->lcdlight.max)); singletag_to_clients(CHANGEVALUE, TAG_LCDBRIGHTNESS, VAL2PERCENT(level, base->lcdlight.max)); } else taglist->data = base->flags.nobacklight ? -1 : VAL2PERCENT(base->lcdlight.current, base->lcdlight.max); break; case TAG_LCDFADINGSPEED: if (cfgure) { display_set_fading (&base->lcdlight, taglist->data); config_set_int (SECTION, "LCD_FadingSpeed", taglist->data); } else taglist->data = display_get_fading (&base->lcdlight); break; case TAG_KBDBRIGHTNESS: if (cfgure) { level = taglist->data > 100 ? 100 : taglist->data; /* level in percent */ if (level > 100) level = 100; if (level < 0) level = 0; level = display_set_kbdbrightness (PERCENT2VAL(level, base->kbdlight.max)); if (level > 0) base->flags.kbd_switchedoff = 0; singletag_to_clients(CHANGEVALUE, TAG_KBDBRIGHTNESS, VAL2PERCENT(level, base->kbdlight.max)); } else taglist->data = VAL2PERCENT(base->kbdlight.current, base->kbdlight.max); break; case TAG_KBDONBRIGHTNESS: if (cfgure) { level = taglist->data > 100 ? 100 : taglist->data; /* level in percent */ config_set_percent (SECTION, "KBD_OnBrightness", level); base->kbdon_brightness = PERCENT2VAL(level, base->kbdlight.max); if (base->kbdon_brightness < KBD_BRIGHTNESS_MIN) base->kbdon_brightness = KBD_BRIGHTNESS_MIN; } else taglist->data = VAL2PERCENT(base->kbdon_brightness, base->kbdlight.max); break; case TAG_KBDFADINGSPEED: if (cfgure) { display_set_fading (&base->kbdlight, taglist->data); config_set_int (SECTION, "KBD_FadingSpeed", taglist->data); } else taglist->data = display_get_fading (&base->kbdlight); break; case TAG_LCDILLUMUPKEY: if (cfgure) { base->keylcdup = taglist->data; config_set_keymod (SECTION, "LCD_IllumUpKey", taglist->data, base->modlcdup); } else taglist->data = base->keylcdup; break; case TAG_LCDILLUMUPMOD: if (cfgure) { base->modlcdup = taglist->data; config_set_keymod (SECTION, "LCD_IllumUpKey", base->keylcdup, taglist->data); } else taglist->data = base->modlcdup; break; case TAG_LCDILLUMDOWNKEY: if (cfgure) { base->keylcddn = taglist->data; config_set_keymod (SECTION, "LCD_IllumDownKey", taglist->data, base->modlcddn); } else taglist->data = base->keylcddn; break; case TAG_LCDILLUMDOWNMOD: if (cfgure) { base->modlcddn = taglist->data; config_set_keymod (SECTION, "LCD_IllumDownKey", base->keylcddn, taglist->data); } else taglist->data = base->modlcddn; break; case TAG_KBDILLUMUPKEY: if (cfgure) { base->keykbdup = taglist->data; config_set_keymod (SECTION, "KBD_IllumUpKey", taglist->data, base->modkbdup); } else taglist->data = base->keykbdup; break; case TAG_KBDILLUMUPMOD: if (cfgure) { base->modkbdup = taglist->data; config_set_keymod (SECTION, "KBD_IllumUpKey", base->keykbdup, taglist->data); } else taglist->data = base->modkbdup; break; case TAG_KBDILLUMDOWNKEY: if (cfgure) { base->keykbddn = taglist->data; config_set_keymod (SECTION, "KBD_IllumDownKey", taglist->data, base->modkbddn); } else taglist->data = base->keykbddn; break; case TAG_KBDILLUMDOWNMOD: if (cfgure) { base->modkbddn = taglist->data; config_set_keymod (SECTION, "KBD_IllumDownKey", base->keykbddn, taglist->data); } else taglist->data = base->modkbddn; break; case TAG_KBDILLUMONKEY: if (cfgure) { base->keykbdon = taglist->data; config_set_keymod (SECTION, "KBD_IllumOnKey", taglist->data, base->modkbdon); } else taglist->data = base->keykbdon; break; case TAG_KBDILLUMONMOD: if (cfgure) { base->modkbdon = taglist->data; config_set_keymod (SECTION, "KBD_IllumOnKey", base->keykbdon, taglist->data); } else taglist->data = base->modkbdon; break; case TAG_CRTMIRRORKEY: if (cfgure) { base->keymirror = taglist->data; config_set_keymod (SECTION, "CRT_MirrorKey", taglist->data, base->modmirror); } else taglist->data = base->keymirror; break; case TAG_CRTMIRRORMOD: if (cfgure) { base->modmirror = taglist->data; config_set_keymod (SECTION, "CRT_MirrorKey", base->keymirror, taglist->data); } else taglist->data = base->modmirror; break; case TAG_FRAMEBUFFERDEVICE: if (cfgure) { if ((err = check_path ((char *) taglist->data, TYPE_CHARDEV, CPFLG_NONE))) tagerror (taglist, err); else { replace_string (&base->fbdev, (char *) taglist->data); config_set_string (SECTION, "Device_FB", base->fbdev); } } else taglist->data = (long) base->fbdev; break; case TAG_BLANKFRAMEBUFFER: if (cfgure) { base->flags.ctrl_fb = taglist->data & 1; config_set_boolean (SECTION, "UseFBBlank", base->flags.ctrl_fb); } else taglist->data = base->flags.ctrl_fb; break; case TAG_DIMFULLYDARK: if (cfgure) { base->flags.dimfullydark = taglist->data & 1; config_set_boolean (SECTION, "DimFullyDark", base->flags.dimfullydark); } else taglist->data = base->flags.dimfullydark; break; case TAG_LCDAUTOADJUST: if (cfgure) { base->lcdlight.offset = 0; base->lcdlight.autoadj_mode = taglist->data > AUTOADJ_LAST ? 0 : taglist->data; config_set_option (SECTION, "LCD_AutoadjMode", AutoadjModeList, base->lcdlight.autoadj_mode); } else taglist->data = base->lcdlight.autoadj_mode; break; case TAG_KBDAUTOADJUST: if (cfgure) { base->kbdlight.offset = 0; base->kbdlight.autoadj_mode = taglist->data > AUTOADJ_LAST ? 0 : taglist->data; config_set_option (SECTION, "KBD_AutoadjMode", AutoadjModeList, base->kbdlight.autoadj_mode); } else taglist->data = base->kbdlight.autoadj_mode; break; case TAG_LCDAUTOADJBAT: if (cfgure) display_set_autoadj_from_tag (&base->lcdlight, BATTERY, taglist->data); else taglist->data = display_get_autoadj_for_tag (&base->lcdlight, BATTERY); break; case TAG_LCDAUTOADJAC: if (cfgure) display_set_autoadj_from_tag (&base->lcdlight, AC, taglist->data); else taglist->data = display_get_autoadj_for_tag (&base->lcdlight, AC); break; case TAG_KBDAUTOADJBAT: if (cfgure) display_set_autoadj_from_tag (&base->kbdlight, BATTERY, taglist->data); else taglist->data = display_get_autoadj_for_tag (&base->kbdlight, BATTERY); break; case TAG_KBDAUTOADJAC: if (cfgure) display_set_autoadj_from_tag (&base->kbdlight, AC, taglist->data); else taglist->data = display_get_autoadj_for_tag (&base->kbdlight, AC); break; case TAG_COVERSTATUS: /* private tag */ if (cfgure) base->flags.coveropen = taglist->data & 1; break; case TAG_PREPAREFORSLEEP: /* private tag */ if ((cfgure) && base->flags.nobacklight) { display_framebuffer (0); } break; case TAG_WAKEUPFROMSLEEP: /* private tag */ display_sync_lcdbrightness (); if ((cfgure) && base->lcdlight.current) { display_framebuffer (1); } /* base->coveropen must be synchronized after sleep. This is done * by the module_pmac. This module sends the WAKEUPFROMSLEEP tag * and after a short delay the COVERSTATUS tag so that no special * actions need to be taken here. */ break; } taglist++; } } /** * @brief Calculates the brightness level for the current ambient light * * This function calculates the brightness level dependent on the * ambient light level. Two controller models are supported. * * level = f(ambient) * *
 *     lvel     2                 lvel          2
 *      |         o------           |      +--<--o-----
 *      |        /                  |      |     |
 *      |       /                   |      |     |
 *      |------o                    |------o-->--+
 *      |       1                   |     1
 *      +-----------ambient->       +--------------ambient->
 *            linear                      hysteresis
 * 
* * The characteristic curve of the controller will be defined by two * ambient light / brightness level pairs. the brightness levels will * set the boundaries within the controller have to work. It is only * able to change the LCD brightness within this limits. Outside the * boundaries the brightness level will be kept constant. * * The ambient light values set ambient thresholds or characteristic * points where the brightness controller change its behaviour. What * happens in detail depends on the choosen model (see sketches above). * * @param illu struct display_light containing the parameter * @param pwrsource is the machine running on battery or on AC? * @param ambient current ambient light level (compensated) * @param ambientmax maximum ambient light level * @return native brightness level for the backlight controller */ int display_calc_brightness (struct display_light *illu, int pwrsource, int ambient, int ambientmax) { struct autoadj_param *params = pwrsource ? &illu->ac_params : &illu->battery_params; double a,b,x,y; x = (double) ambient * 100 / (double) ambientmax; switch (illu->autoadj_mode) { case AUTOADJ_OFF: y = 0; break; case AUTOADJ_LIN: if (x < params->ambient1) y = params->level1; else if (x > params->ambient2) y = params->level2; else { a = (double)(params->level2 - params->level1) / (double)(params->ambient2 - params->ambient1); b = params->level2 - a * params->ambient2; y = a * x + b; } break; case AUTOADJ_HYS: if (illu->autoadj_hyst_out == params->level1) { if (x >= params->ambient2) illu->autoadj_hyst_out = params->level2; } else { if (x <= params->ambient1) illu->autoadj_hyst_out = params->level1; } y = (double) illu->autoadj_hyst_out; break; } return (int) nearbyint ((double) illu->max * y / 100); } /** * @brief Clip brightness level and start LCD brightness timer * * This functions checks the limits of a given brightness level, * clip it if neseccary and set it as new target. * * If no brightness timer function is running, this function * will start one. The timer function call the backlight driver * to change the brightness value of the LCD backlight. * * @param level new LCD brightness level * @return level clipped to a valid range */ int display_set_lcdbrightness(int level) { struct moddata_display *base = &modbase_display; struct display_light *illu = &base->lcdlight; int val; if (base->flags.nobacklight) { if (level > 0) level = illu->max; illu->target = level; return -1; } else { val = display_clip_brightness (illu, level); if (illu->isrunning == 0) { illu->isrunning = 1; #if defined(DEBUG) && DISPLAYTIMER illu->steps = abs(illu->target - illu->current); gettimeofday (&illu->start, NULL); print_msg (PBB_INFO, "DBG: LCD Display Timer started.\n"); #endif /* The timer needs always some more time to react as given * so we decrease the time by 1 milisecond here to compensate * this behaviour. */ g_timeout_add (illu->fading ? illu->fading - 1 : 9, display_lcdtimer, NULL); } #if defined(DEBUG) && BRIGHTNESS print_msg (PBB_INFO, "DBG: LCD Brightness: %d\n", val); #endif return val; } } /** * @brief Clip brightness level and start keyboard brightness timer * * This functions checks the limits of a given brightness level, * clip it if neseccary and set it as new target. * * If no brightness timer function is running, this function * will start one. The timer function call the backlight driver * to change the brightness level of the keyboard illumination. * * @param level new keyboard brightness level * @return level clipped to a valid range */ int display_set_kbdbrightness(int level) { struct moddata_display *base = &modbase_display; struct display_light *illu = &base->kbdlight; int val; val = display_clip_brightness (illu, level); if (illu->isrunning == 0) { illu->isrunning = 1; #if defined(DEBUG) && DISPLAYTIMER illu->steps = abs(illu->target - illu->current); gettimeofday (&illu->start, NULL); print_msg (PBB_INFO, "DBG: KBD Display Timer started.\n"); #endif /* The timer needs always some more time to react as given * so we decrease the time by 1 milisecond here to compensate * this behaviour. */ g_timeout_add (illu->fading ? illu->fading - 1 : 9, display_kbdtimer, NULL); } #if defined(DEBUG) && BRIGHTNESS print_msg (PBB_INFO, "DBG: KBD Brightness: %d\n", val); #endif return val; } int display_clip_brightness(struct display_light *illu, int level) { if (level > illu->max) level = illu->max; if (level < 0) level = 0; illu->target = level; return level; } void display_set_fading (struct display_light *illu, int fading) { double timer, step; if (fading > 0) { timer = (double) fading / (illu->max + 1); step = ceil (5.0 / timer); if (step < illu->max) { illu->fading = floor (timer * step + 0.5); illu->fadingstep = step; goto out; } } illu->fading = 0; illu->fadingstep = 1; out: #if defined(DEBUG) && DISPLAYTIMER print_msg (PBB_INFO, "DBG: Timer: %d, step: %d\n", illu->fading, illu->fadingstep); #endif return; } int display_get_fading (struct display_light *illu) { return illu->fading * (illu->max + 1) / illu->fadingstep; } void display_set_autoadj_parameter (struct display_light *illu, int pwrsource, int *params) { struct autoadj_param *parm; parm = pwrsource ? &illu->ac_params : &illu->battery_params; parm->ambient1 = params[0] < 0 ? 0 : params[0] > 100 ? 100 : params[0]; parm->level1 = params[1] < 0 ? 0 : params[1] > 100 ? 100 : params[1]; parm->ambient2 = params[2] < 0 ? 0 : params[2] > 100 ? 100 : params[2]; parm->level2 = params[3] < 0 ? 0 : params[3] > 100 ? 100 : params[3]; g_free (params); } void display_set_autoadj_from_tag (struct display_light *illu, int pwrsource, tag_t data) { int *params = g_new0 (int, 4); printf("data = 0x%lx\n", data); params[0] = (data >> 24) & 0xff; params[1] = (data >> 16) & 0xff; params[2] = (data >> 8) & 0xff; params[3] = data & 0xff; display_set_autoadj_parameter (illu, pwrsource, params); } tag_t display_get_autoadj_for_tag (struct display_light *illu, int pwrsource) { struct autoadj_param *parm; tag_t data; parm = pwrsource ? &illu->ac_params : &illu->battery_params; data = parm->ambient1 << 24 | parm->level1 << 16; data |= parm->ambient2 << 8 | parm->level2; return data; } /** * @brief Change the brightness relative to the current level * * This function changes the display and keyboard brightness relative * to its current value. The opcode defines the action and can have * following values: * @li OP_DIM_LIGHT - Dim display to lowest level, but * remember the former value * @li OP_DIM_OFF - Switch display off but remember the * former value * @li OP_DIM_RECOVER - Reset the display brightness back * to the remembered level * * If someone else has changed the display or keyboard brighhtness, * this function also synchronize the internal brightness levels with * the real ones. * * This function is mainly used to dim the display when the user is idle. * * The brightness level will be set by display_lcdtimer() and * display_kbdtimer() functions. * * @see display_lcdtimer(), display_kbdtimer() * * @param op opcode, see list above */ void display_change_brightness(int op) { struct moddata_display *base = &modbase_display; /* somebody might have changed the brightness level directly so * check if we are still synchron here */ display_sync_lcdbrightness (); if (((op == OP_DIM_RECOVER) && (base->flags.status == STATUS_NORMAL)) || ((op == OP_DIM_LIGHT) && (base->flags.status != STATUS_NORMAL)) || ((op == OP_DIM_OFF) && (base->flags.status == STATUS_OFF))) return; /* if a backlight controller is not available try to dim to * complete darkness in hope the framebuffer device is able * to switch the backlight off. The framebuffer option must * be configured accordingly to make this work. */ if ((base->flags.dimfullydark || base->flags.nobacklight) && op == OP_DIM_LIGHT) op = OP_DIM_OFF; switch (op) { case OP_DIM_LIGHT: base->lcdlight.backup = base->lcdlight.current; /* if current LCD brightness level is 0 then let it * as it is because it is user's will */ if (base->lcdlight.current > LCD_BRIGHTNESS_OFF) base->lcdlight.target = LCD_BRIGHTNESS_MIN; base->kbdlight.backup = base->kbdlight.current; base->kbdlight.target = KBD_BRIGHTNESS_OFF; base->flags.status = STATUS_DIMMED; break; case OP_DIM_OFF: if (base->flags.status != STATUS_DIMMED) { base->lcdlight.backup = base->lcdlight.current; base->kbdlight.backup = base->kbdlight.current; } base->lcdlight.target = LCD_BRIGHTNESS_OFF; base->kbdlight.target = KBD_BRIGHTNESS_OFF; base->flags.status = STATUS_OFF; break; case OP_DIM_RECOVER: base->lcdlight.target = base->lcdlight.backup; /* don't recover zero display brightness * set to minimum brightness instead */ if (base->lcdlight.target == LCD_BRIGHTNESS_OFF) base->lcdlight.target = LCD_BRIGHTNESS_MIN; base->kbdlight.target = base->kbdlight.backup; base->flags.status = STATUS_NORMAL; break; } display_set_lcdbrightness(base->lcdlight.target); display_set_kbdbrightness(base->kbdlight.target); } void display_framebuffer (int on) { struct moddata_display *base = &modbase_display; int fd = -1, err; if (base->flags.ctrl_fb) { if ((fd = open(base->fbdev, O_RDWR)) >= 0) { /* open framebuffer device */ err = ioctl(fd, FBIOBLANK, on ? 0 : VESA_POWERDOWN + 1); close (fd); } else print_msg (PBB_ERR, _("Can't open framebuffer device '%s'.\n"), base->fbdev); } } void display_sync_lcdbrightness (void) { struct moddata_display *base = &modbase_display; int level; level = process_queue_single (QUERYQUEUE, TAG_BACKLIGHTLEVEL, -1); if (level != base->lcdlight.current) { base->flags.status = STATUS_NORMAL; if (level != -1) { /* Somebody else has changed the LCD brightness * so sync our system. */ base->lcdlight.current = level; base->lcdlight.target = level; base->flags.nobacklight = 0; } else { /* no backlight controller available */ base->lcdlight.current = base->lcdlight.max; base->lcdlight.target = base->lcdlight.max; base->flags.nobacklight = 1; } } } int display_switchmirror () { struct moddata_display *base = &modbase_display; unsigned long value; int fd, rc = -1; if ((fd = open(base->fbdev, O_RDWR)) >= 0) { /* open framebuffer device */ if (ioctl(fd, FBIO_ATY128_GET_MIRROR, &value) == 0) { value ^= ATY_MIRROR_CRT_ON; ioctl(fd, FBIO_ATY128_SET_MIRROR, &value); rc = value & ATY_MIRROR_CRT_ON ? 1 : 0; } else if (ioctl(fd, FBIO_RADEON_GET_MIRROR, &value) == 0) { value ^= ATY_RADEON_CRT_ON; ioctl(fd, FBIO_RADEON_SET_MIRROR, &value); rc = value & ATY_RADEON_CRT_ON ? 1 : 0; } close (fd); } else print_msg (PBB_ERR, _("Can't open framebuffer device '%s'.\n"), base->fbdev); return rc; } pbbuttonsd-0.8.1a/src/module_display.h0000644000175000017500000001027710641705157014755 00000000000000#ifndef INCLUDE_MODULE_DISPLAY_H #define INCLUDE_MODULE_DISPLAY_H /** * @brief Definitions and prototypes for module_display.c * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/module_display.h * @author Matthias Grimm */ #include #include "debug.h" #define DEFAULT_FB_DEVICE "/dev/fb0" #ifndef KEY_KBDILLUMTOGGLE #define KEY_KBDILLUMTOGGLE 228 #endif #ifndef KEY_KBDILLUMDOWN #define KEY_KBDILLUMDOWN 229 #endif #ifndef KEY_KBDILLUMUP #define KEY_KBDILLUMUP 230 #endif #ifndef FBIOBLANK #define FBIOBLANK 0x4611 /* 0 or vesa-level+1 */ #endif #ifndef VESA_POWERDOWN /* vesa level for FBIOBLANK */ #define VESA_POWERDOWN 3 #endif /* Definitions to control ATI Framebuffer, because they aren't * available as linux include file. Definitions for the radeon * framebuffer are placed in linux/radeonfb.h */ #define ATY_MIRROR_CRT_ON 0x00000002 #define FBIO_ATY128_GET_MIRROR _IOR('@', 1, __u32) #define FBIO_ATY128_SET_MIRROR _IOW('@', 2, __u32) enum {BATTERY, AC}; enum {AUTOADJ_OFF, AUTOADJ_LIN, AUTOADJ_HYS, AUTOADJ_LAST=AUTOADJ_HYS}; /* operation codes (OP) for display_setlevel() */ #define OP_DIM_LIGHT 1 #define OP_DIM_RECOVER 2 #define OP_DIM_OFF 3 #define LCD_BRIGHTNESS_OFF 0 /* lower ranges for light sources */ #define LCD_BRIGHTNESS_MIN 1 /* of 16 steps */ #define KBD_BRIGHTNESS_OFF 0 #define KBD_BRIGHTNESS_MIN 16 /* of 256 steps */ /* definitions for status */ #define STATUS_NORMAL 0 #define STATUS_DIMMED 1 #define STATUS_OFF 2 struct display_flags { unsigned int lmu_enable:1; unsigned int kbd_switchedoff:1; unsigned int ctrl_fb:1; /* 1, if framebuffer should be blanked too */ unsigned int dimfullydark:1; unsigned int status:2; unsigned int coveropen:1; /* track signal from TAG_COVERSTATUS */ unsigned int nobacklight:1; /* no backlight controller available */ unsigned int :0; }; struct autoadj_param { unsigned int ambient1; /* x1 */ unsigned int level1; /* y1 */ unsigned int ambient2; /* x2 */ unsigned int level2; /* y2 */ }; struct display_light { int current; /* current brightness value */ int target; /* brightness to set to */ int max; /* maximum brightness value */ int backup; int offset; /* users influence on automatic adjustment */ int fading; /* timer interval or 0 for no fading */ int fadingstep; int autoadj_mode; /* operating mode of the ambient controller: off, linear or hysteresis */ unsigned int autoadj_hyst_out; /* the hysteresis function needs to know its output status */ struct autoadj_param ac_params; struct autoadj_param battery_params; int isrunning; /* display timer currently running */ #if defined(DEBUG) && DISPLAYTIMER struct timeval start; /* for profiling fading routines */ int steps; #endif }; /* public prototypes */ int display_init (); void display_exit (); /* private prototypes */ void display_keyboard (struct tagitem *taglist); void display_query (struct tagitem *taglist); void display_configure (struct tagitem *taglist); /*void display_timer (struct tagitem *taglist);*/ gboolean display_timer (gpointer data); void display_ambienttimer (struct tagitem *taglist); void display_handle_tags (int mode, struct tagitem *taglist); int display_calc_brightness (struct display_light *illu, int pwrsource, int ambient, int ambientmax); int display_set_lcdbrightness(int level); int display_set_kbdbrightness(int level); int display_clip_brightness(struct display_light *illu, int level); void display_set_fading (struct display_light *illu, int fading); int display_get_fading (struct display_light *illu); void display_set_autoadj_from_tag (struct display_light *illu, int pwrsource, tag_t data); tag_t display_get_autoadj_for_tag (struct display_light *illu, int pwrsource); void display_set_autoadj_parameter (struct display_light *illu, int pwrsource, int *params); void display_change_brightness(int op); void display_framebuffer (int on); void display_sync_lcdbrightness (void); int display_switchmirror (); #endif /* INCLUDE_MODULE_DISPLAY_H */ pbbuttonsd-0.8.1a/src/module_cdrom.c0000644000175000017500000002553410643743705014414 00000000000000/** * @brief Module to eject the CDROM on users request * * This module contains the code to read a key from the keyboard and * eject the CDROM on trigger. This module is most usefull on some * Apple PowerBooks that have no eject key on the drive. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/module_cdrom.c * @author Matthias Grimm */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include #include "pbbinput.h" #include "gettext_macros.h" #include "input_manager.h" #include "module_cdrom.h" #include "support.h" #include "debug.h" #include "class_config.h" #define SECTION "MODULE CDROM" struct moddata_cdrom { char *cdromdev; /* pathname of the cdrom device */ unsigned short keyejectcd; unsigned short modejectcd; struct timeval tv; /* time of key press */ int keydelaytime; /* delay in ms */ int cdejected; } modbase_cdrom; int cdrom_init () { struct moddata_cdrom *base = &modbase_cdrom; int rc; /* get module configuration */ base->cdromdev = config_get_string (SECTION, "Device", DEFAULT_CDROM); base->keyejectcd = config_get_keycode (SECTION, "EjectCDKey", KEY_EJECTCD); base->modejectcd = config_get_modmask (SECTION, "EjectCDKey", MOD_NONE); base->keydelaytime = config_get_int (SECTION, "EjectCDKeyDelay", 0); if ((rc = check_path (base->cdromdev, TYPE_BLKDEV, CPFLG_MAYBEMISSED))) { print_msg (PBB_ERR, _("Please check your CDROM settings in configuration file.\n")); return rc; } #if defined(DEBUG) && CDROMPERF cdrom_testperformance (); #endif register_function (QUERYQUEUE, cdrom_query); register_function (CONFIGQUEUE, cdrom_configure); register_function (KBDQUEUE, cdrom_keyboard); return 0; } void cdrom_exit () { struct moddata_cdrom *base = &modbase_cdrom; g_free (base->cdromdev); } void cdrom_keyboard (struct tagitem *taglist) { struct moddata_cdrom *base = &modbase_cdrom; int code, value, mod; code = (int) tagfind (taglist, TAG_KEYCODE, 0); value = (int) tagfind (taglist, TAG_KEYREPEAT, 0); mod = (int) tagfind (taglist, TAG_MODIFIER, 0); if (value) { if (value == 1) base->cdejected = 0; if ((code == base->keyejectcd) && (mod == base->modejectcd)) if ((base->keydelaytime == 0) || (keydelayms(&base->tv, value, base->keydelaytime))) if (base->cdejected == 0) { base->cdejected = 1; cdrom_eject (); } } } void cdrom_query (struct tagitem *taglist) { cdrom_handle_tags(MODE_QUERY, taglist); } void cdrom_configure (struct tagitem *taglist) { cdrom_handle_tags(MODE_CONFIG, taglist); } void cdrom_handle_tags (int cfgure, struct tagitem *taglist) { struct moddata_cdrom *base = &modbase_cdrom; int err; while (taglist->tag != TAG_END) { switch (taglist->tag) { case TAG_EJECTCD: if (cfgure) { singletag_to_clients(CHANGEVALUE, TAG_EJECTCD, 1); if ((cdrom_eject()) == 0) singletag_to_clients(CHANGEVALUE, TAG_EJECTCD, 0); } else tagerror (taglist, E_NOREAD); break; case TAG_CDROMDEVICE: if (cfgure) { if ((err = check_path ((char *) taglist->data, TYPE_BLKDEV, CPFLG_MAYBEMISSED))) tagerror (taglist, err); else { replace_string (&base->cdromdev, (char *) taglist->data); config_set_string (SECTION, "Device", base->cdromdev); } } else taglist->data = (long) base->cdromdev; break; case TAG_EJECTCDKEY: if (cfgure) { base->keyejectcd = taglist->data; config_set_keymod (SECTION, "EjectCDKey", taglist->data, base->modejectcd); } else taglist->data = base->keyejectcd; break; case TAG_EJECTCDMOD: if (cfgure) { base->modejectcd = taglist->data; config_set_keymod (SECTION, "EjectCDKey", base->keyejectcd, taglist->data); } else taglist->data = base->modejectcd; break; case TAG_EJECTCDKEYDELAY: if (cfgure) { base->keydelaytime = taglist->data; config_set_int (SECTION, "EjectCDKeyDelay", taglist->data); } else taglist->data = base->keydelaytime; break; } taglist++; } } /* This function checks is a given name could be found in * a list of names. It returns a boolean walue: * 1 = list contains name * 0 = name could not be found in list */ int cdrom_cmpDevName(struct listhead *list, char *name) { struct listnode *it = list->first; while ((it = it->next)) if (strcmp (name, (char*) getNodeData(it->pred)) == 0) return 1; return 0; } /* This function adds 'name' to a double linked list. The * memory for the node and the name is dynamically allocated. * The name is copied to the newly allocated memory so that * the caller must no longer take care about it. * The function returns -1 on error (out of memory). */ int cdrom_addDevName(struct listhead *list, char *name) { struct listnode *node; if((node = newListNode (strlen(name)+1))) { strcpy ((char*)getNodeData(node), name); appendListNode (list, node); return 0; } return -1; /* out of memory */ } /* This function gets the mountpoint of a given device. The source * of mountpoints is the file /proc/mounts. The function compares * if the device is mounted and where. Symlinks will be resolved * so that if a link to the device was mounted the mountpoint * would be found too. * * symlink chain: /dev/cdrom -> /dev/cd1 -> /dev/hdc * cdrom mounted: /dev/cd1 * * The mountpount will be found either /dev/cdrom or /dev/hdc is * given. */ char * cdrom_getmountpoint(char *device) { static char buffer[100]; struct listhead devs; char linkbuf[50], *mountpoint = NULL, *token; FILE *fd; int n; initListHeader (&devs); strcpy (buffer, device); do { if (cdrom_addDevName (&devs, buffer)) return NULL; /* out of memory */ if ((n = readlink(buffer, linkbuf, sizeof(linkbuf)-1)) >= 0) { linkbuf[n] = '\0'; /* readlink() doesn't terminate buffer */ if (linkbuf[0] == '/') /* link is absolute */ strcpy (buffer, linkbuf); else if ((token = strrchr (buffer, '/'))) { *(++token) = 0; /* terminate path behind last '/' */ strcat (buffer, linkbuf); } else /* this should never happen. It means the startpath is already * relative, so that we can't evaluate the path */ break; } } while (n != -1); if ((fd = fopen ("/proc/mounts","r"))) { while (fgets (buffer, sizeof (buffer), fd)) { if (buffer[0] != '/') continue; /* check only real devices */ #if defined(DEBUG) && CDROM printf("mount = %s", buffer); #endif if ((token = strtok (buffer," \n"))) { strcpy (buffer, token); do { #if defined(DEBUG) && CDROM printf(" dev = %s\n", buffer); #endif if ((cdrom_cmpDevName (&devs, buffer))) { mountpoint = strtok(0," \n"); goto out; } if ((n = readlink(buffer, linkbuf, sizeof(linkbuf)-1)) >= 0) linkbuf[n] = '\0'; /* readlink() doesn't terminate buffer */ if (linkbuf[0] == '/') /* link is absolute */ strcpy (buffer, linkbuf); else if ((token = strrchr (buffer, '/'))) { *(++token) = 0; /* terminate path behind last '/' */ strcat (buffer, linkbuf); } else /* this should never happen. It means the startpath is already * relative, so that we can't evaluate the path */ break; } while (n != -1); } } out: fclose(fd); } freeList (&devs); return mountpoint; } /* This function eject the cdrom or close the tray if the CDROM is * already ejected. If neseccary the cdrom will be unmounted first. * Following return codes are possible: * 0: Drive is busy, * 1: CDROM has been ejected or the tray was opened, * 2: The Tray has been closed, * The external helper program umount is used because the system * call umount() doesn't update /etc/mtab and this conflicts with * umount's normal operation. */ int cdrom_eject() { struct moddata_cdrom *base = &modbase_cdrom; int fd, err = 0, rc = 0; unsigned int t1, t2; char *mp; singletag_to_clients(CHANGEVALUE, TAG_EJECTCD, 0); /* busy */ if ((mp = cdrom_getmountpoint(base->cdromdev))) { err = call_script ("/usr/bin/eject %.30s", mp); if (err) err = call_script ("/bin/umount %.30s", mp); } #if defined(DEBUG) && CDROM printf ("mp=%s, err=%d, %s (%d)\n", mp, err, strerror(errno), errno); #endif if (mp == NULL || err == 0 || errno == EINVAL) { if ((fd = open(base->cdromdev, O_RDONLY | O_NONBLOCK | O_NDELAY)) >= 0) { #if defined(DEBUG) && CDROMPERF err = ioctl (fd, CDROM_GET_CAPABILITY); printf ("capabilities: %x\n", err); #endif err = ioctl (fd, CDROM_DRIVE_STATUS); switch (err) { case 2: /* CDS_TRAY_OPEN */ default: singletag_to_clients(CHANGEVALUE, TAG_EJECTCD, 2); /* close */ t1 = cdrom_gettime (); ioctl (fd, CDROMCLOSETRAY); t2 = cdrom_gettime (); #if defined(DEBUG) && CDROMPERF printf ("close Tray: %4d (%4u-%4u)\n", t2-t1, t2, t1); #endif rc = 2; if (t2-t1 > 100) break; case 1: /* CDS_NO_DISK */ case 4: /* CDS_DISK_OK */ singletag_to_clients(CHANGEVALUE, TAG_EJECTCD, 1); /* eject */ #if defined(DEBUG) && CDROMPERF t1 = cdrom_gettime (); #endif ioctl (fd, CDROMEJECT); #if defined(DEBUG) && CDROMPERF t2 = cdrom_gettime (); printf ("open Tray : %4d (%4u-%4u)\n", t2-t1, t2, t1); #endif rc = 1; } close (fd); } else print_msg (PBB_WARN, _("Can't open %s. Eject CDROM won't work.\n"), base->cdromdev); } return rc; } unsigned int cdrom_gettime () { struct timeval tv; gettimeofday(&tv, NULL); return (tv.tv_sec * 1000 + tv.tv_usec / 1000 ); } #if defined(DEBUG) && CDROMPERF void cdrom_testperformance () { struct moddata_cdrom *base = &modbase_cdrom; int fd; unsigned int t1, t2; printf ("\nCDROM Performancedata: \n"); if ((fd = open(base->cdromdev, O_RDONLY | O_NONBLOCK | O_NDELAY)) >= 0) { printf ("Close already closed Tray: "); t1 = cdrom_gettime(); ioctl (fd, CDROMCLOSETRAY); t2 = cdrom_gettime(); printf ("%4d (%4u-%4u)\n", t2-t1, t2, t1); sleep(1); printf ("Open closed Tray : "); t1 = cdrom_gettime(); ioctl (fd, CDROMEJECT); t2 = cdrom_gettime(); printf ("%4d (%4u-%4u)\n", t2-t1, t2, t1); sleep(1); printf ("Open already open Tray : "); t1 = cdrom_gettime(); ioctl (fd, CDROMEJECT); t2 = cdrom_gettime(); printf ("%4d (%4u-%4u)\n", t2-t1, t2, t1); sleep(1); printf ("Close open Tray : "); t1 = cdrom_gettime(); ioctl (fd, CDROMCLOSETRAY); t2 = cdrom_gettime(); printf ("%4d (%4u-%4u)\n", t2-t1, t2, t1); sleep(1); printf ("Close already closed Tray: "); t1 = cdrom_gettime(); ioctl (fd, CDROMCLOSETRAY); t2 = cdrom_gettime(); printf ("%4d (%4u-%4u)\n\n", t2-t1, t2, t1); close (fd); } else printf ("CDROM open failed!\n\n"); } #endif pbbuttonsd-0.8.1a/src/module_cdrom.h0000644000175000017500000000212110641705157014401 00000000000000#ifndef INCLUDE_MODULE_CDROM_H #define INCLUDE_MODULE_CDROM_H /* ---------------------------------------------------------------------------- * module_cdrom.h * prototypes and definitions for the CDROM module. * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #define DEFAULT_CDROM "/dev/cdrom" /* public prototypes */ int cdrom_init (); void cdrom_exit (); /* private prototypes */ void cdrom_keyboard (struct tagitem *taglist); void cdrom_query (struct tagitem *taglist); void cdrom_configure (struct tagitem *taglist); void cdrom_handle_tags (int cfgure, struct tagitem *taglist); char *cdrom_getmountpoint(char *device); int cdrom_eject (); unsigned int cdrom_gettime (); void cdrom_testperformance (); #endif /* INCLUDE_MODULE_CDROM_H */ pbbuttonsd-0.8.1a/src/class_backlight.c0000644000175000017500000001231210641705164015041 00000000000000/** * @brief Class Backlight - controlls the LCD backlight of a computer. * * This module contains the class backlight which will define the interface * to a LCD backlight controller. Below the module are the backlight drivers * which implement the interface to the specific hardware or kernel interface. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/class_backlight.c * @author Matthias Grimm */ #ifdef HAVE_CONFIG_H # include #endif #include "systems.h" #include #include "gettext_macros.h" #include "input_manager.h" #include "class_backlight.h" #include "driver_backlight_sysfs.h" #include "driver_backlight_pmu.h" #include "driver_backlight_x1600.h" #include "driver_backlight_gma950.h" /** * @brief Private class data of the object * * The structure holds all private data for objects of this class. */ struct class_backlight { struct driver_backlight *driver; /**< driver object of the currently active backlight driver */ } modbase_backlight; /** * @brief Initializes the class backlight. * * This function initializes the class backlight. The main job is to call * each known driver one by one and see if one works. The class object * will be initialized with the first driver object that returns success. * * More important and valuable drivers are probed first so that the class * walked on a fallback path. If the best driver doesn't work, take the * second best and so forth. * * @return always zero */ int backlight_init () { struct class_backlight *base = &modbase_backlight; base->driver = NULL; if (!base->driver) base->driver = driver_backlight_sysfs_init (); #ifdef WITH_BACKLIGHT_PMU if (!base->driver) base->driver = driver_backlight_pmu_init (); #endif #ifdef WITH_BACKLIGHT_PCI if (!base->driver) base->driver = driver_backlight_x1600_init (); if (!base->driver) base->driver = driver_backlight_gma950_init (); #endif if (base->driver) { register_function (QUERYQUEUE, backlight_query); register_function (CONFIGQUEUE, backlight_config); print_msg (PBB_INFO, _("Initialized: %s\n"), _(base->driver->name)); } else print_msg (PBB_WARN, _("No backlight driver available - check your Kernel configuration.\n")); return 0; } /** * @brief close the backlight object and frees all ressources * * This function does all the cleanup after a day of heavy day. In fact it * delegates this job to the open backlight driver and calls driver_exit(). */ void backlight_exit () { struct class_backlight *base = &modbase_backlight; if (base->driver) base->driver->driver_exit(); } /** * @brief Queries the backlight driver for certain parameters * * The backlight class provides a generic interface to the backlight * drivers. Each driver has several properties that could be read. * The caller has to put all properties he wants to know in a taglist * and call this function. It will then get all the wanted information * from the backlight driver, fill them into the taglist and return * it to the caller. * * @param taglist parameters to query from the driver * @return taglist same taglist with filled in parameter values */ void backlight_query (struct tagitem *taglist) { backlight_handle_tags (MODE_QUERY, taglist); } /** * @brief Set certain parameters of the backlight driver to a new value * * The backlight class provides a generic interface to the backlight * drivers. Each driver has several properties that could be written. * The caller has to put all properties and their new values in a taglist * and call this function. It will then set all given properties in the * currently open driver to a new value. * * @param taglist parameters and new values to set * @return taglist same taglist as called with. They will be unchanged * unless an error occours. In that case the tag of * the faulty parameter was marked as error and contains * an error code. */ void backlight_config (struct tagitem *taglist) { backlight_handle_tags (MODE_CONFIG, taglist); } /** * @brief Set or read parameters from a backlight driver * * This function did the work for backlight_config() and backlight_query(). * * @param taglist parameterlist to read or write * @param cfgure mode that decides if the parameters should be read or written * @return taglist depends on mode * @see backlight_config(), backlight_config() */ void backlight_handle_tags (int cfgure, struct tagitem *taglist) { struct class_backlight *base = &modbase_backlight; while (taglist->tag != TAG_END) { switch (taglist->tag) { case TAG_BACKLIGHTDRIVER: if (cfgure) tagerror(taglist, E_NOWRITE); else taglist->data = (long) base->driver->name; break; case TAG_BACKLIGHTMAX: /* private tag */ if (cfgure) ; else taglist->data = base->driver->get_brightness_max(); break; case TAG_BACKLIGHTLEVEL: /* private tag */ if (cfgure) base->driver->set_brightness(taglist->data); else taglist->data = base->driver->get_brightness(); break; } taglist++; } } pbbuttonsd-0.8.1a/src/class_backlight.h0000644000175000017500000000371510641705164015055 00000000000000#ifndef INCLUDE_CLASS_BACKLIGHT_H #define INCLUDE_CLASS_BACKLIGHT_H /** * @brief Class Backlight header file - class definition * * This files contains the class definition of class backlight. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/class_backlight.h * @author Matthias Grimm */ #include /** * @brief backlight driver structure * * This structure contains the public interface to a backlight driver. * * The class backlight probes multiple driver until one will correctly * initialize. In this case the driver returns a pointer to this * structure with will be uses by the class object to call the drivers * methods. * * A new backlight driver must at least define the functions in this * structure. */ struct driver_backlight { /** * @brief name of this driver * * This string is used to give the user a feedback about used * drivers. It might also be used in the configuration unitlity * PowerPrefs to configure this driver. */ char *name; int (*get_brightness)(); int (*get_brightness_max)(); void (*set_brightness)(); void (*driver_exit)(); }; #define INREG(addr) readl(memory+addr) #define OUTREG(addr,val) writel(val, memory+addr) static inline unsigned int readl(const volatile void *addr) { return *(volatile unsigned int*) addr; } static inline void writel(unsigned int b, volatile void *addr) { *(volatile unsigned int*) addr = b; } /* public prototypes class backlight*/ int backlight_init (); void backlight_exit (); /* private prototypes class backlight */ void backlight_query (struct tagitem *taglist); void backlight_config (struct tagitem *taglist); void backlight_handle_tags (int cfgure, struct tagitem *taglist); #endif /* INCLUDE_CLASS_BACKLIGHT_H */ pbbuttonsd-0.8.1a/src/driver_backlight_sysfs.c0000644000175000017500000001226010641705165016461 00000000000000/** * @brief Low level backlight driver for SysFD controlled backlights. * * This module contains the low level driver to control a LCD backlight * via the SysFS kernel interface. The low level driver overloads * methods of class backlight. * This driver uses the new kernel backlight interface introduced in * kernel version 2.6.18. It won't work on earlier kernels. * * It is also recommended to compile the kernel *without* the kernel * option CONFIG_PMAC_BACKLIGHT_LEGACY to prevent conflicts with ancient * kernel features controlling the backlight. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/driver_backlight_sysfs.c * @author Matthias Grimm */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include "gettext_macros.h" #include "class_backlight.h" #include "driver_backlight_sysfs.h" #include "debug.h" /** * @brief Path to the backlight device in SysFS * * This string contains the directory name in SysFS where the * backlight device is located. The directory name derives * from the graphics card name and it is expensive to retrieve * it every time again so it is saved here. */ static GString *sysfs_backlight_path; /** * @brief Exit function of the driver - cleans up all ressources * * This function will be called when the work is done and the driver * should be unloaded. It frees all allocated ressources. */ void driver_backlight_sysfs_exit () { g_string_free (sysfs_backlight_path, TRUE); } /** * @brief Get the current brightness level from the device * * This function is part of the public interface of the driver. * * It returns the current brightness level of the LCD backlight. * * @return current brightness level or -1 on error */ int sysfsbl_get_brightness () { GString *var; FILE *fd; int brightness = -1; char buffer[5]; var = g_string_new (sysfs_backlight_path->str); var = g_string_append (var, "/brightness"); if ((fd = fopen(var->str, "r"))) { fgets(buffer, sizeof(buffer), fd); buffer[4] = 0; /* to be safe, terminate the buffer */ brightness = atoi (buffer); fclose(fd); } g_string_free (var, TRUE); return brightness; } /** * @brief Get the maximum brightness level the device supports * * This function is part of the public interface of the driver. * * It returns the maximum brightness level the LCD backlight * device supports. * * @return maximum supported brightness level of the device. */ int sysfsbl_get_brightness_max () { GString *var; FILE *fd; int max_brightness = -1; char buffer[5]; var = g_string_new (sysfs_backlight_path->str); var = g_string_append (var, "/max_brightness"); if ((fd = fopen(var->str, "r"))) { fgets(buffer, sizeof(buffer), fd); buffer[4] = 0; /* to be safe, terminate the buffer */ max_brightness = atoi (buffer); fclose(fd); } g_string_free (var, TRUE); return max_brightness; } /** * @brief Change the current brightness level. * * This function is part of the public interface of the driver. * * This function sets a new brightness level. The given level must be * valid for this device, that means it must be lower than the level * sysfsbl_get_brightness_max() returns. No further check is done on * that. * * @param val new brightness level */ void sysfsbl_set_brightness (int val) { GString *var; FILE *fd; char buffer[5]; if (val > 255) return; var = g_string_new (sysfs_backlight_path->str); var = g_string_append (var, "/brightness"); sprintf(buffer, "%d\n", val); if ((fd = fopen(var->str, "w"))) { fputs(buffer, fd); fclose(fd); } g_string_free (var, TRUE); } static struct driver_backlight driver_backlight_sysfs = { .name = N_("SysFS Backlight Driver"), .get_brightness = sysfsbl_get_brightness, .get_brightness_max = sysfsbl_get_brightness_max, .set_brightness = sysfsbl_set_brightness, .driver_exit = driver_backlight_sysfs_exit }; /** * @brief Constructor of a SysFS backlight driver object * * This function probes for a backlight controller in the sysfs. * If sysfs is not mounted or a backlight controller could not * be found NULL is returned. Otherwise a driver object is * initialized and returned. * * @return Initializes backlight driver object or NULL */ struct driver_backlight * driver_backlight_sysfs_init () { DIR *dh; struct dirent *dir; sysfs_backlight_path = g_string_new ("/sys/class/backlight"); if ((dh = opendir(sysfs_backlight_path->str))) { while ((dir = readdir(dh))) { if (dir->d_name[0] == '.') continue; if (g_str_has_suffix(dir->d_name, "bl0") || g_str_has_suffix(dir->d_name, "bl")) { g_string_append_printf (sysfs_backlight_path, "/%s", dir->d_name); #if defined(DEBUG) print_msg (PBB_INFO, "DBG: SysFS Backlight Path: %s\n", sysfs_backlight_path->str); #endif return &driver_backlight_sysfs; } } } return NULL; } pbbuttonsd-0.8.1a/src/driver_backlight_sysfs.h0000644000175000017500000000142010641705165016462 00000000000000#ifndef INCLUDE_DRIVER_BACKLIGHT_SYSFS_H #define INCLUDE_DRIVER_BACKLIGHT_SYSFS_H /** * @brief Low level backlight driver for SysFS backlight controller. * * This file contains some definitions and the prototypes for the * SysFs kernel backlight driver. * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/driver_backlight_sysfs.h * @author Matthias Grimm */ #include /* public prototypes driver SysFS backlight */ struct driver_backlight *driver_backlight_sysfs_init (); #endif /* INCLUDE_DRIVER_BACKLIGHT_SYSFS_H */ pbbuttonsd-0.8.1a/src/class_mixer.c0000644000175000017500000001433210641705162014237 00000000000000/** * @brief Class Mixer - controls the volume of the speakers * * This module contains the class mixer which will define the interface * to a sound mixer device. Below the module are the mixer drivers * which implement the interface to the specific hardware or kernel * interface. * * Currently two mixer drivers are available: * @li driver_mixer_oss.c which supports the OSS kernel interface * @li driver_mixer_alsa.c which supports the new ALSA interface * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/class_mixer.c * @author Matthias Grimm */ #ifdef HAVE_CONFIG_H # include #endif #include "systems.h" #include #include #include "gettext_macros.h" #include "input_manager.h" #include "class_config.h" #include "class_mixer.h" #include "driver_mixer_alsa.h" #include "driver_mixer_oss.h" #define SECTION "MODULE MIXER" struct class_mixer { struct driver_mixer *driver; unsigned short keyvolup; unsigned short modvolup; unsigned short keyvoldn; unsigned short modvoldn; unsigned short keymute; unsigned short modmute; } classdata; /* keep basic init function for compatibility with old config system */ int mixer_init () { struct class_mixer *base = &classdata; /* get configuration for this module */ base->keyvolup = config_get_keycode (SECTION, "VolumeUpKey", KEY_VOLUMEUP); base->modvolup = config_get_modmask (SECTION, "VolumeUpKey", MOD_NONE); base->keyvoldn = config_get_keycode (SECTION, "VolumeDownKey", KEY_VOLUMEDOWN); base->modvoldn = config_get_modmask (SECTION, "VolumeDownKey", MOD_NONE); base->keymute = config_get_keycode (SECTION, "MuteKey", KEY_MUTE); base->modmute = config_get_modmask (SECTION, "MuteKey", MOD_NONE); base->driver = NULL; #if WITH_ALSA if (!base->driver) base->driver = driver_mixer_alsa_init (); #endif #if WITH_OSS if (!base->driver) base->driver = driver_mixer_oss_init (); #endif if (base->driver) { register_function (QUERYQUEUE, mixer_query); register_function (CONFIGQUEUE, mixer_config); register_function (KBDQUEUE, mixer_keyboard); print_msg (PBB_INFO, _("Initialized: %s\n"), _(base->driver->name)); } else print_msg (PBB_WARN, _("No mixer driver available - check your Kernel configuration.\n")); return 0; } void mixer_exit () { struct class_mixer *base = &classdata; if (base->driver) base->driver->driver_exit(); } void mixer_inform_clients () { struct class_mixer *base = &classdata; if (base->driver->is_muted () == TRUE) singletag_to_clients (CHANGEVALUE, TAG_MUTE, 0); else singletag_to_clients (CHANGEVALUE, TAG_VOLUME, base->driver->get_volume (VALUE_ABS_PERCENT)); } void mixer_query (struct tagitem *taglist) { mixer_handle_tags (MODE_QUERY, taglist); } void mixer_config (struct tagitem *taglist) { mixer_handle_tags (MODE_CONFIG, taglist); } void mixer_handle_tags (int cfgure, struct tagitem *taglist) { struct class_mixer *base = &classdata; gboolean muted; while (taglist->tag != TAG_END) { switch (taglist->tag) { case TAG_MIXERDRIVER: if (cfgure) tagerror(taglist, E_NOWRITE); else taglist->data = (long) base->driver->name; break; case TAG_VOLUMEUPKEY: if (cfgure) { base->keyvolup = taglist->data; config_set_keymod (SECTION, "VolumeUpKey", base->keyvolup, base->modvolup); } else taglist->data = base->keyvolup; break; case TAG_VOLUMEUPMOD: if (cfgure) { base->modvolup = taglist->data; config_set_keymod (SECTION, "VolumeUpKey", base->keyvolup, base->modvolup); } else taglist->data = base->modvolup; break; case TAG_VOLUMEDOWNKEY: if (cfgure) { base->keyvoldn = taglist->data; config_set_keymod (SECTION, "VolumeDownKey", base->keyvoldn, base->modvoldn); } else taglist->data = base->keyvoldn; break; case TAG_VOLUMEDOWNMOD: if (cfgure) { base->modvoldn = taglist->data; config_set_keymod (SECTION, "VolumeDownKey", base->keyvoldn, base->modvoldn); } else taglist->data = base->modvoldn; break; case TAG_MUTEKEY: if (cfgure) { base->keymute = taglist->data; config_set_keymod (SECTION, "MuteKey", base->keymute, base->modmute); } else taglist->data = base->keymute; break; case TAG_MUTEMOD: if (cfgure) { base->modmute = taglist->data; config_set_keymod (SECTION, "MuteKey", base->keymute, base->modmute); } else taglist->data = base->modmute; break; case TAG_MIXER: if (cfgure) base->driver->set_mixer ((char *) taglist->data); else taglist->data = (long) base->driver->get_mixer (); break; case TAG_MIXERCHANNELS: if (cfgure) base->driver->set_channels ((char *)taglist->data); else taglist->data = (long) base->driver->get_channels (); break; case TAG_VOLUME: if (cfgure) { base->driver->set_volume (VALUE_ABS_PERCENT, taglist->data); mixer_inform_clients (); } else taglist->data = base->driver->get_volume (VALUE_ABS_PERCENT); break; case TAG_MUTE: muted = base->driver->is_muted (); if (cfgure) { if (muted == (gboolean) taglist->data) { base->driver->set_volume (VALUE_REL, 0); mixer_inform_clients (); } } else taglist->data = muted; break; } taglist++; } } void mixer_keyboard (struct tagitem *taglist) { struct class_mixer *base = &classdata; int code, value, mod, step; code = (int) tagfind (taglist, TAG_KEYCODE, 0); value = (int) tagfind (taglist, TAG_KEYREPEAT, 0); mod = (int) tagfind (taglist, TAG_MODIFIER, 0); if (value) { if ((code == base->keyvolup) && ((mod & ~MOD_SHIFT) == base->modvolup)) { step = (mod & MOD_SHIFT) ? +1 : +10; } else if ((code == base->keyvoldn) && ((mod & ~MOD_SHIFT) == base->modvoldn)) { step = (mod & MOD_SHIFT) ? -1 : -10; } else if ((code == base->keymute) && (mod == base->modmute) && (value == 1)) { step = 0; } else return; /* change volume level */ if ((step == 0) || (mod & MOD_SHIFT)) base->driver->set_volume (VALUE_REL, step); /* mute and fine tuning */ else base->driver->set_volume (VALUE_REL_PERCENT, step); /* normal control */ mixer_inform_clients (); } } pbbuttonsd-0.8.1a/src/class_mixer.h0000644000175000017500000000243310641705165014246 00000000000000#ifndef INCLUDE_CLASS_MIXER_H #define INCLUDE_CLASS_MIXER_H /** * @brief Class mixer header file - class definition * * This files contains the class definition of class mixer. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/class_mixer.h * @author Matthias Grimm */ #include enum valueinc { VALUE_REL, VALUE_REL_PERCENT, VALUE_ABS, VALUE_ABS_PERCENT }; struct driver_mixer { char * name; void (*set_mixer)(char *); const char * (*get_mixer)(void); void (*set_channels)(char *); const char * (*get_channels)(void); int (*get_volume)(enum valueinc); void (*set_volume)(enum valueinc, int); gboolean (*is_muted)(); void (*driver_exit)(); }; /* public prototypes class mixer */ int mixer_init (); void mixer_exit (); /* private prototypes class mixer */ void mixer_query (struct tagitem *taglist); void mixer_config (struct tagitem *taglist); void mixer_handle_tags (int cfgure, struct tagitem *taglist); void mixer_keyboard (struct tagitem *taglist); #endif /* INCLUDE_CLASS_MIXER_H */ pbbuttonsd-0.8.1a/src/gettext_macros.h0000644000175000017500000000221710641705157014766 00000000000000#ifndef INCLUDE_GETTEXT_MACROS_H #define INCLUDE_GETTEXT_MACROS_H /* ---------------------------------------------------------------------------- * gettext:macros.h * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef ENABLE_NLS # include #endif /* Standard gettext macros */ #ifdef ENABLE_NLS # include # undef _ # define _(String) dgettext (PACKAGE, String) # ifdef gettext_noop # define N_(String) gettext_noop (String) # else # define N_(String) (String) # endif #else # define textdomain(String) (String) # define gettext(String) (String) # define dgettext(Domain,Message) (Message) # define dcgettext(Domain,Message,Type) (Message) # define bindtextdomain(Domain,Directory) (Domain) # define _(String) (String) # define N_(String) (String) #endif #endif /* INCLUDE_GETTEXT_MACROS_H */ pbbuttonsd-0.8.1a/src/pbbinput.h0000644000175000017500000000160510641705160013553 00000000000000#ifndef INCLUDE_PBBINPUT_H #define INCLUDE_PBBINPUT_H /* ---------------------------------------------------------------------------- * pbbinput.h * This includefile adds support for the brightnes keys * to the kernel input.h if they wasn't already supported. * This allows to compile pbbuttonsd on kernels before * 2.4.18-rc2-benh. * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #ifndef KEY_BRIGHTNESSUP #define KEY_BRIGHTNESSUP 225 #endif #ifndef KEY_BRIGHTNESSDOWN #define KEY_BRIGHTNESSDOWN 224 #endif #endif /* INCLUDE_PBBINPUT_H */ pbbuttonsd-0.8.1a/src/ibam_stub.cpp0000644000175000017500000000337410641705163014240 00000000000000/* -------------------------------------------------------------------------- * ibam_stup.cpp * interface to integrate IBAM into pbbuttonsd * * Copyright 2005 Matthias Grimm * IBAM is Copyright by Sebastion Ritterbusch * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * -------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #ifdef WITH_IBAM #include "debug.h" #if defined(DEBUG) && IBAM # define IBAM_DEBUG 1 #endif #define IBAM_VERSION "0.4" #include "ibam.hpp" extern "C" { static ibam *ObjIBAM = NULL; int ibam_init(const char *data_path) { int rc = 1; // SUCCESS if (!ObjIBAM) { // Object already created ? try { ObjIBAM = new ibam(data_path); } catch(...) { rc = 0; // ERROR } } return rc; } void ibam_exit() { if (ObjIBAM) { delete(ObjIBAM); ObjIBAM = NULL; } } void ibam_recordProfile() { static long lasttime = time(NULL); ObjIBAM->update(); if (ObjIBAM->valid()) { if (time(NULL) < lasttime+10) ObjIBAM->update_statistics(); else ObjIBAM->ignore_statistics(); lasttime = time(NULL); ObjIBAM->save(); } } int ibam_getBatteryTimeAdaptive() { if (!ObjIBAM->valid()) return 0; return (ObjIBAM->seconds_left_battery_adaptive() + ObjIBAM->seconds_battery_correction()+30)/60; } int ibam_getChargeTimeAdaptive() { if (!ObjIBAM->valid()) return 0; return (ObjIBAM->seconds_left_charge_adaptive() + ObjIBAM->seconds_charge_correction()+30)/60; } } /* extern "C" */ #endif /* WITH_IBAM */ pbbuttonsd-0.8.1a/src/ibam_stub.h0000644000175000017500000000151210641705164013676 00000000000000#ifndef INCLUDE_IBAM_H #define INCLUDE_IBAM_H /* ---------------------------------------------------------------------------- * ibam_stub.h * prototypes and definitions for ibam integration. * * Copyright 2005 Matthias Grimm * IBAM is Copyright by Sebastion Ritterbusch * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ /* prototypes */ int ibam_init(const char *data_path); void ibam_exit(); void ibam_recordProfile(); int ibam_getBatteryTimeAdaptive(); int ibam_getChargeTimeAdaptive(); #endif /* INCLUDE_IBAM_H */ pbbuttonsd-0.8.1a/src/ibam.hpp0000644000175000017500000001304110641705163013200 00000000000000// IBAM, the Intelligent Battery Monitor // Copyright (C) 2001-2003, Sebastian Ritterbusch (IBAM@Ritterbusch.de) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // #define IBAM_IGNORE_DATA_AFTER_X_SECONDS 3600 #define IBAM_MINIMAL_SECONDS_PER_PERCENT 10 #define IBAM_MAXIMAL_SECONDS_PER_PERCENT 800 #define IBAM_ASSUME_DEFAULT_BATTERY_MIN 120 #define IBAM_MAXIMAL_PROFILES 500 #include #include #include #include #include #include #include using namespace std; class battery_status { protected: int acLineStatus; int batteryStatus; int chargeStatus; int remainingBatteryPercent; int remainingBatteryLifeSeconds; string Path; public: inline int onBattery(void) const; inline int charging(void) const; inline int percent(void) const; inline int seconds(void) const; virtual inline void update(void) = 0; inline battery_status(string path); virtual inline ~battery_status(void); }; class apm_status : public battery_status { public: inline void update(void); inline apm_status(string path="/proc/apm"); }; class pmu_status : public battery_status { public: inline void update(void); inline pmu_status(string path="/proc/pmu"); }; class acpi_status : public battery_status { public: inline void update(void); inline acpi_status(string path="/proc/acpi"); }; class percent_data { private: int maxpercents; double *time_for_percent; double *time_deriv_for_percent; int *time_samples; inline void size_to(int newpercents); public: inline percent_data(void); inline ~percent_data(void); friend inline ostream & operator <<(ostream & o,const percent_data & a); inline double add_data(int percent,double time_for,int samples=1); inline double average(int a,int b); // average from a to b inline double average_derivation(int a,int b); // standard derivation from a to b inline double add_data(int percent,double time_for,double time_deriv_for,int samples=1); friend inline istream & operator >>(istream & i,percent_data &a); inline istream & import(istream & i); inline double remain(int percent); inline double inverted_remain(int percent); inline double total(void); }; class ibam { private: percent_data data; int data_changed; // 1 if save of ibam.rc demanded battery_status *apm; percent_data battery; int battery_loaded; int battery_changed; percent_data charge; int charge_loaded; int charge_changed; int profile_changed; unsigned long lasttime; int lastpercent; double lastratio; int lastratiocount; int laststatus; double last_sec_per_min; double last_sec_per_min_prediction; unsigned long currenttime; int currentpercent; int currentstatus; string home; int isvalid; int profile_logging; // 1 if cycle shall be logged for later analysis int profile_number; // number of profile (increased on each cycle change) int profile_active; // data has been written to current profile public: inline ibam(const char *); inline void import(void); inline void load_battery(void); inline void load_charge(void); inline void update_statistics(void); inline void ignore_statistics(void); inline void save(void); inline string profile_filename(int n,int type) const; inline int current_profile_number(void) const; inline int current_profile_type(void) const; inline void set_profile_logging(int); inline int profile_logging_setting(void) const; inline int seconds_left_battery_bios(void); inline int seconds_left_battery(void); inline int seconds_left_battery_adaptive(void); inline int percent_battery_bios(void); inline int percent_battery(void); inline int seconds_left_charge(void); inline int seconds_left_charge_adaptive(void); inline int percent_charge(void); inline int seconds_battery_total(void); inline int seconds_battery_total_adaptive(void); inline int seconds_charge_total(void); inline int seconds_charge_total_adaptive(void); inline int seconds_battery_correction(void); inline int seconds_charge_correction(void); inline int onBattery(void); inline int charging(void); inline int valid(void) const; inline void update(void); }; #include "ibam.inl" pbbuttonsd-0.8.1a/src/ibam.inl0000644000175000017500000007510710641705163013206 00000000000000// IBAM, the Intelligent Battery Monitor // Copyright (C) 2001-2003, Sebastian Ritterbusch (IBAM@Ritterbusch.de) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // #include #include #include #include #include #include #include #include #include #include // for acpi multiple batteries /* Arguments, with symbols from linux/apm_bios.h. Information is + from the Get Power Status (0x0a) call unless otherwise noted. + + 0) Linux driver version (this will change if format changes) + 1) APM BIOS Version. Usually 1.0 or 1.1. + 2) APM flags from APM Installation Check (0x00): + bit 0: APM_16_BIT_SUPPORT + bit 1: APM_32_BIT_SUPPORT + bit 2: APM_IDLE_SLOWS_CLOCK + bit 3: APM_BIOS_DISABLED + bit 4: APM_BIOS_DISENGAGED + 3) AC line status + 0x00: Off-line + 0x01: On-line + 0x02: On backup power (APM BIOS 1.1 only) + 0xff: Unknown + 4) Battery status + 0x00: High + 0x01: Low + 0x02: Critical + 0x03: Charging + 0xff: Unknown + 5) Battery flag + bit 0: High + bit 1: Low + bit 2: Critical + bit 3: Charging + bit 7: No system battery + 0xff: Unknown + 6) Remaining battery life (percentage of charge): + 0-100: valid + -1: Unknown + 7) Remaining battery life (time units): + Number of remaining minutes or seconds + -1: Unknown + 8) min = minutes; sec = seconds */ inline int battery_status::onBattery(void) const { return acLineStatus==0; } inline int battery_status::charging(void) const { return chargeStatus; } inline int battery_status::percent(void) const { return remainingBatteryPercent; } inline int battery_status::seconds(void) const { return remainingBatteryLifeSeconds; } inline battery_status::battery_status(string path) { Path = path; } inline battery_status::~battery_status(void) { } inline void battery_status::update(void) { cout << "battery_status::update() called. This should never happen!" << endl; } inline apm_status::apm_status(string path) : battery_status(path) { update(); } inline pmu_status::pmu_status(string path) : battery_status(path) { update(); } inline acpi_status::acpi_status(string path) : battery_status(path) { update(); } inline void apm_status::update(void) { ifstream in; int i; in.open(Path.c_str()); for(i=0;i<10 && in.fail();i++) in.open(Path.c_str()); if(in.fail()) { acLineStatus=0; batteryStatus=0; chargeStatus=0; remainingBatteryPercent=-1; remainingBatteryLifeSeconds=-1; return; } string driverVersion, biosVersion; int apmFlags, batteryFlag; char c,d; in >> driverVersion; in >> biosVersion; in >> c >> d; // 0x in >> c >> d; apmFlags=(c>'9'?c-'a'+10:c-'0')*16+(d>'9'?d-'a'+10:d-'0'); in >> c >> d; // 0x in >> c >> d; acLineStatus=(c>'9'?c-'a'+10:c-'0')*16+(d>'9'?d-'a'+10:d-'0'); in >> c >> d; // 0x in >> c >> d; batteryStatus=(c>'9'?c-'a'+10:c-'0')*16+(d>'9'?d-'a'+10:d-'0'); in >> c >> d; // 0x in >> c >> d; batteryFlag=(c>'9'?c-'a'+10:c-'0')*16+(d>'9'?d-'a'+10:d-'0'); chargeStatus = (batteryStatus&8)!=0; in >> remainingBatteryPercent >> c; // % string minsec; in >> remainingBatteryLifeSeconds >> minsec; if(minsec=="min") remainingBatteryLifeSeconds*=60; #ifdef IBAM_DEBUG cout << "Driver Version: " << driverVersion << endl; cout << "Bios Version: " << biosVersion << endl; cout << "APM Flags: " << apmFlags << endl; cout << "AC Line Status: " << acLineStatus << endl; cout << "Battery Status: " << batteryStatus << endl; cout << "Battery Flag: " << batteryFlag << endl; cout << "Remaining Percent: " << remainingBatteryPercent << endl; cout << "Remaining Seconds: " << remainingBatteryLifeSeconds << endl; #endif } // PMU File-format // // 2 batteries, running on battery // // /proc/pmu/info: // // PMU driver version : 2 // PMU firmware version : 0c // AC Power : 0 // Battery count : 2 // // 1) Note that there are systems where AC Power may falsely show 0 if the // computer booted without any batteries plugged in. The battery-flags // are reported to be more reliable in that case. // This is *not* yet taken into account by ibam. // // 2) The battery count only reflects the number of theoretically available // battery slots and not the number of batteries currently in the system. // // /proc/pmu/battery_0: // // flags : 00000011 // charge : 5788 // max_charge : 5789 // current : 0 // voltage : 12549 // time rem. : 0 // // /proc/pmu_battery_1: // // flags : 00000011 // charge : 518 // max_charge : 1112 // current : -1087 // voltage : 11324 // time rem. : 1715 // // case no battery: // // flags : 00000010 // charge : 0 // max_charge : 0 // current : 0 // voltage : 0 // time rem. : 0 // // 1) flags is to be read hexadeicmal (or binary perhaps?), bit 0 // denotes if this battery is present, bit 1 denotes reportingly // rather unreliable a charging state. // // 2) A positive current denotes charging more reliably. (unchecked) // This is *not* yet taken into account, because it's unclear how this // reading behaves with two batteries. // inline void pmu_status::update(void) { ifstream in; int i; in.open((Path+"/info").c_str()); if (in.fail()) { acLineStatus = 0; chargeStatus = 0; remainingBatteryLifeSeconds = -1; remainingBatteryPercent = -1; return; } stringbuf buf; char c; int d, cur_charge = 0, max_charge = 0; for (i = 0; i < 4; i++) { in.get(buf, ':'); in >> c >> d; if (i == 2) acLineStatus = d; } in.close(); in.open((Path+"/battery_0").c_str()); if (in.fail()) { acLineStatus = 0; chargeStatus = 0; remainingBatteryLifeSeconds = -1; remainingBatteryPercent = -1; return; } for (i = 0; i < 6; i++) { in.get(buf, ':'); in >> c >> d; if (i == 0) chargeStatus = (d&2)==0; if (i == 1) cur_charge = d; if (i == 2) max_charge = d; if (i == 5) remainingBatteryLifeSeconds = d; } in.close(); in.open((Path+"/battery_1").c_str()); if (in.fail()) { remainingBatteryPercent = (int)(cur_charge*100/max_charge); return; } for (i = 0; i < 6; i++) { in.get(buf, ':'); in >> c >> d; if (i == 0) chargeStatus = (d&2)==0; if (i == 1) cur_charge += d; if (i == 2) max_charge += d; if (i == 5) remainingBatteryLifeSeconds += d; } remainingBatteryPercent = (int)(cur_charge*100/max_charge); } // Acpi Percentage and Remaining time computation based upon // http://www.acpi.info/spec.htm V3.0 // // [...] // 3.9.3 Battery Gas Gauge // // At the most basic level, the OS calculates Remaining Battery // Percentage [%] using the following formula: // // Battery Remaining Capacity [mAh/mWh] // Remaining Battery Percentage [%] = ------------------------------------ * 100 // Last Full Charged Capacity [mAh/mWh] // // Control Method Battery also reports the Present Drain Rate [mA or mW] // for calculating the remaining battery life. At the most basic level, // Remaining Battery life is calculated by following formula: // // Battery Remaining Capacity [mAh/mWh] // Remaining Battery Life [h] = ------------------------------------ // Battery Present Drain Rate [mA/mW] // // Smart Batteries also report the present rate of drain, but since they // can directly report the estimated runtime, this function should be used // instead as it can more accurately account for variations specific to // the battery // [...] // // I don't have a "Smart Battery", so I don't know, how /proc/acpi would // report that. Contributions are greatly appreciated. // // See also http://www.tldp.org/HOWTO/ACPI-HOWTO/usingacpi.html // inline void acpi_status::update(void) { ifstream in; DIR *acpi_battery_dir; struct dirent *battery_entry; int i; acpi_battery_dir=opendir((Path+"/battery").c_str()); if (acpi_battery_dir==NULL) { acLineStatus = 0; chargeStatus = 0; remainingBatteryLifeSeconds = -1; remainingBatteryPercent = -1; return; } long total_capacity=0; long total_remain=0; long total_rate=0; while ((battery_entry=readdir(acpi_battery_dir))) { if(battery_entry->d_name!=string(".") && battery_entry->d_name!=string("..")) { in.open((((Path+"/battery/")+battery_entry->d_name)+"/info").c_str()); stringbuf buf; char c; int capacity=0; for (i=0; i<3; i++) { in.get(buf, ':'); in >> c; if (i==0) { in >> c; if(c!='y') // present: yes i=3; } else if(i==2) { in >> capacity; total_capacity+=capacity; } } in.close(); #ifdef IBAM_DEBUG cout << "Battery "<d_name<<": Capacity " << capacity; #endif if(capacity) { in.open((((Path+"/battery/")+battery_entry->d_name)+"/state").c_str()); for (i=0; i<5; i++) { in.get(buf, ':'); in >> c; if (i==2) { char d,e,f,g,h; in >> c >> d >> e >> f >> g >> h; // OUCH... #-} Somebody, please fix me if(c=='c' && h=='i') // charging state: charging { acLineStatus=1; batteryStatus=3; chargeStatus=1; #ifdef IBAM_DEBUG cout << " charging"; #endif } else if(c=='d') // charging state: discharge { acLineStatus=0; batteryStatus=0; chargeStatus=0; #ifdef IBAM_DEBUG cout << " discharging"; #endif } else if(c=='c' && h=='e') // charging state: charged { acLineStatus=1; batteryStatus=0; chargeStatus=0; #ifdef IBAM_DEBUG cout << " charged"; #endif } } else if(i==3) { int rate=0; in >> rate; total_rate+=rate; #ifdef IBAM_DEBUG cout << " Rate " << rate; #endif } else if(i==4) { int remain=0; in >> remain; total_remain+=remain; #ifdef IBAM_DEBUG cout << " Remain " << remain; #endif } } in.close(); } // has capacity #ifdef IBAM_DEBUG cout << endl; #endif } } closedir(acpi_battery_dir); if(total_capacity) remainingBatteryPercent=int((100.*total_remain)/total_capacity+.5); else remainingBatteryPercent=100; if(remainingBatteryPercent>100) remainingBatteryPercent=100; // Don't ask... if(remainingBatteryPercent<100 && acLineStatus==1 && chargeStatus==0) // Deal with strange Acpi-Data? { acLineStatus=1; batteryStatus=3; chargeStatus=1; } if(total_rate) remainingBatteryLifeSeconds=(total_remain*60*60)/total_rate; else remainingBatteryLifeSeconds=(remainingBatteryPercent*IBAM_ASSUME_DEFAULT_BATTERY_MIN*60)/100; #ifdef IBAM_DEBUG cout << "Remaining percent: " << remainingBatteryPercent << endl; cout << "Remaining battery life seconds: " << remainingBatteryLifeSeconds << endl; #endif } inline void percent_data::size_to(int newpercents) { if(newpercents>=maxpercents) { newpercents++; double *time_for=new double[newpercents]; double *time_deriv=new double[newpercents]; int *samples=new int[newpercents]; int i; for(i=0;i=0;i--) if(a.time_samples[i]) { if(a.time_deriv_for_percent[i]<0) a.time_deriv_for_percent[i]=0; o << i << '\t' << a.time_for_percent[i] << '\t' << sqrt(a.time_deriv_for_percent[i]) << '\t' << a.time_samples[i] << endl; } return o; } inline double percent_data::add_data(int percent,double time_for,int samples) { if(percent<0) return 0; size_to(percent); double ratio; if(time_samples[percent]) ratio=time_for/time_for_percent[percent]; else ratio=time_for/(IBAM_ASSUME_DEFAULT_BATTERY_MIN*60./100.); double old_time_for_percent=time_for_percent[percent]; time_for_percent[percent]= (time_for_percent[percent]*time_samples[percent] +time_for*samples )/(samples+time_samples[percent]); time_deriv_for_percent[percent]= ( (time_deriv_for_percent[percent]+old_time_for_percent*old_time_for_percent)*time_samples[percent] +time_for*time_for*samples )/(samples+time_samples[percent])-time_for_percent[percent]*time_for_percent[percent]; time_samples[percent]+=samples; return ratio; } inline double percent_data::average(int a,int b) // average from a to b { if(a>b) { int c=a;a=b;b=c; } if(a<0) { a=0; if(b<0) b=0; } if(b>=maxpercents) { b=maxpercents-1; if(a>=maxpercents) a=b; } int i; double su(0); int co(0); for(i=a;i<=b;i++) { if(time_samples[i]) { su+=time_for_percent[i]*time_samples[i]; co+=time_samples[i]; } } if(co) return (su/co); int gotdata=0; for(a--,b++;(a>0 || b=maxpercents) b=maxpercents-1; su+=time_for_percent[a]*time_samples[a] +time_for_percent[b]*time_samples[b]; co+=time_samples[a]+time_samples[b]; if(time_samples[a] || time_samples[b]) gotdata++; } if(co) return (su/co); return (IBAM_ASSUME_DEFAULT_BATTERY_MIN*60/100); } inline double percent_data::add_data(int percent,double time_for,double time_deriv_for,int samples) { if(percent<0) return 0; size_to(percent); double ratio; if(time_samples[percent]) ratio=time_for/time_for_percent[percent]; else ratio=time_for/average(percent,percent); double old_time_for_percent=time_for_percent[percent]; time_for_percent[percent]= (time_for_percent[percent]*time_samples[percent] +time_for*samples )/(samples+time_samples[percent]); time_deriv_for_percent[percent]= ( (time_deriv_for_percent[percent]+old_time_for_percent*old_time_for_percent)*time_samples[percent] + (time_deriv_for+time_for*time_for)*samples )/(samples+time_samples[percent])-time_for_percent[percent]*time_for_percent[percent]; time_samples[percent]+=samples; return ratio; } inline istream & operator >>(istream & i,percent_data &a) { while(!i.fail() && !i.eof()) { int percent; double time_for(-1); double time_deriv_for(-1); int samples; i >> percent >> time_for >> time_deriv_for>> samples; if(time_for>=0) a.add_data(percent,time_for,time_deriv_for*time_deriv_for,samples); } return i; } inline istream & percent_data::import(istream & i) { percent_data & a(*this); double maxval=0; while(!i.fail() && !i.eof()) { int val; double time_for(-1); int samples; i >> val >> time_for >> samples; if(val>maxval) maxval=val; if(time_for>=0) a.add_data(int(double(val)/maxval*100+.5),time_for*maxval/100,samples/10+1); } return i; } inline double percent_data::remain(int percent) { double r=0; size_to(percent); int i; for(i=percent;i>0;i--) { if(time_samples[i]) r+=time_for_percent[i]; else { int down=i-15; int up=i+15; if(down<0) down=0; if(up>=maxpercents) up=maxpercents-1; r+=average(down,up); } } return r; } inline double percent_data::inverted_remain(int percent) { double r=0; size_to(percent); int i; for(i=percent+1;i=maxpercents) up=maxpercents-1; r+=average(down,up); } } return r; } inline double percent_data::total(void) { double r=0; int i; for(i=maxpercents-1;i>0;i--) { if(time_samples[i]) r+=time_for_percent[i]; else { int down=i-15; int up=i+15; if(down<0) down=0; if(up>=maxpercents) up=maxpercents-1; r+=average(down,up); } } return r; } inline ibam::ibam(const char *data_path) : data_changed(0), battery_loaded(0),battery_changed(0), charge_loaded(0),charge_changed(0), profile_changed(0), lasttime(time(NULL)),lastpercent(0), lastratio(1),lastratiocount(1), laststatus(-1), currenttime(time(NULL)),isvalid(0),profile_logging(1), profile_number(0),profile_active(0) { string pmu_path = "/proc/pmu"; // These strings are already in ibam.hpp, string acpi_path = "/proc/acpi"; // maybe a static function should check this ifstream pmu,acpi; pmu.open((pmu_path+"/info").c_str()); acpi.open((acpi_path+"/info").c_str()); if (pmu.is_open()) { #ifdef IBAM_DEBUG cout << "using pmu" << endl; #endif pmu.close(); apm = new pmu_status(); } else if (acpi.is_open()) { #ifdef IBAM_DEBUG cout << "using acpi" << endl; #endif acpi.close(); apm = new acpi_status(); } else { #ifdef IBAM_DEBUG cout << "using apm" << endl; #endif apm = new apm_status(); } home = data_path; ifstream in((home+"/ibam.rc").c_str()); string saveversion; in >> saveversion; double dummy; if(saveversion==string("0.3")) { in >> lasttime >> lastpercent >> lastratio >> laststatus >> dummy >> dummy >> profile_logging >> profile_number >> profile_active; data_changed=1; } if(saveversion==IBAM_VERSION) in >> lasttime >> lastpercent >> lastratio >> lastratiocount >> laststatus >> profile_logging >> profile_number >> profile_active; else data_changed=1; // force update in.close(); currentpercent=apm->percent(); if(currentpercent!=-1) isvalid=1; currentstatus=apm->onBattery()?1:apm->charging()?2:0; if(currentstatus!=laststatus) { lastratio=1; lastratiocount=1; } } inline void ibam::update(void) { save(); apm->update(); currenttime=time(NULL); currentpercent=apm->percent(); if(currentpercent!=-1) isvalid=1; else isvalid=0; currentstatus=apm->onBattery()?1:apm->charging()?2:0; if(currentstatus!=laststatus) { lastratio=1; lastratiocount=1; } } inline int ibam::valid(void) const { return isvalid; } inline void ibam::import(void) { { ifstream in(".ibam.battery.rc"); battery.import(in); battery_changed=1; } { ifstream in(".ibam.charge.rc"); charge.import(in); charge_changed=1; } } inline void ibam::load_battery(void) { if(!battery_loaded) { ifstream in((home+"/battery.rc").c_str()); in >> battery; battery_loaded=1; } } inline void ibam::load_charge(void) { if(!charge_loaded) { ifstream in((home+"/charge.rc").c_str()); in >> charge; charge_loaded=1; } } inline void ibam::update_statistics(void) { if(currentstatus==laststatus && currenttime-lasttime=IBAM_MINIMAL_SECONDS_PER_PERCENT && sec_per_min<=IBAM_MAXIMAL_SECONDS_PER_PERCENT) { int i; last_sec_per_min=sec_per_min; last_sec_per_min_prediction=last_av; profile_changed=1; if(lastpercent-currentpercent>lastratiocount) lastratiocount=(lastpercent-currentpercent); for(i=currentpercent;i<=lastpercent;i++) { if(lastratiocount>2 || lastpercent==100) // Don't trust the first lastratio=(lastratio*lastratiocount+battery.add_data(i,sec_per_min))/(lastratiocount+1); lastratiocount++; } battery_changed=1; data_changed=1; } } else if(currentpercent>lastpercent) // strange data { data_changed=1; // discard if(profile_logging && profile_active) profile_number++; profile_active=0; } break; case 2: // charging if(currentpercent>lastpercent) { load_charge(); double sec_per_min; sec_per_min=(currenttime-lasttime)/double(currentpercent-lastpercent); double last_av=charge.average(lastpercent,currentpercent); if(sec_per_min<=IBAM_MAXIMAL_SECONDS_PER_PERCENT && sec_per_min>=IBAM_MINIMAL_SECONDS_PER_PERCENT) { int i; last_sec_per_min=sec_per_min; last_sec_per_min_prediction=last_av; profile_changed=1; if(currentpercent-lastpercent>lastratiocount) lastratiocount=(currentpercent-lastpercent); for(i=lastpercent;i<=currentpercent;i++) { if(lastratiocount>2) // Don't trust the first lastratio=(lastratio*lastratiocount+1./charge.add_data(i,sec_per_min))/(lastratiocount+1); lastratiocount++; } charge_changed=1; data_changed=1; } } else if(currentpercentseconds(); } inline int ibam::seconds_left_battery(void) { load_battery(); return int(battery.remain(currentpercent)+.5); } inline int ibam::seconds_left_battery_adaptive(void) { load_battery(); return int(battery.remain(currentpercent)*lastratio+.5); } inline int ibam::percent_battery_bios(void) { return apm->percent(); } inline int ibam::percent_battery(void) { load_battery(); return int((100.*seconds_left_battery())/battery.total()+.5); } inline int ibam::seconds_left_charge(void) { load_charge(); return int(charge.inverted_remain(currentpercent)+.5); } inline int ibam::seconds_left_charge_adaptive(void) { load_charge(); return int(charge.inverted_remain(currentpercent)/lastratio+.5); } inline int ibam::percent_charge(void) { load_charge(); return 100-int((100.*seconds_left_charge())/charge.total()+.5); } inline int ibam::seconds_battery_total(void) { load_battery(); return int(battery.total()+.5); } inline int ibam::seconds_battery_total_adaptive(void){ load_battery(); return int(battery.total()*lastratio+.5); } inline int ibam::seconds_charge_total(void) { load_charge(); return int(charge.total()+.5); } inline int ibam::seconds_charge_total_adaptive(void) { load_charge(); return int(charge.total()/lastratio+.5); } inline int ibam::seconds_battery_correction(void) { if(currentstatus!=laststatus || currentstatus==0 || lastpercent!=currentpercent) return 0; if(currentstatus==1) return lasttime-currenttime; load_battery(); load_charge(); return int((currenttime-lasttime)*(battery.average(currentpercent-1,currentpercent+1)/charge.average(currentpercent-1,currentpercent+1))+.5); } inline int ibam::seconds_charge_correction(void) { if(currentstatus!=laststatus || currentstatus==0 || lastpercent!=currentpercent) return 0; if(currentstatus==2) return lasttime-currenttime; load_battery(); load_charge(); return int((currenttime-lasttime)/(battery.average(currentpercent-1,currentpercent+1)/charge.average(currentpercent-1,currentpercent+1))+.5); } inline int ibam::onBattery(void) { return apm->onBattery(); } inline int ibam::charging(void) { return apm->charging(); } inline double percent_data::average_derivation(int a,int b) // average standard derivation from a to b { if(a>b) { int c=a;a=b;b=c; } if(a<0) { a=0; if(b<0) b=0; } if(b>=maxpercents) { b=maxpercents-1; if(a>=maxpercents) a=b; } int i; double su(0); int co(0); for(i=a;i<=b;i++) { if(time_samples[i]) { if(time_deriv_for_percent[i]>0) su+=sqrt(time_deriv_for_percent[i])*time_samples[i]; co+=time_samples[i]; } } if(co) return (su/co); int gotdata=0; for(a--,b++;(a>0 || b=maxpercents) b=maxpercents-1; if(time_deriv_for_percent[a]>0 && time_samples[a]) su+=sqrt(time_deriv_for_percent[a])*time_samples[a]; if(time_deriv_for_percent[b]>0 && time_samples[b]) su+=sqrt(time_deriv_for_percent[b])*time_samples[b]; co+=time_samples[a]+time_samples[b]; if(time_samples[a] || time_samples[b]) gotdata++; } if(co) return (su/co); return 20; } pbbuttonsd-0.8.1a/src/module_pmac.c0000644000175000017500000015102210641705155014213 00000000000000/** * @brief Hardware abstraction layer for PMU based machines * * This module contains all hardware related functions for PMU based * machines that are used by the high level logic modules to do their * job. * * This module is needed for all powerpc based Apple PowerBooks and * iBooks. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/module_pmac.c * @author Matthias Grimm */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include "pbbinput.h" #include #include #include #include #include #include "gettext_macros.h" #include "input_manager.h" #include "class_config.h" #include "module_pmac.h" #include "support.h" #ifdef WITH_PMUD # include "tcp.h" #endif #include "debug.h" #define TRACKPAD_PAUSETIME 6 /* time in 1/100 of a second */ #define SECTION "MODULE PMAC" struct moddata_pmac { char *pmudev; /* pathname of the PMU device */ int fd_pmu; /* filehandle of the PMU device */ char *adbdev; /* pathname of the ADB device */ int fd_adb; /* filehandle of ADB device */ GString *i2cdev; /* pathname of the I2C device with ambient sensor and KBD illu */ GString *identity; /* Identity string of this laptop */ int version; /* PMU version */ int machine; /* OpenFirmware machine code */ int lmuaddr; /* i2c address of LMU Controller */ struct modflags_pmac flags; int flagschanged; /* PMU flags that have changed recently */ int oharevolbutton; /* level of volume button on OHARE PBs scaled to 0..100 */ int oharebrightbutton; /* level of brightness button on OHARE PBs scaled to 0..15 */ int charge[MAX_BATTERIES]; /* current battery charge */ int chargemax[MAX_BATTERIES]; /* max battery charge */ int current[MAX_BATTERIES]; /* electrical currrent out of the batteries */ int voltage[MAX_BATTERIES]; /* current battery voltage */ int timeleft; /* time until battery runs out of fuel. This value is low pass filtered to reduce fast signal fluctuation This filter doesn't reduce accuracy. */ unsigned short keytpmodeup; /* trackpad control values */ unsigned short modtpmodeup; unsigned short keytpmodedn; unsigned short modtpmodedn; int trackpad_mode; int trackpad_pause; /* trackpad switch-off timeout */ int keyboard_mode; /* keyboard mode for recent keyboards (0xC[0..4]) */ int batlog_mode; int batlog_cycle; #if defined(DEBUG) && SIMU_AMBIENT int ambient; #endif } modbase_pmac; static const char *TPModeList[] = { "notap", "tap", "drag", "lock", NULL }; static const char *KBDModeList[] = { "disabled", "fkeyslast", "fkeysfirst", NULL }; static const char *BatlogModeList[] = { "none", "cycle", "log", NULL }; /** * @brief Initalizes the module pmac * * This function initializes the module pmac. The data structure will * be initialized and the hardware status is read. * * Immideately after this initialisation the module is able to and * will answer upon requests. * * @return error code, zero if the module is ready to operate */ int pmac_init () { struct moddata_pmac *base = &modbase_pmac; long DUMMY = 0; int val, rc; base->i2cdev = g_string_new(NULL); base->identity = g_string_new(NULL); base->fd_pmu = -1; base->fd_adb = -1; base->trackpad_pause = 0; base->batlog_cycle = -1; /* cycle invalid */ base->timeleft = -1; base->machine = 0; #if defined(DEBUG) && SIMU_AMBIENT base->ambient = 0; #endif base->flags.coveropen = 1; /* lid is open */ base->flags.sleepsupported = 0; /* sleep not supported by default */ base->flags.set_kbdmode = 0; /* request flags for delayed actions */ base->flags.goto_sleep = 0; /* / */ base->pmudev = config_get_string (SECTION, "Device_PMU", DEFAULT_PMU); base->adbdev = config_get_string (SECTION, "Device_ADB", DEFAULT_ADB); base->keytpmodeup = config_get_keycode (SECTION, "TPModeUpKey", KEY_BRIGHTNESSUP); base->modtpmodeup = config_get_modmask (SECTION, "TPModeUpKey", MOD_ALT); base->keytpmodedn = config_get_keycode (SECTION, "TPModeDownKey", KEY_BRIGHTNESSDOWN); base->modtpmodedn = config_get_modmask (SECTION, "TPModeDownKey", MOD_ALT); base->batlog_mode = config_get_option (SECTION, "Batlog", BatlogModeList, BATLOG_NONE); base->flags.notap_typing = config_get_boolean (SECTION, "NoTapTyping", FALSE); if ((rc = check_path (base->pmudev, TYPE_CHARDEV, CPFLG_NONE)) == 0) { if ((base->fd_pmu = open(base->pmudev, O_RDWR)) < 0) { print_msg (PBB_ERR, _("Can't open PMU device %s: %s\n"), base->pmudev, strerror(errno)); return E_OPEN; } } else return rc; if ((rc = check_path (base->adbdev, TYPE_CHARDEV, CPFLG_NONE)) == 0) { if ((base->fd_adb = open(base->adbdev, O_RDWR)) < 0) { print_msg (PBB_ERR, _("Can't open ADB device %s: %s\n"), base->adbdev, strerror(errno)); return E_OPEN; } } else return rc; base->version = get_pmu_version(base->fd_adb); base->machine = getMachineID (base->version); g_string_printf (base->identity, "%s - PMU version: %d", getMachineName(base->machine), base->version); /* check if sleep is supported on this system */ ioctl(base->fd_pmu, PMU_IOC_CAN_SLEEP, &val); base->flags.sleepsupported = val == 1 ? 1 : 0; /* If this PowerBook has an ambient light sensor connected * to the I2C bus, search for the device and save name and * bus address */ if ((base->lmuaddr = getLMUAddress()) != 0) g_string_assign (base->i2cdev, findLMUDevice(base->lmuaddr)); pmac_update_flags (); pmac_update_batteryinfo (); base->flagschanged = 0; #ifdef DEBUG print_msg (PBB_INFO, "DBG: Machine: %0x\n", base->machine); print_msg (PBB_INFO, "DBG: Keyboard: %s\n", base->machine > 1 ? haveADBKeyboard () ? "ADB" : "USB" : "ADB (without config)"); print_msg (PBB_INFO, "DBG: Trackpad: %s\n", haveADBTrackpad () ? "ADB" : "USB"); print_msg (PBB_INFO, "DBG: Ambient: %s\n", haveI2CAmbient () ? "I2C" : havePMUAmbient () ? "PMU" : "None"); #endif #ifdef WITH_PMUD print_msg (PBB_INFO, _("pmud support compiled in and active.\n")); #endif base->trackpad_mode = config_get_option (SECTION, "TPMode", TPModeList, trackpad_get_config()); trackpad_set_config(base->trackpad_mode); /* set configured trackpad mode */ base->keyboard_mode = config_get_option (SECTION, "KBDMode", KBDModeList, keyboard_get_config()); keyboard_set_config(base->keyboard_mode); /* set configured keyboard mode */ if (base->version != OHARE_PMU) { /* If the kernel has been compiled with CONFIG_PMAC_BACKLIGHT_LEGACY * the following ioctl is needed to disable the ancient backlight * control of the kernel. Otherwise the new sysfs interface to the * backlight will not work correctly on PowerBooks. * The ioctl doesn't matter if the PMU backlight driver is used or * the kernel legacy code was not compiled in. * Because this is a PowerBook speciality the ioctl is called here and * not in the sysfs backlight driver. */ ioctl(base->fd_pmu, PMU_IOC_GRAB_BACKLIGHT, &DUMMY); } if ((addInputSource (base->fd_pmu, pmac_pmu_handler, NULL, FALSE)) == NULL) print_msg (PBB_WARN, _("Can't install PMU input handler. Some functionality may be missing.\n")); /* register keyboard handler for trackpad control only if we have an ADB trackpad */ if (haveADBTrackpad ()) register_function (KBDQUEUE, pmac_keyboard); register_function (MOUSEQUEUE, pmac_mouse); register_function (T100QUEUE, pmac_timer100); register_function (T1000QUEUE, pmac_timer1000); register_function (SECUREQUEUE, pmac_secure); register_function (QUERYQUEUE, pmac_query); register_function (CONFIGQUEUE, pmac_configure); return 0; } /** * @brief Frees all ressources allocated from module pmac * * This function is usually called on program termination. It * frees all allocated ressources and closes all open file * handles. * * @return always zero */ void pmac_exit () { struct moddata_pmac *base = &modbase_pmac; batlog_save(); /* save batlog info to disc */ if (base->fd_pmu != -1) close (base->fd_pmu); /* close PMU device */ if (base->fd_adb != -1) close (base->fd_adb); /* close ADB device */ g_free (base->pmudev); g_free (base->adbdev); g_string_free (base->identity, TRUE); g_string_free (base->i2cdev, TRUE); } void pmac_keyboard (struct tagitem *taglist) { struct moddata_pmac *base = &modbase_pmac; int code, value, mod; code = (int) tagfind (taglist, TAG_KEYCODE, 0); value = (int) tagfind (taglist, TAG_KEYREPEAT, 0); mod = (int) tagfind (taglist, TAG_MODIFIER, 0); if (value == 1 || value == 2) { /* trackpad tapping control * the left mouse button must be filtered out because it will * break NoTapTyping. The Trackpad will emulate a left mouse * button which causes that 'tapping' will be disabled. The * event system received a 'mouse button down' but a 'mouse * button up' will never be seen. This leads to a weird * trackpad behaviour. */ if (code != BTN_LEFT && !isModifier (code, mod) && base->flags.notap_typing) { if (base->trackpad_pause == 0) { trackpad_set_config(TRACKPAD_NOTAP); #if defined(DEBUG) && TRACKPAD printf ("Trackpad tapping disabled\r"); fflush (stdout); #endif } base->trackpad_pause = TRACKPAD_PAUSETIME; } } if (value == 1) { /* trackpad mode keys */ if ((code == base->keytpmodeup) && (mod == base->modtpmodeup)) { if (++base->trackpad_mode > TRACKPAD_LAST) base->trackpad_mode = 0; } else if ((code == base->keytpmodedn) && (mod == base->modtpmodedn)) { if (--base->trackpad_mode < 0) base->trackpad_mode = TRACKPAD_LAST; } else return; trackpad_set_config(base->trackpad_mode); singletag_to_clients (CHANGEVALUE, TAG_TPMODE, base->trackpad_mode); } } void pmac_mouse (struct tagitem *taglist) { struct moddata_pmac *base = &modbase_pmac; /* trackpad tapping control */ if (base->trackpad_pause) { base->trackpad_pause = 0; trackpad_set_config(base->trackpad_mode); #if defined(DEBUG) && TRACKPAD printf ("Trackpad tapping enabled \r"); fflush (stdout); #endif } } /* This function is called when the user is idle. That means no key is pressed */ void pmac_secure (struct tagitem *taglist) { struct moddata_pmac *base = &modbase_pmac; if (base->flags.set_kbdmode == 1) { base->flags.set_kbdmode = 0; keyboard_set_config(base->keyboard_mode); } else if (base->flags.goto_sleep == 1) { base->flags.goto_sleep = 0; if (base->flags.sleepsupported) { batlog_save(); process_queue_single (CONFIGQUEUE, TAG_PREPAREFORSLEEP, 0); #ifdef WITH_PMUD activate_sleepmode (); base->flagschanged = pmac_update_flags (); #else do { activate_sleepmode (); base->flagschanged = pmac_update_flags (); } while (base->flags.coveropen == 0); #endif base->timeleft = 7200; /* reset time value so that the */ /* filter approximate the real value from top. Otherwise */ /* an errornous battery warnlevel could be sent to */ /* clients because the filtered value doesn't cross the */ /* thresholds quick enough. This problem occours only */ /* after wakeup on battery after the battery had been */ /* recharged during sleep. */ pmac_update_batteryinfo (); process_queue_single (CONFIGQUEUE, TAG_WAKEUPFROMSLEEP, 0); base->batlog_cycle = batlog_setup(); } } } void pmac_query (struct tagitem *taglist) { pmac_handle_tags (MODE_QUERY, taglist); } void pmac_configure (struct tagitem *taglist) { pmac_handle_tags (MODE_CONFIG, taglist); } void pmac_handle_tags (int cfgure, struct tagitem *taglist) { struct moddata_pmac *base = &modbase_pmac; int err; while (taglist->tag != TAG_END) { switch (taglist->tag) { case TAG_REINIT: /* system tag */ trackpad_set_config(base->trackpad_mode); base->flags.set_kbdmode = 1; /* reset keyboard mode */ break; case TAG_PMUDEVICE: if (cfgure) { if ((err = check_path ((char *) taglist->data, TYPE_CHARDEV, CPFLG_NONE))) tagerror (taglist, err); else { replace_string (&base->pmudev, (char *) taglist->data); config_set_string (SECTION, "Device_PMU", base->pmudev); } } else taglist->data = (long) base->pmudev; break; case TAG_ADBDEVICE: if (cfgure) { if ((err = check_path ((char *) taglist->data, TYPE_CHARDEV, CPFLG_NONE))) tagerror (taglist, err); else { replace_string (&base->adbdev, (char *) taglist->data); config_set_string (SECTION, "Device_ADB", base->adbdev); } } else taglist->data = (long) base->adbdev; break; case TAG_TPMODEUPKEY: if (cfgure) { base->keytpmodeup = taglist->data; config_set_keymod (SECTION, "TPModeUpKey", taglist->data, base->modtpmodeup); } else taglist->data = base->keytpmodeup; break; case TAG_TPMODEUPMOD: if (cfgure) { base->modtpmodeup = taglist->data; config_set_keymod (SECTION, "TPModeUpKey", base->keytpmodeup, taglist->data); } else taglist->data = base->modtpmodeup; break; case TAG_TPMODEDOWNKEY: if (cfgure) { base->keytpmodedn = taglist->data; config_set_keymod (SECTION, "TPModeDownKey", taglist->data, base->modtpmodedn); } else taglist->data = base->keytpmodedn; break; case TAG_TPMODEDOWNMOD: if (cfgure) { base->modtpmodedn = taglist->data; config_set_keymod (SECTION, "TPModeDownKey", base->keytpmodedn, taglist->data); } else taglist->data = base->modtpmodedn; break; case TAG_TPMODE: if (cfgure) { base->trackpad_mode = taglist->data > TRACKPAD_LAST ? 0 : taglist->data; trackpad_set_config(base->trackpad_mode); config_set_option (SECTION, "TPMode", TPModeList, base->trackpad_mode); singletag_to_clients (CHANGEVALUE, TAG_TPMODE, base->trackpad_mode); } else taglist->data = base->trackpad_mode; break; case TAG_NOTAPTYPING: if (cfgure) { base->flags.notap_typing = taglist->data & 1; config_set_boolean (SECTION, "NoTapTyping", base->flags.notap_typing); } else taglist->data = base->flags.notap_typing; break; case TAG_KBDMODE: if (cfgure) { if (base->version != OHARE_PMU) { base->keyboard_mode = taglist->data > KEYBOARD_LAST ? 0 : taglist->data; if (haveADBKeyboard() && !taglist->data) { print_msg (PBB_WARN, _("ADB keyboard can't disable fnmode, force mode to 'fkeyslast'.\n")); base->keyboard_mode = KEYBOARD_FNBACK; } config_set_option (SECTION, "KBDMode", KBDModeList, base->keyboard_mode); base->flags.set_kbdmode = 1; /* request a secure function call */ } } else taglist->data = base->keyboard_mode; break; case TAG_BATLOG: if (cfgure) { batlog_save(); base->batlog_mode = taglist->data > BATLOG_LAST ? 0 : taglist->data; base->batlog_cycle = batlog_setup(); config_set_option (SECTION, "Batlog", BatlogModeList, base->batlog_mode); } else taglist->data = base->batlog_mode; break; case TAG_BATCYCLE: if (cfgure) tagerror(taglist, E_NOWRITE); else taglist->data = base->batlog_cycle; break; case TAG_REQUESTSLEEP: /* private tag */ if (cfgure) base->flags.goto_sleep = 1; /* trigger delayed sleep */ break; case TAG_IDENTITY: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = (long) base->identity->str; break; case TAG_SLEEPSUPPORTED: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = base->flags.sleepsupported; break; #ifndef WITH_IBAM case TAG_TIMEREMAINING: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = base->timeleft; break; #endif case TAG_POWERSOURCE: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = base->flags.ac_power; break; case TAG_BATTERYPRESENT: if (cfgure) tagerror (taglist, E_NOWRITE); /* /proc/pmu is not reliable on machines with removable batteries. * If no batteries were plugged in, /proc/pmu would not be updated * anymore and contains the last battery data, which is not valid * anymore. * So pbbuttonsd ask the PMU for the existance of any battery and * report the values from /proc/pmu only if the answer was yes. */ else taglist->data = base->flags.batpresent ? base->flags.bat_present : 0; break; case TAG_AMBIENTLIGHT: if (!haveI2CAmbient() && !havePMUAmbient()) tagerror (taglist, E_NOSUPPORT); else if (cfgure) #if defined(DEBUG) && SIMU_AMBIENT base->ambient = taglist->data; #else tagerror (taglist, E_NOWRITE); #endif else taglist->data = getRawAmbient(); break; case TAG_AMBIENTLIGHTMAX: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = haveI2CAmbient() ? 1600 : 2048; break; case TAG_KEYBLIGHTLEVEL: /* private tag */ if (cfgure) setKBDIllumination (taglist->data); break; case TAG_KEYBLIGHTMAX: /* private tag */ if (cfgure) ; else taglist->data = KEYBLIGHTMAX; break; case TAG_SYSINFOSLAVE: if (cfgure) ; else { if (base->version != OHARE_PMU) taglist->data |= haveADBKeyboard () ? 0 : SYSINFO_PB_USB_KBD; taglist->data |= haveADBTrackpad () ? 0 : SYSINFO_PB_USB_TPAD; } } taglist++; } } gboolean pmac_pmu_handler (int fd, gpointer user_data) { unsigned char intr[16]; struct tagitem taglist[4]; int n; static int PBpressed = 0; #if defined(DEBUG) && PMUINTR int i; #endif if ((n = read(fd, intr, sizeof(intr))) > 0) { switch (intr[0]) { case 4: if (n < 3 || intr[2] < 1 || intr[2] > 2) break; call_script ("/sbin/cardctl %s %d", "eject", intr[2]-1); break; case 0x40: /* timer interrupt */ /* no battery present -> no timer interrupts on G3 Pismo*/ /* n = 2 && intr[1] = 0x04 = %00100 std timer interrupt */ /* n = 2 && intr[1] = 0x14 = %10100 if a battery is present */ /* n = 2 && intr[1] = 0x0c = %01100 power button on mac-mini */ /* n = 6 && intr[1] = 0x1c = %11100 if power button is pressed */ /* n = 6 && intr[1] = 0x15 = %10101 after cover close */ if (n == 6 && ((intr[1] >> 3) & 1) != PBpressed) { PBpressed = (intr[1] >> 3) & 1; taglist_init (taglist); taglist_add (taglist, TAG_KEYCODE, KEY_POWER); taglist_add (taglist, TAG_KEYREPEAT, PBpressed ? 1 : 0); taglist_add (taglist, TAG_MODIFIER, 0); process_queue (KBDQUEUE, taglist); } break; } #if defined(DEBUG) && PMUINTR printf ("\nPMU interrupt: "); for (i=0; i < n; i++) printf ("%.2x ", intr[i]); printf ("\n"); #endif } return TRUE; /* we assume that the filehandle for /dev/pmu can't be closed from outside pbbuttonsd */ } void pmac_timer100 (struct tagitem *taglist) { struct moddata_pmac *base = &modbase_pmac; struct tagitem args[6]; int val; taglist_init (args); if (base->version == OHARE_PMU) { /* PowerBook 3400, etc */ if ((val = get_button(base->fd_adb, PMU_GET_VOLBUTTON)) >= 0) { val = val > 64 ? 100 : val * 100 / 64; if (base->oharevolbutton != val) { base->oharevolbutton = val; taglist_add (args, TAG_VOLUME, val); } } if ((val = get_button(base->fd_adb, 0x49)) >= 0) { val = 18 - (val >> 2); /* This formula was derived for the usual pmac backlights */ if (val > 15) val = 15; /* which uses 16 brightness steps. 0=min, 15=max */ if (val < 0) val = 0; if (base->oharebrightbutton != val) { base->oharebrightbutton = val; taglist_add (args, TAG_LCDBRIGHTNESS, val); } } } /* trackpad tapping control */ if (base->trackpad_pause) { if ((--base->trackpad_pause) == 0) { trackpad_set_config(base->trackpad_mode); #if defined(DEBUG) && TRACKPAD printf ("Trackpad tapping enabled \r"); fflush (stdout); #endif } } if (args[0].tag != TAG_END) process_queue (CONFIGQUEUE, args); /* distribute changes to other modules */ } void pmac_timer1000 (struct tagitem *taglist) { struct moddata_pmac *base = &modbase_pmac; struct tagitem args[6]; int val; taglist_init (args); val = base->timeleft; if (base->flagschanged == 0) /* check if anybody else has already read the flags */ base->flagschanged = pmac_update_flags (); /* if not, get ac power and cover status */ pmac_update_batteryinfo (); #ifndef WITH_PMUD /* The COVERSTATUS must be sent before POWERCHANGED because the * POWERCHANGED code in module_powersave.c rely on the correct * cover status. */ if (base->flagschanged & PMU_ENV_LID_CLOSED) taglist_add (args, TAG_COVERSTATUS, base->flags.coveropen); #endif if (base->flagschanged & PMU_ENV_AC_POWER) { taglist_add (args, TAG_POWERCHANGED, base->flags.ac_power); if (!base->flags.ac_power) /* running on Battery */ base->batlog_cycle++; /* then increase cycle */ } if (val != base->timeleft && !base->flags.ac_power) { #ifndef WITH_IBAM taglist_add (args, TAG_TIMECHANGED, base->timeleft); #endif batlog_write(base->timeleft); } if (args[0].tag != TAG_END) process_queue (CONFIGQUEUE, args); /* distribute changes to other modules */ base->flagschanged = 0; } /* ------------------------------- MISCELLANEOUS FUNCTIONS ----------------------------------- */ /* This function put the machine into sleep mode. It tries pmud first. If it was not available, it would go directly over the PMU. Very importent is, that no modifier key is pressed, when this function is called, because this would confuse the input driver after wakeup. This case is not fully avoided, because this function is not atomic and with some fast actions the user could bypass our security gate. The second point is that current states of the trackpad and the keyboard will only stored locally. This will normally have no side effects but the global variables base->trackpad_mode and base->keyboard-mode won't be synchronized with the hardware here anymore. So the states set by external programs will survive sleep but also will be overwritten as soon as pbbuttonsd access one of the devices. */ void activate_sleepmode () { struct moddata_pmac *base = &modbase_pmac; int tpmode, kbdmode = 0; #ifdef WITH_PMUD char buf[35]; int fd; #endif tpmode = trackpad_get_config (); kbdmode = keyboard_get_config (); sync(); #ifndef WITH_PMUD /* PMU_IOC_SLEEP only succeeds if called as root. * It returns immediatly if not, without putting * the mashine to sleep */ ioctl (base->fd_pmu, PMU_IOC_SLEEP, 0); /* returns after next awake */ trackpad_set_config(tpmode); #else if (((fd = tcp_open("localhost", "pmud", 879)) < 0)) { print_msg (PBB_WARN, _("Can't find pmud on port 879. Trigger PMU directly for sleep.\n")); ioctl (base->fd_pmu, PMU_IOC_SLEEP, 0); /* returns after next awake */ trackpad_set_config(tpmode); } else { tcp_printf(fd, "sleep\n"); /* read some bytes, in order to prevent pmud complaining about * dropped connections, before ever handling the 'sleep' command */ tcp_printf(fd, "\n"); sleep(6); /* give pmud time to snooze */ tcp_read(fd, buf, sizeof(buf)); tcp_close(fd); } #endif keyboard_set_config(kbdmode); } /* This function gets the battery status from the PMU kernel driver via * /proc/pmu and fill all battery slots of moddata struct, also if less * batteries are present.The following flags were set accordingly: * ac_power, bat_present and charging. */ void pmac_update_batteryinfo () { struct moddata_pmac *base = &modbase_pmac; FILE *fd; char buffer[100], *token; int val, n, syscurrent, time_rem = 0; int charge, chargemax, current, voltage, timeleft[MAX_BATTERIES]; syscurrent = 0; for (n=0; n < MAX_BATTERIES; n++) { charge = chargemax = current = voltage = timeleft[n] = 0; base->flags.bat_present &= ~(1<flags.bat_present |= (val & 1) << n; base->flags.bat_charging = (base->flags.bat_charging & ~(1<> 1) << n); } else if (!strncmp ("charge", token, 6)) { charge = atoi(strtok(0, ":\n")); } else if (!strncmp ("max_charge", token, 9)) { chargemax = atoi (strtok(0,":\n")); } else if (!strncmp ("current", token, 7)) { current = atoi (strtok(0, ":\n")); } else if (!strncmp ("voltage", token, 7)) { voltage = atoi (strtok(0,":\n")); } else if (!strncmp ("time rem.", token, 8)) { timeleft[n] = atoi (strtok(0, ":\n")); } else strtok (0,":\n"); } } fclose(fd); } base->charge[n] = charge; base->chargemax[n] = chargemax; base->voltage[n] = voltage; syscurrent += base->current[n] = current; /* overall current out of the batteries */ } /* work around for kernel bug: After booting without batteries the kernel doesn't recognise the ac plug and thought by mistake the computer runs on batteries but there were no batteries connected. So we check for batteries here and if none were found it would have to be AC. */ if (!base->flags.ac_power && !base->flags.bat_present) base->flags.ac_power = 1; /* During plug and unplug of the AC connector it could happen that the pmu time remaining temporarely is set to zero. In this case we freeze the timeleft and wait until the pmu time remaining value returns to a valid value */ if (syscurrent < 0) { /* computer runs on battery */ for (n=0; n < MAX_BATTERIES; n++) { if ((timeleft[n] > 0) || (base->charge[n] == 0)) /* is /proc/pmu reliable ? */ time_rem += timeleft[n]; /* then use it */ else if (base->version == OHARE_PMU) /* otherwise calculate it by yourself */ time_rem += base->charge[n] * 274 / (-syscurrent); /* formula for old Notebooks */ else time_rem += base->charge[n] * 3600 / (-syscurrent); /* formula for modern Notebools */ } } else time_rem = -1; if (time_rem != -1) { if (base->timeleft >= 0) time_rem = base->timeleft + (time_rem - base->timeleft) / 8; /* very simple low pass filter */ base->timeleft = time_rem; } } /* use /proc/pmu/info as fallback, if PMU_GET_COVER did't work * As I know this has not happend yet and it is doubtable that * /proc/pmu/info will work correctly in this case. So this * routine may be removed in future versions. */ int pmac_get_procac () { FILE *fd; char buffer[100], *token; int ac = 0; /* return battery if anything fails */ if ((fd = fopen ("/proc/pmu/info","r"))) { while (fgets (buffer, sizeof (buffer), fd)) if ((token = strtok (buffer,":\n"))) { if (!strncmp ("AC Power", token, 8)) ac = atoi (strtok(0,":\n")); else strtok (0,":\n"); } fclose(fd); } return ac; } /* This funtion gets some important flags from the PMU driver. If the * driver doesn't support the ioctl or reports an error, power source * will be read from /proc/pmu/info as fallback, so that power source * should always be set correctly. */ int pmac_update_flags() { struct moddata_pmac *base = &modbase_pmac; int env, envold, envnew; envold = base->flags.ac_power ? PMU_ENV_AC_POWER : 0; envold |= base->flags.coveropen ? PMU_ENV_LID_CLOSED : 0; env = get_int_environment(base->fd_adb); if (env != -1) { base->flags.coveropen = (env & PMU_ENV_LID_CLOSED) ? 0 : 1; base->flags.ac_power = (env & PMU_ENV_AC_POWER) ? 1 : 0; base->flags.batpresent = (env & PMU_ENV_BATTERY_PRESENT) ? 1 : 0; } else base->flags.ac_power = pmac_get_procac(); /* the PB G3 lombard PMU doesn't support the AC power flag in * environment flags. We use the /proc entry instead. */ if (base->version < 12) base->flags.ac_power = pmac_get_procac(); envnew = base->flags.ac_power ? PMU_ENV_AC_POWER : 0; envnew |= base->flags.coveropen ? PMU_ENV_LID_CLOSED : 0; return (envold ^ envnew); } /* ---------------------------- GENERIC FUNCTIONS ----------------------------- */ int isModifier (int code, int mod) { if (mod) { switch (code) { case KEY_LEFTCTRL: case KEY_LEFTALT: case KEY_LEFTSHIFT: case KEY_LEFTMETA: case KEY_RIGHTCTRL: case KEY_RIGHTALT: case KEY_RIGHTSHIFT: case KEY_RIGHTMETA: case KEY_COMPOSE: case KEY_CAPSLOCK: case KEY_NUMLOCK: case KEY_SCROLLLOCK: return 1; /* key is modifier */ } } return 0; /* key is not a modifier */ } /** * @brief Checks if the PowerBook has an ADB keyboard * * This function uses the machine id to determine if the PowerBook * has an ABD keyboard or not. * * Very early PowerBooks doesn't have a machine code. On those * machines a pseude machine code is calculated from the PMU * version. PMU version 9 results in a machine code of 01, 10 in * 02 and 11 in 03. * * PowerBooks with OHARE PMU (version 9) were reported not to support * keyboard configuration. Despite of having an ADB keyboard, this * function reports FALSE for OHARE based PowerBooks. Pbbuttonsd will * think a OHARE based PowerBook has an USB keyboard, but this has no * consequences because the appropriate file in /sys are not availabe. * * @return TRUE, if the PowerBook has an ADB keyboard or * FALSE otherwise. */ int haveADBKeyboard () { struct moddata_pmac *base = &modbase_pmac; if (base->machine > 1) { if (base->machine < 0x56) /* 0 - 56 -> true */ return 1; if (base->machine > 0x67) /* 68 - ?? -> false */ return 0; if (((base->machine >> 4) & 0xf) == 5) if (base->machine >= 0x56) /* 56 - 5f -> false */ return 0; if (((base->machine >> 4) & 0xf) == 6) if (base->machine <= 0x67) /* 60 - 67 -> true */ return 1; } return 0; } /** * @brief Checks if the PowerBook has an ADB Trackpad * * This function uses the machine id to determine if the PowerBook * has an ABD trackpad or not. * * Very early PowerBooks doesn't have a machine code. On those * machines a pseude machine code is calculated from the PMU * version. PMU version 9 results in a machine code of 01, 10 in * 02 and 11 in 03. * * @return TRUE, if the PowerBook has an ADB trackpad or * FALSE otherwise. */ int haveADBTrackpad () { struct moddata_pmac *base = &modbase_pmac; if (base->machine > 0) { if (base->machine < 0x56) /* 1 - 55 -> true */ return 1; if (base->machine > 0x67) /* 68 - ?? -> false */ return 0; if (((base->machine >> 4) & 0xf) == 5) if (base->machine >= 0x56) /* 56 - 5f -> false */ return 0; if (((base->machine >> 4) & 0xf) == 6) if (base->machine <= 0x67) /* 60 - 67 -> true */ return 1; } return 0; } int haveI2CAmbient () { struct moddata_pmac *base = &modbase_pmac; #if defined(DEBUG) && SIMU_AMBIENT return 1; #endif if ((base->machine >= 0x51) && (base->machine <= 0x57)) if (base->lmuaddr != 0 && base->i2cdev->len > 0) return 1; return 0; } int havePMUAmbient () { struct moddata_pmac *base = &modbase_pmac; if ((base->machine >= 0x58) && (base->machine <= 0x59)) return 1; return 0; } /* ------------------ POWER MAC SPECIFIC KEYBOARD FUNCTIONS ------------------- */ int keyboard_get_config () { struct moddata_pmac *base = &modbase_pmac; unsigned char ADBBuffer[ADB_BUFSIZE]; int fd, n, dev, config = -1; if (haveADBKeyboard()) { if ((dev = keyboard_get_dev (base->fd_adb)) > 0) { if ((n = adb_read_reg (base->fd_adb, ADBBuffer, dev, 1)) > 0) { config = ADBBuffer[3] & 0x01 ? KEYBOARD_FNTOP : KEYBOARD_FNBACK; } } } else { if ((fd = open ("/sys/module/usbhid/parameters/pb_fnmode", O_RDONLY)) < 0) fd = open ("/sys/module/hid/parameters/pb_fnmode", O_RDONLY); if (fd >= 0) { if ((n = read (fd, ADBBuffer, ADB_BUFSIZE-1)) > 0) { ADBBuffer[n] = 0; /* terminate read buffer */ config = atoi((const char*)ADBBuffer); #ifdef DEBUG printf ("DBG: Keyboard config read: '%s' -> %d.\n", ADBBuffer, config); #endif } close (fd); } } return config; } void keyboard_set_config (int config) { struct moddata_pmac *base = &modbase_pmac; unsigned char ADBBuffer[ADB_BUFSIZE]; int fd, n, dev; if (haveADBKeyboard()) { if ((dev = keyboard_get_dev (base->fd_adb)) > 0) { n = adb_read_reg (base->fd_adb, ADBBuffer, dev, 1); if (n > 0) { ADBBuffer[3] &= 0xfe; ADBBuffer[3] |= (config == KEYBOARD_FNTOP) ? 0x01 : 0x00; adb_write_reg (base->fd_adb, ADBBuffer, n, dev, 1); } } } else { if ((fd = open ("/sys/module/usbhid/parameters/pb_fnmode", O_WRONLY)) < 0) fd = open ("/sys/module/hid/parameters/pb_fnmode", O_WRONLY); if (fd >= 0) { sprintf ((char*)ADBBuffer, "%d", config); write (fd, ADBBuffer, strlen((const char*)ADBBuffer)); #ifdef DEBUG printf ("DBG: Keyboard config written: '%s' -> %d.\n", ADBBuffer, config); #endif close (fd); } } } int keyboard_get_dev (int fd) { unsigned char ADBBuffer[ADB_BUFSIZE]; int n; for (n=1; n<16; n++) { if ((adb_read_reg (fd, ADBBuffer, n, 3)) > 0) { if (((ADBBuffer[2] & 0x0f) == 2) && /* device id = keyboard */ ((ADBBuffer[3] & 0xc0) == 0xc0)) { /* keyboard type */ return n; } } } return -1; } /* -------------------- POWER MAC SPECIFIC TRACKPAD FUNCTIONS ------------------ */ int trackpad_get_config () { struct moddata_pmac *base = &modbase_pmac; unsigned char ADBBuffer[ADB_BUFSIZE]; int n, dev, config = -1; if (haveADBTrackpad()) { if ((dev = trackpad_get_dev (base->fd_adb)) > 0) { trackpad_set_prgmode (base->fd_adb, dev, 1); n = adb_read_reg (base->fd_adb, ADBBuffer, dev, 2); if (n > 0) { if (ADBBuffer[5] == 0xff) config = TRACKPAD_LOCK; else if (ADBBuffer[3] == 0x94) config = TRACKPAD_DRAG; else if (ADBBuffer[2] == 0x99) config = TRACKPAD_TAP; else config = TRACKPAD_NOTAP; } trackpad_set_prgmode (base->fd_adb, dev, 0); } } return config; } void trackpad_set_config (int config) { struct moddata_pmac *base = &modbase_pmac; unsigned char ADBBuffer[ADB_BUFSIZE]; int n, dev; if (haveADBTrackpad()) { if ((dev = trackpad_get_dev (base->fd_adb)) > 0) { trackpad_set_prgmode (base->fd_adb, dev, 1); n = adb_read_reg (base->fd_adb, ADBBuffer, dev, 2); if (n > 0) { ADBBuffer[2] = (config < TRACKPAD_TAP) ? 0x19 : 0x99; ADBBuffer[3] = (config < TRACKPAD_DRAG) ? 0x14 : 0x94; ADBBuffer[5] = (config < TRACKPAD_LOCK) ? 0xb2 : 0xff; adb_write_reg (base->fd_adb, ADBBuffer, n, dev, 2); } trackpad_set_prgmode (base->fd_adb, dev, 0); } } } int trackpad_get_dev (int fd) { unsigned char ADBBuffer[ADB_BUFSIZE]; int n; for (n=1; n<16; n++) { if ((adb_read_reg(fd, ADBBuffer, n, 1)) > 4) { if ((ADBBuffer[2] == 0x74) && (ADBBuffer[3] == 0x70) && /* 'tpad' */ (ADBBuffer[4] == 0x61) && (ADBBuffer[5] == 0x64) && (ADBBuffer[8] == 0x03)) { /* class:Trackpad */ return n; } } } return -1; } void trackpad_set_prgmode (int fd, int dev, int mode) { unsigned char ADBBuffer[ADB_BUFSIZE]; int n; n = adb_read_reg(fd, ADBBuffer, dev, 1); if (n > 0) { ADBBuffer[8] = mode ? 0x0d : 0x03; adb_write_reg(fd, ADBBuffer, n, dev, 1); adb_read_reg(fd, ADBBuffer, dev, 2); /* nessecary to activate program mode ! */ } } /* ----------------------------- LOW LEVEL ADB FUNCTIONS ---------------------------- */ #if defined(DEBUG) && PMUTALK /* Debug functions to track down mysterious shutdowns and freezes */ #define DEBUGLOG "/var/log/pbbuttonsd" void debug_wrtcmd (char *title, unsigned char *buffer, int size) { struct timeval tv; FILE *fd; int i; gettimeofday(&tv, NULL); if ((fd = fopen(DEBUGLOG, "a")) != NULL) { /* open protocol file */ fprintf (fd, "%ld.%4d %-20s (%d)", tv.tv_sec, (int)tv.tv_usec/1000, title, size); for (i=0; i < size; i++) { fprintf (fd, " %02x", buffer[i]); } fclose(fd); } } void debug_wrtrc (int rc, int expected) { FILE *fd; if ((fd = fopen(DEBUGLOG, "a")) != NULL) { /* open protocol file */ if (rc == -1 || rc != expected) fprintf(fd, "\t-- FAIL\n"); else fprintf(fd, "\t-- ok\n"); fclose(fd); } } void debug_rdcmd (char *title, unsigned char *buffer, int size) { struct timeval tv; FILE *fd; int i; gettimeofday(&tv, NULL); if ((fd = fopen(DEBUGLOG, "a")) != NULL) { /* open protocol file */ fprintf (fd, "%ld.%4d %-20s (%d)", tv.tv_sec, (int)tv.tv_usec/1000, title, size); if (size >= 0) { for (i=0; i < size; i++) { fprintf (fd, " %02x", buffer[i]); } fprintf(fd, "\t-- ok\n"); } else fprintf(fd, "\t-- FAIL\n"); fclose(fd); } } /* ---------------------------------------------------------------*/ #endif /* This function sends a request to the PMU via the ADB bus and reads the result. If successful the count of valid data bytes in the buffer will be returned, otherwise -1 */ int send_pmu_request(int fd, unsigned char *buffer, int params, ...) { va_list list; int n, x; if (params < 0 || params > 30) return -1; buffer[0] = PMU_PACKET; va_start(list, params); for (x = 0; x < params; ++x) buffer[x+1] = va_arg(list, int); va_end(list); #if defined(DEBUG) && PMUTALK debug_wrtcmd("PMU request", buffer, x+1); #endif n = write(fd, buffer, x+1); #if defined(DEBUG) && PMUTALK debug_wrtrc(n, x+1); #endif if ((n != x+1) || (n == -1)) return -1; n = read(fd, buffer, ADB_BUFSIZE); #if defined(DEBUG) && PMUTALK debug_rdcmd("PMU answer", buffer, n); #endif if (n < 0) return -1; return n; } /* This function reads a register from an ADB device into a Buffer. The data starts at byte 1 in buffer. Byte 0 contains the Packettype and could be ignored. The funtion returns the count of valid data bytes in the buffer (excluding byte 0) */ int adb_read_reg(int fd, unsigned char *ADBBuffer, int dev, int reg) { int n; ADBBuffer[0] = ADB_PACKET; ADBBuffer[1] = ADB_READREG(dev, reg); #if defined(DEBUG) && PMUTALK debug_wrtcmd("ADB read register", ADBBuffer, 2); #endif n = write(fd, ADBBuffer, 2); #if defined(DEBUG) && PMUTALK debug_wrtrc(n, 2); #endif if (n != 2) return -1; n = read(fd, ADBBuffer+1, ADB_BUFSIZE-1); #if defined(DEBUG) && PMUTALK debug_rdcmd("ADB read answer", ADBBuffer, n); #endif return n; } /* This function writes a register into an ADB device. The first two bytes of the buffer are set by this funtion. */ int adb_write_reg(int fd, unsigned char *ADBBuffer, int len, int dev, int reg) { int n; len++; /* take care about the command byte */ ADBBuffer[0] = ADB_PACKET; ADBBuffer[1] = ADB_WRITEREG(dev, reg); #if defined(DEBUG) && PMUTALK debug_wrtcmd("ADB write register", ADBBuffer, 2); #endif n = write(fd, ADBBuffer, len); #if defined(DEBUG) && PMUTALK debug_wrtrc(n, len); #endif if (n != len) return -1; n = read(fd, ADBBuffer+1, ADB_BUFSIZE-1); #if defined(DEBUG) && PMUTALK debug_rdcmd("ADB write answer", ADBBuffer, n); #endif return 0; } /* ----------------------------- LOW LEVEL PMU FUNCTIONS ---------------------------- */ int get_pmu_version(int fd) { int count; unsigned char buffer[ADB_BUFSIZE]; count = send_pmu_request(fd, buffer, 1, PMU_GET_VERSION); if (count == 2) return buffer[1]; else return -1; } int get_button(int fd, int button) { int count; unsigned char buffer[ADB_BUFSIZE]; count = send_pmu_request(fd, buffer, 1, button); if (count == 2) return buffer[1]; else return -1; /* not available or invalid */ } int get_int_environment(int fd) { int count; unsigned char buffer[ADB_BUFSIZE]; count = send_pmu_request(fd, buffer, 1, PMU_GET_COVER); if (count == 2) return buffer[1]; else return -1; /* not available or invalid */ } /* ----------------------------- LOW LEVEL LMU FUNCTIONS ---------------------------- */ int addPath(char *path, int maxlen, char *pattern) { DIR *dh; struct dirent *dir; int rc = 1; if ((dh = opendir(path))) { while ((dir = readdir(dh))) { if ((strncmp(dir->d_name, pattern, strlen(pattern)) == 0)) { strncat(path, "/", maxlen-1); strncat(path, dir->d_name, maxlen-1); rc = 0; break; } } closedir(dh); } return rc; } /* This function searches the device-tree for the lmu-controller to * read its I2C bus address. Two device paths are searched: * uni-n/i2c/lmu-controller/reg or * uni-n/i2c/i2c-bus/lmu-micro/reg * * If the file 'reg' is found it contents divided by two will be * returned. Otherwise the result is 0. */ int getLMUAddress() { char path[200]; long reg; int fd, n, rc = 0, err = 0; path[0] = 0; /* terminate path buffer */ strncat(path, OFBASE, sizeof(path)-1); if ((err = addPath(path, sizeof(path), "uni-n")) == 0) if ((err = addPath(path, sizeof(path), "i2c")) == 0) if ((err = addPath(path, sizeof(path), "lmu-controller")) != 0) if ((err = addPath(path, sizeof(path), "i2c-bus")) == 0) err = addPath(path, sizeof(path), "lmu-micro"); strncat(path, "/reg", sizeof(path)-1); if (err == 0 && (fd = open(path, O_RDONLY)) >= 0) { n = read(fd, ®, sizeof(long)); if (n == sizeof(long)) rc = (int) (reg >> 1); close(fd); } return rc; } int probeLMU(char *device, int addr) { char buffer[4]; int fd, rc = 0; if ((fd = open(device, O_RDWR)) >= 0) { if (ioctl(fd, I2C_SLAVE, addr) >= 0) { if (read (fd, buffer, 4) == 4) rc = 1; } close(fd); } else print_msg (PBB_ERR, _("Can't access i2c device %s - %s.\n"), device, strerror(errno)); return rc; } /* This function tries to find the I2C device that controls the keyboard * illumination and the ambient light sensor used in some alluminum PowerBooks * It returns the device file name on success or an empty string, if no LMU * controller could be found. * The function uses the sysfs to find the appropriate i2c device to which the * LMU controller is connected to. The kernel module i2c-dev must be loaded * for this function to work. */ const char* findLMUDevice(int addr) { static char buffer[40]; DIR *dh; struct dirent *dir; unsigned int n; int fd; if ((dh = opendir(SYSI2CDEV))) { while ((dir = readdir(dh))) { if (dir->d_name[0] == '.') continue; snprintf(buffer, sizeof(buffer), SYSI2CDEV"/%s/name", dir->d_name); if ((fd = open(buffer, O_RDONLY)) >= 0) { n = read(fd, buffer, sizeof(buffer)); close(fd); if (n > 0 && n < sizeof(buffer)) { buffer[n-1] = 0; if ((strncmp(I2CCHIP" ", buffer, 6) == 0)) { snprintf(buffer, sizeof(buffer), "/dev/%s", dir->d_name); if ((probeLMU(buffer, addr))) break; buffer[0] = 0; } } } } closedir(dh); } return buffer; } /** * @brief Get the raw ambient light sensor value from hardware * * This function read the ambient sensor from hardware. Two * interfaces are supported: * @li I2C * @li PMU * * The first ambient light sensor was connected to the I2C * Bus but recent PowerBooks 5.8 and 5.9 have a new ambient * light sensor connected to the PMU. This functions reads * the current sensor value from the correct interface. * * The returned sensor values are checked for boundaries and if * any value is suspect the fuction return -1. In this case the * suspect is guilty until its innocence is proven. * * The PowerBooks have two independent ambient light sensors. * To reduce flickering through shadows or spot lights at one of * the sensors the sensor with the highest value is returned. * * The maximum ambient brightness depends on the used sensor. * It is 1600 for the I2C sensor and 2048 for the PMU sensor. * * @return The raw ambient light value or -1 if something went * wrong and the value is invalid. */ int getRawAmbient () { struct moddata_pmac *base = &modbase_pmac; unsigned char buf[ADB_BUFSIZE]; int fd, rc = -1, rc2; #if defined(DEBUG) && SIMU_AMBIENT int ambient, level, idx, max; /* this array contains sensor values depending on the * LCD brightness without additional ambient light. * They simulate the LCD brightness influence on the * light sensors and are for debugging only. * * This function simulates an I2C ambient sensor and * will also work with more than 16 LCD brightness * levels. */ int asens0[] ={ 2, 182, 217, 248, 309, 337, 381, 423, 461, 499, 538, 576, 620,1072,1073,1077 }; int asens[] = { 0, 2, 20, 50, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 175, 182, 184, 187, 189, 192, 194, 196, 199, 201, 203, 206, 208, 211, 213, 215, 218, 220, 222, 225, 227, 230, 232, 234, 237, 239, 241, 244, 246, 249, 251, 253, 256, 258, 260, 263, 265, 268, 270, 272, 275, 277, 279, 282, 284, 287, 289, 291, 294, 296, 298, 301, 303, 305, 308, 310, 313, 315, 317, 320, 322, 324, 327, 329, 332, 334, 336, 339, 341, 343, 346, 348, 351, 353, 355, 358, 360, 362, 365, 367, 370, 372, 374, 377, 379, 381, 384, 386, 389, 391, 393, 396, 398, 400, 403, 405, 408, 410, 412, 415, 417, 419, 422, 424, 427, 429, 431, 434, 436, 438, 441, 443, 445, 448, 450, 453, 455, 457, 460, 462, 464, 467, 469, 472, 474, 476, 479, 481, 483, 486, 488, 491, 493, 495, 498, 500, 502, 505, 507, 510, 512, 514, 517, 519, 521, 524, 526, 529, 531, 533, 536, 538, 540, 543, 545, 548, 550, 552, 555, 557, 559, 562, 564, 567, 569, 571, 574, 576, 578, 581, 583, 586, 588, 590, 593, 595, 597, 600, 602, 604, 607, 609, 612, 614, 623, 673, 723, 773, 823, 873, 923, 973,1023,1073, 1073,1073,1073,1073,1073,1073,1073,1073, 1073,1073,1073,1073,1073,1073,1073,1074, 1074,1074,1074,1074,1074,1074,1074,1074, 1074,1074,1075,1075,1075,1076,1076,1076, 1076,1076,1077,1077,1077,1077,1077,1077, 1077,1077,1077,1077,1077,1077,1077,1077 }; level = process_queue_single (QUERYQUEUE, TAG_BACKLIGHTLEVEL, -1); max = process_queue_single (QUERYQUEUE, TAG_BACKLIGHTMAX, -1); idx = level * sizeof(asens) / sizeof(int) / (max + 1); ambient = asens[level == -1 ? 0 : idx] + base->ambient; if (ambient > 1600) ambient = 1600; return ambient; #else if (haveI2CAmbient()) { if ((fd = open (base->i2cdev->str, O_RDWR)) >= 0 ) { if (ioctl (fd, I2C_SLAVE, base->lmuaddr) >= 0 ) if (read (fd, buf, 4 ) == 4) { rc = (buf[0] << 8) | buf[1]; rc2 = (buf[2] << 8) | buf[3]; rc = rc > rc2 ? rc : rc2; } close (fd); } } if (havePMUAmbient()) { if (send_pmu_request (base->fd_adb, buf, 2, 0x4F, 1) == 5) { rc = (buf[2] << 8) | buf[1]; rc2 = (buf[4] << 8) | buf[3]; rc = rc > rc2 ? rc : rc2; } } return rc; #endif } void setKBDIllumination (unsigned short level) { #if !(defined(DEBUG) && SIMU_AMBIENT) struct moddata_pmac *base = &modbase_pmac; unsigned char buf[ADB_BUFSIZE]; int fd; if (level > KEYBLIGHTMAX) level = KEYBLIGHTMAX; /* check bounds */ if (haveI2CAmbient()) { buf[0] = 0x01; /* i2c register */ /* The format appears to be: * * byte 1 byte 2 * |<---->| |<---->| * xxxx7654 3210xxxx * |<----->| * ^-- brightness */ buf[1] = (unsigned char) level >> 4; buf[2] = (unsigned char) (level & 0x0F) << 4; if ((fd = open (base->i2cdev->str, O_RDWR)) >= 0 ) { if (ioctl (fd, I2C_SLAVE, base->lmuaddr) >= 0 ) write (fd, buf, 3); close (fd); } } if (havePMUAmbient ()) { send_pmu_request (base->fd_adb, buf, 4, 0x4F, 0, 0, level); } #else printf("KBD Level: %2d at %3d%% Ambient\n", level, getRawAmbient() * 100 / 1600); #endif } /* -------------------- LOW LEVEL OPEN FIRMWARE FUNCTIONS -------------------- */ int getMachineID(int pmu) { char buffer[32]; int fd, n, machine = 0; if ((fd = open(OFBASE"/model", O_RDONLY))) { if ((n = read(fd, buffer, sizeof(buffer) - 1)) != -1) { buffer[n] = 0; /* terminate buffer, only to be sure */ if (strncmp("PowerBook", buffer, 9) == 0) { if (buffer[9] == 0) /* Dummy codes for pre-Lombard PowerBooks */ machine = pmu - OHARE_PMU + 1; else { machine = (atoi(&buffer[9]) & 0xf) << 4; for (n = 9; buffer[n] != ',' && buffer[n] != '\0'; ++n); if (buffer[n] == ',') machine |= atoi(&buffer[n+1]) & 0xf; } } } close(fd); } return machine; } const char* getMachineName(int mid) { unsigned int x, y; static char *machines[7][10] = { { N_("Unknown PowerBook"), "PowerBook 3400", /* 0,1 */ "PowerBook 3500", /* 0,2 */ "PowerBook Wallstreet (Apr 1998)", /* 0,3 */ NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, "PowerBook 101 Lombard (Apr 1999)", /* 1,1 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, "iBook (Feb 2000)", /* 2,1 */ "iBook FireWire (Sep 2000)", /* 2,2 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, "PowerBook G3 Pismo (Feb 2000)", /* 3,1 */ "PowerBook G4 Titanium (Dec 2000)", /* 3,2 */ "PowerBook G4 Titanium II (Oct 2001)", /* 3,3 */ "PowerBook G4 Titanium III (Apr 2002)", /* 3,4 */ "PowerBook G4 Titanium IV (Nov 2002)", /* 3,5 */ NULL, NULL, NULL, NULL }, { NULL, "iBook 2 (May 2001)", /* 4,1 */ "iBook 2 (May 2002)", /* 4,2 */ "iBook 2 rev. 2 (Nov 2002)", /* 4,3 */ NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, "PowerBook G4 17\" (Mar 2003)", /* 5,1 */ "PowerBook G4 15\" (Sep 2003)", /* 5,2 */ "PowerBook G4 17\" (Sep 2003)", /* 5,3 */ "PowerBook G4 15\" (Apr 2004)", /* 5,4 */ "PowerBook G4 17\" (Apr 2004)", /* 5,5 */ "PowerBook G4 15\" (Feb 2005)", /* 5,6 */ "PowerBook G4 17\" (Feb 2005)", /* 5,7 */ "PowerBook G4 15\" (Oct 2005)", /* 5,8 */ "PowerBook G4 17\" (Oct 2005)" }, /* 5,9 */ { NULL, "PowerBook G4 12\" (Jan 2003)", /* 6,1 */ "PowerBook G4 12\" (Sep 2003)", /* 6,2 */ "iBook G4 (Oct 2003)", /* 6,3 */ "PowerBook G4 12\" (Apr 2004)", /* 6,4 */ "iBook G4 (Apr 2004)", /* 6,5 */ NULL, "iBook G4 (Jul 2005)", /* 6,7 */ "PowerBook G4 12\" (Oct 2005)", /* 6,8 */ NULL } }; x = mid >> 4 & 0x0f; y = mid & 0xf; if (x < 7 && y < 10 && machines[x][y] != NULL) return machines[x][y]; else return machines[0][0]; } /* --------------------- BATTERY LOGFILE DEBUG FUNCTIONS --------------------- */ int batlog_setup() { struct moddata_pmac *base = &modbase_pmac; FILE *fd; char buffer[100], *token; char batlog[STDBUFFERLEN]; int chargeold = 0, chargenew, cycle = -1; if (base->batlog_mode) { cycle = 1; if ((fd = fopen (DEFAULT_BATCYCLE,"r"))) { while (fgets (buffer, sizeof (buffer), fd)) if ((token = strtok (buffer,":\n"))) { if (!strncmp ("cycle", token, 5)) cycle = atoi (strtok(0,":\n")); else if (!strncmp ("charge", token, 6)) chargeold = atoi(strtok(0, ":\n")); else strtok (0,":\n"); } fclose(fd); if (!base->flags.ac_power) { chargenew = base->charge[0] + base->charge[1]; if ((chargenew-chargeold) > 50) cycle++; /* start new cycle */ } } snprintf (batlog, STDBUFFERLEN, DEFAULT_BATLOG, cycle); print_msg (PBB_INFO, _("Current battery cycle: %d, active logfile: %s.\n"), cycle, base->batlog_mode == BATLOG_LOG ? batlog : "none"); } return cycle; } void batlog_save() { struct moddata_pmac *base = &modbase_pmac; FILE *fd; if (base->batlog_mode) if ((fd = fopen (DEFAULT_BATCYCLE,"w"))) { fprintf (fd,"cycle : %d\n", base->batlog_cycle); fprintf (fd,"charge : %d\n", base->charge[0] + base->charge[1]); fclose(fd); } } void batlog_write(long timerem) { struct moddata_pmac *base = &modbase_pmac; struct timeval tv; char batlog[STDBUFFERLEN]; FILE *fd; static long curtime = 0; int rc; if (base->batlog_mode != BATLOG_LOG) return; snprintf (batlog, STDBUFFERLEN, DEFAULT_BATLOG, base->batlog_cycle); rc = check_devorfile(batlog, TYPE_FILE); if (rc == E_NOEXIST) { if ((fd = fopen(batlog, "w")) != NULL) { /* open new protocol file */ fprintf(fd, "# battery cycle %d\n# time\tvoltage[0]\tcharge[0]\tchargemax[0]\tvoltage[1]\tcharge[1]\tchargemax[1]\ttimerem.\n", base->batlog_cycle); fclose(fd); rc = 0; } else rc = E_OPEN; } /* to evaluate battery degradation current battery values are written to a lofile for further investigation. Each battery charge/discharge cycle in a seperate file. */ if (rc == 0 && timerem > -1) { gettimeofday(&tv, NULL); if (tv.tv_sec != curtime) { curtime = tv.tv_sec; if ((fd = fopen(batlog, "a")) != NULL) { /* open protocol file */ fprintf(fd, "%ld\t%d\t%d\t%d\t%d\t%d\t%d\t%ld\n", tv.tv_sec, base->voltage[0], base->charge[0], base->chargemax[0], base->voltage[1], base->charge[1], base->chargemax[1], timerem); fclose(fd); } } } } pbbuttonsd-0.8.1a/src/module_pmac.h0000644000175000017500000001014610641705160014215 00000000000000#ifndef INCLUDE_MODULE_PMAC_H #define INCLUDE_MODULE_PMAC_H /* ---------------------------------------------------------------------------- * module_pmac.h * prototypes and definitions for the laptop module pmac. * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #include #ifndef I2C_SLAVE #define I2C_SLAVE 0x0703 /* Change slave address (7 or 10 bits) */ #endif #define I2CCHIP "uni-n" #define ADB_BUFSIZE 32 /* Size of the ADB buffer, constant, must not be changed !! */ #define OHARE_PMU 9 #define KEYBLIGHTMAX 255 #define MAX_BATTERIES 2 #define DEFAULT_PMU "/dev/pmu" #define DEFAULT_ADB "/dev/adb" #define DEFAULT_BATLOG "/var/lib/pbbuttons/%03d_battery.log" #define DEFAULT_BATCYCLE "/var/lib/pbbuttons/battery.cycle" #define OFBASE "/proc/device-tree" #define SYSI2CDEV "/sys/class/i2c-dev" /* definitions for input device config */ enum {TRACKPAD_NOTAP, TRACKPAD_TAP, TRACKPAD_DRAG, TRACKPAD_LOCK, TRACKPAD_LAST=TRACKPAD_LOCK}; enum {KEYBOARD_FNDISABLED, KEYBOARD_FNBACK, KEYBOARD_FNTOP, KEYBOARD_LAST=KEYBOARD_FNTOP}; enum {BATLOG_NONE, BATLOG_CYCLE, BATLOG_LOG, BATLOG_LAST=BATLOG_LOG}; #ifndef PMU_IOC_GRAB_BACKLIGHT #define PMU_IOC_GRAB_BACKLIGHT _IOR('B', 6, 0) #endif #ifndef PMU_ENV_AC_POWER #define PMU_ENV_AC_POWER 0x04 #endif #ifndef PMU_ENV_BATTERY_PRESENT #define PMU_ENV_BATTERY_PRESENT 0x10 #endif struct modflags_pmac { unsigned int coveropen :1; unsigned int ac_power:1; unsigned int batpresent:1; /* set by pmu hardware */ unsigned int sleepsupported:1; unsigned int notap_typing:1; /* switch trackpad tap off while typing */ /* unsigned int set_tpmode:1; * delayed function triggered */ unsigned int set_kbdmode:1; /* delayed function triggered */ unsigned int goto_sleep:1; /* delayed function triggered */ unsigned int bat_present:MAX_BATTERIES; /* set by /proc/pmu/battery_% */ unsigned int bat_charging:MAX_BATTERIES; unsigned int :0; }; /* public prototypes */ int pmac_init (); void pmac_exit (); /* private prototypes */ void pmac_keyboard (struct tagitem *taglist); void pmac_mouse (struct tagitem *taglist); void pmac_secure (struct tagitem *taglist); void pmac_query (struct tagitem *taglist); void pmac_configure (struct tagitem *taglist); void pmac_handle_tags (int cfgure, struct tagitem *taglist); gboolean pmac_pmu_handler (int fd, gpointer user_data); void pmac_timer100 (struct tagitem *taglist); void pmac_timer1000 (struct tagitem *taglist); void pmac_update_batteryinfo (); int pmac_get_procac (); int pmac_update_flags (); void activate_sleepmode (); int getMachineID(int pmu); const char* getMachineName(int mid); int isModifier (int code, int mod); int haveADBKeyboard (); int haveADBTrackpad (); int haveI2CAmbient (); int havePMUAmbient (); int keyboard_get_config(); void keyboard_set_config(int config); int keyboard_get_dev(int fd); int trackpad_get_config(); void trackpad_set_config(int config); int trackpad_get_dev(int fd); void trackpad_set_prgmode(int fd, int dev, int mode); int send_pmu_request(int fd, unsigned char *buffer, int params, ...); int adb_read_reg(int fd, unsigned char *ADBBuffer, int dev, int reg); int adb_write_reg(int fd, unsigned char *ADBBuffer, int len, int dev, int reg); int get_pmu_version(int fd); int get_button(int fd, int button); int get_int_environment(int fd); #ifndef WITH_PMUD int get_cover_position(int fd); #endif int batlog_setup(); void batlog_save(); void batlog_write(long timerem); /* functions for ambient light sensor and keyboard illumination */ int addPath(char *path, int maxlen, char *pattern); int getLMUAddress(); int probeLMU(char *device, int addr); const char *findLMUDevice(int addr); int getRawAmbient (); void setKBDIllumination (unsigned short level); #endif /* INCLUDE_MODULE_PMAC_H */ pbbuttonsd-0.8.1a/src/module_acpi.c0000644000175000017500000005551110641705162014213 00000000000000/** * @brief Hardware abstraction layer for ACPI power management * * This module contains all functions for ACPI based machines that * are used by the high level logic modules to do their job. * * This module is needed for all new i386 laptops and the MacBook * family from Apple. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/module_acpi.c * @author Matthias Grimm */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include #include #include "gettext_macros.h" #include "input_manager.h" #include "module_acpi.h" #include "support.h" #include "debug.h" #define SECTION "MODULE ACPI" #define ACPI_BUFFER_LEN 50 #if defined(DEBUG) && ACPI_PATHS void acpi_print_file (GString *file, gpointer data) { printf ("file: %s\n", file->str); } #endif /** * @brief module specific data */ struct moddata_acpi { int fd_evacpi; /* filehandle to receive ACPI events */ struct modflags_acpi flags; GList *BatteryList; int timeleft; char *ac; /* ACPI path to AC adaptor status */ char *lid; /* ACPI path to lid button status */ GString *event_buffer; } modbase_acpi; /** * @brief Initalizes the module acpi * * This function initializes the module acpi. The data structure will * be initialized and the hardware status is read. * * Immideately after this initialisation the module is able to and * will answer upon requests. * * This function will also collect batteries available in the system. * This is only done once. See acpi_update_batteries() for more details * why. * * @see acpi_update_batteries() * * @return error code, zero if the module is ready to operate * * @todo Add real check and add functions to trigger sleep if * requested. */ int acpi_init () { struct moddata_acpi *base = &modbase_acpi; int val, rc; /* is ACPI available on this machine? */ if ((rc = check_devorfile (PATH_ACPI"/info", TYPE_FILE))) { print_msg (PBB_ERR, _("Can't access ACPI interface in /proc. Are all necessary modules loaded?\n")); return rc; } /* check if sleep is supported on this system */ base->flags.sleepsupported = 0; base->ac = NULL; base->lid = NULL; base->event_buffer = g_string_sized_new (256); base->flags.ac_power = acpi_read_ac_adapter(); /* collecting of batteries is only done once. See * acpi_update_batteries() for more details why. */ base->BatteryList = acpi_collect_batteries (base->BatteryList); base->BatteryList = acpi_update_batteries (base->BatteryList); base->timeleft = acpi_calc_timeleft (base->BatteryList); #if !(defined(DEBUG) && SIMU_ACPI) if ((base->fd_evacpi = acpi_open_socket (ACPID_SOCKET)) < 0) if ((base->fd_evacpi = open(PATH_ACPI"/event", O_RDONLY)) < 0) { print_msg (PBB_ERR, _("Can't connect to ACPI event queue: %s\n"), strerror(errno)); return E_OPEN; } #else base->fd_evacpi = STDIN_FILENO; #endif if ((addInputSource (base->fd_evacpi, acpi_event_handler, NULL, FALSE)) == NULL) { print_msg (PBB_ERR, _("Can't install ACPI event handler.\n")); return E_NOMEM; } register_function (T1000QUEUE, acpi_timer1000); register_function (QUERYQUEUE, acpi_query); register_function (CONFIGQUEUE, acpi_configure); return 0; } /** * @brief Frees all ressources allocated from module acpi * * This function is usually called on program termination. It * frees all allocated ressources and closes all open file * handles. */ void acpi_exit () { struct moddata_acpi *base = &modbase_acpi; GList *iter, *niter; iter = g_list_first (base->BatteryList); while (iter) { niter = g_list_next (iter); acpi_free_battery ((struct battery *) iter->data); iter = niter; } if (base->ac) g_free (base->ac); if (base->lid) g_free (base->lid); if (base->fd_evacpi != -1) close (base->fd_evacpi); /* close ACPI event device */ } /** * @brief Request information from the module * * @see acpi_handle_tags() * * @param *taglist Taglist containing one or more requests */ void acpi_query (struct tagitem *taglist) { acpi_handle_tags (MODE_QUERY, taglist); } /** * @brief Configure parameters of the module * * @see acpi_handle_tags() * * @param *taglist Taglist containing one or more parameters */ void acpi_configure (struct tagitem *taglist) { acpi_handle_tags (MODE_CONFIG, taglist); } /** * @brief Get or set module parameters * * This function handles the module-2-module communication. * If a parameter should be read or written this function * is called. Return vales are written to the taglist directly. * * @param cfgure MODE_CONFIG if parameters should be set or * MODE_QUERY if parameters should be read. * @param *taglist Taglist with one ore more parameters. */ void acpi_handle_tags (int cfgure, struct tagitem *taglist) { struct moddata_acpi *base = &modbase_acpi; while (taglist->tag != TAG_END) { switch (taglist->tag) { case TAG_SLEEPSUPPORTED: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = base->flags.sleepsupported; break; #ifndef WITH_IBAM case TAG_TIMEREMAINING: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = base->timeleft; break; #endif case TAG_POWERSOURCE: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = base->flags.ac_power; break; } taglist++; } } /** * @brief ACPI event handler (original design) * * @param fd Filehandle of ACPI event device * @param user_data Not used yet * @return TRUE, if the handler should stay active */ gboolean acpi_event_handler (int fd, gpointer user_data) { struct moddata_acpi *base = &modbase_acpi; struct tagitem taglist[2]; struct acpi_event acpi; GString *buffer; gboolean status; char *cur, *next, *tmp; int n; taglist_init (taglist); buffer = g_string_sized_new (ACPI_BUFFER_LEN + 1); while ((n = read (fd, buffer->str, ACPI_BUFFER_LEN)) > 0) { g_string_append_len (base->event_buffer, buffer->str, n); if (n < ACPI_BUFFER_LEN) break; } if (n < 0) { /* An error occoured. If errno == EAGAIN, the received data * has been thrown away by the socket driver and there is * nothing left to read for us. We reset and try again next * time. */ if (errno != EAGAIN) print_msg (PBB_ERR, _("Can't read ACPI events: %s.\n"), strerror(errno)); goto out; } if ((tmp = index(base->event_buffer->str, '\n'))) { *tmp = 0; /* terminate substring */ buffer = g_string_assign (buffer, base->event_buffer->str); g_string_erase (base->event_buffer, 0, buffer->len + 1); #if defined(DEBUG) && ACPI_EVENTS printf ("ACPI event received: '%s'\n", buffer->str); #endif /* decode ACPI event */ cur = buffer->str; for (n=0; n < 4; n++) { if ((next = strchr (cur, ' '))) *next++ = '\0'; else if (n != 3) break; /* syntax error */ switch (n) { case 0: acpi.device = cur; break; case 1: acpi.bus = cur; break; case 2: acpi.type = axtoi(cur); break; case 3: acpi.data = axtoi(cur); break; } cur = next; } if (n == 4) { #if defined(DEBUG) && ACPI_EVENTS printf (" device: '%s'\n bus : '%s'\n type : %ld\n data : %ld\n\n", acpi.device, acpi.bus, acpi.type, acpi.data); #endif if (strcmp ("button/lid", acpi.device) == 0) { /* The ACPI event doesn't tell us the status of the cover. * Instead a count of "how often the lid button was pressed" * is transmitted which is of no known use. We have to * retrieve the cover status on our own here. */ status = acpi_read_cover_status (); taglist_add (taglist, TAG_COVERSTATUS, status ? 1 : 0); } else if (strcmp ("ac_adapter", acpi.device) == 0) { /* data is 0x00 if running on battery, 0x01 if running on * AC and 0xff if power source is unknown. An unknown * powersource is treated as AC here. */ taglist_add (taglist, TAG_POWERCHANGED, acpi.data); base->flags.ac_power = acpi.data; } /* distribute events to other modules */ if (taglist[0].tag != TAG_END) process_queue (CONFIGQUEUE, taglist); } #if defined(DEBUG) && ACPI_PATHS printf (" base->ac = %s\n", base->ac ? base->ac : ""); printf (" base->lid = %s\n", base->lid ? base->lid : ""); #endif } out: g_string_free (buffer, TRUE); return TRUE; } /** * @brief Time function called every second * * This function does regulary tasks like reporting * remaining battery time or flag changes. * * @param taglist not used in this function */ void acpi_timer1000 (struct tagitem *taglist) { struct moddata_acpi *base = &modbase_acpi; struct tagitem args[6]; int val; taglist_init (args); val = base->timeleft; base->BatteryList = acpi_update_batteries (base->BatteryList); base->timeleft = acpi_calc_timeleft (base->BatteryList); #if defined(DEBUG) && ACPI_BATTERY static int count = 0; int n = g_list_length (base->BatteryList); if (count != n) { acpi_print_battery (base->BatteryList); printf ("Time left: %d\n", base->timeleft); count = n; } #endif #ifndef WITH_IBAM if (val != base->timeleft && !base->flags.ac_power) { taglist_add (args, TAG_TIMECHANGED, base->timeleft); } #endif if (args[0].tag != TAG_END) process_queue (CONFIGQUEUE, args); /* distribute changes to other modules */ } /** * @brief Calculate the time left on battery * * The battery list contains data about current and voltage * and this seperatly for each battery but the time the system * will run on battery was not stored. This function adds * the capacity of ll batteries in system and divide them by * the overall current to get a good guess how log the battery * will last. * * @param batlist BatteryList to calulate over * @return time remaining in seconds or -1 if not available */ int acpi_calc_timeleft (GList *batlist) { GList *iter; int charge, current; struct battery *bat; charge = current = 0; iter = g_list_first (batlist); while (iter) { bat = (struct battery *) iter->data; charge += bat->capacity; current += bat->current; iter = g_list_next (iter); } return current == 0 ? -1 : charge * 3600 / current; } /** * @brief Update battery data in the battery list * * This function reads the battery status from /proc/acpi/battery * and fill the battery data fields in dthe battery list. * * Before updating the battery data, the battery list is rescanned * for batteries new in the system. This will be done by the * function acpi_collect_batteries(). * * If a battery in the batery list couldn't be accessed, it will * be removed from the battery list. * * @see acpi_collect_batteries() * * @param *batlist List of batteries to update * @return revised and updated battery list */ GList * acpi_update_batteries (GList *batlist) { FILE *fd; char buffer[100], *token, *tmp; GList *iter, *niter; GString *batinfo; struct battery *bat; /* update battery list */ /* having this call here will allow batteries to appear and * vanish dynamically. The battery-list will catch up with * the changes and is always up-to-date. I think this is * not necessary because the ACPI system knows about all * possible batteries from the beginning and won't add or * remove battery entries on the fly. Therefor this call * is commented out here and added to acpi_init() * * batlist = acpi_collect_batteries (batlist); */ iter = g_list_first(batlist); while (iter) { niter = g_list_next (iter); bat = (struct battery *) iter->data; if ((fd = fopen (bat->path, "r"))) { while (fgets (buffer,sizeof (buffer), fd)) { cleanup_buffer (buffer); if ((token = strtok (buffer, ":\n"))) { if (!strncmp ("chargingstate", token, 13)) { bat->charging = strcmp (strtok(0, "\n"), "charging") ? FALSE : TRUE; } else if (!strncmp ("presentrate", token, 11)) { bat->current = atoi (strtok(0,":\n")); } else if (!strncmp ("remainingcapacity", token, 17)) { bat->capacity = atoi (strtok(0, ":\n")); } else if (!strncmp ("presentvoltage", token, 14)) { bat->voltage = atoi (strtok(0,":\n")); } else if (!strncmp ("present", token, 7)) { bat->present = strcmp (strtok(0, "\n"), "yes") ? FALSE : TRUE; } else strtok (0,":\n"); } } fclose(fd); batinfo = g_string_new (bat->path); if ((tmp = g_strrstr (batinfo->str,"/")) != NULL) { batinfo = g_string_truncate (batinfo, tmp - batinfo->str); batinfo = g_string_append (batinfo, "/info"); if ((fd = fopen (batinfo->str, "r"))) { while (fgets (buffer,sizeof (buffer), fd)) { cleanup_buffer (buffer); if ((token = strtok (buffer, ":\n"))) { if (!strncmp ("lastfullcapacity", token, 16)) { bat->full_capacity = atoi (strtok(0,":\n")); } else strtok (0,":\n"); } } } fclose(fd); } g_string_free (batinfo, TRUE); } else { batlist = g_list_remove (batlist, bat); acpi_free_battery (bat); } iter = niter; } return batlist; } /** * @brief Frees all ressources of a battery structure * * This functions frees all allocated ressources of a battery * structure. * * @param *bat Battery structure to clean up */ void acpi_free_battery (struct battery *bat) { if (bat->path) g_free(bat->path); g_free (bat); } /** * @brief finds out if the AC connector is plugged in * * This function checks if the AC connector is plugged in. * * If the status can't be read, the function returns TRUE, assuming * that running errornous on AC has less side effects that running * errornous on battery. A warning in the log file pointed that out. * * If more than one AC adapter is available, only the first one is * taken into account. Any further adapter will be ignored. A warning * in the log file will point this case out. * * @return TRUE, if the machine is running on AC, false otherwise */ gboolean acpi_read_ac_adapter () { struct moddata_acpi *base = &modbase_acpi; GList *files; GString *tmp; FILE *fd; char buffer[100], *token; gboolean rc = TRUE; if (base->ac == NULL) { if ((files = acpi_get_file_list ("ac_adapter"))) { if (g_list_length (files) > 1) print_msg (PBB_WARN, _("More than one AC adapter found. Only the first one is used.\n")); tmp = (GString *) g_list_nth_data (files, 0); /* save first file path for later use */ base->ac = g_strdup (tmp->str); #if defined(DEBUG) && ACPI_PATHS g_list_foreach (files, (GFunc) acpi_print_file, NULL); #endif acpi_free_file_list (files); } } if (base->ac) { if ((fd = fopen (base->ac,"r"))) { while (fgets (buffer, sizeof (buffer), fd)) { cleanup_buffer (buffer); if ((token = strtok (buffer,":\n"))) { if (!strncmp ("state", token, 5)) { rc = strcmp ("on-line", strtok(0,":\n")) == 0 ? TRUE : FALSE; break; } else if (!strncmp ("status", token, 6)) { rc = strcmp ("on-line", strtok(0,":\n")) == 0 ? TRUE : FALSE; break; } else strtok (0,":\n"); } } fclose(fd); } else print_msg (PBB_ERR, _("Can't read AC adapter status - assuming it is connected.\n")); } return rc; } /** * @brief Reads the status of the lid switch * * This function checks if the cover is open or close * * If the status can't be read, the function returns TRUE, assuming * that the cover is open. Otherwise it wouldn't be possible to work * with the machine anymore if the wrong configuration had been set. * * @return TRUE, if the cover is open, false otherwise */ gboolean acpi_read_cover_status () { struct moddata_acpi *base = &modbase_acpi; GList *files; GString *tmp; FILE *fd; char buffer[100], *token; gboolean rc = TRUE; if (base->lid == NULL) { if ((files = acpi_get_file_list ("button/lid"))) { if (g_list_length (files) > 1) print_msg (PBB_WARN, _("More than one Lid button found. Only the first one is used.\n")); tmp = (GString *) g_list_nth_data (files, 0); /* save first file path for later use */ base->lid = g_strdup (tmp->str); #if defined(DEBUG) && ACPI_PATHS g_list_foreach (files, (GFunc) acpi_print_file, NULL); #endif acpi_free_file_list (files); } } if (base->lid) { if ((fd = fopen (base->lid,"r"))) { while (fgets (buffer, sizeof (buffer), fd)) { cleanup_buffer (buffer); if ((token = strtok (buffer,":\n"))) { if (!strncmp ("state", token, 5)) { rc = strncmp ("open", strtok(0,":\n"), 4) == 0 ? TRUE : FALSE; break; } else if (!strncmp ("status", token, 6)) { rc = strncmp ("open", strtok(0,":\n"), 4) == 0 ? TRUE : FALSE; break; } else strtok (0,":\n"); } } fclose(fd); } else print_msg (PBB_ERR, _("Can't read cover status - assuming it is open.\n")); } return rc; } /** * @brief callback function to find a battery with a given path * * This callback function will be called for every battery in the battery * list and checks if this battery could be found on the given path. In * that case it returns zero. * * @param *a Battery entry to check * @param *b Battery path to find * @return zero, if the battery entry was found */ gint acpi_find_battery (gconstpointer *a, gconstpointer *b) { struct battery *bat = (struct battery *) a; char *batpath = (char *) b; return strcmp (batpath, bat->path); } /** * @brief Collects all batteries found in /proc/acpi/battery * * This function collects all batteries from /proc/acpi/battery * and creates a data field for each of them. This datafields * will be queued up in a list. * * This function fills only the path entry of the datafield. Any * other field will be filled by acpi_update_batteries(). * * If an old battery list was given, the function adds newly found * batteries to this list and ignore batteries already in the list. * * @see acpi_update_batteries() * * @param *batlist Existing batlist or NULL if a new should be * generated * @return new or revised battery list */ GList * acpi_collect_batteries (GList *batlist) { DIR *dd; struct dirent *dir; GString *batpath; struct battery *newbat; batpath = g_string_new (NULL); if ((dd = opendir (PATH_ACPI"/battery"))) { while ((dir = readdir (dd))) { if (dir->d_name[0] == '.') continue; /* skip "." and ".." */ g_string_printf (batpath, PATH_ACPI"/battery/%s/state", dir->d_name); if (access(batpath->str, R_OK)) { g_string_printf (batpath, PATH_ACPI"/battery/%s/status", dir->d_name); if (access(batpath->str, R_OK)) continue; /* try next one */ } if ((g_list_find_custom (batlist, batpath->str, (GCompareFunc) acpi_find_battery)) == NULL) { newbat = g_new0 (struct battery, 1); newbat->path = g_strdup (batpath->str); batlist = g_list_append (batlist, newbat); } } closedir (dd); } return batlist; } /** * @brief Opens the acpid socked for reading events * * The ACPI system reports events through /proc/acpi/event but * it allows only one listener. If another daemon already listens * for events it is impossible for pbbuttonsd to receive ACPI * events. * * The ACPI deamon acpid work around this problem by forwarding * the events to a newly created socket file. This way multiply * daemons could cascade on /proc/acpi/event. * * This function opens the socket file from acpid and prepare * it so that pbbuttonsd can read events from it. * * @param *name Name of the socket file * @return filehandle of open socket or -1 on error */ int acpi_open_socket (char *name) { struct sockaddr_un addr; int fd, val; if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0) { bzero (&addr, sizeof(addr)); addr.sun_family = AF_UNIX; sprintf(addr.sun_path, "%s", name); if ((connect(fd, (struct sockaddr *)&addr, sizeof(addr))) >= 0) { /* Make socket non-blocking because select() may spuriously * report sockets as ready. See man page of select() for * details. */ val = fcntl(fd, F_GETFL); fcntl(fd, F_SETFL, val | O_NONBLOCK); return fd; } close (fd); } return -1; } /** * @brief scans a directory and returns all 'state' and 'status' files found * * This function scans a given directory for the files 'state' and 'status' * and returns a list with all found and valid path names. A path name is valid * if the file exists and the caller has the right permissions to read them. * * The list must be freed with acpi_free_file_list() after usage. * * @see acpi_free_file_list() * * @param *startdir subdirectory in /proc/acpi to scan * @return GList with all found 'state' and 'status' files or NULL if the * directory does not exist or no files could be found. */ GList* acpi_get_file_list (char *startdir) { GString *path, *file; GList *list; DIR *dd; struct dirent *dir; list = NULL; path = g_string_new (PATH_ACPI"/"); path = g_string_append (path, startdir); if ((dd = opendir (path->str))) { while ((dir = readdir (dd))) { if (dir->d_name[0] == '.') continue; /* skip "." and ".." */ file = g_string_new (NULL); g_string_printf (file, "%s/%s/state", path->str, dir->d_name); if (access(file->str, R_OK)) { g_string_printf (file, "%s/%s/status", path->str, dir->d_name); if (access(file->str, R_OK)) { g_string_free (file, TRUE); continue; /* try next one */ } } list = g_list_append (list, file); } closedir (dd); } return list; } /** * @brief handler for acpi_free_file_list() * * This function will be called by acpi_free_file_list() for * every list entry. The GString of the list entry will be * freed. * * @see acpi_free_file_list() * * @param *file GString that should be freed * @param data Not used in this function */ void acpi_free_file (GString *file, gpointer data) { g_string_free (file, TRUE); } /** * @brief frees all ressources of a file list * * This function frees all ressources of a file list created * with acpi_get_file_list(). The function acpi_free_file() * is called for every list entry. * * @see acpi_get_file_list(), acpi_free_file() * * @param *list Pointer to GList that should be freed */ void acpi_free_file_list (GList *list) { g_list_foreach (list, (GFunc) acpi_free_file, NULL); g_list_free (list); } #if defined(DEBUG) && ACPI_BATTERY void acpi_print_battery (GList *batlist) { struct battery *bat; GList *iter; printf ("\nBattery List\n------------\n"); iter = g_list_first(batlist); while (iter) { bat = (struct battery *) iter->data; printf ("Battery: %s\n", bat->path); printf (" (%p)\n", bat); printf (" present: %s\n", bat->present ? "yes" : "no"); printf (" charging: %s\n", bat->charging ? "yes" : "no"); printf (" full capacity: %d mAh\n", bat->full_capacity); printf (" capacity: %d mAh\n", bat->capacity); printf (" voltage: %d mV\n", bat->voltage); printf (" current: %d mA\n\n", bat->current); iter = g_list_next (iter); } } #endif pbbuttonsd-0.8.1a/src/module_acpi.h0000644000175000017500000000773510641705165014230 00000000000000#ifndef INCLUDE_MODULE_ACPI_H #define INCLUDE_MODULE_ACPI_H /** * @brief Definitions and prototypes for module_acpi.c * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/module_acpi.h * @author Matthias Grimm */ #include #include "debug.h" #if defined(DEBUG) && SIMU_ACPI # define PATH_ACPI "/home/grimm/acpi" #else # define PATH_ACPI "/proc/acpi" #endif #define ACPID_SOCKET "/var/run/acpid.socket" /** * @brief Battery data * * This structure contains data of a battery. This data is used * from the power management for battery warnings. * * This structure is currently filled only by the ACPI module * but could also be used by the PMU module. */ struct battery { /** * @brief TRUE, if the battery is present */ gboolean present; /** * @brief TRUE, if the battery is charging */ gboolean charging; /** * @brief voltage of the battery in mV */ int voltage; /* in mV */ /** * @brief Current sourced or sinked by the battery in mA * * Some ACPI systems report the current rate as power * consumption in mW. In that case this field contains * the power consumption rather than a current. * * @todo calculate the current out of power consumption * and battery voltage. */ int current; /* in mA */ /** * @brief Remaining battery capacity in mAh * * Those ACPI systems that report their current rate in * mW report the capacity in mWh. * * @todo recalculate this value to mAh if given in mWh */ int capacity; /* in mAh */ /** * @brief Last full battery capacity in mAh * * The battery capacity will decrease over time. This value * shows the capacity the battery have had after the last * charge process. * * Those ACPI systems that report their current rate in * mW report the capacity in mWh. * * @todo recalculate this value to mAh if given in mWh */ int full_capacity; /* in mAh */ /** * @brief Source of battery data * * This field contains the source path to the battery data. * For ACPI systems this path link to /proc/acpi/battery/.. * and for PMU systems it could show /proc/pmu/battery/.. */ char *path; }; /** * @brief ACPI event * * This structure holds a decoded ACPI event. Each ACPI event * has four segments: * @li device which triggers the event. This is a string which * holds the class and the event source divided by a slash. * @li bus identifier * @li type This value is set by the specific ACPI driver * @li data Free to choose data set by the specific ACPI driver * * The complete event is sent as a string of following format by * the kernel via /proc/acpi/event: * button/lid PFCD 00000040 00000001 */ struct acpi_event { char *device; char *bus; int type; int data; }; /** * @brief Structure to store module specific flags */ struct modflags_acpi { unsigned int coveropen :1; unsigned int ac_power:1; unsigned int sleepsupported:1; unsigned int :0; }; /* public prototypes */ int acpi_init (); void acpi_exit (); /* private prototypes */ void acpi_query (struct tagitem *taglist); void acpi_configure (struct tagitem *taglist); void acpi_handle_tags (int cfgure, struct tagitem *taglist); gboolean acpi_event_handler (int fd, gpointer user_data); void acpi_timer1000 (struct tagitem *taglist); int acpi_calc_timeleft (GList *batlist); GList *acpi_update_batteries (GList *batlist); void acpi_free_battery (struct battery *bat); gboolean acpi_read_ac_adapter (); gboolean acpi_read_cover_status (); GList *acpi_collect_batteries (GList *batlist); int acpi_open_socket (char *name); GList *acpi_get_file_list (char *startdir); void acpi_free_file_list (GList *list); #if defined(DEBUG) && ACPI_BATTERY void acpi_print_battery (GList *batlist); #endif #endif /* INCLUDE_MODULE_ACPI_H */ pbbuttonsd-0.8.1a/src/module_imac.c0000644000175000017500000002451010641705162014203 00000000000000/** * @brief Hardware abstraction layer for Intel based MacBooks * * This module contains all hardware related functions for the new * intel based machines from Apple that are used by the high level * logic modules to do their job. * * This module is needed for all intel based Apple MacBooks. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/module_imac.c * @author Stefan Bruda * @author Matthias Grimm */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #ifdef WITH_SMBIOS # include #endif #include #include "gettext_macros.h" #include "input_manager.h" #include "class_config.h" #include "module_imac.h" #include "support.h" #include "debug.h" #define SECTION "MODULE IMAC" #if defined(DEBUG) && SIMU_I386 unsigned char inb (unsigned long from) { return 0; } void outb (unsigned char byte, unsigned long from) { } int ioperm (unsigned long from, unsigned long num, int turn_on) { return 0; } #endif struct moddata_imac { GString *identity; /* Identity string of this laptop */ machine_t machine; /* Identifier of machine */ #if defined(DEBUG) && SIMU_AMBIENT int ambient; #endif } modbase_imac; /** * @brief Initalizes the module imac * * This function initializes the module imac. The data structure will * be initialized and the hardware status is read. * * Immideately after this initialisation the module is able to and * will answer upon requests. * * @return error code, zero if the module is ready to operate */ int imac_init () { struct moddata_imac *base = &modbase_imac; int val; #if defined(DEBUG) && SIMU_AMBIENT base->ambient = 0; #endif base->identity = g_string_new(NULL); base->machine = getMachineType(); g_string_printf (base->identity, "%s", _(getMachineName(base->machine))); #ifdef DEBUG print_msg(PBB_INFO, "DBG: Machine: %x\n", base->machine); if (haveKBDIllumination()) { if ((check_devorfile (SYSFS_KEYBLIGHT, TYPE_FILE)) == 0) print_msg(PBB_INFO, "DBG: SysFS support for keyboard illumination found.\n"); else print_msg(PBB_INFO, "DBG: Using native SMC interface for keyboard illumination.\n"); } else print_msg(PBB_INFO, "DBG: No keyboard illumination available on this MacBook.\n"); if (haveAmbient()) { if ((check_devorfile (SYSFS_AMBIENT, TYPE_FILE)) == 0) print_msg(PBB_INFO, "DBG: SysFS support for ambient light sensor found.\n"); else print_msg(PBB_INFO, "DBG: Using native SMC interface for ambient light sensor.\n"); } else print_msg(PBB_INFO, "DBG: No ambient light sensor available on this MacBook.\n"); #endif register_function (QUERYQUEUE, imac_query); register_function (CONFIGQUEUE, imac_configure); return 0; } /** * @brief Frees all ressources allocated from module imac * * This function is usually called on program termination. It * frees all allocated ressources and closes all open file * handles. * * @return always zero */ void imac_exit () { } void imac_query (struct tagitem *taglist) { imac_handle_tags (MODE_QUERY, taglist); } void imac_configure (struct tagitem *taglist) { imac_handle_tags (MODE_CONFIG, taglist); } void imac_handle_tags (int cfgure, struct tagitem *taglist) { struct moddata_imac *base = &modbase_imac; while (taglist->tag != TAG_END) { switch (taglist->tag) { case TAG_IDENTITY: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = (long) base->identity->str; break; case TAG_AMBIENTLIGHT: if (!haveAmbient()) tagerror (taglist, E_NOSUPPORT); else if (cfgure) #if defined(DEBUG) && SIMU_AMBIENT base->ambient = taglist->data; #else tagerror (taglist, E_NOWRITE); #endif else taglist->data = getRawAmbient(); break; case TAG_AMBIENTLIGHTMAX: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = AMBIENTLIGHTMAX; break; case TAG_KEYBLIGHTLEVEL: /* private tag */ if (cfgure) setKBDIllumination (taglist->data); break; case TAG_KEYBLIGHTMAX: /* private tag */ if (cfgure) ; else taglist->data = KEYBLIGHTMAX; break; case TAG_SYSINFOSLAVE: if (cfgure) ; else taglist->data |= SYSINFO_PB_USB_KBD | SYSINFO_PB_USB_TPAD; } taglist++; } } machine_t getMachineType () { #ifndef WITH_SMBIOS /* We can't probe for the machine type if the SMBios library * is not installed. Nevertheless we assume that this machine * is a MacBook but MacBook Pro features will be disabled */ return CMTYPE(TYPE_MACBOOK,0,0); #else const char *prop; char *p; int type, ver, rev; type = ver = rev = 0; if ((prop = SMBIOSGetSystemName())) { if (strncmp("MacBookPro", prop, 10) == 0) { type = TYPE_MACBOOKPRO; if ((p = strchr(prop, ',')) != NULL) { ver = atoi(&prop[10]) & 0xf; rev = atoi(p+1) & 0xf; } } else if (strncmp("MacBook", prop, 7) == 0) { type = TYPE_MACBOOK; if ((p = strchr(prop, ',')) != NULL) { ver = atoi(&prop[7]) & 0xf; rev = atoi(p+1) & 0xf; } } SMBIOSFreeMemory(prop); } return CMTYPE(type,ver,rev); #endif } const char* getMachineName(machine_t mid) { unsigned int type, ver, rev; static char *macbooks[3][10] = { { N_("Unknown MacBook"), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, "MacBook Core Duo (May 2006)", /* 1,1 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, "MacBook Core2 Duo (Nov 2006)", /* 2,1 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } }; static char *macbookpros[3][10] = { { N_("Unknown MacBook Pro"), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, "MacBook Pro 15\" Cor22e Duo (Jan 2006)", /* 1,1 */ "MacBook Pro 17\" Core Duo (Apr 2006)", /* 1,2 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, "MacBook Pro 17\" Core2 Duo (Oct 2006)", /* 2,1 */ "MacBook Pro 15\" Core2 Duo (Oct 2006)", /* 2,2 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL } }; type = MTYPE (mid); ver = MVERSION (mid); rev = MREVISION (mid); if (type == TYPE_MACBOOK) { if (ver < 3 && rev < 10 && macbooks[ver][rev] != NULL) return macbooks[ver][rev]; } else if (type == TYPE_MACBOOKPRO) { if (ver < 3 && rev < 10 && macbookpros[ver][rev] != NULL) return macbookpros[ver][rev]; } return N_("Unknown Machine"); } /* ------------------------------- MISCELLANEOUS FUNCTIONS ----------------------------------- */ gboolean haveAmbient() { struct moddata_imac *base = &modbase_imac; return MTYPE(base->machine) == TYPE_MACBOOKPRO ? TRUE : FALSE; } /** * @brief Get the raw ambient light sensor value from hardware * * This function read the ambient sensor from hardware. Two * interfaces are supported: * @li sysfs * @li direct SMC communication * * The returned sensor values are checked for boundaries and if * any value is suspect the fuction return -1. In this case the * suspect is guilty until its innocence is proven. * * The MacBook Pros have two independent ambient light sensors. * To reduce flickering through shadows or spot lights at one of * the sensors the sensor with the highest value is returned. * * The maximum ambient brightness is 255 * * @return The raw ambient light value or -1 if something went * wrong and the value is invalid. */ int getRawAmbient () { FILE *fd; unsigned char buffer[16], *p, *buf; int left = -1, right = -1; #if defined(DEBUG) && SIMU_AMBIENT struct moddata_imac *base = &modbase_imac; left = (base->ambient >> 8) & 0xFF; right = base->ambient & 0xFF; #else /* return immediately, if no ambient light sensor is available */ if (haveAmbient()) { if ((fd = fopen(SYSFS_AMBIENT, "r"))) { if ((buf = fgets(buffer, sizeof(buffer), fd))) { if ((p = strchr(buf, ','))) { *p++ = '\0'; right = atoi (p); left = atoi (buf+1); } } fclose(fd); } else if (ioperm(0x300, 0x304, 1) == 0) { if (readSMCKey(SMC_LIGHT_SENSOR_LEFT_KEY, 6, buffer)) left = buffer[2]; if (readSMCKey(SMC_LIGHT_SENSOR_RIGHT_KEY, 6, buffer)) right = buffer[2]; } } #endif if (left < 0 || left > 255) return -1; if (right < 0 || right > 255) return -1; return left > right ? left : right; } gboolean haveKBDIllumination() { struct moddata_imac *base = &modbase_imac; return MTYPE(base->machine) == TYPE_MACBOOKPRO ? TRUE : FALSE; } void setKBDIllumination (unsigned short level) { FILE *fd; unsigned char buffer[8]; /* return immediately, if keyboard illumination is not supported */ if (!haveKBDIllumination()) return; if ((fd = fopen(SYSFS_KEYBLIGHT, "w"))) { if ((snprintf(buffer, sizeof(buffer), "%d", level)) < sizeof(buffer)) fputs(buffer, fd); fclose(fd); return; } if (ioperm(0x300, 0x304, 1) < 0) return; buffer[0] = level & 0xFF; buffer[1] = 0x00; writeSMCKey(SMC_BACKLIGHT_KEY, 2, buffer); } /************************ Apple SMC interface *********************/ static struct timeval lasttv; static struct timeval newtv; void inline ssleep(const int usec) { gettimeofday(&lasttv, NULL); while (1) { gettimeofday(&newtv, NULL); if (((newtv.tv_usec - lasttv.tv_usec) + ((newtv.tv_sec - lasttv.tv_sec)*1000000)) > usec) { break; } } } unsigned char get_status() { return inb(0x304); } int waitfree(char num) { char c, pc = -1; int retry = 100; while (((c = get_status())&0x0F) != num && retry) { ssleep(10); retry--; if (pc != c) { pc = c; } } if (retry == 0) { #if defined(DEBUG) // printf("Waitfree failed %x != %x.\n", c, num); #endif return 0; } return 1; } int writeSMCKey(char* key, char len, unsigned char* buffer) { int i; outb(0x11, 0x304); if (!waitfree(0x0c)) return 0; for (i = 0; i < 4; i++) { outb(key[i], 0x300); if (!waitfree(0x04)) return 0; } outb(len, 0x300); for (i = 0; i < len; i++) { if (!waitfree(0x04)) return 0; outb(buffer[i], 0x300); } return 1; } int readSMCKey(char* key, char len, unsigned char* buffer) { int i; unsigned char c; outb(0x10, 0x304); if (!waitfree(0x0c)) return 0; for (i = 0; i < 4; i++) { outb(key[i], 0x300); if (!waitfree(0x04)) return 0; } outb(len, 0x300); for (i = 0; i < len; i++) { if (!waitfree(0x05)) return 0; c = inb(0x300); buffer[i] = c; } return 1; } pbbuttonsd-0.8.1a/src/module_imac.h0000644000175000017500000000456610641705161014220 00000000000000#ifndef INCLUDE_MODULE_IMAC_H #define INCLUDE_MODULE_IMAC_H /** * @brief Hardware abstraction layer for Intel based MacBooks * * This file contains the definitions and prototypes for the * MacBook hardware abstraction layer. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/module_imac.h * @author Stefan Bruda * @author Matthias Grimm */ #include #include #define SYSFS_AMBIENT "/sys/devices/platform/applesmc/light" #define SYSFS_KEYBLIGHT "/sys/class/leds/smc:kbd_backlight/brightness" #define KEYBLIGHTMAX 255 #define AMBIENTLIGHTMAX 255 #define CMTYPE(type,ver,rev) (type << 8 | ver << 4 | rev) #define MTYPE(mid) (mid >> 8 & 0xff) #define MVERSION(mid) (mid >> 4 & 0x0f) #define MREVISION(mid) (mid & 0xf) enum machine_type { TYPE_UNKNOWN, TYPE_MACBOOK, TYPE_MACBOOKPRO }; typedef unsigned short machine_t; #define SMC_LIGHT_SENSOR_LEFT_KEY "ALV0" //0x414c5630, r-o length 6 #define SMC_LIGHT_SENSOR_RIGHT_KEY "ALV1" //0x414c5631, r-o length 6 #define SMC_BACKLIGHT_KEY "LKSB" //0x4c4b5342, w-o #define SMC_CLAMSHELL_KEY "MSLD" //0x4d534c44, r-o length 1 (unused) #define SMC_MOTION_SENSOR_X_KEY "MO_X" //0x4d4f5f58, r-o length 2 #define SMC_MOTION_SENSOR_Y_KEY "MO_Y" //0x4d4f5f58, r-o length 2 #define SMC_MOTION_SENSOR_Z_KEY "MO_Z" //0x4d4f5f58, r-o length 2 #define SMC_MOTION_SENSOR_KEY "MOCN" //0x4d4f434e, r/w length 2 /* public prototypes */ int imac_init (); void imac_exit (); /* private prototypes */ void imac_query (struct tagitem *taglist); void imac_configure (struct tagitem *taglist); void imac_handle_tags (int cfgure, struct tagitem *taglist); /* functions for ambient light sensor and keyboard illumination */ gboolean haveKBDIllumination(); gboolean haveAmbient(); int getRawAmbient (); void setKBDIllumination (unsigned short level); machine_t getMachineType (); const char *getMachineName(machine_t mid); /* Apple SMC interface */ unsigned char get_status(); int waitfree(char num); int writeSMCKey(char* key, char len, unsigned char* buffer); int readSMCKey(char* key, char len, unsigned char* buffer); #endif /* INCLUDE_MODULE_IMAC_H */ pbbuttonsd-0.8.1a/src/driver_backlight_pmu.c0000644000175000017500000001262610641705165016121 00000000000000/** * @brief Low level backlight driver for PMU controlled backlights. * * This module contains the low level driver to control a LCD backlight * via the PMU. The low level driver overloads methods of class backlight. * * To make this driver work under kernel versions > 2.6.18 the kernel * option CONFIG_PMAC_BACKLIGHT_LEGACY must be set. This option includes * some old ioctls for /dev/pmu that are needed here. For older kernels * it will work out of the box. * * Every frame buffer driver could register a backlight controller, * but only the right one is accepted. Verification is done by checking * OpenFirmware's property "backlight-control" in register_backlight_controller(). * ioctl(base->fd_pmu, PMU_IOC_GET_BACKLIGHT, &val); returns -ENODEV if no * backlight device is registered. This is used to check if a backlight * controller is installed. If no backlight controller is available the * initialization of this driver will fail. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/driver_backlight_pmu.c * @author Matthias Grimm * * @todo This module accesses the PMU functions of module pmac. The * better way would be to put all PMU and ADB functions in a * seperate library file and include that. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include "gettext_macros.h" #include "module_pmac.h" #include "class_backlight.h" #include "class_config.h" #include "driver_backlight_pmu.h" #include "support.h" /** * @brief filehandle to access the PMU * * This filehandle is needed to communicate with the PMU. The PMU * controlls the LCD backlight in various Apple machines. */ static int pmu_filehandle; /** * @brief Exit function of the driver - cleans up all ressources * * This function will be called when the work is done and the driver * should be unloaded. It frees all allocated ressources. */ void driver_backlight_pmu_exit () { if (pmu_filehandle != -1) close (pmu_filehandle); } /** * @brief Get the current brightness level from the device * * This function is part of the public interface of the driver. * * It returns the current brightness level of the LCD backlight. * * @return current brightness level or -1 on error */ int pmubl_get_brightness () { long val = 0; if ((ioctl(pmu_filehandle, PMU_IOC_GET_BACKLIGHT, &val)) == -1) return -1; return (int) val; } /** * @brief Get the maximum brightness level the device supports * * This function is part of the public interface of the driver. * * It returns the maximum brightness level the LCD backlight * device supports. In this case it is a fixed value of 15 because * the amount of brightness steps for PMU controlled backlight * devices is har coded in the kernel. The graphics hardware would * be able to support more than 15 steps but the kernel programmers * didn't reflect in that. * * @return maximum supported brightness level of the device. */ int pmubl_get_brightness_max () { return PMUBRIGHTNESSMAX; } /** * @brief Change the current brightness level. * * This function is part of the public interface of the driver. * * This function sets a new brightness level. The given level must be * valid for this device, that means it must be lower than the level * pmubl_get_brightness_max() returns. No further check is done on that. * * @param val new brightness level */ void pmubl_set_brightness (int val) { if (val != -1) ioctl(pmu_filehandle, PMU_IOC_SET_BACKLIGHT, &val); } static struct driver_backlight driver_backlight_pmu = { .name = N_("PMU Backlight Driver"), .get_brightness = pmubl_get_brightness, .get_brightness_max = pmubl_get_brightness_max, .set_brightness = pmubl_set_brightness, .driver_exit = driver_backlight_pmu_exit, }; /** * @brief Constructor of a PMU backlight driver object * * This function probes for a PMU and if the LCD backlight could * be controlled with it. If so, an initialized driver object is * returned, otherwise NULL. * * @return Initializes backlight driver object or NULL */ struct driver_backlight * driver_backlight_pmu_init () { int pmu_version = 0, fd; char *device; long DUMMY = 0; device = config_get_string ("MODULE PMAC", "Device_PMU", DEFAULT_PMU); if ((check_path (device, TYPE_CHARDEV, CPFLG_NONE)) == 0) { if ((pmu_filehandle = open(device, O_RDWR)) < 0) { print_msg (PBB_ERR, _("Can't open PMU device %s: %s\n"), device, strerror(errno)); goto out; } } else goto out; device = config_get_string ("MODULE PMAC", "Device_ADB", DEFAULT_ADB); if ((check_path (device, TYPE_CHARDEV, CPFLG_NONE)) == 0) { if ((fd = open(device, O_RDWR)) >= 0) { pmu_version = get_pmu_version(fd); close (fd); } else print_msg (PBB_WARN, _("Can't open ADB device %s: %s\n"), device, strerror(errno)); }; g_free (device); if ((ioctl(pmu_filehandle, PMU_IOC_GET_BACKLIGHT, &DUMMY)) == -1) return NULL; if (pmu_version > OHARE_PMU) ioctl(pmu_filehandle, PMU_IOC_GRAB_BACKLIGHT, &DUMMY); return &driver_backlight_pmu; out: g_free (device); return NULL; } pbbuttonsd-0.8.1a/src/driver_backlight_pmu.h0000644000175000017500000000200710641705165016116 00000000000000#ifndef INCLUDE_DRIVER_BACKLIGHT_PMU_H #define INCLUDE_DRIVER_BACKLIGHT_PMU_H /** * @brief Low level backlight driver for PMU backlight controller. * * This file contains some definitions and the prototypes for the * PMU backlight driver. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/driver_backlight_pmu.h * @author Matthias Grimm */ #include /** * @brief Maximum brightness level of PMU controlled backlight * * This value is lent from asm/backlight.h and limited by the * kernel driver. */ #define PMUBRIGHTNESSMAX 15 #ifndef PMU_IOC_GRAB_BACKLIGHT #define PMU_IOC_GRAB_BACKLIGHT _IOR('B', 6, 0) #endif /* public prototypes driver PMU backlight */ struct driver_backlight *driver_backlight_pmu_init (); #endif /* INCLUDE_DRIVER_BACKLIGHT_PMU_H */ pbbuttonsd-0.8.1a/src/driver_backlight_x1600.c0000644000175000017500000001137710641705162016075 00000000000000/** * @brief Low level backlight driver for ATI X1600 graphics card. * * This module contains the low level driver to control a LCD backlight * connected to the ATI X1600 graphics card. This card is used in the * new MacBook Pros from Apple. * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/driver_backlight_x1600.c * @author Matthias Grimm * @author Stefan Bruda * @author Nicolas Boichat * @author Julien Blache */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include "gettext_macros.h" #include "class_backlight.h" #include "driver_backlight_x1600.h" /** * @brief Address in memory of the ATI X1600 graphics card * */ static long address; /** * @brief Length of memory segment the ATI X1600 graphics card uses */ static long length; /** * @brief Exit function of the driver - cleans up all ressources * * This function will be called when the work is done and the driver * should be unloaded. It frees all allocated ressources. */ void driver_backlight_x1600_exit () { } /** * @brief Get the current brightness level from the device * * This function is part of the public interface of the driver. * * It returns the current brightness level of the LCD backlight. * * @return current brightness level or -1 on error */ int x1600bl_get_brightness () { int fd, state, rc = -1; char *memory; if ((fd = open("/dev/mem", O_RDWR)) >= 0) { memory = mmap(NULL, length, PROT_READ|PROT_WRITE, MAP_SHARED, fd, address); if (memory != MAP_FAILED) { OUTREG(0x4dc, 0x00000005); state = INREG(0x7ae4); OUTREG(0x7ae4, state); rc = INREG(0x7af8) >> 8; /* backlight value */ munmap(memory, length); } close(fd); rc = rc < X1600_BRIGHTNESS_MIN ? 0 : rc - (X1600_BRIGHTNESS_MIN - 1); } return rc; } /** * @brief Get the maximum brightness level the device supports * * This function is part of the public interface of the driver. * * It returns the maximum brightness level the LCD backlight * device supports. The number of steps is hardware dependent and * 256 for the ATi X1600 graphics card. * * @return maximum supported brightness level of the device. */ int x1600bl_get_brightness_max () { return X1600_BRIGHTNESS_MAX - X1600_BRIGHTNESS_MIN + 1; } /** * @brief Change the current brightness level. * * This function is part of the public interface of the driver. * * This function sets a new brightness level. The given level must be * valid for this device, that means it must be lower than the level * pmubl_get_brightness_max() returns. No further check is done on that. * * @param val new brightness level */ void x1600bl_set_brightness (int val) { int fd, state; char *memory; if (val >= 0) { if ((fd = open("/dev/mem", O_RDWR)) >= 0) { memory = mmap(NULL, length, PROT_READ|PROT_WRITE, MAP_SHARED, fd, address); if (memory != MAP_FAILED) { OUTREG(0x4dc, 0x00000005); state = INREG(0x7ae4); OUTREG(0x7ae4, state); val = val ? val + (X1600_BRIGHTNESS_MIN - 1) : 0; OUTREG(0x7af8, 0x00000001 | ((val & 0xFF) << 8)); munmap(memory, length); } close (fd); } } } static struct driver_backlight driver_backlight_x1600 = { .name = N_("ATI X1600 Backlight Driver"), .get_brightness = x1600bl_get_brightness, .get_brightness_max = x1600bl_get_brightness_max, .set_brightness = x1600bl_set_brightness, .driver_exit = driver_backlight_x1600_exit, }; /** * @brief Constructor of a X1600 backlight driver object * * This function probes for a ATI X1600 graphics card on the * PCI bus and if one is found, saves the memory address and * the seqment length. The other functions of this driver rely * on this data to change the LCD brightness. * * @return Initializes backlight driver object or NULL */ struct driver_backlight * driver_backlight_x1600_init () { struct pci_access *pacc = pci_alloc(); struct pci_dev *dev; address = 0; length = 0; pci_init(pacc); pci_scan_bus(pacc); for(dev=pacc->devices; dev; dev=dev->next) { /* Iterate over all devices */ pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_BASES); if ((dev->vendor_id == PCI_ID_VENDOR_ATI) && (dev->device_id == PCI_ID_PRODUCT_X1600)) { address = dev->base_addr[2]; length = dev->size[2]; } } pci_cleanup(pacc); if (!address) return NULL; return &driver_backlight_x1600; } pbbuttonsd-0.8.1a/src/driver_backlight_x1600.h0000644000175000017500000000200010641705162016061 00000000000000#ifndef INCLUDE_DRIVER_BACKLIGHT_X1600_H #define INCLUDE_DRIVER_BACKLIGHT_X1600_H /** * @brief Low level backlight driver for ATI X1600 graphics card. * * This file contains some definitions and the prototypes for the * X1600 backlight driver. * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/driver_backlight_x1600.h * @author Matthias Grimm * @author Stefan Bruda * @author Nicolas Boichat * @author Julien Blache */ #define PCI_ID_VENDOR_ATI 0x1002 #define PCI_ID_PRODUCT_X1600 0x71c5 #define X1600_BRIGHTNESS_MIN 32 /* This value must never be 0 */ #define X1600_BRIGHTNESS_MAX 255 struct driver_backlight *driver_backlight_x1600_init (); #endif /* INCLUDE_DRIVER_BACKLIGHT_X1600_H */ pbbuttonsd-0.8.1a/src/driver_backlight_gma950.c0000644000175000017500000001653310641705162016320 00000000000000/** * @brief Low level backlight driver for Intel GMA950 graphics card. * * This module contains the low level driver to control a LCD backlight * connected to the Intel GMA950 graphics card. This card is used in the * new MacBooks from Apple. * * This program was written after Julian Blache reverse engineered * the AppleIntelIntegratedFramebuffer.kext kernel extension in * Mac OS X and played with the register at the memory location * found therein. The following description is based on his experiences: * * The register appears to have two halves. * yyyyyyyyyyyyyyy0xxxxxxxxxxxxxxx0 * * The top (y) bits appear to be the maximum brightness level and the * bottom (x) bits are the current brightness level. 0s are always 0. * The brightness level is, therefore, x/y. * * At a freshly booted Macbook, y is set to 0x94 and x is set to 0x1f. * Going below 0x1f produces odd results. For example, if you come from * above, the backlight will completely turn off at 0x12 (18). Coming * from below, however, you need to get to 0x15 (21) before the backlight * comes back on. * * Since there is no clear threshold, it looks like that this value * specifies a raw voltage. It seems that the bootup value of 0x1f * corresponds to the lowest level that Mac OS X will set the backlight. * * Because of this a value of 0x1f is taken as minimum brightness. The * maximum value is defined by the upper 15 bits. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/driver_backlight_gma950.c * @author Matthias Grimm * @author Stefan Bruda * @author Nicolas Boichat * @author Julien Blache */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include "gettext_macros.h" #include "class_backlight.h" #include "driver_backlight_gma950.h" #define REGISTER_OFFSET 0x00061254 /** * @brief Address in memory of the Intel GMA950 graphics card * */ static long address; /** * @brief Length of memory segment the Intel GMA950 graphics card uses */ static long length; /** * @brief Maximum brightbess level of backlight * * This value may vary between different systems so it will queried * from the graphics card at init time. */ static int max_brightness; /** * @brief Exit function of the driver - cleans up all ressources * * This function will be called when the work is done and the driver * should be unloaded. It frees all allocated ressources. */ void driver_backlight_gma950_exit () { } /** * @brief Get the current brightness level from the device * * This function is part of the public interface of the driver. * * It returns the current brightness level of the LCD backlight. * * Because the brightness levels beween 0 and 0x1f aren't very usefull, * they will be masked out here. That means the read out brightness * values are transformed as follows: * @li 0x00...0x1e -> 0 * @li 0x1f - 0x1e -> 1 * @li 0x20 - 0x1e -> 2 * @li : * * @return transformed brightness level or -1 on error */ int gma950bl_get_brightness () { int fd, rc = -1; char *memory; if ((fd = open("/dev/mem", O_RDWR)) >= 0) { memory = mmap(NULL, length, PROT_READ|PROT_WRITE, MAP_SHARED, fd, address); if (memory != MAP_FAILED) { rc = (INREG(REGISTER_OFFSET) >> 1) & 0x7fff; /* backlight value */ munmap(memory, length); } close(fd); rc = rc < GMA950_BRIGHTNESS_MIN ? 0 : rc - (GMA950_BRIGHTNESS_MIN - 1); } return rc; } /** * @brief Get the maximum brightness level the device supports * * This function is part of the public interface of the driver. * * It returns the maximum brightness level the LCD backlight * device supports. The number of steps is hardware dependent and * must be read from the graphics card. The level was probed in init * phase. * * Bacause the brightness levels beween 0 and 0x1f aren't very usefull, * they will be masked out here. That means the maximum brightness * value returned by this function will be the hardware reported maximum * brightness value minus 0x1f. * * @return maximum supported brightness level of the device. */ int gma950bl_get_brightness_max () { return max_brightness - GMA950_BRIGHTNESS_MIN; } /** * @brief Change the current brightness level. * * This function is part of the public interface of the driver. * * This function sets a new brightness level. The given level must be * valid for this device, that means it must be lower than the level * gma950_get_brightness_max() returns. No further check is done on that. * * Because the brightness levels beween 0 and 0x1f aren't very usefull, * they will be masked out here. That means the given brightness value * must be in range 0 .. gma950bl_get_brightness_max() and does not * contain any gap. The value will then be transformed as follows. * @li 0 -> 0 * @li 1 -> 0x1f = 1 + 0x1e * @li 2 -> 0x20 = 2 + 0x1e * @li : * * @param val new brightness level */ void gma950bl_set_brightness (int val) { int fd; char *memory; if (val >= 0) { if ((fd = open("/dev/mem", O_RDWR)) >= 0) { memory = mmap(NULL, length, PROT_READ|PROT_WRITE, MAP_SHARED, fd, address); if (memory != MAP_FAILED) { val = val ? val + (GMA950_BRIGHTNESS_MIN - 1) : 0; OUTREG(REGISTER_OFFSET, (max_brightness << 17) | (val << 1)); munmap(memory, length); } close (fd); } } } static struct driver_backlight driver_backlight_gma950 = { .name = N_("Intel GMA950 Backlight Driver"), .get_brightness = gma950bl_get_brightness, .get_brightness_max = gma950bl_get_brightness_max, .set_brightness = gma950bl_set_brightness, .driver_exit = driver_backlight_gma950_exit, }; /** * @brief Constructor of a GMA950 backlight driver object * * This function probes for a Intel GMA950 graphics card on the * PCI bus and if one is found, saves the memory address and * the seqment length. The other functions of this driver rely * on this data to change the LCD brightness. * * @return Initializes backlight driver object or NULL */ struct driver_backlight * driver_backlight_gma950_init () { struct pci_access *pacc; struct pci_dev *dev; char *memory; int fd; /* initialize the globals */ address = 0; length = 0; max_brightness = 0; pacc = pci_alloc(); pci_init(pacc); pci_scan_bus(pacc); for(dev=pacc->devices; dev; dev=dev->next) { /* Iterate over all devices */ pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_BASES); if ((dev->vendor_id == PCI_ID_VENDOR_INTEL) && (dev->device_id == PCI_ID_PRODUCT_GMA950)) { address = dev->base_addr[0]; length = dev->size[0]; } } pci_cleanup(pacc); if (!address) return NULL; if ((fd = open("/dev/mem", O_RDWR)) >= 0) { memory = mmap(NULL, length, PROT_READ|PROT_WRITE, MAP_SHARED, fd, address); if (memory != MAP_FAILED) { max_brightness = INREG(REGISTER_OFFSET) >> 17; /* max backlight value */ munmap(memory, length); } close(fd); } if (!max_brightness) return NULL; return &driver_backlight_gma950; } pbbuttonsd-0.8.1a/src/driver_backlight_gma950.h0000644000175000017500000000170110641705165016317 00000000000000#ifndef INCLUDE_DRIVER_BACKLIGHT_GMA950_H #define INCLUDE_DRIVER_BACKLIGHT_GMA950_H /** * @brief Low level backlight driver for Intel GMA960 graphic cards. * * This file contains some definitions and the prototypes for the * GMA950 backlight driver. * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/driver_backlight_gma950.h * @author Matthias Grimm * @author Stefan Bruda * @author Nicolas Boichat * @author Julien Blache */ #define GMA950_BRIGHTNESS_MIN 0x1f #define PCI_ID_VENDOR_INTEL 0x8086 #define PCI_ID_PRODUCT_GMA950 0x27A2 struct driver_backlight *driver_backlight_gma950_init (); #endif /* INCLUDE_DRIVER_BACKLIGHT_GMA950_H */ pbbuttonsd-0.8.1a/src/driver_mixer_oss.c0000644000175000017500000002533610641705165015322 00000000000000/* -------------------------------------------------------------------------- * driver_mixer_oss.c * This module contains the low level driver to control the OSS mixer. The * low level driver overloads methods of class mixer. * * Copyright 2002-2006 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * -------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include #include #include "gettext_macros.h" #include "class_config.h" #include "class_mixer.h" #include "driver_mixer_oss.h" #include "support.h" #include "debug.h" #define SECTION "MODULE MIXER OSS" struct driver_ossmixer { char *device; /** OSS mixer device, allocated string */ GString *channels; struct { unsigned int init_complete:1; unsigned int mute:1; unsigned int:0; } flags; int mixerdevmask; /* supported channels from mixer */ int userdevmask; /* desired channels from user */ int volume; /* last volume set */ int master; /* master sound channel */ } moddata; char *mixerchannels[] = {"volume", "bass", "treble", "synth", "pcm", "speaker", \ "line", "mic", "cd", "imix", "altpcm", "reclev", "igain", "ogain", \ "line1", "line2", "line3", "digital1", "digital2", "digital3", "phonein", \ "phoneout", "video", "radio", "monitor"}; void driver_mixer_oss_exit () { struct driver_ossmixer *base = &moddata; g_free (base->device); g_string_free (base->channels, TRUE); } /** * @brief Sets the volume of a given channel * * This function sets a channel's volume to a new level * It returns the average volume of the left and right channel * * @param fd filehandle of an open OSS mixer device * @param channel channel number that should get a new volume level * @param volume new volume levelto set * @return new volume level or -1 on error */ int ossmixer_set_channel_volume (int fd, int channel, int volume) { volume += 256*volume; if (ioctl (fd, MIXER_WRITE(channel), &volume) >= 0) return (volume & 255); return -1; } /** * @brief Reads the volume of a given channel * * This function asks the mixer for a channel's volume level * It returns the average volume of the left and right channel * * @param fd filehandle of an open OSS mixer device * @param channel channel number to read out * @return volume level of the given channel or -1 on error */ int ossmixer_get_channel_volume(int fd, int channel) { int volume; if (ioctl (fd, MIXER_READ(channel), &volume) >= 0) return ((volume & 255) + ((volume >> 8) & 255)) >> 1; return -1; } /** * @brief Retrieves the channels the sound hardware supports * * This function asks the mixer which sound channels it * supports * * @param fd filehandle of an open OSS mixer device * @return channel mask or -1 on error */ int ossmixer_get_channel_mask (int fd) { int devmask; if (ioctl(fd, SOUND_MIXER_READ_DEVMASK, &devmask) >= 0) return devmask; return -1; } /** * @brief Set masters volume level to all slave channels * * This function sets the volume level of every slave to the same * level as the master. If the mixer device couldn't be opened, * nothing would be done. */ void ossmixer_set_slaves_volume () { struct driver_ossmixer *base = &moddata; int volume = (base->flags.mute ? 0 : base->volume); unsigned int n, devmask; int fd; devmask = base->userdevmask & base->mixerdevmask; if ((fd = open (base->device, O_RDWR)) >= 0) { /* open mixer device */ for (n=0; n < sizeof(mixerchannels) / sizeof(char *); n++) if ((devmask >> n & 1) == 1) ossmixer_set_channel_volume (fd, n, volume); close(fd); } } void ossmixer_set_channel_mask (char *channels[]) { struct driver_ossmixer *base = &moddata; int n; base->userdevmask = 0; g_string_truncate (base->channels, 0); while (*channels) { for (n=sizeof(mixerchannels) / sizeof(char *) -1; n >= 0; n--) if (!strcasecmp (mixerchannels[n], *channels)) { if (base->userdevmask == 0) base->master = n; /* first channel in list becomes master */ else base->channels = g_string_append (base->channels, ", "); base->userdevmask |= 1 << n; base->channels = g_string_append (base->channels, mixerchannels[n]); break; } channels++; } } int ossmixer_finish_init () { struct driver_ossmixer *base = &moddata; int fd, devmask; if ((fd = open (base->device, O_RDWR)) >= 0) { /* open mixer device */ if ((base->volume = ossmixer_get_channel_volume (fd, base->master)) != -1) { if ((devmask = ossmixer_get_channel_mask (fd)) != -1) base->mixerdevmask = devmask; else { base->mixerdevmask = 1 << SOUND_MIXER_VOLUME; print_msg (PBB_WARN, _("Can't get devmask from mixer [%s]; using default.\n"), base->device); } base->flags.init_complete = 1; /* mixer setup completed */ close (fd); return 0; } print_msg (PBB_ERR, _("Can't get volume of master channel [%s].\n"), mixerchannels[base->master]); close(fd); } else print_msg (PBB_WARN, _("Can't open mixer device [%s]. %s\n"), base->device, strerror(errno)); return -1; } /** * @brief Increment or decrease the master channel volume level * * This function increases, decreases or mute/unmute sound channels. * It opens the mixer devices as long as it is needed. The volume level * is tracked internal and only syncronized time by time with the hardware * volume level to take external mixer adjustments into account. If * everything was alright the new volume level would be returned. If the * mixer device could not be opened the function will return -1 without * changing the internal volume level. If the mixer isn't already set up, * this function will do it. * * @param increment how much should the masters colume change * @return current volume level or -1 on error */ int ossmixer_increment_master_volume (int increment) { struct driver_ossmixer *base = &moddata; int volume = base->volume; int fd; if (base->flags.init_complete == 0) /* is mixer setup already completed? */ if ((ossmixer_finish_init ()) != 0) /* no, then do it now */ return volume; /* Oops, try it again later */ if ((fd = open (base->device, O_RDWR)) >= 0) { /* open mixer device */ if ((volume = ossmixer_get_channel_volume (fd, base->master)) != -1) { if ((volume != 0) && (base->flags.mute)) /* someone else increased volume? */ base->flags.mute = 0; /* so we can't stay muted. */ if (base->flags.mute == 0) if ((base->volume < volume - VOLUME_FR) || (base->volume > volume + VOLUME_FR)) /* someone else changed volume */ base->volume = volume; /* so we must sychonize our volume level */ } volume = base->volume + increment; if (volume > VOLUME_MAX) volume = VOLUME_MAX; if (volume < VOLUME_MIN) volume = VOLUME_MIN; if (increment != 0) { /* volume should be increased/decreased? */ base->volume = volume; /* store new volume level */ base->flags.mute = 0; /* unmute channels */ } else { if (base->flags.mute == 0) { /* channels not already muted? */ volume = 0; base->flags.mute = 1; /* channels are muted. */ } else { volume = base->volume; /* set former volume level again */ base->flags.mute = 0; /* unmute channels */ } } ossmixer_set_channel_volume(fd, base->master, volume); close(fd); } else volume = -1; return volume; } gboolean ossmixer_is_muted (void) { struct driver_ossmixer *base = &moddata; return base->flags.mute == 1 ? TRUE : FALSE; } int ossmixer_get_volume (enum valueinc type) { struct driver_ossmixer *base = &moddata; switch (type) { case VALUE_ABS: case VALUE_ABS_PERCENT: return base->volume; case VALUE_REL: case VALUE_REL_PERCENT: default: return -1; /* no relative values available */ } } void ossmixer_set_volume (enum valueinc type, int volume) { struct driver_ossmixer *base = &moddata; int inc; switch (type) { case VALUE_REL: case VALUE_REL_PERCENT: inc = volume; break; case VALUE_ABS: case VALUE_ABS_PERCENT: inc = volume - base->volume; if (inc == 0) return; } if ((ossmixer_increment_master_volume (inc)) != -1) ossmixer_set_slaves_volume (); } void ossmixer_set_mixer (char *mixer) { struct driver_ossmixer *base = &moddata; GString *tmp; if ((check_path (mixer, TYPE_CHARDEV, 0)) == 0) { if (base->device) g_free (base->device); /* set the new mixer device */ tmp = g_string_new (mixer); base->device = tmp->str; g_string_free (tmp, FALSE); /* save new mixer device to configuration file */ config_set_string (SECTION, "Device", base->device); /* re-initialize the mixer with next usage */ base->flags.init_complete = 0; } } const char * ossmixer_get_mixer (void) { struct driver_ossmixer *base = &moddata; return base->device; } void ossmixer_set_channels (char *channels) { struct driver_ossmixer *base = &moddata; char **tmpstrlst; int n; tmpstrlst = g_strsplit (channels, ",", 0); for (n=0; tmpstrlst[n] != NULL; n++) g_strstrip (tmpstrlst[n]); ossmixer_set_channel_mask (tmpstrlst); g_strfreev (tmpstrlst); /* save new mixer channels to configuration file */ config_set_string (SECTION, "Channels", base->channels->str); } const char * ossmixer_get_channels (void) { struct driver_ossmixer *base = &moddata; return base->channels->str; } static struct driver_mixer driver_mixer_oss = { .name = N_("OSS Mixer"), .get_mixer = ossmixer_get_mixer, .set_mixer = ossmixer_set_mixer, .get_channels = ossmixer_get_channels, .set_channels = ossmixer_set_channels, .get_volume = ossmixer_get_volume, .set_volume = ossmixer_set_volume, .is_muted = ossmixer_is_muted, .driver_exit = driver_mixer_oss_exit }; struct driver_mixer * driver_mixer_oss_init () { struct driver_ossmixer *base = &moddata; char **channels; base->master = SOUND_MIXER_VOLUME; base->mixerdevmask = 1 << SOUND_MIXER_VOLUME; base->userdevmask = 0; base->volume = -1; base->flags.mute = 0; base->flags.init_complete = 0; base->channels = g_string_new (NULL); base->device = config_get_string (SECTION, "Device", "/dev/mixer"); if ((check_path (base->device, TYPE_CHARDEV, 0)) == 0) { channels = config_get_strlist (SECTION, "Channels", "volume"); ossmixer_set_channel_mask (channels); g_strfreev (channels); return &driver_mixer_oss; } driver_mixer_oss_exit (); return NULL; } pbbuttonsd-0.8.1a/src/driver_mixer_oss.h0000644000175000017500000000162310641705165015320 00000000000000#ifndef INCLUDE_DRIVER_MIXER_OSS_H #define INCLUDE_DRIVER_MIXER_OSS_H /** * @brief Low level mixer driver for OSS mixer. * * This file contains some definitions and the prototypes for the * OSS mixer driver. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation * (http://www.gnu.org/licenses/gpl.html) * * @file src/driver_mixer_oss.h * @author Matthias Grimm */ #define VOLUME_MAX 100 #define VOLUME_MIN 0 #define VOLUME_FR 6 /* volume failure range defines */ /* how wide the hardware volume level */ /* is allowed to jitter without adjustment */ /* public prototypes driver OSS mixer */ struct driver_mixer *driver_mixer_oss_init (); #endif /* INCLUDE_DRIVER_MIXER_OSS_H */ pbbuttonsd-0.8.1a/src/driver_mixer_alsa.c0000644000175000017500000002574610641705165015443 00000000000000/* -------------------------------------------------------------------------- * driver_mixer_alsa.c * This module contains the low level driver to control the ALSA mixer. The * low level driver overloads methods of class mixer. * * Copyright 2006 Matthias Grimm * Copyright 2004 John Steele Scott * Copyright 2002 Matthias Grimm * Copyright 1999-2000 by Jaroslav Kysela * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * -------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "gettext_macros.h" #include "input_manager.h" #include "class_config.h" #include "class_mixer.h" #include "driver_mixer_alsa.h" #include "debug.h" #define SECTION "MODULE MIXER ALSA" struct driver_alsamixer { char *card; /* name of the soundcard (usually "default" is fine) */ GString *channels; /* channel names to use */ struct { unsigned int init_complete:1; unsigned int mute:1; unsigned int:0; } flags; snd_mixer_t *mixer; snd_mixer_elem_t **elements; /* points to a NULL terminated list, first is master */ } moddata; /** free currently open alsa card ressources */ void driver_mixer_alsa_free () { struct driver_alsamixer *base = &moddata; if (base->elements) { free (base->elements); base->elements = NULL; } if (base->mixer) { snd_mixer_detach (base->mixer, base->card); snd_mixer_close (base->mixer); base->mixer = NULL; } base->flags.init_complete = 0; } void driver_mixer_alsa_exit () { struct driver_alsamixer *base = &moddata; driver_mixer_alsa_free (); g_free (base->card); g_string_free (base->channels, TRUE); } /* initialise the list of elements, based on the "channels" string */ static int alsamixer_setup_elements_internal (char *channels, snd_mixer_selem_id_t *sid) { struct driver_alsamixer *base = &moddata; char **element; int n, m; /* get rid of old list */ if (base->elements) { free (base->elements); base->elements = NULL; } base->flags.init_complete = 0; element = g_strsplit (channels, ",", 0); for (n=0,m=0; element[n] != NULL; n++) { g_strstrip (element[n]); /* ensure we have enough memory to store pointer + terminator */ base->elements = realloc (base->elements, (m+2)*sizeof (snd_mixer_elem_t *)); if (base->elements == NULL) { print_msg (PBB_ERR, _("Memory allocation failed.\n")); return -1; } /* find element */ for (base->elements[m] = snd_mixer_first_elem (base->mixer); base->elements[m] != NULL; base->elements[m] = snd_mixer_elem_next (base->elements[m])) { snd_mixer_selem_get_id (base->elements[m], sid); if (strcasecmp (snd_mixer_selem_id_get_name (sid), element[n]) == 0) break; } if (base->elements[m] == NULL) { /* report any element we can't find */ print_msg (PBB_WARN, _("Card '%s' has no '%s' element.\n"), base->card, element[n]); } else m++; } /* terminate list */ base->elements[m] = NULL; g_strfreev (element); /* check that we have a master element */ if (!base->elements[0]) { print_msg (PBB_WARN, _("Option 'ALSA_Elements' contains no valid elements\n")); return -1; } /* check that master element has a playback volume */ if (!snd_mixer_selem_has_playback_volume (base->elements[0])) { snd_mixer_selem_get_id (base->elements[0], sid); print_msg (PBB_WARN, _("Mixer element '%s' has no playback volume control.\n"), snd_mixer_selem_id_get_name (sid)); return -1; } base->flags.init_complete = 1; return 0; } /* wrapper arround alsamixer_setup_elements_internal so we can be sure to free the sid. */ static int alsamixer_setup_elements (char *channels) { snd_mixer_selem_id_t *sid; int err, result; /* create a selem_id to extract names from */ if ((err = snd_mixer_selem_id_malloc (&sid))){ print_msg (PBB_ERR, _("Memory allocation failed: %s\n"), snd_strerror (err)); return -1; } result = alsamixer_setup_elements_internal (channels, sid); snd_mixer_selem_id_free (sid); return result; } static int alsamixer_finish_init () { struct driver_alsamixer *base = &moddata; snd_mixer_t *mixer; int err; /* setup mixer */ if ((err = snd_mixer_open (&mixer, 0)) < 0) { print_msg (PBB_ERR, _("Can't open card '%s': %s\n"), base->card, snd_strerror (err)); return -1; } if ((err = snd_mixer_attach (mixer, base->card)) < 0) { print_msg (PBB_ERR, _("Can't attach card '%s': %s\n"), base->card, snd_strerror (err)); snd_mixer_close (mixer); return -1; } if ((err = snd_mixer_selem_register (mixer, NULL, NULL)) < 0) { print_msg (PBB_ERR, _("Can't register mixer: %s\n"), snd_strerror (err)); snd_mixer_detach (mixer, base->card); snd_mixer_close (mixer); return -1; } if ((err = snd_mixer_load (mixer)) < 0) { print_msg (PBB_ERR, _("Can't load card '%s': %s\n"), base->card, snd_strerror (err)); snd_mixer_detach (mixer, base->card); snd_mixer_close (mixer); return -1; } base->mixer = mixer; return alsamixer_setup_elements (base->channels->str); } /* Converts an ALSA volume to a number in the range [0, +/-100]. This function * assumes that the mixer has already been setup successfully. */ static int alsamixer_vol_to_percentage (snd_mixer_elem_t * elem, long volume) { long volmin, volmax; int pct; snd_mixer_selem_get_playback_volume_range (elem, &volmin, &volmax); pct = volmax == volmin ? 0 : rint(volume*100.0/(volmax-volmin)); if (pct > 100) pct = 100; if (pct < 0) pct = 0; return pct; } /* Converts a number in the range [0, +/-100] to an ALSA volume. This function * assumes that the mixer has already been setup successfully. */ static long alsamixer_percentage_to_vol (snd_mixer_elem_t * elem, int pct) { long volmin, volmax; snd_mixer_selem_get_playback_volume_range (elem, &volmin, &volmax); return rint((volmax-volmin)*pct/100.0); } /* Saves the current mute status in base-flags.>mute, and returns the volume of the first playback channel of the master element */ static int alsamixer_get_volume_absolute () { struct driver_alsamixer *base = &moddata; long volume; int mute; if (base->flags.init_complete == 0) /* is mixer setup already completed? */ if ((alsamixer_finish_init ()) != 0) /* no, then do it now */ return -1; /* Oops, try it again later */ /* force simple mixer to update its values from audio driver */ snd_mixer_handle_events (base->mixer); /* read values */ snd_mixer_selem_get_playback_switch (base->elements[0], 0, &mute); snd_mixer_selem_get_playback_volume (base->elements[0], 0, &volume); base->flags.mute = !mute; return volume; } /* same as alsamixer_get_volume_absolute, but returns the volume as number between 0 and 100 */ static int alsamixer_get_volume_as_percentage () { struct driver_alsamixer *base = &moddata; int volume; volume = alsamixer_get_volume_absolute (); return volume < 0 ? volume : alsamixer_vol_to_percentage (base->elements[0], volume); } gboolean alsamixer_is_muted (void) { struct driver_alsamixer *base = &moddata; return base->flags.mute == 1 ? TRUE : FALSE; } int alsamixer_get_volume (enum valueinc type) { switch (type) { case VALUE_ABS: return alsamixer_get_volume_absolute (); case VALUE_ABS_PERCENT: return alsamixer_get_volume_as_percentage (); case VALUE_REL: case VALUE_REL_PERCENT: default: return -1; /* no relative values available */ } } void alsamixer_set_volume (enum valueinc type, int volume) { struct driver_alsamixer *base = &moddata; long master = 0, vol, min, max; unsigned int n; if (base->flags.init_complete == 0) /* is mixer setup already completed? */ if ((alsamixer_finish_init ()) != 0) /* no, then do it now */ return; /* Oops, try it again later */ base->flags.mute = volume ? 0 : !base->flags.mute; /* cycle through elements */ for (n=0; base->elements[n] != NULL; n++) { /* sync playback switch */ snd_mixer_selem_set_playback_switch_all (base->elements[n], !base->flags.mute); if (n == 0) { switch (type) { case VALUE_REL: snd_mixer_selem_get_playback_volume_range (base->elements[0], &min, &max); if (max > 100) volume *= max/100 + 1; volume += alsamixer_get_volume_absolute (); case VALUE_ABS: master = alsamixer_vol_to_percentage (base->elements[0], volume); break; case VALUE_REL_PERCENT: volume += alsamixer_get_volume_as_percentage (); case VALUE_ABS_PERCENT: if (volume > 100) volume = 100; if (volume < 0) volume = 0; master = volume; break; } } /* sync volume with master element, if not muted */ if (!base->flags.mute && snd_mixer_selem_has_playback_volume (base->elements[n])) { vol = alsamixer_percentage_to_vol (base->elements[n], master); snd_mixer_selem_set_playback_volume_all (base->elements[n], vol); } } } void alsamixer_set_mixer (char *card) { struct driver_alsamixer *base = &moddata; GString *tmp; if (base->card) g_free (base->card); /* set the new mixer card */ tmp = g_string_new (card); base->card = tmp->str; g_string_free (tmp, FALSE); /* save new mixer card to configuration file */ config_set_string (SECTION, "Card", base->card); /* re-initialize the mixer with next usage */ driver_mixer_alsa_free(); } const char * alsamixer_get_mixer (void) { struct driver_alsamixer *base = &moddata; return base->card; } void alsamixer_set_channels (char *channels) { struct driver_alsamixer *base = &moddata; base->channels = g_string_assign(base->channels, channels); /* save new mixer channels to configuration file */ config_set_string (SECTION, "Channels", base->channels->str); driver_mixer_alsa_free(); } const char * alsamixer_get_channels (void) { struct driver_alsamixer *base = &moddata; return base->channels->str; } static struct driver_mixer driver_mixer_alsa = { .name = N_("ALSA Mixer"), .get_mixer = alsamixer_get_mixer, .set_mixer = alsamixer_set_mixer, .get_channels = alsamixer_get_channels, .set_channels = alsamixer_set_channels, .get_volume = alsamixer_get_volume, .set_volume = alsamixer_set_volume, .is_muted = alsamixer_is_muted, .driver_exit = driver_mixer_alsa_exit }; struct driver_mixer * driver_mixer_alsa_init () { struct driver_alsamixer *base = &moddata; char **channels; int n; base->flags.mute = 0; base->flags.init_complete = 0; base->channels = g_string_new (NULL); base->elements = NULL; base->mixer = NULL; if ((check_devorfile ("/proc/asound", TYPE_DIR)) == 0) { base->card = config_get_string (SECTION, "Device", "default"); channels = config_get_strlist (SECTION, "Channels", "Master"); for (n=0; channels[n] != NULL; n++) { if (n > 0) g_string_append (base->channels, ", "); g_string_append (base->channels, channels[n]); } g_strfreev (channels); return &driver_mixer_alsa; } return NULL; } pbbuttonsd-0.8.1a/src/driver_mixer_alsa.h0000644000175000017500000000135610641705165015437 00000000000000#ifndef INCLUDE_DRIVER_MIXER_ALSA_H #define INCLUDE_DRIVER_MIXER_ALSA_H /* ---------------------------------------------------------------------------- * driver_mixer_alsa.h * prototypes and definitions for a low level mixer driver. * * Copyright 2002-2006 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ /* public prototypes driver ALSA mixer */ struct driver_mixer *driver_mixer_alsa_init (); #endif /* INCLUDE_DRIVER_MIXER_ALSA_H */ pbbuttonsd-0.8.1a/src/module_peep.c0000644000175000017500000002707210643746130014233 00000000000000/* -------------------------------------------------------------------------- * module_test.c * code for test module * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * -------------------------------------------------------------------------*/ #ifdef DEBUG #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include "gettext_macros.h" #include "input_manager.h" #include "module_peep.h" #include "module_pmac.h" #include "support.h" #include "debug.h" static struct tagtable tagtab[] = { { "TAG_SKIP", TAG_SKIP}, { "TAG_SAVECONFIG", TAG_SAVECONFIG}, { "TAG_USERALLOWED", TAG_USERALLOWED}, { "TAG_AUTORESCAN", TAG_AUTORESCAN}, { "TAG_TIMEFORCMD", TAG_TIMEFORCMD}, { "TAG_VERSION", TAG_VERSION}, { "TAG_REINIT", TAG_REINIT}, { "TAG_KEYCODE", TAG_KEYCODE}, { "TAG_KEYREPEAT", TAG_KEYREPEAT}, { "TAG_MODIFIER", TAG_MODIFIER}, { "TAG_MOUSERELX", TAG_MOUSERELX}, { "TAG_MOUSERELY", TAG_MOUSERELY}, { "TAG_SYSINFO", TAG_SYSINFO}, { "TAG_SYSINFOSLAVE", TAG_SYSINFOSLAVE}, { "TAG_BACKLIGHTMAX", TAG_BACKLIGHTMAX}, { "TAG_BACKLIGHTLEVEL", TAG_BACKLIGHTLEVEL}, { "TAG_COVERSTATUS", TAG_COVERSTATUS}, { "TAG_BATLOG", TAG_BATLOG}, { "TAG_BATCYCLE", TAG_BATCYCLE}, #if PEEP_NOCYCLIC { "TAG_TIMEREMAINING", TAG_TIMEREMAINING | FLG_NOPEEP}, { "TAG_TIMECHANGED", TAG_TIMECHANGED | FLG_NOPEEP}, { "TAG_POWERSOURCE", TAG_POWERSOURCE | FLG_NOPEEP}, { "TAG_AMBIENTLIGHT", TAG_AMBIENTLIGHT | FLG_NOPEEP}, { "TAG_BATTERYPRESENT", TAG_BATTERYPRESENT | FLG_NOPEEP}, #else { "TAG_TIMEREMAINING", TAG_TIMEREMAINING}, { "TAG_TIMECHANGED", TAG_TIMECHANGED}, { "TAG_POWERSOURCE", TAG_POWERSOURCE}, { "TAG_AMBIENTLIGHT", TAG_AMBIENTLIGHT}, { "TAG_BATTERYPRESENT", TAG_BATTERYPRESENT}, #endif { "TAG_AMBIENTLIGHTMAX", TAG_AMBIENTLIGHTMAX}, { "TAG_POWERCHANGED", TAG_POWERCHANGED}, { "TAG_REQUESTSLEEP", TAG_REQUESTSLEEP}, { "TAG_SLEEPSUPPORTED", TAG_SLEEPSUPPORTED}, { "TAG_PREPAREFORSLEEP", TAG_PREPAREFORSLEEP}, { "TAG_WAKEUPFROMSLEEP", TAG_WAKEUPFROMSLEEP}, { "TAG_PMUDEVICE", TAG_PMUDEVICE}, { "TAG_ADBDEVICE", TAG_ADBDEVICE}, { "TAG_TPMODEUPKEY", TAG_TPMODEUPKEY}, { "TAG_TPMODEUPMOD", TAG_TPMODEUPMOD}, { "TAG_TPMODEDOWNKEY", TAG_TPMODEDOWNKEY}, { "TAG_TPMODEDOWNMOD", TAG_TPMODEDOWNMOD}, { "TAG_TPMODE", TAG_TPMODE}, { "TAG_NOTAPTYPING", TAG_NOTAPTYPING}, { "TAG_KBDMODE", TAG_KBDMODE}, { "TAG_KEYBLIGHTLEVEL", TAG_KEYBLIGHTLEVEL }, { "TAG_KEYBLIGHTMAX", TAG_KEYBLIGHTMAX }, { "TAG_LCDILLUMUPKEY", TAG_LCDILLUMUPKEY}, { "TAG_LCDILLUMUPMOD", TAG_LCDILLUMUPMOD}, { "TAG_LCDILLUMDOWNKEY", TAG_LCDILLUMDOWNKEY}, { "TAG_LCDILLUMDOWNMOD", TAG_LCDILLUMDOWNMOD}, { "TAG_KBDILLUMUPKEY", TAG_KBDILLUMUPKEY}, { "TAG_KBDILLUMUPMOD", TAG_KBDILLUMUPMOD}, { "TAG_KBDILLUMDOWNKEY", TAG_KBDILLUMDOWNKEY}, { "TAG_KBDILLUMDOWNMOD", TAG_KBDILLUMDOWNMOD}, { "TAG_KBDILLUMONKEY", TAG_KBDILLUMONKEY}, { "TAG_KBDILLUMONMOD", TAG_KBDILLUMONMOD}, { "TAG_LCDAUTOADJUST", TAG_LCDAUTOADJUST }, { "TAG_LCDAUTOADJAC", TAG_LCDAUTOADJAC }, { "TAG_LCDAUTOADJBAT", TAG_LCDAUTOADJBAT }, { "TAG_LCDBRIGHTNESS", TAG_LCDBRIGHTNESS}, { "TAG_LCDFADINGSPEED", TAG_LCDFADINGSPEED}, { "TAG_KBDAUTOADJUST", TAG_KBDAUTOADJUST }, { "TAG_KBDAUTOADJAC", TAG_KBDAUTOADJAC }, { "TAG_KBDAUTOADJBAT", TAG_KBDAUTOADJBAT }, { "TAG_KBDBRIGHTNESS", TAG_KBDBRIGHTNESS}, { "TAG_KBDONBRIGHTNESS", TAG_KBDONBRIGHTNESS}, { "TAG_KBDFADINGSPEED", TAG_KBDFADINGSPEED}, { "TAG_BRIGHTNESSOP", TAG_BRIGHTNESSOP}, { "TAG_FRAMEBUFFERDEVICE", TAG_FRAMEBUFFERDEVICE}, { "TAG_BLANKFRAMEBUFFER", TAG_BLANKFRAMEBUFFER}, { "TAG_CRTMIRROR", TAG_CRTMIRROR}, { "TAG_CRTMIRRORKEY", TAG_CRTMIRRORKEY}, { "TAG_CRTMIRRORMOD", TAG_CRTMIRRORMOD}, { "TAG_DIMFULLYDARK", TAG_DIMFULLYDARK}, { "TAG_SOUNDSYSTEM", TAG_SOUNDSYSTEM}, { "TAG_SOUNDSYSTEMCFG", TAG_SOUNDSYSTEMCFG}, { "TAG_MIXERDEVICE", TAG_MIXERDEVICE}, { "TAG_MIXERCARD", TAG_MIXERCARD}, { "TAG_VOLUMEUPKEY", TAG_VOLUMEUPKEY}, { "TAG_VOLUMEUPMOD", TAG_VOLUMEUPMOD}, { "TAG_VOLUMEDOWNKEY", TAG_VOLUMEDOWNKEY}, { "TAG_VOLUMEDOWNMOD", TAG_VOLUMEDOWNMOD}, { "TAG_MUTEKEY", TAG_MUTEKEY}, { "TAG_MUTEMOD", TAG_MUTEMOD}, { "TAG_MIXERINITDELAY", TAG_MIXERINITDELAY}, { "TAG_VOLUME", TAG_VOLUME }, { "TAG_MUTE", TAG_MUTE }, { "TAG_MIXERCHANNELS", TAG_MIXERCHANNELS }, { "TAG_MIXERELEMENTS", TAG_MIXERELEMENTS }, { "TAG_CDROMDEVICE", TAG_CDROMDEVICE }, { "TAG_EJECTCDKEY", TAG_EJECTCDKEY }, { "TAG_EJECTCDMOD", TAG_EJECTCDMOD }, { "TAG_EJECTCDKEYDELAY", TAG_EJECTCDKEYDELAY }, { "TAG_EJECTCD", TAG_EJECTCD }, { "TAG_SCRIPTPMCS", TAG_SCRIPTPMCS }, { "TAG_HEARTBEATBEEP", TAG_HEARTBEATBEEP }, { "TAG_SLEEPKEY", TAG_SLEEPKEY }, { "TAG_SLEEPMOD", TAG_SLEEPMOD }, { "TAG_SLEEPKEYDELAY", TAG_SLEEPKEYDELAY }, { "TAG_GOTOSLEEP", TAG_GOTOSLEEP }, { "TAG_GOTOHIBERNATE", TAG_GOTOHIBERNATE }, { "TAG_BWLFIRST", TAG_BWLFIRST }, { "TAG_BWLSECOND", TAG_BWLSECOND }, { "TAG_BWLLAST", TAG_BWLLAST }, { "TAG_CURRENTBWL", TAG_CURRENTBWL }, { "TAG_SLEEPINSECONDS", TAG_SLEEPINSECONDS }, { "TAG_CPULOADSLEEPLOCK", TAG_CPULOADSLEEPLOCK }, { "TAG_CPULOADMIN", TAG_CPULOADMIN }, { "TAG_CPULOADPERIOD", TAG_CPULOADPERIOD }, { "TAG_NETLOADSLEEPLOCK", TAG_NETLOADSLEEPLOCK }, { "TAG_NETLOADMIN", TAG_NETLOADMIN }, { "TAG_NETLOADPERIOD", TAG_NETLOADPERIOD }, { "TAG_NETLOADDEV", TAG_NETLOADDEV }, { "TAG_IBAMDATADIR", TAG_IBAMDATADIR }, { "TAG_CHARGETIME", TAG_CHARGETIME }, { "TAG_POLICY", TAG_POLICY }, { "TAG_ONAC_POLICY", TAG_ONAC_POLICY }, { "TAG_ONAC_TIMERACTION", TAG_ONAC_TIMERACTION }, { "TAG_ONAC_COVERACTION", TAG_ONAC_COVERACTION }, { "TAG_ONAC_KEYACTION", TAG_ONAC_KEYACTION }, { "TAG_ONAC_TIMESUSPEND", TAG_ONAC_TIMESUSPEND }, { "TAG_ONAC_TIMEDIM", TAG_ONAC_TIMEDIM }, { "TAG_ONBATT_POLICY", TAG_ONBATT_POLICY }, { "TAG_ONBATT_TIMERACTION",TAG_ONBATT_TIMERACTION }, { "TAG_ONBATT_COVERACTION",TAG_ONBATT_COVERACTION }, { "TAG_ONBATT_KEYACTION", TAG_ONBATT_KEYACTION }, { "TAG_ONBATT_TIMESUSPEND",TAG_ONBATT_TIMESUSPEND }, { "TAG_ONBATT_TIMEDIM", TAG_ONBATT_TIMEDIM }, { "TAG_EMERGENCYACTION", TAG_EMERGENCYACTION }, { "TAG_IDENTITY", TAG_IDENTITY }, { NULL, 0 }}; static struct tagtable errortab[] = { { N_("Permission denied"), E_PERM}, { N_("Private Tag"), E_PRIVATE}, { N_("File doesn't exist"), E_NOEXIST}, { N_("File not a character device"), E_NOCHAR}, { N_("File not a block device"), E_NOBLK}, { N_("File not a file"), E_NOFILE}, { N_("Buffer overflow"), E_BUFOVL}, { N_("open error"), E_OPEN}, { N_("format error"), E_FORMAT}, { N_("Messageport not available"), E_MSGPORT}, { N_("Server already running"), E_TWICE}, { N_("Help or version info"), E_INFO}, { N_("Insecure script owner"), E_USER}, { N_("Script must be write-only by owner"), E_RIGHTS}, { N_("read-only value"), E_NOWRITE}, { N_("write-only value"), E_NOREAD}, { N_("argument invalid"), E_INVALID}, { N_("function not supported"), E_NOSUPPORT}, { NULL, 0 }}; struct moddata_peep { int timer10; int timer100; int timer1000; int secure; } modbase_peep; int peep_init () { struct moddata_peep *base = &modbase_peep; base->timer10 = 0; base->timer100 = 0; base->timer1000 = 0; base->secure = 0; #if PEEP_KEYBOARD register_function (KBDQUEUE, peep_keyboard); #endif #if PEEP_MOUSE register_function (MOUSEQUEUE, peep_mouse); #endif #if PEEP_TIMER register_function (T10QUEUE, peep_t10); register_function (T100QUEUE, peep_t100); register_function (T1000QUEUE, peep_t1000); #endif register_function (CONFIGQUEUE, peep_config); register_function (QUERYQUEUE, peep_query); register_function (SECUREQUEUE, peep_secure); return 0; } void peep_exit () { } #if PEEP_KEYBOARD void peep_keyboard (struct tagitem *taglist) { int code = (int) tagfind (taglist, TAG_KEYCODE, 0); int value = (int) tagfind (taglist, TAG_KEYREPEAT, 0); int mod = (int) tagfind (taglist, TAG_MODIFIER, 0); printf("\tKeyboard: code %3d, value %d, modifier %d\r", code, value, mod); fflush(stdout); } #endif #if PEEP_MOUSE void peep_mouse (struct tagitem *taglist) { int rel_x = (int) tagfind (taglist, TAG_MOUSERELX, 0); int rel_y = (int) tagfind (taglist, TAG_MOUSERELY, 0); printf("Mouse: Rel-X %3d, Rel-Y %3d\n", rel_x, rel_y); } #endif #if PEEP_TIMER void peep_t10 (struct tagitem *taglist) { struct moddata_peep *base = &modbase_peep; base->timer10++; } void peep_t100 (struct tagitem *taglist) { struct moddata_peep *base = &modbase_peep; base->timer100++; } void peep_t1000 (struct tagitem *taglist) { struct moddata_peep *base = &modbase_peep; base->timer1000++; printf ("timer10: %d timer100: %d timer1000: %d secure: %d\n", base->timer10, base->timer100, base->timer1000, base->secure); } #endif void peep_ipc (struct tagitem *taglist) { #if PEEP_IPC peep_taglist ("IPC", taglist); #endif } void peep_config (struct tagitem *taglist) { #if PEEP_CONFIG peep_taglist ("Config", taglist); #endif } void peep_query (struct tagitem *taglist) { #if PEEP_QUERY peep_taglist ("Query", taglist); #endif } void peep_secure (struct tagitem *taglist) { #if PEEP_SECURE peep_taglist ("Secure", taglist); #endif } void peep_taglist (char *source, struct tagitem *taglist) { struct tagtable *tt, *tt2; char mark; if (taglist != NULL) while (taglist->tag != TAG_END) { if ((tt = findttentry (tagtab, taglist->tag & TAGMASK))) { if (tt->tag & FLG_NOPEEP) { taglist++; continue; /* skip tag */ } if (taglist->tag & FLG_ERROR) mark = 'E'; else if (tt->tag & FLG_DEPRECIATED) mark = 'D'; else if (tt->tag & FLG_PRIVATE) mark = 'P'; else mark = ' '; printf ("%-10s: %c %-25s: ", source, mark, tt->tagname); if (taglist->data == -1) { printf ("tag not filled"); } else if (tt->tag == TAG_SKIP) { tt2 = findttentry (tagtab, taglist->data); if (tt2 != NULL) printf ("%s", tt2->tagname); else printf ("???"); } else if (taglist->tag & FLG_ERROR) { tt2 = findttentry (errortab, taglist->data); if (tt2 != NULL) printf ("%s", tt2->tagname); else printf ("???"); } else if (tt->tag & FLG_STRING) { printf ("\"%s\"", (char *) taglist->data); } else { printf ("%ld", taglist->data); } printf (" \n"); } else printf ("%-10s: %-25s: %lx\n", source, _("unknown tag"), taglist->tag & TAGMASK); taglist++; } } struct tagtable * findttentry (struct tagtable *ttab, long tag) { while (ttab->tag != 0) { if ((ttab->tag & TAGMASK) == tag) return ttab; ttab++; } return NULL; } #endif /* Debug */ pbbuttonsd-0.8.1a/src/module_peep.h0000644000175000017500000000242110641705160014223 00000000000000#ifndef INCLUDE_MODULE_PEEP_H #define INCLUDE_MODULE_PEEP_H /* ---------------------------------------------------------------------------- * module_peep.h * prototypes and definitions for the module peep. * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include struct tagtable { char *tagname; long tag; }; /* public prototypes */ int peep_init (); void peep_exit (); /* private prototypes */ void peep_keyboard (struct tagitem *taglist); void peep_mouse (struct tagitem *taglist); void peep_t10 (struct tagitem *taglist); void peep_t100 (struct tagitem *taglist); void peep_t1000 (struct tagitem *taglist); void peep_ipc (struct tagitem *taglist); void peep_config (struct tagitem *taglist); void peep_query (struct tagitem *taglist); void peep_secure (struct tagitem *taglist); void peep_taglist (char *source, struct tagitem *taglist); struct tagtable *findttentry (struct tagtable *ttab, long tag); #endif /* INCLUDE_MODULE_PEEP_H */ pbbuttonsd-0.8.1a/src/debug.h0000644000175000017500000000526310641705157013030 00000000000000#ifndef INCLUDE_DEBUG_H #define INCLUDE_DEBUG_H /* ---------------------------------------------------------------------------- * debug.h * definitions for debugging. This file describes in detail which debug * information should be printed to console. The symbol DEBUG must also * be defined. It is the master key for all of this options. * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ /* emulation flags for non available hardware */ #define SIMU_I386 0 /* =1, some i386 specific calls will be redirected */ #define SIMU_ACPI 0 /* =1, read acpi info from home instead of /proc */ #define SIMU_AMBIENT 0 /* =1 for simulating ambient light sensor */ /* module_powersave.c */ #define SLEEPLOCKS 0 /* =1 for printing sleeplock status to console */ #define IBAM 0 /* =1 for printing adaptive battery time */ /* module_pmac.c & module_imac.c */ #define PMUINTR 0 /* =1 for printing PMU interrupts to console */ #define PMUTALK 0 /* =1 for logging PMU communication into /var/log/pbbuttonsd */ #define TRACKPAD 0 /* =1 for debugging dynamic trackpad reconfiguration */ /* module_cdrom.c */ #define CDROM 0 /* =1 mount and status information */ #define CDROMPERF 0 /* =1 for printing CDROM performance data to console */ /* module_display.c */ #define BRIGHTNESS 0 /* =1 show current brightness values of KBD and LCD */ #define DISPLAYTIMER 0 /* =1 show when the display timer is active */ #define AMBIENT 0 /* =1 for printing some ambient values to console */ #define FADING 0 /* =1 for printing fading values to console */ /* module_peep.c */ #define PEEP_IPC 1 /* =1, all tags sent to clients will be printed */ #define PEEP_CONFIG 1 /* =1, all configure tags will be printed */ #define PEEP_QUERY 1 /* =1, all query tags will be printed */ #define PEEP_SECURE 1 /* =1, all security tags will be printed */ #define PEEP_KEYBOARD 0 /* =1, keyboard events are printed */ #define PEEP_MOUSE 0 /* =1, mouse events are printed */ #define PEEP_TIMER 0 /* =1, timer events are printed */ #define PEEP_NOCYCLIC 1 /* =1, some cyclic tags will be filtered out */ /* module_acpi.c */ #define ACPI_EVENTS 0 /* =1, show information about ACPI events */ #define ACPI_PATHS 0 /* =1, show ACPI files, selected for polling */ #define ACPI_BATTERY 0 /* =1, show information about ACPI batteries */ #endif /* INCLUDE_DEBUG_H */ pbbuttonsd-0.8.1a/src/tcp.c0000644000175000017500000001420210641705155012512 00000000000000/* * --------------------------------------------------------------------------- * $Id: tcp.c,v 1.3 2003/11/12 18:25:05 matthiasgrimm Exp $ * --------------------------------------------------------------------------- * Revision 1.1.1.1 2001/12/07 11:31:48 sleemburg * Initial CVS import of the unreleased pmud-0.8 to apmud (new project name * because of a name clash at sourceforge.net). * * Revision 1.3 1999/01/12 08:29:17 stephan * in tcp_open, close the socket if the connection fails. * * Revision 1.2 1998/09/15 07:13:31 stephan * win32 modifications by Job de Haas (job@dsl.nl) * * Revision 1.1 1998/04/02 12:54:49 stephan * Initial revision * * --------------------------------------------------------------------------- */ #ifdef HAVE_CONFIG_H # include #endif #ifdef WITH_PMUD #include #ifndef WIN32 #include #endif #include #include #include #ifdef WIN32 #include #include #define open _open #define close _close #else #include #include #include #include #include #endif #if defined( __STDC__ ) || defined( WIN32 ) #include #else #include #endif #define FATAL(error) { errno = error; return (-1); } /* * --------------------------------------------------------------------------- * public interface * --------------------------------------------------------------------------- */ int tcp_open(char *, char *, unsigned short); int tcp_bind(unsigned short); void tcp_listen(int); int tcp_read(int, const char *, size_t); int tcp_write(int, const char *, size_t); #ifdef __STDC__ int tcp_printf(int, char *, ...); #else int tcp_printf(); #endif #ifdef SOCKS #define connect Rconnect #define getsockname Rgetsockname #define bind Rbind #define accept Raccept #define listen Rlisten #define select Rselect #endif #ifdef WIN32 int first = 1; #endif int tcp_open(char *host, char *service, unsigned short port) { struct sockaddr_in server; struct hostent *hostinfo; struct servent *servinfo; #ifdef WIN32 SOCKET sock_fd; int iResult; if(first) { /* Start the WSA */ WSADATA wsadata; iResult= WSAStartup( MAKEWORD( 1, 1 ), &wsadata ); if( iResult != 0 ) FATAL( iResult ); first = 0; } #else int sock_fd; #endif /* use localhost if none specified */ if(! host || ! *host) host = "localhost"; /* check arguments */ if( (!service || !*service ) && port <= 0) #ifdef WIN32 FATAL(WSAEDESTADDRREQ) #else FATAL(EDESTADDRREQ) #endif /* initialise the server information */ memset((char *) &server, 0, sizeof(server)); server.sin_family = AF_INET; server.sin_port = htons(port); /* try to get the server specification, if fail then use port */ if( service && *service ) { servinfo = getservbyname(service, "tcp"); if(servinfo) server.sin_port = servinfo->s_port; } /* try to get the address of the host */ server.sin_addr.s_addr = inet_addr(host); if( server.sin_addr.s_addr == INADDR_NONE ) { hostinfo = gethostbyname(host); if(!hostinfo) #ifdef WIN32 FATAL(WSAEADDRNOTAVAIL) #else FATAL(EADDRNOTAVAIL) #endif memcpy( (char *) &server.sin_addr, hostinfo->h_addr, hostinfo->h_length ); } /* create socket */ sock_fd = socket(AF_INET, SOCK_STREAM, 0); if( sock_fd < 0 ) FATAL(errno) /* connect to the server */ if(connect(sock_fd, (struct sockaddr *) &server, sizeof(server)) < 0) { close(sock_fd); FATAL(errno) } return(sock_fd); } int tcp_bind(unsigned short port) { int fd; struct sockaddr_in server; fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if(fd < 0) return fd; memset((char*)&server, 0, sizeof(server)); server.sin_family = AF_INET; server.sin_addr.s_addr = htonl(INADDR_ANY); server.sin_port = htons(port); if(bind(fd, (struct sockaddr*) &server, sizeof(server)) < 0) { close(fd); return -1; } return fd; } void tcp_listen(int fd) { if(fd>=0) listen(fd, 5); } int tcp_accept(int fd) { return accept(fd, (struct sockaddr*)0, (int*)0); } int tcp_close(int fd) { #ifdef WIN32 if (!first) { int iResult = WSACleanup(); if(iResult != 0) FATAL(iResult) } #endif return close(fd); } char *tcp_identify(int fd) { struct sockaddr_in client; int len = sizeof(client); char *inetaddr; struct hostent *remote; struct in_addr *remaddr; register int i; int match; if(getpeername(fd, (struct sockaddr*) &client, &len)) return (char*)0; if(client.sin_family != AF_INET) return 0; inetaddr = inet_ntoa(client.sin_addr); if(inetaddr <= (char*)0) return (char*)0; remote=gethostbyaddr((char *)&client.sin_addr, sizeof(client.sin_addr), (int)client.sin_family); if(!remote) return (char*)0; for(match=i=0; remote->h_addr_list[i]; i++) { remaddr = (struct in_addr*) remote->h_addr_list[i]; if(remaddr->s_addr == client.sin_addr.s_addr) match++; } return match ? remote->h_name : (char*)0; } int tcp_write(int fildes, const char *buffer, size_t nbytes) { register char *data; register size_t right; register size_t left; for(data=(char *)buffer, left=nbytes;;) if((right=send(fildes, data, left, 0)) < 0) { return right; } else { left -= right; data += right; /* if right == 0 then EOF, return #bytes written */ if(right == 0 || left == 0) return nbytes - left; } /*NOTREACHED*/ } int tcp_read(int fildes, const char *buffer, size_t nbytes) { register char *data; register size_t right; register size_t left; for(data=(char *)buffer, left=nbytes;;) if((right=recv(fildes, data, left, 0)) < 0) { return right; } else { left -= right; data += right; /* if right == 0 then EOF, return #bytes already read */ if(right == 0 || left == 0) return nbytes - left; } /*NOTREACHED*/ } /*VARARGS*/ int #if defined( __STDC__ ) || defined( WIN32 ) tcp_printf(int sock, char *fmt, ...) #else tcp_printf(sock, fmt, va_alist) int sock; char *fmt; va_dcl #endif { va_list ap; static char buf[2*BUFSIZ]; #if defined( __STDC__ ) || defined( WIN32 ) va_start(ap, fmt); #else va_start(ap); #endif vsprintf(buf, fmt, ap); va_end(ap); return tcp_write(sock, buf, strlen(buf)); } #endif /* WITH_PMUD */ pbbuttonsd-0.8.1a/src/tcp.h0000644000175000017500000000247010641705161012520 00000000000000/* * --------------------------------------------------------------------------- * $Id: tcp.h,v 1.2 2002/08/21 17:55:08 matthiasgrimm Exp $ * --------------------------------------------------------------------------- * $Log: tcp.h,v $ * Revision 1.2 2002/08/21 17:55:08 matthiasgrimm * new version 0.5 * * Revision 1.1 2002/08/13 16:14:47 matthiasgrimm * initial upload * * Revision 1.1 2002/03/17 14:19:39 matthiasgrimm * *** empty log message *** * * Revision 1.1.1.1 2001/12/07 11:31:48 sleemburg * Initial CVS import of the unreleased pmud-0.8 to apmud (new project name * because of a name clash at sourceforge.net). * * Revision 1.1 2000/02/09 20:44:20 stephan * Initial revision * * --------------------------------------------------------------------------- */ #ifndef HDR_MYTCP_H #define HDR_MYTCP_H /* * --------------------------------------------------------------------------- * public interface * --------------------------------------------------------------------------- */ int tcp_open(char *, char *, unsigned short); int tcp_bind(unsigned short); void tcp_listen(int); int tcp_read(int, const char *, size_t); int tcp_write(int, const char *, size_t); #ifdef __STDC__ int tcp_printf(int, char *, ...); #else int tcp_printf(); #endif int tcp_close(int); #endif /* HDR_MYTCP_H */ pbbuttonsd-0.8.1a/scripts/0002777000175000017500000000000010652456422012551 500000000000000pbbuttonsd-0.8.1a/scripts/pmcs-apmd0000755000175000017500000000425210652456422014275 00000000000000#!/bin/sh # # This shell script is called by the APM daemon (apmd) when the state # of any power management function has changed. The exact events that # trigger the calling of apmd_proxy depend on how apmd was configured # at compile time. # # Here are the calling sequences for apmd_proxy: # # apmd_proxy start - APM daemon has started # apmd_proxy stop - APM daemon is shutting down # apmd_proxy suspend system - APM system has requested suspend mode # apmd_proxy suspend critical - APM system indicates critical suspend # apmd_proxy standby system - APM system has requested standby mode # apmd_proxy suspend user - User has requested suspend mode # apmd_proxy standby user - User has requested standby mode # apmd_proxy resume suspend - System has resumed from suspend mode # apmd_proxy resume standby - System has resumed from standby mode # apmd_proxy resume critical - System has resumed from critical suspend # apmd_proxy change battery - APM system reported low battery # apmd_proxy change power - APM system reported AC/battery change # apmd_proxy change time - APM system reported need for time update # apmd_proxy change capability - APM system reported config. change # PATH=/bin:/sbin:/usr/bin:/usr/sbin on_ac_power >/dev/null && PWR=ac || PWR=battery cd `dirname $0` case "$1" in start) if [ "$PWR" = "battery" ]; then run-parts --arg="powersave" --arg="$PWR" event.d else run-parts --arg="performance" --arg="$PWR" event.d fi ;; change) case "$2" in battery) wall "Low battery - system will go down now!" ;; power) if [ "$PWR" = "battery" ]; then run-parts --arg="powersave" --arg="$PWR" event.d else run-parts --arg="performance" --arg="$PWR" event.d fi ;; esac ;; suspend|standby) [ -d suspend.d ] && run-parts --arg="suspend" --arg="$PWR" --arg="ram" suspend.d run-parts --arg="suspend" --arg="$PWR" --arg="ram" event.d ;; resume) [ -d resume.d ] && run-parts --arg="resume" --arg="$PWR" --arg="ram" resume.d run-parts --arg="resume" --arg="$PWR" --arg="ram" event.d ;; esac pbbuttonsd-0.8.1a/scripts/pmcs-config0000644000175000017500000000155510652456422014621 00000000000000# Configuration file for the PowerManagement Control Scripts # Section for general options general_HDDevice="/dev/hda" # hdsetup general_PCMCIAShutdown="suspend" # pcmcia # Path of laptop_mode.sh delivered with the kernel source tree # The script is not externally configurable yet. You have to # modify the script according your needs. general_LMScript=scripts.d/laptopmode.sh # Section for power policy 'performance' performance_HDTimeOff=0 # hdsetup - timeout in seconds performance_HDOptions="" # hdsetup performance_LaptopMode="stop" # bdflush # Section for power policy 'custom' custom_HDTimeOff=60 # hdsetup - timeout in seconds custom_HDOptions="" # hdsetup custom_LaptopMode="start" # bdflush # Section for power policy 'powersave' powersave_HDTimeOff=60 # hdsetup - timeout in seconds powersave_HDOptions="" # hdsetup powersave_LaptopMode="start" # bdflush pbbuttonsd-0.8.1a/scripts/pmcs-pbbuttonsd0000755000175000017500000000367310652456422015546 00000000000000#!/bin/sh # # This script is invoked by pbbuttonsd to configure the system for a # given power level. The script gets three arguments: # The first and the the third argument belong together. The first # argument is a command and the third a corresponding argument. Not # each of the commands have a corresponding argument. The following # table shows possible combinations: # # $1 $3 # 'powersave' | power policies transfered to slave # 'custom' | scripts # 'performance' | # 'suspend' 'ram' prepare for suspend to RAM (sleep) # 'disk' prepare for suspend to disk # 'shutdown' prepare for system shutdown # 'resume' 'ram' after wakeup from suspend to RAM # 'disk' theoretically, not used yet # 'emergency' battery is critically low -> shutdown. # 'shutdown' user initiated a system shutdown. # 'cover-open' 'open' cover has been opened # 'cover-close' 'close' cover has been closed # # 'cover-open' and 'cover-closed' will only be called if no other # suspend script is going to be called or sleep is not supported # on this machine. The argument for this command is a future # investment. # # The second argument contains the current powersource of the laptop # 'ac' # 'battery' # # The commands 'emergency' and 'shutdown' are handled directly. All # other commands will be transfered to the slave scripts which hopefully # will do the work. PATH=/bin:/sbin:/usr/bin:/usr/sbin # Logging is done by the pbbuttonsd daemon. case "$1" in emergency) shutdown -h now "Low battery - system will go down now!" ;; shutdown) shutdown -h now "User requested shutdown - system will go down now!" ;; *) cd `dirname $0` PATH=$PATH:$PWD [ -d ${1}.d ] && run-parts --arg="$1" --arg="$2" --arg="$3" ${1}.d run-parts --arg="$1" --arg="$2" --arg="$3" event.d ;; esac pbbuttonsd-0.8.1a/scripts/pmcs-pmud0000755000175000017500000000276110652456422014324 00000000000000#!/bin/sh # # This script is invoked by pmud to configure the system for a # given power level. The desired level is indicated by the first # argument and can take the following values: # # minimum = minimum power # medium = medium power # maximum = full power # lid-opened = cover has been opened # lid closed = cover has been closed # sleep = prepare for sleep # wakeup = system woke up after a sleep # warning = low battery condition detected, issue a warning to users # # the second argument gives the current power source, and can take the # following values: # # ac # battery # PATH=/bin:/sbin:/usr/bin:/usr/sbin [ -x logger ] && \ logger -p daemon.info -t pmcs-pmud "called with $1 $2" cd `dirname $0` case "$1" in warning) wall "Low battery - system will go down now!" ;; minimum) run-parts --arg="powersave" --arg="$2" event.d ;; medium) run-parts --arg="custom" --arg="$2" event.d ;; maximum) run-parts --arg="performance" --arg="$2" event.d ;; lid-opened) run-parts --arg="cover-open" --arg="$2" --arg="open" event.d ;; lid-closed) run-parts --arg="cover-close" --arg="$2" --arg="close" event.d ;; sleep) [ -d suspend.d ] && run-parts --arg="suspend" --arg="$2" --arg="ram" suspend.d run-parts --arg="suspend" --arg="$2" --arg="ram" event.d ;; wakeup) [ -d resume.d ] && run-parts --arg="resume" --arg="$2" --arg="ram" resume.d run-parts --arg="resume" --arg="$2" --arg="ram" event.d ;; esac pbbuttonsd-0.8.1a/scripts/README0000644000175000017500000001317410652456422013351 00000000000000 PowerManagement Control Scripts ---------------------------------------------------------- Matthias Grimm , 2004 Introduction ------------ A powermanagement daemon can't be prepared for all aspects of power management for a whole bunch of different systems. The hardware is not always the same, used software needs some special care or the user wants a special job done at a certain event. All this aspects can't be handled in one single program without help. This help is usually a highly adaptable shell script. Most tasks that have to be done after a power management event are common tasks needed from most people. For example someone with an IDE hard disk may want to spin down the disk after some idle time. Those scripts for common tasks useful for many people without change are collected in the PowerManagement Control Scripts. As mentioned this package contains a lot of common scripts to assist the power management handling of the daemon. But on a certain computer not all are needed. To control which scripts should be executed and which not, the scripts are stored in different locations: ./scripts.d place for all scripts in package. Scripts in this directory are referenced to as 'slave scripts' later in this document ./event.d place for scripts to be executed If following directories exist the containing scripts will be executed just before suspend and after wakeup additionally to those in ./event.d: ./suspend.d contains scripts to be launched before suspend ./resume.d contains scripts to be launched after wakeup In avoidance of storing each script twice the directories ./event.d, ./suspend.d and ./resume.d should only contain symbolic links to the real scripts in ./scripts.d. The master script will not differentiate between suspend-to-ram and suspend-to-disk. In both cases the scripts in suspend.d will be executed. A third argument will help to distinguish the two cases. Each script now may decide to handle the two cases seperately or not. If the calling sequence matters, use link name with leading numbers. For example: suspend.d/20nfs -> ../scripts.d/nfs umount filesystems first suspend.d/21eth0 -> ../scripts.d/eth0 then shut down eth0 resume.d/20eth0 -> ../scripts.d/eth0 first bring up eth0 before resume.d/21nfs -> ../scripts.d/nfs mounting filesystems again The Master Script ----------------- The master script will be called by the powermanagement daemon and will then launch all slave scripts in ./event.d. The main task of this script is to translate the given arguments from the daemon into those the slave scripts understand. In some cases it might be useful that the master script itself complete a task directly without calling any slave script. To adapt the PMCS (PowerManagement Control Scripts) to a new powermanagement daemon, a new master script for this deamon have to be provided. Nothing else have to be changed. The slave scripts can be used without any change. Master scripts for some common powermanagement daemons are already included: pmcs-pbbuttonsd, pmcs-pmud and pmcs-apmd. The Slave Scripts ----------------- As already mentioned the slave scripts actual do the work. They are stored in .scripts.d and the active ones are linked to ./event.d. Each scripts except at least two arguments; some accept three: arg $1: contains the action code or the power policy that should be set. Possible keywords are: 'powersave' power policy, minimum power consumption 'custom' power policy, user defined, something in between 'performance' power policy, maximum performance 'suspend' action, prepare for sleep 'resume' action, wakeup from sleep 'cover-open' action, cover has been opened 'cover-close' action, cover has been closed arg $2: power source. following keywords are possible: 'ac' the computer runs on AC power 'battery' the computer runs on battery power arg $3: argument for arg $1 depending on arg $1. Following arguments have been defined yet: 'ram'|'disk' for 'suspend' and 'resume' 'open' for 'cover-open' 'close' for 'cover-close' The arguments 'cover-open' / 'cover-closed' and 'suspend' / 'resume' are mutually exclusive. The 'cover-*' scripts will only be called if no suspend mode is chosen at all or the chosen suspend mode is not supported on this machine. The third argument of the 'cover-*' events will allow to combine those two commands in the slave scripts. It might happen in future that the two commands 'cover-open' and 'cover-close' will be replaced by one single command called 'cover'. New scripts should take this into account. The Configuration ----------------- Most slave scripts allow some options to configure. In avoidance of setting those options in each slave script all configuration options are collected in the file 'pmcs-config' that will be sourced by all slave scripts. This 'pmcs-config' contains shell variables containing the option. This variables will then be used in the slave scripts. To get the full option list of a slave script please refer the scripts documentation or look into the script itself. Each pmcs-config variable should be unique and carry a certain prefix: general_ if the variable defines a policy independent option powersave_ if the option belongs to 'powersave' policy custom_ if the option belongs to 'custom' policy performance_ if the option belongs to 'performance' policy Licence ------- All scripts and attached material are published under the terms of the GNU Public Licence (GPL). pbbuttonsd-0.8.1a/scripts/scripts.d/0002777000175000017500000000000010652456422014462 500000000000000pbbuttonsd-0.8.1a/scripts/scripts.d/apmd-compat0000755000175000017500000000244010652456422016524 00000000000000#!/bin/sh # # name : apmd-compat # author : Guido Guenther # description : Execute scripts in /etc/apm for compatibility # # --- end of public part -- don't change below this line --- . pmcs-config [ -d "/etc/apm" ] || exit 0 case "$2" in battery) if [ -x /etc/apm/apmd_proxy ]; then /etc/apm/apmd_proxy change power else run-parts --arg=change --arg=power /etc/apm/event.d if [ -d /etc/apm/other.d ]; then run-parts --arg=change --arg=power /etc/apm/other.d fi fi ;; ac) if [ -x /etc/apm/apmd_proxy ]; then /etc/apm/apmd_proxy change power else run-parts --arg=change --arg=power /etc/apm/event.d if [ -d /etc/apm/other.d ]; then run-parts --arg=change --arg=power /etc/apm/other.d fi fi ;; esac case "$1" in suspend) if [ -x /etc/apm/apmd_proxy ]; then /etc/apm/apmd_proxy $1 user else run-parts --arg=$1 --arg=user /etc/apm/event.d if [ -d /etc/apm/$1.d ]; then run-parts --arg=$1 --arg=user /etc/apm/$1.d fi fi ;; resume) if [ -x /etc/apm/apmd_proxy ]; then /etc/apm/apmd_proxy $1 suspend else run-parts --arg=$1 --arg=suspend /etc/apm/event.d if [ -d /etc/apm/$1.d ]; then run-parts --arg=$1 --arg=suspend /etc/apm/$1.d fi fi ;; esac pbbuttonsd-0.8.1a/scripts/scripts.d/bdflush0000755000175000017500000000241010652456422015746 00000000000000#!/bin/sh # name : bdflush # author : Matthias Grimm # description : toggle laptop mode in kernel and adjust # memory management buffer flush timeouts # This script will first look for an global laptop-mode # script before running a private version. # requirements: laptop-mode patch in kernel # laptopmode.sh somewhere on your system # limitations : none # # --- end of public part -- don't change below this line --- if [ -x event.d/apmd-compat ]; then if [ -x /etc/apm/event.d/laptop-mode ]; then logger -p daemon.error -t pmcs-bdflush "External laptop-mode script found - exiting." exit 0 fi fi # source configuration . pmcs-config if [ -w /proc/sys/vm/laptop_mode ]; then if [ -x $general_LMScript ]; then case "$1" in powersave) $general_LMScript $powersave_LaptopMode ;; custom) $general_LMScript $custom_LaptopMode ;; performance) $general_LMScript $performance_LaptopMode ;; esac elif [ -x logger ]; then logger -p daemon.error -t pmcs-bdflush "Can't find $general_LMScript." fi elif [ -x logger ]; then logger -p daemon.error -t pmcs-bdflush "Laptop-mode patch missing in kernel." fi pbbuttonsd-0.8.1a/scripts/scripts.d/cpufreq0000755000175000017500000000460310652456422015772 00000000000000#!/bin/sh # name : cpufreq # author : Dominik Brodowski # Davin Kimdon # modified : Matthias Grimm # description : Set processor frequency # requirements: # limitations : only first CPU supported # # --- end of public part -- don't change below this line --- # source configuration . pmcs-config KVER=`uname -r` case "$1" in powersave|custom) case "$KVER" in 2.6.*) if [ -d /sys ]; then echo -n "userspace" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed elif [ -f /proc/cpufreq ]; then echo -n "0:0:0:powersave" > /proc/cpufreq elif [ -d /proc/sys/cpu ]; then cat /proc/sys/cpu/0/speed-min > /proc/sys/cpu/0/speed fi ;; 2.4.*) if [ -f /proc/cpufreq ]; then echo -n "0:0:0:powersave" > /proc/cpufreq elif [ -d /proc/sys/cpu ]; then cat /proc/sys/cpu/0/speed-min > /proc/sys/cpu/0/speed fi ;; esac ;; performance) case "$KVER" in 2.6.*) if [ -d /sys ]; then echo -n "userspace" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed elif [ -f /proc/cpufreq ]; then echo -n "0%76%100%performance" > /proc/cpufreq elif [ -d /proc/sys/cpu ]; then cat /proc/sys/cpu/0/speed-max > /proc/sys/cpu/0/speed fi ;; 2.4.*) if [ -f /proc/cpufreq ]; then echo -n "0%76%0100%performance" > /proc/cpufreq elif [ -d /proc/sys/cpu ]; then cat /proc/sys/cpu/0/speed-max > /proc/sys/cpu/0/speed fi ;; esac ;; suspend) ;; resume) ;; esac pbbuttonsd-0.8.1a/scripts/scripts.d/hdsetup0000755000175000017500000000152410652456422016000 00000000000000#!/bin/sh # name : hdsetup # author : Matthias Grimm # description : Set harddisk spin-down timeouts # requirements: hdparm and sync in path # limitations : work only with IDE harddisks # controls only a single harddisk # # --- end of public part -- don't change below this line --- # source configuration . pmcs-config case "$1" in powersave) for HD in $general_HDDevice; do hdparm $powersave_HDOptions -S $(($powersave_HDTimeOff/5)) $HD done ;; custom) for HD in $general_HDDevice; do hdparm $custom_HDOptions -S $(($custom_HDTimeOff/5)) $HD done ;; performance) for HD in $general_HDDevice; do hdparm $performance_HDOptions -S $(($performance_HDTimeOff/5)) $HD done ;; suspend) sync ;; resume) ;; esac pbbuttonsd-0.8.1a/scripts/scripts.d/laptopmode.sh0000755000175000017500000002176710652456422017114 00000000000000#! /bin/sh # start or stop laptop_mode, best run by a power management daemon when # ac gets connected/disconnected from a laptop # # install as /sbin/laptop_mode # # Contributors to this script: Kiko Piris # Bart Samwel # Micha Feigin # Andrew Morton # Dax Kelson # # Original Linux 2.4 version by: Jens Axboe # Remove an option (the first parameter) of the form option= from # a mount options string (the rest of the parameters). parse_mount_opts () { OPT="$1" shift echo "$*" | \ sed 's/.*/,&,/' | \ sed 's/,'"$OPT"'=[0-9]*,/,/g' | \ sed 's/,,*/,/g' | \ sed 's/^,//' | \ sed 's/,$//' | \ cat - } # Remove an option (the first parameter) without any arguments from # a mount option string (the rest of the parameters). parse_nonumber_mount_opts () { OPT="$1" shift echo "$*" | \ sed 's/.*/,&,/' | \ sed 's/,'"$OPT"',/,/g' | \ sed 's/,,*/,/g' | \ sed 's/^,//' | \ sed 's/,$//' | \ cat - } # Find out the state of a yes/no option (e.g. "atime"/"noatime") in # fstab for a given filesystem, and use this state to replace the # value of the option in another mount options string. The device # is the first argument, the option name the second, and the default # value the third. The remainder is the mount options string. # # Example: # parse_yesno_opts_wfstab /dev/hda1 atime atime defaults,noatime # # If fstab contains, say, "rw" for this filesystem, then the result # will be "defaults,atime". parse_yesno_opts_wfstab () { L_DEV=$1 shift OPT=$1 shift DEF_OPT=$1 shift L_OPTS="$*" PARSEDOPTS1="$(parse_nonumber_mount_opts $OPT $L_OPTS)" PARSEDOPTS1="$(parse_nonumber_mount_opts no$OPT $PARSEDOPTS1)" # Watch for a default atime in fstab FSTAB_OPTS="$(cat /etc/fstab | tr -s "[:blank:]" " " | grep ^\ *"$L_DEV " | awk '{ print $4 }')" if [ -z "$(echo "$FSTAB_OPTS" | grep "$OPT")" ] ; then # option not specified in fstab -- choose the default. echo "$PARSEDOPTS1,$DEF_OPT" else # option specified in fstab: extract the value and use it if [ -z "$(echo "$FSTAB_OPTS" | grep "no$OPT")" ] ; then # no$OPT not found -- so we must have $OPT. echo "$PARSEDOPTS1,$OPT" else echo "$PARSEDOPTS1,no$OPT" fi fi } # Find out the state of a numbered option (e.g. "commit=NNN") in # fstab for a given filesystem, and use this state to replace the # value of the option in another mount options string. The device # is the first argument, and the option name the second. The # remainder is the mount options string in which the replacement # must be done. # # Example: # parse_mount_opts_wfstab /dev/hda1 commit defaults,commit=7 # # If fstab contains, say, "commit=3,rw" for this filesystem, then the # result will be "rw,commit=3". parse_mount_opts_wfstab () { L_DEV=$1 shift OPT=$1 shift L_OPTS="$*" PARSEDOPTS1="$(parse_mount_opts $OPT $L_OPTS)" # Watch for a default commit in fstab FSTAB_OPTS="$(cat /etc/fstab | sed 's/ / /g' | grep ^\ *"$L_DEV " | awk '{ print $4 }')" if [ -z "$(echo "$FSTAB_OPTS" | grep "$OPT=")" ] ; then # option not specified in fstab: set it to 0 echo "$PARSEDOPTS1,$OPT=0" else # option specified in fstab: extract the value, and use it echo -n "$PARSEDOPTS1,$OPT=" echo "$FSTAB_OPTS" | \ sed 's/.*/,&,/' | \ sed 's/.*,'"$OPT"'=//' | \ sed 's/,.*//' | \ cat - fi } KLEVEL=$( uname -r | ( IFS="." read a b c echo $a.$b ) ) case "$KLEVEL" in "2.4"|"2.6") true ;; *) echo "Unhandled kernel version: $KLEVEL ('uname -r' = '$(uname -r)')" exit 1 ;; esac # Shall we remount journaled fs. with appropiate commit interval? (1=yes) DO_REMOUNTS=1 # And shall we add the "noatime" option to that as well? (1=yes) DO_REMOUNT_NOATIME=1 # age time, in seconds. should be put into a sysconfig file MAX_AGE=600 # Dirty synchronous ratio. At this percentage of dirty pages the process which # calls write() does its own writeback DIRTY_RATIO=40 # # Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been # exceeded, the kernel will wake pdflush which will then reduce the amount # of dirty memory to dirty_background_ratio. Set this nice and low, so once # some writeout has commenced, we do a lot of it. # DIRTY_BACKGROUND_RATIO=5 READAHEAD=4096 # kilobytes # kernel default dirty buffer age DEF_AGE=30 DEF_UPDATE=5 DEF_DIRTY_BACKGROUND_RATIO=10 DEF_DIRTY_RATIO=40 DEF_XFS_AGE_BUFFER=15 DEF_XFS_SYNC_INTERVAL=30 DEF_XFS_BUFD_INTERVAL=1 # This must be adjusted manually to the value of HZ in the running kernel # on 2.4, until the XFS people change their 2.4 external interfaces to work in # centisecs. This can be automated, but it's a work in progress that still needs # some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for external # interfaces, and that is currently always set to 100. So you don't need to # change this on 2.6. XFS_HZ=100 if [ ! -e /proc/sys/vm/laptop_mode ]; then echo "Kernel is not patched with laptop_mode patch." exit 1 fi if [ ! -w /proc/sys/vm/laptop_mode ]; then echo "You do not have enough privileges to enable laptop_mode." exit 1 fi if [ $DO_REMOUNT_NOATIME -eq 1 ]; then NOATIME_OPT=",noatime" fi case "$1" in start) AGE=$((100*$MAX_AGE)) XFS_AGE=$(($XFS_HZ*$MAX_AGE)) echo -n "Starting laptop_mode" if [ -d /proc/sys/vm/pagebuf ] ; then # (For 2.4 and early 2.6.) # This only needs to be set, not reset -- it is only used when # laptop mode is enabled. echo $XFS_AGE > /proc/sys/vm/pagebuf/lm_flush_age echo $XFS_AGE > /proc/sys/fs/xfs/lm_sync_interval elif [ -f /proc/sys/fs/xfs/lm_age_buffer ] ; then # (A couple of early 2.6 laptop mode patches had these.) # The same goes for these. echo $XFS_AGE > /proc/sys/fs/xfs/lm_age_buffer echo $XFS_AGE > /proc/sys/fs/xfs/lm_sync_interval elif [ -f /proc/sys/fs/xfs/age_buffer ] ; then # (2.6.6) # But not for these -- they are also used in normal # operation. echo $XFS_AGE > /proc/sys/fs/xfs/age_buffer echo $XFS_AGE > /proc/sys/fs/xfs/sync_interval elif [ -f /proc/sys/fs/xfs/age_buffer_centisecs ] ; then # (2.6.7 upwards) # And not for these either. These are in centisecs, # not USER_HZ, so we have to use $AGE, not $XFS_AGE. echo $AGE > /proc/sys/fs/xfs/age_buffer_centisecs echo $AGE > /proc/sys/fs/xfs/xfssyncd_centisecs echo 3000 > /proc/sys/fs/xfs/xfsbufd_centisecs fi case "$KLEVEL" in "2.4") echo "1" > /proc/sys/vm/laptop_mode echo "30 500 0 0 $AGE $AGE 60 20 0" > /proc/sys/vm/bdflush ;; "2.6") echo "5" > /proc/sys/vm/laptop_mode echo "$AGE" > /proc/sys/vm/dirty_writeback_centisecs echo "$AGE" > /proc/sys/vm/dirty_expire_centisecs echo "$DIRTY_RATIO" > /proc/sys/vm/dirty_ratio echo "$DIRTY_BACKGROUND_RATIO" > /proc/sys/vm/dirty_background_ratio ;; esac if [ $DO_REMOUNTS -eq 1 ]; then cat /etc/mtab | while read DEV MP FST OPTS DUMP PASS ; do PARSEDOPTS="$(parse_mount_opts "$OPTS")" case "$FST" in "ext3"|"reiserfs") PARSEDOPTS="$(parse_mount_opts commit "$OPTS")" mount $DEV -t $FST $MP -o remount,$PARSEDOPTS,commit=$MAX_AGE$NOATIME_OPT ;; "xfs") mount $DEV -t $FST $MP -o remount,$OPTS$NOATIME_OPT ;; esac if [ -b $DEV ] ; then blockdev --setra $(($READAHEAD * 2)) $DEV fi done fi echo "." ;; stop) U_AGE=$((100*$DEF_UPDATE)) B_AGE=$((100*$DEF_AGE)) echo -n "Stopping laptop_mode" echo "0" > /proc/sys/vm/laptop_mode if [ -f /proc/sys/fs/xfs/age_buffer ] && [ ! -f /proc/sys/fs/xfs/lm_age_buffer ] ; then # These need to be restored, if there are no lm_*. echo "$(($XFS_HZ*$DEF_XFS_AGE_BUFFER))" > /proc/sys/fs/xfs/age_buffer echo "$(($XFS_HZ*$DEF_XFS_SYNC_INTERVAL))" > /proc/sys/fs/xfs/sync_interval elif [ -f /proc/sys/fs/xfs/age_buffer_centisecs ] ; then # These need to be restored as well. echo "$((100*$DEF_XFS_AGE_BUFFER))" > /proc/sys/fs/xfs/age_buffer_centisecs echo "$((100*$DEF_XFS_SYNC_INTERVAL))" > /proc/sys/fs/xfs/xfssyncd_centisecs echo "$((100*$DEF_XFS_BUFD_INTERVAL))" > /proc/sys/fs/xfs/xfsbufd_centisecs fi case "$KLEVEL" in "2.4") echo "30 500 0 0 $U_AGE $B_AGE 60 20 0" > /proc/sys/vm/bdflush ;; "2.6") echo "$U_AGE" > /proc/sys/vm/dirty_writeback_centisecs echo "$B_AGE" > /proc/sys/vm/dirty_expire_centisecs echo "$DEF_DIRTY_RATIO" > /proc/sys/vm/dirty_ratio echo "$DEF_DIRTY_BACKGROUND_RATIO" > /proc/sys/vm/dirty_background_ratio ;; esac if [ $DO_REMOUNTS -eq 1 ]; then cat /etc/mtab | while read DEV MP FST OPTS DUMP PASS ; do # Reset commit and atime options to defaults. case "$FST" in "ext3"|"reiserfs") PARSEDOPTS="$(parse_mount_opts_wfstab $DEV commit $OPTS)" PARSEDOPTS="$(parse_yesno_opts_wfstab $DEV atime atime $PARSEDOPTS)" mount $DEV -t $FST $MP -o remount,$PARSEDOPTS ;; "xfs") PARSEDOPTS="$(parse_yesno_opts_wfstab $DEV atime atime $OPTS)" mount $DEV -t $FST $MP -o remount,$PARSEDOPTS ;; esac if [ -b $DEV ] ; then blockdev --setra 256 $DEV fi done fi echo "." ;; *) echo "Usage: $0 {start|stop}" ;; esac exit 0 pbbuttonsd-0.8.1a/scripts/scripts.d/pcmcia0000755000175000017500000000424110652456422015557 00000000000000#!/bin/sh # This script was provided for those systems with broken APM and those # systems with problem cards that cannot handle a suspend/resume cycle. # The average user will not need to activate it. Systems with broken # APM will not correctly issue a "cardctl suspend" and "cardctl resume" # during a suspend/resume cycle. However, the apm daemon can be used # to run this script which will properly power down and power up your # cards. Some drivers, notably the PCMCIA SCSI drivers, cannot recover # from a suspend/resume cycle. When using a PCMCIA SCSI card, always # use "cardctl eject" prior to suspending the system. This script can # be used to issue the eject command and other necessary commands, such # as unmounting filesystems, etc. # # To activate this script, create a file /etc/pcmcia/apm.opts. This # file should contain one line. Either # # APM=suspend # # if the PCMCIA cards are supposed to be suspended before the system is # suspended or # # APM=eject # # if the PCMCIA cards are supposed to be ejected before the system is # suspended. # name : pcmcia # author : Craig Markwardt # David Brownell # modified : Matthias Grimm # description : handle PCMCIA cards with broken APM # requirements: cardctl in path # limitations : # # --- end of public part -- don't change below this line --- # source configuration . pmcs-config if [ -r /etc/pcmcia/apm.opts ]; then . /etc/pcmcia/apm.opts general_PCMCIAShutdown=$APM fi case "$1" in powersave) ;; custom) ;; performance) ;; suspend) case "$general_PCMCIAShutdown" in suspend) # May be necessary to prevent system freeze if pcmcia # network card is in. #/sbin/ifconfig eth0 down # prevent "card busy" cardctl suspend ;; eject) # May be necessary to prevent system freeze if pcmcia # network card is in. #/sbin/ifconfig eth0 down # prevent "card busy" cardctl eject ;; esac ;; resume) case "$general_PCMCIAShutdown" in suspend) cardctl resume;; eject) cardctl insert;; esac ;; esac pbbuttonsd-0.8.1a/scripts/scripts.d/PMac_34000000755000175000017500000000115610652456422015613 00000000000000#!/bin/sh # name : pmac_3400 # author : Stephan Leemburg <@> # modified : Matthias Grimm # description : hardware related stuff for PowerBook 3400 # requirements: # limitations : # # --- end of public part -- don't change below this line --- # source configuration . pmcs-config case "$1" in powersave) echo 1 >/proc/sys/kernel/powersave-nap ;; custom) echo 1 >/proc/sys/kernel/powersave-nap ;; performance) echo 0 >/proc/sys/kernel/powersave-nap ;; suspend) ifconfig eth0 down ;; resume) ifconfig eth0 up ;; esac pbbuttonsd-0.8.1a/scripts/scripts.d/skeleton0000755000175000017500000000121410652456422016144 00000000000000#!/bin/sh # example power management control script - skeleton # name : # author : # modified : # description : # requirements: # limitations : # # # --- end of public part -- don't change below this line --- # source configuration . pmcs-config case "$1" in powersave) ;; custom) ;; performance) ;; suspend) case "$3" in ram) ;; disk) ;; esac ;; resume) case "$3" in ram) ;; disk) ;; esac ;; cover-open|cover-close|cover) case "$3" in open) ;; close) ;; esac ;; esac pbbuttonsd-0.8.1a/scripts/event.d/0002777000175000017500000000000010652456423014115 500000000000000pbbuttonsd-0.8.1a/scripts/event.d/apmd-compat0000755000175000017500000000244010652456423016157 00000000000000#!/bin/sh # # name : apmd-compat # author : Guido Guenther # description : Execute scripts in /etc/apm for compatibility # # --- end of public part -- don't change below this line --- . pmcs-config [ -d "/etc/apm" ] || exit 0 case "$2" in battery) if [ -x /etc/apm/apmd_proxy ]; then /etc/apm/apmd_proxy change power else run-parts --arg=change --arg=power /etc/apm/event.d if [ -d /etc/apm/other.d ]; then run-parts --arg=change --arg=power /etc/apm/other.d fi fi ;; ac) if [ -x /etc/apm/apmd_proxy ]; then /etc/apm/apmd_proxy change power else run-parts --arg=change --arg=power /etc/apm/event.d if [ -d /etc/apm/other.d ]; then run-parts --arg=change --arg=power /etc/apm/other.d fi fi ;; esac case "$1" in suspend) if [ -x /etc/apm/apmd_proxy ]; then /etc/apm/apmd_proxy $1 user else run-parts --arg=$1 --arg=user /etc/apm/event.d if [ -d /etc/apm/$1.d ]; then run-parts --arg=$1 --arg=user /etc/apm/$1.d fi fi ;; resume) if [ -x /etc/apm/apmd_proxy ]; then /etc/apm/apmd_proxy $1 suspend else run-parts --arg=$1 --arg=suspend /etc/apm/event.d if [ -d /etc/apm/$1.d ]; then run-parts --arg=$1 --arg=suspend /etc/apm/$1.d fi fi ;; esac pbbuttonsd-0.8.1a/scripts/event.d/bdflush0000755000175000017500000000241010652456423015401 00000000000000#!/bin/sh # name : bdflush # author : Matthias Grimm # description : toggle laptop mode in kernel and adjust # memory management buffer flush timeouts # This script will first look for an global laptop-mode # script before running a private version. # requirements: laptop-mode patch in kernel # laptopmode.sh somewhere on your system # limitations : none # # --- end of public part -- don't change below this line --- if [ -x event.d/apmd-compat ]; then if [ -x /etc/apm/event.d/laptop-mode ]; then logger -p daemon.error -t pmcs-bdflush "External laptop-mode script found - exiting." exit 0 fi fi # source configuration . pmcs-config if [ -w /proc/sys/vm/laptop_mode ]; then if [ -x $general_LMScript ]; then case "$1" in powersave) $general_LMScript $powersave_LaptopMode ;; custom) $general_LMScript $custom_LaptopMode ;; performance) $general_LMScript $performance_LaptopMode ;; esac elif [ -x logger ]; then logger -p daemon.error -t pmcs-bdflush "Can't find $general_LMScript." fi elif [ -x logger ]; then logger -p daemon.error -t pmcs-bdflush "Laptop-mode patch missing in kernel." fi pbbuttonsd-0.8.1a/scripts/event.d/hdsetup0000755000175000017500000000152410652456423015433 00000000000000#!/bin/sh # name : hdsetup # author : Matthias Grimm # description : Set harddisk spin-down timeouts # requirements: hdparm and sync in path # limitations : work only with IDE harddisks # controls only a single harddisk # # --- end of public part -- don't change below this line --- # source configuration . pmcs-config case "$1" in powersave) for HD in $general_HDDevice; do hdparm $powersave_HDOptions -S $(($powersave_HDTimeOff/5)) $HD done ;; custom) for HD in $general_HDDevice; do hdparm $custom_HDOptions -S $(($custom_HDTimeOff/5)) $HD done ;; performance) for HD in $general_HDDevice; do hdparm $performance_HDOptions -S $(($performance_HDTimeOff/5)) $HD done ;; suspend) sync ;; resume) ;; esac pbbuttonsd-0.8.1a/srcdoc/0002777000175000017500000000000010652456423012340 500000000000000pbbuttonsd-0.8.1a/srcdoc/mainpage.txt0000644000175000017500000000133110652456423014572 00000000000000/** * @mainpage * * PBButtons is a program suite to support laptop specific functions and * make them available again under Linux. Basically it was developed to * support the special hotkeys of an Apple iBook, Powerbook or TiBook but * since version 0.5 the design has been changed to support all kind of * laptop or notebook. * * This document describes the internals of pbbuttons and is mainly aimed * ad software developers who would like to contribute to pbbuttonsd or to * write their own modules. * * For feature list, configuration or usage please see the man pages and * the README file. * * @li @subpage structure "Program Structure" * @li @subpage taglist "Taglists - How modules exchange data" */ pbbuttonsd-0.8.1a/srcdoc/modules.txt0000644000175000017500000000630710652456423014471 00000000000000/** * @page modules The Module System * * One major component of pbbuttonsd is the module system. The daemon * does a lot of mostly independent jobs like changing the master volume * or setting the display brightness. Volume and brightness have nothing * to do with each other except that Their change is triggered by some * input data comming from the Input Manager. This makes it easy to put * different functionality in seperate modules and makes it possible to * extend the system with new modules or exchange single ones. * * One main goal of the concept is to divide hardware or machine dependent * functions from non hardware or machine dependent and put all this into * layers. This would make it possible to adapt pbbuttonsd to a new machine * simply by replacing the machine layer (module). * * The modules are as independent and free as possible and are free to do * anything necessary to do their job. The program framework will only * provide some useful tools to simplify things every module needs like an * IPC interface to the clients or similar. * * Now have a look to the modules and their interaction: * * * Modules directly above the Kernel are hardware or machine dependent * modules. They are modules Pri1 (priority one). The modules in the next * row are function modules and Pri2 (priority 2). System services such as * the input manager and the IPC system are Pri0 (priority 0). The priority * tells us the sequence which is used to initialise the modules: First Pri0 * modules followed by Pri1 and last but not least Pri2. It tells us further * that a Pri1 module can't ask a Pri2 module for data during startup because * it wouldn't be initialised at this time. * * Modules with the same colour do identical jobs so only one of them would * be active in PBButtons. The picture shows just enough different modules to * make the idea clear. We could think of much more different modules. * *

The Module API

* * To implement a new module only four functions have to be implemented: * @li int init() * @li void exit() * @li void query(struct tagitem *taglist) * @li void config(struct tagitem *taglist) * * The function init() will be called during startup and should do any * task that is necessary to make the module operate. Pbbuttons expects that * each module is able to work properly and respond correctly to requests after * this function has returned sucessfully. * * If something went wrong this function may return FALSE. This will imedeately * terminate pbbuttonsd and should only be returned on grave errors. On less * important errors, the module should print a warning and disable itself. * * The function exit() will be called just before pbbuttonsd terminates. * It should close all file handles and free all ressources allocated by the * module. * * The functions query() and config() are used to interchange data * with this module. Config() is called if a client or another module wants to * change a property of this module and query() is called whenever someone asks * for a certain property. * * The mechanism to exchange information is described in * @subpage taglist "Taglists". */ pbbuttonsd-0.8.1a/srcdoc/pbbuttonsd.css0000644000175000017500000002037410652456423015156 00000000000000BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { font-family: Geneva, Arial, Helvetica, sans-serif; } BODY,TD { font-size: 90%; } H1 { text-align: center; font-size: 160%; } H2 { font-size: 120%; } H3 { font-size: 100%; } CAPTION { font-weight: bold } DIV.qindex { width: 100%; background-color: #e8eef2; border: 1px solid #84b0c7; text-align: center; margin: 2px; padding: 2px; line-height: 140%; } DIV.nav { width: 100%; background-color: #e8eef2; border: 1px solid #84b0c7; text-align: center; margin: 2px; padding: 2px; line-height: 140%; } DIV.navtab { background-color: #e8eef2; border: 1px solid #84b0c7; text-align: center; margin: 2px; margin-right: 15px; padding: 2px; } TD.navtab { font-size: 70%; } A.qindex { text-decoration: none; font-weight: bold; color: #1A419D; } A.qindex:visited { text-decoration: none; font-weight: bold; color: #1A419D } A.qindex:hover { text-decoration: none; background-color: #ddddff; } A.qindexHL { text-decoration: none; font-weight: bold; background-color: #6666cc; color: #ffffff; border: 1px double #9295C2; } A.qindexHL:hover { text-decoration: none; background-color: #6666cc; color: #ffffff; } A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } A.el { text-decoration: none; font-weight: bold } A.elRef { font-weight: bold } A.code:link { text-decoration: none; font-weight: normal; color: #0000FF} A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF} A.codeRef:link { font-weight: normal; color: #0000FF} A.codeRef:visited { font-weight: normal; color: #0000FF} A:hover { text-decoration: none; background-color: #f2f2ff } DL.el { margin-left: -1cm } .fragment { font-family: monospace, fixed; font-size: 95%; } PRE.fragment { border: 1px solid #CCCCCC; background-color: #f5f5f5; margin-top: 4px; margin-bottom: 4px; margin-left: 2px; margin-right: 8px; padding-left: 6px; padding-right: 6px; padding-top: 4px; padding-bottom: 4px; } DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold; } DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } BODY { background: white; color: black; margin-right: 20px; margin-left: 20px; } TD.indexkey { background-color: #e8eef2; font-weight: bold; padding-right : 10px; padding-top : 2px; padding-left : 10px; padding-bottom : 2px; margin-left : 0px; margin-right : 0px; margin-top : 2px; margin-bottom : 2px; border: 1px solid #CCCCCC; } TD.indexvalue { background-color: #e8eef2; font-style: italic; padding-right : 10px; padding-top : 2px; padding-left : 10px; padding-bottom : 2px; margin-left : 0px; margin-right : 0px; margin-top : 2px; margin-bottom : 2px; border: 1px solid #CCCCCC; } TR.memlist { background-color: #f0f0f0; } P.formulaDsp { text-align: center; } IMG.formulaDsp { } IMG.formulaInl { vertical-align: middle; } SPAN.keyword { color: #008000 } SPAN.keywordtype { color: #604020 } SPAN.keywordflow { color: #e08000 } SPAN.comment { color: #800000 } SPAN.preprocessor { color: #806020 } SPAN.stringliteral { color: #002080 } SPAN.charliteral { color: #008080 } .mdescLeft { padding: 0px 8px 4px 8px; font-size: 80%; font-style: italic; background-color: #FAFAFA; border-top: 1px none #E0E0E0; border-right: 1px none #E0E0E0; border-bottom: 1px none #E0E0E0; border-left: 1px none #E0E0E0; margin: 0px; } .mdescRight { padding: 0px 8px 4px 8px; font-size: 80%; font-style: italic; background-color: #FAFAFA; border-top: 1px none #E0E0E0; border-right: 1px none #E0E0E0; border-bottom: 1px none #E0E0E0; border-left: 1px none #E0E0E0; margin: 0px; } .memItemLeft { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memItemRight { padding: 1px 8px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplItemLeft { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplItemRight { padding: 1px 8px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplParams { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; color: #606060; background-color: #FAFAFA; font-size: 80%; } .search { color: #003399; font-weight: bold; } FORM.search { margin-bottom: 0px; margin-top: 0px; } INPUT.search { font-size: 75%; color: #000080; font-weight: normal; background-color: #e8eef2; } TD.tiny { font-size: 75%; } a { color: #1A41A8; } a:visited { color: #2A3798; } .dirtab { padding: 4px; border-collapse: collapse; border: 1px solid #84b0c7; } TH.dirtab { background: #e8eef2; font-weight: bold; } HR { height: 1px; border: none; border-top: 1px solid black; } /* Style for detailed member documentation */ .memtemplate { font-size: 80%; color: #606060; font-weight: normal; } .memnav { background-color: #e8eef2; border: 1px solid #84b0c7; text-align: center; margin: 2px; margin-right: 15px; padding: 2px; } .memitem { padding-bottom:4px; border-left: 1px solid #8888aa; border-right: 1px solid #8888aa; border-bottom: 1px solid #8888aa; -moz-border-radius: 16px 16px 0px 0px; } .memname { white-space: nowrap; font-weight: bold; } .memdoc{ padding-left: 10px; } .memproto { /* background-color: #d5e1e8;*/ background-color: #ccccff; width: 100%; border-width: 1px; border-style: solid; /* border-color: #84b0c7;*/ border-color: #8888aa; font-weight: bold; -moz-border-radius: 8px 8px 8px 8px; } .paramkey { text-align: right; } .paramtype { white-space: nowrap; } .paramname { color: #602020; font-style: italic; white-space: nowrap; } /* End Styling for detailed member documentation */ /* for the tree view */ .ftvtree { font-family: sans-serif; margin:0.5em; } .directory { font-size: 9pt; font-weight: bold; } .directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } .directory > h3 { margin-top: 0; } .directory p { margin: 0px; white-space: nowrap; } .directory div { display: none; margin: 0px; } .directory img { vertical-align: -30%; } /* pbbuttonsd specific */ table.pbb { border: 0px solid #8888aa; border-collapse:collapse; width:98%; margin:0px; padding:0px; } table.pbb tr { margin:0px; padding:0px; vertical-align:top; } table.pbb th { margin:0px; padding:0px; text-align:left; background-color:#ccccff; } pbbuttonsd-0.8.1a/srcdoc/structure.txt0000644000175000017500000000371210652456423015056 00000000000000/** * @page structure The Program Structure * * In a computer system we have generic input data, like mice, keyboard, timer, * etc, comming from the OS on one side and machine dependent features and input * data on the other. Pbbuttonsd tries to bridge this two sides. * * The first group of input is OS-dependent and always availabe. It is * controlled by the input manager. The second group is machine-dependent * (hardware or software dependent) and handled by modules, that could be added * if needed (currently at compile time only). * * The following picture shows the basic structure of pbbuttonsd: * * * * The main parts of pbbuttonsd are * @li The Main Loop * @li @subpage inputmanager "The Input Manager" * @li @subpage modules "The Modules" * *

Main Loop

* * The main loop of pbbuttonsd repeatedly collects the input events and pass * them over to so called 'input handlers' which then will process the * suitable queues to distribute the data to the modules. * * There are two big blocks of input handlers. In the first are the timer * handlers, which will be called on a regularly time basis. PBButtonsd holds * a list of timers, which will create timer events in different intervals. * Any count of timers would be possible but currently there are only tree * implemented (10ms, 100ms and 1s). This should be sufficient for most * applications. * * In the second block are the input devices which get their input by reading * a device file. The function setup_input() tries to open each desired * input device and add each sucesfully opened device to the input list. * * Furthermore each input device have its own input handler attached, which * does the data translation from the device's data format to pbbuttonsds * internal data format. This input list is also handled by the main loop. * If new data from an input device is available the appropriate handler will * be called. */ pbbuttonsd-0.8.1a/doc/0002777000175000017500000000000010652456423011630 500000000000000pbbuttonsd-0.8.1a/doc/images/0002777000175000017500000000000010652456423013075 500000000000000pbbuttonsd-0.8.1a/doc/images/modules.png0000644000175000017500000003700010652456423015165 00000000000000PNG  IHDRbKGD pHYs.!.![tIME3~ IDATxw\SWdﰇq(RjUj_[km߷Uj *p Ȑ Yǵ)J>ߏ'ޜ'{9(@!c0tBEaB LX!dPՍ_ҥKNjGHXgvww'4VB_RSSg͚X.(CיڇBM v#&,2BFBh`B LX! !d40a!&,2BFBh`B LX! !d4q!t%%%555  MLL3@t Hb*++ZD"1ha{kXaw?~|۶m2ټnݺ@TTTppV5hy{j˗˄;.Zh4̓*5_͛{G.l4l]]]`PPܹsWZ5i$/]T0yQ\~:"4P]ǎKJJZf>[͞9sfttc$,\^XX(J.Fsؚ///___H:ݻD*.\P(8H$"bT =rvvvvvf2{w &,Th4Z~?zMMV (._lkkfggd2eD}\ jԩ_|EΝ enn'6 Q]>>>999uEM2e̘1 iBe2YbرcBKO?ݹsݻCCC;vH7{kXoٲ%66vرJ~ťwd<gϞ6l+++JR|t:L6hРCFEE-^x666sja ܲe>77v|UUUOQ(]xh4iӦ >Xc͚5 ?/,,,,,|3B ax<ի;yÇl߾O>~3ꫯ:w駟zzz._|ǎK,D}鄄KKKsss>tR&ٿٳgk͝%2N?8,DQT\\\޽mmm@ lr޼y?޽{BBEQ;w?a֯__!MXXX ֡BFBh`Ba!Ο?onn陘C !^^^סCrCxxx W^d|ޘ~lٲ_5>>>>>~ݺu}MMM{TVZ8q"44ХFzc! |˗?~E7n,((ׯ_?NPX%B>@ LX! !d40a!S;rZn̢ V|R8!d(u T*]# (GGGA\!d4ч2BFNK( ӧ-[(LMM]lͬ8dHNN޴iJ/ V/^ouE͜9ݝ3:::!!EzYE6***m6qړC65'$"M^Z6>a/ft 42 :aeffoSNm@9p@V脥jo~wFټy# … ׮]{SFqtt|~¢-\.UUXjcj>ϺA-X~ )TELLL~ܻwN$22200 i ?^xAjjTF}=߅Nj 0a!&,hoNq-=e$NA m$k2t0- S8<0 PC ?PU tTg)PDAُп5,udBO mh(P5P%MPyGB.U*dlnB !kK$ȝ5=PJțZQP%/a0@qOub A՘GxkX j!P*|4yP @ ?K0 mr?%W ? ßm m&m䇀bPS.?B}aUŃ! D@8  mUPULqЀ4Z <:8Q`:hx+"(Y4@2ITO@2*!c>&,M, #(ȍ>?'m 4@zgŋ@ L.&*@n@@7cHf3Qo y@TwAy ! 57AheGx@CC(_"X| Ppۂ)p:P @Qw\[WJ(] E 0"[Yp@UãO}ʏaA"(]YG@iz r@[P+q:ȶCf%8YP&@/N}`1 Ҙc'P$ ` -j`d. Py(%ip=HBŮF,?Botd D"ѳ7(JRq8@x5Phd2B fj,=@ ~\@U<8d۠ zP+W-9 m Ӂe ˠ(`Z{ÎP}ߠҴ4Jemmd2P!67Ңdop8FIIZy˖-C)JLfffrjuiiP(|jjjr\SS<&z^7a]~}Μ9F,T\\z6l@  <7IX64|/4P_A$\GPX/{yP}' $C<z LR] `JA C`2YlB7bcc?3Tܹ3eʔyQ|Vd&L9s&ˍ:{PU\\ߏ9r…ӧÇaaa| 'McNlrgϞW_fϟ?ѲeKjBX|^}1eee/^XYYy{{;w?ϦP({j$ ŤIO< Cj}a,J DN%a1P?@$v ` > z-}駳g5j߿^|||Ju뼽Z###7o>zhJ5jԨ((j˖-sѣGYYѣ`@1cƌnѢEtu1>h^Z-8y$V\9k,???PjZ-|:NѰX #j&`0j5EQ#>8},+HKK5jThh(ɤIٳի322lңGyݼ;w~+_KT6<<<,,LPo߾> ,,ڵk;eʔxRVSSS̙bŊ~͘1C._rҥKgϞ}3'L 1d$}_-GP((ڰasϞ=Ғ˳5MFFF߾}m}!UVm޼yΝ:|#GtqFOy&KBBRKLL`V٧ONLL׿}+ܹs?~ 2$==ҥK'Ntttl֬͛rի󣢢&O`0l6xK? m;x𠯯o oWRRo޻w޽{w=mڴӧ&&&Ԯt277lmm/_ )))D?sUVuU Ld&M3g###LoC̙3yQQQfff۷󳵵k+>BH@eeZu=ZFF]tǏoPL&v$44СC{ݻ7F(Çӏ=<<,Yѣ3aÆ-]4///00ܹs۷III9w/]$Zlm۶,ݻwuu5۹scnn^UUo>FsҥT'N:ر#***--sIIIJ2##i˄w3f̞=ڵk;ݎ;ry߾}mFW)2dHttYQQj VªJMM裏>#B8qDooo\ -22Ξ=kggW R}EE˭[jG-[KO7`РAϧ7n\jՇ~XP>511ys999'Oܶm[RRқ: X\g6lkkk:' XV{ݻ\tΝ;믿G xyyyx<ޞ={֮]j,Yboo?o<ݓH$t3944t֬Yj֭[I===grm}Μ93%%ƌtpԨQ6bĈ}ZvK.{`Ǐoݺ~jGFFҵSHD!iWZ Z333MyFf"FO4E޽˫fr|ӦMGG!bH$jV;yfd<[DGGѣe˖tufffm۶7U,@QQQQQP(tuu ۷o޽{޽W^-Jwnݺ.]ЩvڵÇYԩS޳gݻ]\\<믿vؑ,00dJRrÆ 111;v}̷'11vs'$$ɓ]tٿA ׇS-棏>|% ٵmѣG;^kVZyyyM6mڴiRرc?8p`OެY3x⸸wGd:7ZEյk/"(((""ԩS@YxJJHH3gꠥDƍ  8p@YYپ}j,F1nܸdcѢEЯ_ovҤISwU%^gΜ9]vpZ6lؘ1cB!}!ٳ۷oO>}Pϥʾ}nܸ۠g*ȐצW^:t!CH.]@k¿N:m۶~|-[6lXDDݧ_wElffFE''UVqܩSݻB$yzzU 63֭[s\{{ k޼yf?z}Ǒr{ 8N3"QTBn ~'e ?  ^-|?Ԥ=n#ŢOb2uxTL&\ ݺk'OwDҥɓ' ҄ ?O# 8-Z-{" Aa6N~ [Ww J<h.q@b(tZ`4 x%G3f͚5k׮ʕ+_ Y0:Be*(  TC|P-|Owq8 F\$ (|Rr%mT@~_6JB([e|*{Bhl(͉W_iWք?oTi@i@;mg jC7AenP `ـ>ulĢ  u{teX‚` {8{=YϕQ[r^:  HPugZAV^"m1hr w"&mT'|uCr㐄Cx0`9J~$(YV\UЖOL3p\ZP&,@L1YKRA.Ahi@laj\ \(?~P _I$vA0AcܫP{$^`@ 0%y hn;(o8[o97W88 d4 MX-0(t5` g|dG)ejLc @8u @خ@`0f9(,9P(5X L+3\~7La(@L[`AtU`fA6) h8dH7KX>{Rɨ'~ v|ͯO @ǀ`C  E|'`d! t̓?`E-2._‚7IClC@oTyBFBh`B LX!N跴P('_Aic_!-ԖB[f=B@Hee 3 Sv)zwJ?xZZ֭[ QWUիׁT‚&Hzw]k"=;ԞĤw@݀zd(eNv2̼`0u떒bRmڵfGVV֫-Tc(fffu E5)6zMJ1W`tƢNi4E6p}?8Z !&tG LX!@{zzzHHHyyyư–-[F?...ӧOiiaN;wԩS[lo [d͙3gڴi# $,F6W+޼qZ6?k׹&&,;8}\( $0'KEu\S )e!@N5uvvݭ Sw y<->0#_Z?}X! !d40a!&,2BFBhGCC&B5zT`vS{K:"%DO7~{q&at#R7g%7H7k}KO?swZ ԰ ~}Wn3RR߶̭O_aWi3x&8U ꞋRY;d'fBasz3-@V;tjus99n֬+?w m:oήi 6P"qf:[E63/-.9vlff~ponye66݇ YY񖖭x<3Óqʪ 9sfAPr`S_{yMF޽>> 6.;5,<;'粏t;.jgOU,z!-!Q}g6_4#T(ZedѿE <Ȫ@zzM;kuیӄ!0@URbl~KO-Z ܽ{xVVK0[Mf0ZVQQP3۷c<=Ct'7RH۷#Z>x'TV.T*u?@`m2Ʈa15uHZp]|H"5,#z}`p(;wbKx<{w>#-d#1Bݺ}%rw֭}O?}r:(յsRUZ[hX,TڬbZUqqZ^ߊ9HצgDv^իN@iiM6m´Z EQ-[timMg{;|E#ݻSHzBX:Сq<XZzx-[qc{ee!XQYLQd5#\YV+#""#D|kLM(n=89y!u^rf[NCl(`0;vܿ{z??JeAl7NN֭u5S^^߻wD|.}n߸m^ ^AA"ݻC,-ۙjתUpJ^R{ݿTaarU㜜11<<ش}%&. \BG(VuwM7(7m:nnnYksffm sF_n.gdwϜťaOPEQ+:c0tqr p`A͙LoڲeHQQ/EHd[ʚ1(5b鈇`vFEGhA)@(l8 յ?| ZС)l@j:s)p7!?t{ikEQbIV$'ox /֭2,GǞ y{`\3GeeG-) ڵ~ɕ+kjm me߿3u0(RoZ-c0x͖AX|BXZmNf@MÑE}P4nAAAv ;g"ڋP*(JC_8%0w~s̡#+W\d߄ ߹GAjkUZm5BT""Ν[;gN8C)`(v&[6[L?f2 :1vO<5kЃj{ l>/R\O{HC<'d w|4ϋ0Tz)KiiN}{.??ܹre%EitWW=;Vv+p)t5OG\ܾԩŷΞw‡ڿ(mFT=xp%z T*Yj!{V&mڄݸ_lٯ~VVۿdY-Z~}k[_FfΝ}2Ag_AARVօ6m]"+>~[FZ%%w ]j\^@љ|DAtde](+{cg 22J$:IO?+ 4dqf:޿<7kQэʂ5;ʢ,CIj32Ιj36,--DbRDVupU^.:~}^38B]ݾΝ92@owlҳ<[ھwaaJ6ɛE3X’a08,X*u${,Ʀu:80 VV5Q^H"%fTV>=oȐM رYCl"[}M,""*,ejTsTהʲc̋_ĉg Z`--=sr8sp>,BX2qANu.*GPSSQR˕ &L&LB~t#ڵ:pswmB+PB dXZJ( a2LF}jTU~%,^wjaʪmrֳg=z|V9'sZyPVtGH$ee:] !<ҩJfM =r쁉Is_}鈙[iiܺ'/ﺹy+33ݻ1}HM=g0K?s/hKXnةV+}|>'@$ѽ\`A)  LP*ur%h֬camkk/ԑ7x-NHc(~ilwTS5¤ӓ'k,%qq~r4=楧B,cbf۫Ѩ,,Zx8:T Ԗdz=)GǞ\8{ZXxG3YKmobJba-LK?7 7A ډEA˖!a6BS;aVzBFBh`B LX! !d4:AQG"t l$>:}h aQEQԖ-ޭJC(tt (sqj7 :YqE}TGveT'@²?rYT(~̪*W̙4 kս{:tG ;BFBh4Їѣ'VVĞ!(?7n\` &99yժU,ֻBiZlY~~~SSСCy7*B{bBh`B LX! !d40a!&,2BFz?~:񒒒'N$$$44Drĉri„E㏵EEE#G1bD~~>H_̐[n5ˡ DW{#G 0Ѧ_轚Շ C޾}СCQZ)J J.(RIQc2|S=MBݻ]'[ݼys„ z7n͛7xyy Ν;b 3gܸq?LOO_`A޽?L>|8u޽{5… 8).z!tKڵkwj?uΝ >?`6} .߿cǎdׯ_󳴴|} EEE_ii]od2 VRR2x`sɡC޽o߾:qԤ`B'FX,VߢE !&Lݻ%Krƍ'N0cǎH$ڳg@ tE]rZ(_ԩS}.\W^9s`=߉'233?S%%%N1b.+++-- tL& oѢE뉟}@ Ѽys:HQTttt@@5}(P8q .h4F<]ta =۶mjժA-X`͚5֬Yc&&&?[n]瀶_E>|8>>^ĕPmy{{mL|>}DDD7裏FQ{.+KJJ^_ W*8z`B/b}7/^zmmm$,--uѣr]v/{f͚ ڇ{n.]9 c}XHu֩Tɓ'WWW4hÆ ׯ_h4:.99yرIIIɄ 9r9ZMQԃ&ME z:#:vu˗SpBѻw>}O:UoDj9}tgg琐C~~~~gw㘬6 ѳ0;vՉZD:yΝ۲e˥KJ̙3njRtƍ۷omiiw֍ɡCvy|Gtݶm<<<QSEdݿǸz)* 談IVt::SXXܹskޘ7hxY5BFBh`B LX! !d40a!&,2BFBh`BKk.\!d(YYY^^^u $,.iӦF)B5b 60 B5M؇2BFBh`B LX!! IENDB`pbbuttonsd-0.8.1a/doc/images/structure.png0000644000175000017500000013734010652456423015565 00000000000000PNG  IHDRX=XՋbKGD pHYs.!.![tIME! IDATxy\M37)CJp%&E)3!%"A24T  <ө3cu]D9~mXk=z>q@ Tm@  B@| }-bР]v)++91p]|zzzl6l\@!NMM522osctp8WW~fbbbB  @0]}|>_Lx<&b0elgϺ(**f޽Huuuvvϴ@ ?>Z5?l`X,522KᖖFM JhjjoeeaÆG>yDOOð/_~+99劈 q\d >^@ "Bkkk_~hѢ؈d)))ii5k|2!!!+++444!!!..FFF&MyfQQQYYӧO޼y+J~RHHȶmN:+WHHH\t !@ BH p8aNgX D4iޮPSS#Hx<$HĬ/_988ڊ>|.@ Baχ*o Dr\r%%%Æ Hnn.˗/p#ќѣGúfRTT~zjX@ }!$IZZ2x<.+!!cǎ˗p8.+##bdeeE F=c EEEѣ9sL4dlccO2&dɒ>X@ .F={===ˠǛ9saۂ@ F  B@ !D  B@ !D  _@ x<1}?DTTTjj*ﲯcp@ ?̀˜>L0Kf Lf0m@ z€B<uVGG6Ǩ,CX@|ˀskxoGWW\N/_,WVV׻iΝ{}ٌ2# eP__ɓ'1 KKKQQϟ?zjԨQ555111ӧO}Çϗonn&111>|xjjjJJ< YYY.;z蘘QF>{ *t|||KKm?@Jx"x2]]]--O>-YdҤI #%%s…;p@GG_zE&f͚{{{99;vׯeeebbb -//OJJJLLRpiGmdd@H?$@.80k޽{~%%¼e !02 ?KJJr\777YYY}}}"d2a_yyyN>* g222jjj"1L>/++ `FC.EDD`kRRR[ry<^]]񼼼&@ 2EP,LhDDqyyZkkσ;;;Gyoo˗/h4XKGG255LKK֭[)))Ce0pod23͆ ^bccG+b Œ>}ŋ׬Y~z<ĉ&L藻@ 'N}@+Voݺu.\233[vҰa\]]g͚rJD%B}ڵk ve6m۶իW߾}[VVYTTpQyyyIBCC&O,&&v!aaasssGӕ-,,֭[wy???qqq@"Uttt \b^kk3f7mD X,Vmm{,%E hNoC7"$~̙l<?y"D"XC ȀBuu~ ኛnp8 Pm 8!Լ~^^`A@'m3k,k@ #h6l`"["⏦BW2xAFbUB~~~jj*@oV477 iff&$$߶ haâ"p8Vxxx9&7o9?Ba؞={+pGuppoC@t ЪQo+0=A"B ̀BsΝs>>ϟ?#ׯ_:Gh>x)))P_##{\r'..0,--MYYy֭/nll^v-kkkkBBB@@cӧsssݻwQ9>>|pB^^ڵk ߾}#F.w}yxxkhhݻӧ}ӫXhі-[ ",, H$Dp8111,… 8VVV橩s΅B8tPzaaa99ٳg;88tttDGG{xxhii-]TݻK.8qSJJJttt6lG1b7~x--aÆpW^)((zyy uN !;glad2@ ̘1cʕ4@ x 444bbb΂iӦdddtzcc6`̘1?pfff˫C zHkQQх wذap{",k 򅩨 >\UUU9s>|d2d2J}MXXa1CCC[7o޼yP\\d2]\\f"HD"q\( AAAaذacǎ x<^L8=@GGH400ptt ںu+Ǔ,_ѣG/^KKK.\:cƌo'?\.ǃ abEEEA|[}؈`t ЧB9|P@pppTTݻwq\X>OX,vZZ˗/222>|@\\L_^c0 c0vvv[xѣG\]])Y}{@ qԩ\==="K;vɓl6JLbddD ZZZl^5**\p!00044bv5++&Ihooݓ)..w_]]@xmffY,֒%K>}ZYYyN@UUd„ PL&SLLLWWٳgeee4 9J]pӧ_|ymV fgg;::2牉ǎ=z4L,dl:} cڴiϟg0hIӧaEI$`ܸqC L6H$_@ hSĦL"hA__婩 ,`XAAAL&sժU)))/_>|@ pp8?~:`tŋ2MMM0Vty󲳳߿gG&CBB^zejjZ__@&LMMkkk}||nݺyfAAϷgxbݹp"(""RWWwÇ)((SRRJMMt#""͛wUUUEE'Nn߾}ҤIQQQuu{ >qDRRRhh{^ 8zXrrrtt 2}s΅.]OSSp 999YYٛ7oN8ٳ .+WyF[[{̘1ߎ>bbb94 09T*U緷sΥ魭r 322szPH]]CNN+b0 d2cǎ}9aׯm׆Ɠ'O0lĈ4mرuuuUUUiiia6i$  ƪUN4551 7na 0ᨨl۶-==‚b ~kgϞg5kV@@@w_666#GZ>Ax<ͩSvtt|p ð[VXP[ߏ.LMPPt'۲e/ij1PMZ|pbbbq8/ I$ᑃH .rByˮ]߿+**\6 l28YfMEEիxkĈVVV555pSHH̙3~~~ QQQ}WHH… \aÈD 0l۶mcƌpwwf񪪪7oޤ L>fw> cܸqа$HL&@ 3% b/^ Ǐ suy\fϞ=|8Ł&<o̙~~~m 022EAz.;k,>}.svLVNNرchSNd;2"D X޺uk222rrrm!^bXC \. :qDvv6rj }o+1hD@ :DG@ 4HG@ 4HG@ :*V z $~#OyիW3gܱcG@@LݴiH{{cV\I&$%%BBB`cccIII.ppw@ !!!!<d2J c]߽{ѣGvvv3f(**Zx1B;wԩS555%%%MLL=zdee5|g2ߏ\zBU ~$ |>M|V폂H$&$$,ZN^a@ Y"x<ð@ b7((0W%Epx<^MM_LL열;Hx<)v &HKK[*CfL6r8ϟّjGa̙3QF-^fGx5gx<ٳGJx<ׯ |SSM';wnѢE&&&MMMFc2RRRD"QNN+V(,,2e bϘ1tҤI222QQQt:ٳӧOWPP :::#Gr"+l6۷oPRRrvvo4ٳD"zW"J,Xp8ݬaXSSӧO ;::>|PTTIwmii k.\000$77ŋ/_޶mۍ|RXXXQQQ\\5yd___uu'OH[~GGEEihh }B t\.иq㆛|fA%C [[[%$$Y/[LQQq͚5566~ĉɓ'O~YVVִi`-29gΜ;wnܸΝ;>>>d2ػwH2d D͛7߽{\YYr׭[7|aݻw޽{ח#D#pϛ7A !|DFFϟ~ l6;--f3+W444555߿ǏǎNF#Fxٳguuu}}}/\MRtz{{{GGGGGnURR$l6|"N2eݺu=a=ׯ<ؾ}Ԋ+"""p8~S6mJOOwqq޾}ӧOUTTFehh ]]]iiɓ'|&),,|amdeeuuuGޞw=EEE\ ø\.N *--]`AiiQ6b&NaɓSNY[[YYY^zܸq***= H_| ~(v|`,9 IDATŊZZZPߠ*,##|rNɓ'fϞ L<`„ ߮ ++ V4練S ̝;wŊ,ğ B%Nedd9hjtf?>cƌ &=|UASSsҥ `xǭ 222/xbcccQQG=f̘Ǐ7@(T*uxݻwx<370w}}}PPL5qd2TG3p81c|6x9Druudggە@ fdd ]|YBB7B2d2y'NoC999w;!00<vg#++:::gϞUݻ a*+VP#$$dgggggܜ˗S(ٳg;993n 0Q`h]߁ - h4Zffg]]ƌ /))qss{p8@с{YYYkkkkk7nܹSIIiݺuSVVFQ{?G$ -//ߺuرcYDȑ#߼y[{2C=?~<ܕٳ͛7O8qΜ96660,4e~ڝYW?}vZQQѨ;wRǏ 0 =|>/ٳ'33q׮]k֬k\._LXlA[[[KKK"A#Y,99gR9WTT"\'aɒ%cǎsNnn/gKKK܃!TYY sjjBў>}ڳʕ+333/^H&L2zh[[ۛ7o %&&.^ _X>&;;ӳ;%oޝ?rw.%FAǠmjjp_~2eJll/444\\\RRRf̘A$X,V~~s<<lccw^"U ~СcϞ=v1b˕&H0KUUGjkkwHHHd2C0FQQDbKKLeetSS6l,&&fٕ+FСC+… ?>rȉ'G*͜9L&5wu7qD[[[؟Լ}6vvvVVV~Ç'LgLرc޽q|i^.KRϞ=0ĉ4a)))L&N?xjjjϟg2))))))l6CHHݻwYYYpoCC÷zʦM6|pEEL555 6ss3g>~ -Z(???,,D"9;;+))`t>N<{nOOO!!GtA#"""<oΝ999wݴiS@@LDD}>|o߾O>y{{;6##cƍSLKHH8|ѣG\\\VZaÆ=D"qC۫{)晰Ǐaaa<>}eXx---k׮}a&LxMfff||Mx<|߻wL\\ӓH$H*??/vvvϟ?M0!!!㕗&%---O9r]+..7g Hcƌ |1//ի%K|ONLL N?~ /**z!;;uԸ:uG%͓XvmBB¡C6o<~ 33ǏxLLL6mڤiӦ[nm޼9???88XRRlͫVںu-[\ڵk7nx`##ٳgmٲeŊ? ?~xcc˗/----[vرuֽ{`۷/..k̙bbbsݹsʶo~s玒[p!j˷oR(vWWW B,_N<|ׯ8N^^s88op8ׯ\)`ܽ{bq8SN2p}͞ƍ^]a!CcኊwwHUU{zzz/Z(11ԔBTUU秦Ƿ> pݻw;99IHH{zzf͚/-[ 44u߾}3glkk+++p>>>nJJJYRR%''O0JWW7//111ӦM vzҥ#FP(K^밋n:%''/_ BDDD,,,JKKKKK#$$Ғ[[[K YN$%$$&M0--իD"`X[[+**X<?bĈs`ĉt:=::ݻw8N]] !JvZ[[Ϸ066&0UCCsuuB˗/wttp\777(AAA 5 aAA9q~:((H$2L333)))kmmԋogeeq\uuu}}ѣGoٲETTЅbL&D>x<B ڸq6|> S=Hp~'۶mq!~񜄅 `0\nSS ^:;;i4ZAAArrQ?x<˗dѣlvNNNPPPsssaaaBBBUUUvvА!ClvVVF#"""rrr߿.9(t@u֭i4Hrx<0 buvvb FRRp8{h]v8pɩ5::ڵkqqqqYY٣G͙3Cܵkȑ#Μ9#%%5tNvhLqttܽ{ɓ|>STYYY:.{+At>677.ĉ'L x!..n```0*Yޱc` ?޿˗/w9"--堜ߓ 6]feeu9hjjZZZE-Z堋˷G޹sŋfn0zA#RRRG9x#G"##.]cyL>>'O>QWWWSS a0P{`mkk/߹sN544:5kttt1sǛ֯_Νch .;vСC"""'NtqqhNVUUʕ+>>>3fp8;wpǏٷoLt'MK--g/6lɓq}8w9aa7o&$$]HKKs83g444=s֬Y>>>>}zbbC|}}1 tppPSS0 SSS333 葕Uxx… f̘e8 I&o޼bRRR6l/zzzD"@Zbo߾gxƿڵk CYYߟda蘞.""C{{{yycǎH$aaaeeeee/^`g-9W,--, ?@(//pT#''7jԨץ;{ws)kggÇU}_~xbKsssqqa>g3f˗/ɩPTuuu999yy۷o(++hx7sL???CCÞ]]7IJJx{LMM7lӧWΘ1cŽz.TTT899ݸqCbbbN/..Rں}[ZOOkii-X 33SOOL&5&&L&ZJJJ˗)))pׯ{555,Y˗(aaakkkJ~YGGFL<ܹs#Fhχ3޽믿M]]]EEE###KJJf͚͛+VիWF/ٳgo߾rʋ/Μ9C-Z$**zΝŋhiidK_~}{zƇn޼i``h ] CC!C2L.**3%=111zwikkF.\3gNccco4\. SKʕ+#FPTTtpp3<! {߁N6`strrzILLLN8KXXXd#l6[GG'//43^,]t^^^m(44e/_S 0+W>oƧO(5\7133s\.UWWntWE˂`Q7СCXsZkhh-\.::;;cbb&&&mo̪A|@R333=<cxq^D"O>͚5+<<(''G ݻ+++UkS!]7<K14ɓnݪܺu}w:'N|o q8~ANxQZZZEE8'HsqtttAgϞ}֭[[J !L{.;u%:3?i{ѣG,ZHDD-69 BUUՇ~}r\ kkkˋL(̙3 c„ f͂O޽{rvvvׯ9x?>2L`q…ŋGGGB}aϟw4Mp8Bą }ŋNNN0HŞ={_njj:~x* 0!!;{nղÇ7n\rr2uL41۷o}˝={***yӧeee]\\xɢE455a@roooދ+C +C}jj C ?~jjjAAAyy|B L'N URRrss[tA&1M>-(@cǎ7440̇JHHH$###cccuuuMMMXL&8PL&3<<ÇjjjW^rvvvtt`X? }~1Ȅ3 78T/kjjTUU>}:mڴxc M?YWWwi=== ƍ{όe˖ 6L___A ^sssGGݻEDDTjXD"Q0+%[a11o|}aX{{;p<_MMM0?S/˗/WVVرcʕMFQor8hjH$VWWg#6 ۖ #p1gEEņ ` 7n *qqq 0k֬YfصkCP`*Do=cӦM***3g޼ykݻT*ڵkrrrǏ;-xGi4?n&͝;ѣGP-h'&& .&++Ν;˗/߼yׯ!""")) PSSsDTTT`u/_.^XCC#,,lt:ǧUB|deeeEFF%uf)>}.i|Fp[Dl6[P2(.x+V%wQeU?~x|~)##Jֆ?y̼sNyy9!...>>(555..թxwޥfdd| P__ KjkkT*yqllw#XUU khhֆ`II | ɓ'111߹-mU܀) IDATWW?~7oӧZZZ;w^ti۶mཌྷ{JJ |d? `4媩#9''>|K233ccc~fffnn.Ah4Z}}=Jioݺ.hYJJJ[[/777""KK1ߡh=T'lDa6EEEooUV9;;VVVRT###))W|;rȺufϞ}ڵZ;;;haRR˗ݻwҥp8KK;v,]ٳ/^5jeAAmmsbbb`ƉoBBBmmmMMM?h4???՛5k۷oTwryy <… ---) aÆFu۶m0 p #G|۷-[F"\2}t?? WWW555EE߷ڵ+99966 J_~ѢEaaak֬ٳ"//׷]Q儃L[n%%%%gΜ2eJ[[ۧO FTTTGGGFFFaaaIIwkkmے/^LLLvءvĉ_tNNNn݂Y{@pYloo yyMM͵k,XQ[[ ;nnnW\2dȡCl:L[SSѣ3gFFF:99]pAKKѣcƌinnsss̙3###:XRR2qaÆZF=yÇv"HgzzzQQQ0Eݻwkjj6o|Ν*(, HcDEE|CJJJJJJPPPiiRd2L&_p9|ׯmٲl۶mBBBs֦RŇ.,,ܹs9Ǜ;wرcy<͞4iRxx6<D8qk\\߿eggfKKK8y@Pdrkk!C I$ uvv9r<11QXX:D"Btٳ,XPTTk"H"d2鑑AAA222!!!/_⿥ROOODDD__ahkkYHHIgϞ{d;\.H$$$$>kll,##s .kee{ϟ Abcc{N$ Gbb… %$$ݻ'BQQQ%%\؃wsL|>tx())p`r q8\llZsssZZ@XfƍajÇݿ˖-?9"o|$%% B8oUWWс6ȉd|RXXz &&&++abb(8 w;6o޼nNy<l%J$R(Y,!kY$R" RoBıdߗpq>+Ig{3gf{'MMM}}}֯_APpp00<*ARR2$$$::ZSS  g( fffKA 8-%%@ 7' 66̙3 eBDwŋkjj7oެw l۶իWkii]x1,,lppeUUU>vŋHkϞ=>>>`ݞI[[{Ϟ=RRRW\ommݶmۓ'Oͷonggtҗ/_JKKH+WB$ AҥKN8q+++NNNSS ;vOPPpÆ ?[jA<<<7o.KjjjLLLk׮ݲe-Zֆ@ 899gL&S0)}ĉ/~o;6l ˗))ҥKׯ_ohhs A$H$ e˖~ 22!99111k֬166޽{ݎ;()));;wޕF斕IJJܹ3--mݗ/_'\\\eee/VPPXb5?Gbbb3. pYYY||$5TWWR㡫kϞ=咒`#H')**:44bYq틋޽@ vee妦&ؙA&KJJDbeee^^6nĤsLo[[SddM^|ymj}Y.[SS+ rrr`pႹypp0 >|prrJOO˃a8>>NjooaӧO@ϷMZGCCC߻w3g,^uH$==MNN.))|Uw8`qXܹ^?>vE"** ߟ8qٹԩSo߆a޽{ǎY`> Ϟ=khh鉎a8>>n`````ѣ߾}+..>qℵunn. ñ&&&OIg\\\lsa򲰰 a8%% |loowvvJNNaޖ,MnqH$ƍG,888L^OTTTWWWKKKhh(L̬ojj:}Çaʲ={.^Ta0Ā4Eb֭c9qℊeF5 _}W$2@ JKKSn/_0g!Y~k{{{׬Y3mtl2uΔ!$HwݰaawyyyRRRcܮyyy5K.*Oi0s,|/`0fffb8avرs+V$%%[)!uH$üQӨXsVVVnC~~˗/Sř566*((ЌHo\OOos= |e%ilï_Fv HUUUbbbcdUҶf7avΝ3݊ m{ hϞ=BBB9( rrrz}k.ŌMRR;;;\a877!!""2~3d2~.&&'O}vPP U~C"-Zlٲn\L&322N8XyyyDDijgτ߿A+.uvv  >~ȑ#H$rpsshhh HSS6י4ٛ6H$pц1˅ ݻ'++;)aeeezzz"s+ɓ' $iѣ2?~8bmmmSRRGy 33syyVdd$uD8;oO 7oO<ٱc$VW[[{%2Gss󾾾n YGww;w޽Ó>Y:x<,3[߾} ?~FMMMMMRBBd8S\pjLOO?uTWWr}}T̞P(VVVJV9#eAeW\ؿ?EggR`ccϟ?jժ ƵyԘJGGG mmm-++zN[eg?G.,,}!͛y92jhhǗ]xqF˗/{zz >|P]] Ո[|28x*6`qxX0 ߰$,>N(xyy'VXɓ:NNI?#xꀶ󒒒(>60  ȀuN8 >s;]G\Ȋ0a蘙988'JUᎬ#VA= vvvnnnK5v取Ϝ9 6rssoݺuMWWp` ˫vLisss_ez733 ٳggϞΞS Ԩ#CyyhII… }||233 ]hQ||cʀ򧭭-A;wyyHH;P{0 ##cFFƭ["##?)Lmmm``5kB}uuo޺:zz+WbBUWWp+W200`ء!^nnJ"aÆPzzzGGGJP'O1~NNNuuu늊htII A'OU0 ^zDhKN"xڵw^z~\___ƫWvvv&$$֞9sɩS^^ӧO׮]`0NNN<<~x޽ІNNLCCCMM̀ F =zwKK˛7o偾ɓ'edd]]]鱶jJJJ߿766`07otpp bee=|WWWEEfff& O>WF8o߾^AAz*.^aÆOqڗyʿk.QUU133o߾}~?! liiqrr611122zMOOPVzcjjjrrrjkk988\TX7o&IH$RNNBIJJ?R lYhш2}}}zzzܑϟ?!VVVrrr`#""+++qrrr~~~ .dbbjooxw JJJYYY &;;[KKں?~aNBBOJJ U>}EVVV~ۻWTTte$ɾF!qcc΍>}󋉉244L [[[sssMMM:dmmmddDQAPH$Frqqlݺ0k_ݿ8F]Fp@ ܽ{FGCC`0 ]CCankkkmmA 111CCCYYY?B}||v?/9!~:;;;DGG_pRRR/4^ )1p8\QQ˗/RUICZd2---X!H'j4| CaaaWWW<8YVH$O,((ɡ[XXNOOǔݻwExp8ؘ͛I$RTT---??^^^CCæMXYYG+(&& ++[SS,..\SS`"L$_a IDATt=\sssw}%$ a``ٳg ֭[ |||@wӳcTEeÆI֯_/,,[WWq| Gz*""bÆ BBB\\\?~` '111aaa <>x`MMիW+**~^#\xϟ֬YSPP`llt۷O\\[ZZ._|7oۖ-[V^ȑ gggG\IIŋD"qhhtݓLLL222444{챷p77p+ s"oŋ=<>+WڶJHH9r'NPWW)**ĩ˳bggw?M,Xs_KKK; f…D"1222&&&>>L&|v۷obbbmF2" ,.zr@]]]Mfbܹs~kΐiijEEEEE?=a''7nQǏK.A#@ ̈D4ktvB5萐l8II0888))g }ÇGFFs-\\\gΜ٩=`Rw[ׯ۶mC ÝIgggGGǪUHo˯\ǻv1{H$GݻFKKKKKKQĩ3VCXSSsE=mj *--OUZZz%Kښ333Oz#L5(筭}}}?z􈞞~``ȑ#`]-666//DgL 㽼@߾}C" d2D"?~ <׬Y ?uH\v-X[[D" 4[ooor H.ZZZ B#111++ F#ÇA+111(d{ o:VVV?'FFF޽$@]j RPP|÷#\xq21032vD `DtƴNvttdff?<@ hii[ZZ(2wټUV|r֭!Ჲ22ӣ acccZZ!,++A*--fxHQQчҥK544!"ɔ d_ZZ ߜalŖ/_6m۶C Z(.'UUU NWQQº4zzz<O$Oyy9(Ʀ lՇcdJɉ̼dɒ {y{{_pѣcRQQyfTFFFII})IlRSSUp PSS#!!16hhh~J e4-$$4Y0/ҩ (((ؼyT<{xJHd``Çni@JJݻ3݊9O444Lʩ?beeexɓ''1<۷ZZZU9{ 6`beO0<< |D" 1ߟeuuuaaaL"H"׬Y71===AAA`4&,,<|۶m%xL&ܼys3EOOOOO 6`FzN7nܸy󦀀s455ǟ 8QQQ{p% ǎcffVVV,޽{W^hyy'D;'z<{C\PP`ddDTMcccDDC+lllsqqq*S55ۣBCCSRRF;Je63O lKPI"nݺ%&&&...((>رcP2YTWWqqqR II7o\|I{zz|}}Gd`oo?bDxx4ʌ0F]]]SSS L5Dh"쬣+1k*TLfffzzg'\[v!,,LGG7=uԛ7o-,,>}$###^~}q>>N'OR޽{{{oo??2O<)++jjjZ]] ccc>}jkk2zvwwKcjjqƒuF%??|eQ`ttt``[ZZX8N!BBB$ D"۷999ꠠ , <8ݿX9u ͎;9{p8,wMMͽ{ ~􉋋ٳgx<˗/?,,,@`hu]66#G\~'009##իW'Oa2-//>y m4G"H$a,͛̏?(.%%ņ. (((pwwrYXXRRR"##.oܲeKQQѯ <\KKǏ#X'OLV.Yx%C^ oFhsh~P(###^^^eeeQQѢI***AWTTOB ӓH$poIg C"d2ez ;vEIII\\|ڵnٵkWdd***!H$ڵk .掉Z( `)YMMMAAAAAaƍ 5l$ (bmmĴw^x>>44qbbbQppp\pӳ܇Vecca׫xxxر#88***`pƶtR`GG#77wcc`DDEEEBCCWXqƾ>MMHkPMpp ͛7SRR~tׇ-Y$>>׷4<|04bĥ۳gɓ'm#)((cab$$$033^FVUUZL&spp|FIIi---h4z_B"EEE^z+WܺuԩS***&OJe<|c~UÃ@XBQQ777vvv&$$H$Ǐd###4WWWdɒꌌ  688 2,++KI:ѣ Cð讫syy_ sQ(Թs茌~akk;|/|~~~FFƝ;w֭['--m``?- 29 H???]]ݙnccܹO FDD;::z{{QݻƟ:u*;;;;;j+j'=}@"p8SNYYYޟדxBP(Ԝs .Pl@ ̬\@ 1000kkksrrN\\\/_[033F#%%%,,lh9^:tHPPPVVvhhoTK\x...&&&c˻m޼yppp.0`jkkyxxq988mll&\Ν;[fVue&*s!VB%%={DGG/_|b(*==ĉw1T"H`YYYyxxWV @qӧϟ???~ܹpuuu<<<j[ZZg8E]^1_gAjQwCյ`~$`(a[͹<<<3Hܶm۫WƘdddܳgϞ={RRRBCCMLL@/[ o@s?xt+zzziiiG@ )))ۻw%ݯ^۷QW %%%_x1\q0&75---HA<`08Wݚyb?۷o޽{WVVq;wXYYK, qk[===YYݻw]^VVVVVܹs~~~666"""?~|Fğ"@ 8446 @$G.C#ڎX;۷oٓS__?\'YZZ ޸qjjjS=>~]~} qvv   l۶mb͘RD" *4ُ %HIIIs(x@Pj;O ! YYYL&] &&f߾}G #FDrXXx <<<ϝ;7h$>)))"""# ]zQVV.,,\p[GGܯb)TWWرzg'OZYY6;;;۷rrr6l\n]tt4L>t==}]]]tt8x톅Җ|RTTTFFÇ444jjj .??_CCׯܼ8.!! 33[KK B{ÇOuu5@hmm%577kii} Z@PSSӧƘ;wnݺu```ɒ%444쩩%%%{]rׯ_g~~pOOσ888<8¬Ŋ ,k.wdfmmm|||HHȯ"]\\.\xڵٙ$ÇSz{{{yoV IDATyMNG5 !-H$+**"x000LQ( G9::9;;VVV;;; [666BhѢGRʼx񢨨MGG'///--M^^ׯ%%%@1""UKKVPP0''ȑ#w`0zzzd2+W퍉u֩SN:eoo/!!;88`^QQe˖k\\\tt==}eeӧO/^Cys$pzN ͛'N066`0?]VZZZ .477ܹs@>ٳW\y… \gii APkkkEEEjjڵk߼yC V^ܸq-??H__Ν;UWWP(cc}Y,":t(;;illTSS333勮nGGӧ8ŋG&''300?~<##COOOFF&))/qss{}!111:::Y[|7o@gbTH$Erlٲ) aVVVVV):,dB "66ؿ 022NE/BiiiݿO>\RMM$22rPo߾V Sv?~h/^444IIIKKKMLLG a%%%.\ pBLLLss*??ee%' 999}}}jjj-[֬YsΗ/_䞞;;m۶}ѣd2߿ʕH$100k޽YA  k׮  ??_WWwǎ0 ᡡ!VZ/p8zpBCCCwʕ'OC /_v횞~zb%%%0+drbb]P(VYUuF AIfI$ \.../30 kkk뷵VbFFo߾=x)iiiq…(jIIIYYY..rV^`455޽[WWϏ`V^]__~zvvvffUV _ AUUn #""rW^Y[[?^^^::^:::55۷Xi HsqqADGG'%%u޽}Z\e˖HKvvvQFFF:::$ \7ld888p8ך5k߿~ΝsΥ:ujW\ H$H$Lf``dnװ7o .2 &2LGGw:::(K0 /]E!8 inndee P6Z~ۈu+RSS#++SYY9244+~8^RR>A2'pppBҥKuttrrrZZZ6n8 vvv***ׯ_EDD222455%%%~;pl)..~%۷m۶UTT-_@ ::: gϞɕ΁<{33O:t(''F PN`0 ++eLLL9bbbbdde˖ŋсDhh(ے%K@Cvveˀ}'^^^!L;hrp!GGG082-D vtt˖-b߿|R?@ H$p8944zࣲrRR냃x$pڵk8po߾R988ݻghhKCCb#""\]]544|"((e˖$,)$$@OOڊba>L f CKK%uuue<==>|HEFQa^TQQpmmz}B9<,, 7---'''iiiݾ}{>|Ν;0 ihhDGGxCCC WKUUUϟ0. %H/O&uuusssUׯ444/_Ӗ?Ξ=kcc3ӭn!YF(WTT )G#5s;;ӧOS>'%%M3ׯw9ӭݻwH{IgbcMf49Z\t 3fmmmjjjuuu111-###555h4ZLLlR[Je.A5S//oVVܝ;w3UUU-tՠ9D"uuu.#]f SL͛7˖- m#GܹWYOO R2p~~a=|:::nӰ#G,YѣX,c{{ښL@{A&G ȣBi`bbrQ ?~ ZJe.1}N0VV cR}B`X{{?yϞ=7oVUU UnFXFe`0c̿Q 8~ϝ;wXYYAZL ST4"""崴i8A HQ9tЊ+GC yQQєb@hjj*++ϳSa>y ^x:g;w:t$II|gZWJ?s˖-YYY UC ۷oۺsrSo 7 %D"eTϥK~p.^8WǏ?(TSye[#vڬݻw+**FFFKEDDGϜ9s5FFFqF@v9DA&ٜ4@ ~\TT~z~3JJJ}}}*S\\Cנi555U___NNիW?KѣG988/_ bmݺܹssz^$&&9+Her~]jj֭[T``իǰ vڳgϹs&TTC8޿̙3bbb111ߟ[QQakk+##hhh(33{zzzzzƱgnnDϡ2j{@P`CGGOONNܿ?AW^_̯_~a-'idgq8Ad2iPzZJihaýx<6?~)--Oa٩KefɓO>uuu=~APzzwƣGZTTT^^^YY APAAиooo/..8ӧOwttdggWVV֞8qǏ>}jooup8'''???1?? ___ojjϊn_t|;88@(bfddAׯ_N>}Io?3 GҖ-[s`[[ʏ?-Z4F11*!IvڕGS޽&&&6̳g<<}QQQȰwXSٶs tHQP"*EEu,3xaPQ*Ҭ R "D)~/{h~!9d%BV9{cÇѳ޻wO]]u1cƌ3߼yxIIɁ'8^XXf͚aޡ^RRð$$${WӧOֺ;v211q{pvv.))A0233D%Klll jkk;wkYYY0LCCCUUʕ+W^UWWPRR***RN驩v֭[333]\\رcVڿLL vuusd2ɓ۶mIR⁁̎0,%%eϟWPPl   ĉ\\\,--  q++++++ Pʦt%%N`0L&DАP(,'==_MM۷9l6\x]VVzo8חdoo?/--UV ϟ?ojj0LJJ_W||{ܹð={ijj~&MʮBUUocc˗/|yť-Zdddtȑkݺu&&&]]]W^511a2f"GE۠ӡIHH[0KK]GGeA в3goZZZxq\p.--g__QF7(G)J__.++;2!& /_0aMLLlfffvϯYٳg/ <]plwtt:u!˕lmm0dRT]]]c{{Juu5a4Aeee>}aXWW&h ċmݺťBFF&%%P(hp8NRRo{kkנHd D$J&&&ʮX"<}tt1 swwCA(ҥK1 0a2ķqFAk?2R;_DdeeO8\x/--2{쾾/[}~~~?sggVnnnOOFUZZ.P2L4xΜ9k׮%?<999&9zիWw&L |]~OE?~<++kԨQjjj%%%}}}6m 8{lLL J=x𠔔ׯuttN^>z:-H94Ç+Vxˮ..N0~0ԡƍCr(2|!w ܵkנvtt|Fh_ܥKlllŧxCΜ9sɲ2;ϝ;zzz Cׯ_ONNf2<ŋnxl6+W0nS;ԔFx<^GGill>{nwuuegg2<9++ŋ_lccczzz^^y<^AA_|}QRRڥﯿz*NG;w.77fXաqtq``Az0,رcر]]]d]Z8 ١vdm,"H ?p_=֖Jz{{ WUU]f M$*פIP>45 A#TqqqtO]]?oxԿWOM9;;Ԛh?5BW]"E>0::z?:N?@A"Ϟ=VWWAPޞ`;v,11qD/Bs(f͚rGzařegg'z捼c<666666do*((8 cA"$%%/]~l 5ŕ ;w-++ YYYedd z۷ $‘ȑ#6mڲe˵kpAD"X,79p\S@ |WlԆ <<<Ç:: * jjj-a$Q[[{D7󓐐kkkȧrpRcX,UUUfff۷oCم @@T@{1IDAT"I.^ .`v…ٳg8-m7o|ڸ8~oɽ{BBBPxlDn/񉌌dp]]/!pjtDjmmmhh@( j:::bccqG\]]O8ܼxӧGFF8}?}}}999l6{˖-l6JNN.''GIIiÆ T*fǿzٹ~hiiQTT|M\\ݻwoܸ!''tƍ;99EEEM<6q|С0A>|ر[߿JBO@$%%%/^ӃJ 6FEEΘ1}GW^H$6-[xI8qbzz:ltvvvuuÖObbܹsG)/H$s ztԨQGNNN_r%֯!eҥZZZ5h5;pqj~MEEŠRq644}ȤI~'Dk\.7!!F%&&(y&;;;%%EGGG]]=55oJJJEEE^bjwwǏ ;;;qxmmmmmmWWW|e===4Cq(366 VQQ0qqq ٳѡ666 ,X`ApppEEEdd={V\tR}}QF+))䄆Ι3GEEeر{쉉3gΝ;:deeebb"!!!װO:5##رc˖-+**RVVF@ٽ{#G,--BCC/]tE G>|xD( 5y/{D)mllHpΝ>k֬,RKKKKKkDXRO655HssssssDDիWƎ ĉ"O|Q0Y| Feddr+V$$$=644K G #SPPaÆA0"ߚiӦM6mݨGGDDDttu2T38# oMq`BaÆm۶}DM$I_____? ɓyyywVVVXpVx{q11O~h;;; o֭[nǏ'$$(**.\kԩˆP@8-Z9γgƍ'hDDZd񲲲Μ9tҖ III}ڑlZJ߿"rvv{[|0Y"]\\kkk^J 'M4w?eX#zP -))Ɂ,&H@)((X[[?~;))IOOuuuP9s&55@رF_ 677700Bhii9;;wY" _f]ս\,x!}޽hѢIII33uÅ[usxÇ=zӵ qIIɷoߢ! Dihhuuu>>>˖-4iRpp0N/**ڼysRR֯q=z|ڵF zzz^z҂aXyyyYYfF Wee[X,aMMMEEEhw&yΝh4tY0MMM)))W9s&vݧO644u=c.ىloo0VTT;t:a, = CPYfeff %Q8Zi&믿+))֭{j}<衶mF<<|x/_?/_LP,,,***8۲e\]],Y]UUUu֭ Μ9Ǐh+Ws玭_~~>N!@8u_||ŋ ޽+'''%%E"H$Z"rտg͚5NNN*JJII߹sglll~~7.--sSL;{#@s*:wܵk,q\NN0mm7op8]]]:KIIF'O0l իW˗/ $B_pp0tZ!}! q6&@DP`***:::d$xbbb`xv@PUUcX óEoo!Hv,@A"sh4d2x ݻw8O2dud2|ĉŽ4H|.<|: 3gCU j! q%(FbIG   i4HD$B" !HD@A" i4HD$B" !HD@A" i4Haaa|w}]PPFC;994W\y H㥦bn``w &̞=ðM6ܺuԴ^Ϟ=+//X__8_|y͊z>3**… B& qaH0a[xxxss+W~w 233h4=== wW^?̙͛_H0ѵ_9П r$HD"1!!޽{nZtissQ;;;4o555yyy.\HJJp8'N022uE!***==sԩ իD$BF .;w 899ܹsÇG=4n8 öncjjjmmȑ#***0*d2LaVVVByQ:::C?jjjN6 P}}Yf ; !#0`hiiM8ibbbddή*66v衤(]]] WWq_jmmfL&)))gddܹ.''Ç盚nܸ+D$B;.p&Mߏx||O?DRCFFFNNNv풖:u*aFFF/ 311QSS/ðyYZZ:uJII+#[MMX,33dtnaA@4HD$B" !HD@A" i4HD$B" !HD@A" i4HD$B" !!@"C&pv @_/x} ;q+**x pbbuttonsd