pilot-link-0.12.5-dfsg/0000755000175000017500000000000011333433323015076 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/pilot-link-pp.pc.in0000644000175000017500000000032207700362171020530 0ustar rousseaurousseauprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: Pilot Link C++ Description: Version: @VERSION@ Requires: Libs: -L${libdir} -lpisock -lpisock++ Cflags: -I${includedir} pilot-link-0.12.5-dfsg/pilot-link.m40000644000175000017500000000211511333433255017425 0ustar rousseaurousseauAC_DEFUN([AC_PILOT_LINK_HOOK], [ PILOT_LINK_VERS=0 PILOT_LINK_MAJOR=12 PILOT_LINK_MINOR=5 PILOT_LINK_PATCH= AC_MSG_CHECKING(for pilot-link version >= $1) vers=$PILOT_LINK_VERS.$PILOT_LINK_MAJOR.$PILOT_LINK_MINOR$PILOT_LINK_PATCH pl_ve=`echo $1|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` pl_ma=`echo $1|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` pl_mi=`echo $1|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test $PILOT_LINK_VERS -gt $pl_ve; then AC_MSG_RESULT(yes ($vers)) elif test $PILOT_LINK_VERS -eq $pl_ve; then if test $PILOT_LINK_MAJOR -gt $pl_ma; then AC_MSG_RESULT(yes ($vers)) elif test $PILOT_LINK_MAJOR -eq $pl_ma; then if test $PILOT_LINK_MINOR -gt $pl_mi; then AC_MSG_RESULT(yes ($vers)) elif test $PILOT_LINK_MINOR -eq $pl_mi; then AC_MSG_RESULT(yes ($vers)) else AC_MSG_ERROR(no) fi else AC_MSG_ERROR(no) fi else AC_MSG_ERROR(no) fi ]) AC_DEFUN([AC_PILOT_LINK],[ if test x$1 = x; then plv=$PILOT_LINK_VERS.$PILOT_LINK_MAJOR.$PILOT_LINK_MINOR else plv=$1 fi AC_PILOT_LINK_HOOK($plv) ]) pilot-link-0.12.5-dfsg/NEWS0000644000175000017500000004354510716104724015614 0ustar rousseaurousseau-------------------------------------------------------------------------- pilot-link 0.12.3, "Can-of-Raid" (aka "Bug-Squash" release), 11-12-2007 -------------------------------------------------------------------------- Here you go, another pilot-link release. This one fixes quite a few issues: Bug Fixes: * Fix for Sony NR70 devices not being detected properly * BlueZ detection fix * XSLT manpage autogeneration fixes * Perl bindings build error, remove autoconfiscated files from releases * Java bindings build errors, remove autoconfiscated Makefile * Renamed pilot-treofoto and pilot-650foto to pilot-foto-treo600 and pilot-foto-treo650 * Added missing manpages for pilot-foto-treo6xx * Fixed OS5 failures with pilot-addresses.c * Updated pilot-install-memo.c to allow installation of files outside the current working directory * Fix for pi_usb_accept, adding PI_ERR_SOCK_LISTENER from Matt Davey's patch (closing #1782) Check the ChangeLog for the details on all fixes for this release -------------------------------------------------------------------------- pilot-link 0.12.2, "Dance With the Devil" aka "Distraction", 02-09-2007 -------------------------------------------------------------------------- 5 months since the last release (0.12.1) and we have another release! This one is mostly a maintenance release, but there are some new things in here. Major Features: * More cleanup in libpisock and documentation, addition of some new (working :) BlueZ support, new udev rules, expanded OS5 Contacts support, expanded OS X support and a lot more! Other Features: * No major features in this release, mostly bug fixes and minor tweaks here and there. The website has also been refreshed with new content and a completely new layout. All source files are now version-tracked in the header. Bug Fixes: * Python support was broken, fixed now, doh! Palm T|X over libusb has been fixed (we hope) with this release. Of course we need testers to validate that. All of userland is renamed now to avoid some namespace pollution. Documentation is all current with respect to this release, all manpages are in XML source format (requires xsltproc to process), and much more. Check the ChangeLog for the full details if you're interested. -------------------------------------------------------------------------- pilot-link 0.12.1, "Fresh Air", 09-04-2006 -------------------------------------------------------------------------- 3 years since the last release, then 1 week from that release until this one. WHEW! There isn't much "new" in this release, just some rapid-fire bug fixes reported from users and a lot of code has been cleaned up in the tree to remove unnecessary includes (check doxygen for the results). I'm working on cleaning up more, documenting more and making it easier to use and work with. Major Features: * Code cleanup in libpisock, libpisync, src and include Other Features: * Nothing major in this release Bug Fixes: * Fixed the installation faux pas with udev rules, oops! -------------------------------------------------------------------------- pilot-link 0.12.0, "Trois ans", 08-25-2006 -------------------------------------------------------------------------- Yes, 3 whole years since the last official release. There have been quite a few pre-releases in that time, but this is the first major point release in over 4 years. Major Features: * Support for DLP v1.4, more devices supported out of the box * Native support for OS X, no more Darwin ports needed * Native libusb support (using a new port designation of usb: to use that port. See doc/README.libusb for details * Most of the documentation and manpages migrated to DocBook XML * Userland "conduits" have been renamed in places where namespace collision could be a factor * Migration to popt() from getopt() which provides the groundwork for a global option changeover in an upcoming release. Other Features: * Too many to mention, its been over 3 years ;) Bug Fixes: * Much of the code in the DLP subsystem has been reworked and many bugs have been squashed. Check the ChangeLog for details on those items. -------------------------------------------------------------------------- pilot-link 0.11.9, "Anoxia", 07-04-2003 - NEVER RELEASED -------------------------------------------------------------------------- Continuing with the theme of removing the unnecessary code and adding features, along comes "Anoxia" (no oxygen), the next release of pilot-link. Major Features: * New DLP 1.2 function, SetDBInfo, which allows you to update or change the fields in the AppInfo block. Other Features: * No additional features at this time Bug Fixes: * Minor bug in pilot-xfer that caused screen output to get corrupted in certain conditions -------------------------------------------------------------------------- pilot-link 0.11.8, "Asphyxia", 06-17-2003 -------------------------------------------------------------------------- More code cleanups in this release, minor typos fixed here and there, and more reduction of the codebase in general. Things are going to get smaller, faster, and more functional with each of these releases. Major Features: * New timing loop so you don't have to hit HotSync on the Palm first, before launching your desktop conduits. This also work with gnome-pilot and J-Pilot as well. * pilot-foto conduit to fetch/convert photos taken with a Palm Zire71 camera device * Completely new Java bindings, rewritten from the ground-up by John Mitchell and Stephan Bösebeck. Other Features: * A few new manpages Bug Fixes: * Fixed a small leak in the socket code (serial.c/socket.c) (Robert L Krawitz) * Removed CoPilot ROM support from pi-getrom/pi-getram. POSE supercedes it, and should be used instead. * Solaris libpng fix (Simon Burr) * Fixed the pilot-addresses segfault problem on some platforms * BSD gnugetopt cleanup to counter unsetting $LIBS accidentally (Joe Marcus Clarke) * Perl5 errors when building under a debug build of Perl (Johathan Mark) Known Problems: * install-datebook needs proper parsing for spurious arguments * Resources which exceed the Palm recommendation of 64k will cause odd behavior in pilot-link. This can be easily fixed by increasing DLP_BUF_SIZE, but this isn't really good to do. * sync-plan has some issues with events, need testers to verify. * Syncronizing on FreeBSD with USB Palm devices is still flaky, but we believe the issue to be inside the BSD USB stack, and not within pilot-link itself. Can anyone concur/refute this assertion and help us test it further? * If you are doing a Network HotSync backup, and communication is interrupted, your local copy of the last database accessed will be truncated. One proposal to working around this has been floated, but not implemented or tested yet. What's Coming Soon: * VFS support was implemented with 29 of the VFS functions needed to read, write, and query external storage cards on Palm handhelds, but it was not deployed in this release. It should arrive in 0.12 of pilot-link, only a few releases away. * Conduit compression/rewrites. Many of the conduits will be collapsed into singular conduits, and others will be rolled into static versions using Perl for code reduction and portability reasons. * iCal and LDIF support for Calendar and AddressBook input and output The goal of the next few releases of pilot-link is to reduce the number of lines of actual code used, and compress the redundancy into singular entities. This means that similar or like code will be repurposed as much as possible across all of the libraries and conduits, reducing the cruft and maintenance required to update it for new features. -------------------------------------------------------------------------- pilot-link 0.11.7, "What's up Doc?", 1-05-2003 -------------------------------------------------------------------------- The last release had a few small errors in it, namely the changing of the exit(1) vs. exit 1; autoconf vs. C'isms. Major Features: * None at this time Other Features: * New manpages and manpage formatting Bug Fixes: * Fix for failures on libiconv w/Evolution * Fix for PI_LOG output * Fix for exit; vs. exit(); * Fix for readline support breaking C++ detection Known Problems: * Same as previous release -------------------------------------------------------------------------- pilot-link 0.11.6, "Torrent of Lucidity", 12-24-2002 -------------------------------------------------------------------------- A few bugs squashed in this one, improved stability, two new conduits, manpages, docs, more.. Major Features: * None at this time * New pilot-archive sample conduit to send archived ToDo records to STDOUT as CSV-formatted entries. * Deprecated pilot-mail, in favor of pilot-mailsync. pilot-mail remains, as an example to other conduit authors. * pilot-link 0.11.6 will now cleanly build on OSX 10.x.x systems * pilot-xfer --time feature added to sync Palm time to desktop time Other Features: * New install-todo conduit (Robert A. Kaplan) * New install-expenses conduit * Cleaned up pilot_connect() to report better error conditions, and propose possible solutions to solving them for general users * Added HOST_OS detection and linked into each conduit, to assist debugging * Added Python test script (Nicholas Piper) * Added support for ElectricFence malloc() debugging library Bug Fixes: * Fix for failures on usb:// notation use * Fix for missing pi_close() elements * Fix for installing files larger than available space on device * Fix for autoconf 2.1x and 2.5x compatibility * Fix for TCL version detection in pilot-debug * Fix for CreatorID output in dlpsh * Fix to allow gcc 3.2 builds * Fix for pilot_connect() that was losing the client socket * Fix for install-memos malloc() bug, -t missing argument bug, title truncation bug. Known Problems: * FreeBSD hangs on USB synchronization (this may not be a pilot-link bug, as serial, IR works using the same code structures) * Java bindings missing manifest * snprintf() calls fail on Irix 6.4 systems * Improper getopt_long propagation on Irix 6.4 * autoconf/automake 2.5x problems on AIX * install-memo doesn't strip ^M from files before syncronization, doesn't detect duplicate files being sync'd to the same device. -------------------------------------------------------------------------- pilot-link 0.11.5, "Insomnia", 09-28-2002 -------------------------------------------------------------------------- Just minor bugs, closing up a few BSD and zoning in on some BSD and Irix issues for this (and the next) release. Major Features: * None at this time Other Features: * None at this time Bug Fixes: * Fix for dlp_callApplication crash (Owen Stenseth) * Fix for standard includes when using gcc/g++/c++ 3.x or later * Fix for 'name' and 'nameLength' member errors (Nicholas Piper) Known Problems: * Java bindings missing manifest * snprintf() calls fail on Irix 6.4 systems * Improper getopt_long propagation on Irix 6.4 * autoconf/automake 2.5x problems on AIX -------------------------------------------------------------------------- pilot-link 0.11.4, "Alzheimer Release", 09-16-2002 ------------------------------------------------------------------------- Some major bugs have been fixed in this release, which now supercedes all previous releases in the 0.11.x series. Major Features: * Updated configuration to work with newer autoconf/automake versions Other Features: * None at this time Bug Fixes: * Fixed the "double-free" bug that would sometimes cause the visor driver to crash or hang on Linux systems * Network Hotsync from Linux to Windows now works * Perl bindings will build cleanly on perl 5.6 and 5.8 with gcc 2.x and 3.x * Fixed an issue with libpng being linked into every binary by default Known Problems: * Java bindings may or may not work, need to investigate -------------------------------------------------------------------------- pilot-link 0.11.3, "Stable Release", 08-6-2002 -------------------------------------------------------------------------- This is a rollup stable release of previous 0.11.x bugfixes and feature additions. Major Features: * None at this time Other Features: * None at this time Bug Fixes: * Reverted a previous pilot-xfer option that overwrote the existing line during a backup. Curses will be dropped into here soon to more finitely control this. * Fixed a missing dlpErrIllegalReq in pi-dlp.h that caused problems with J-Pilot Known Problems: None identified for this release -------------------------------------------------------------------------- pilot-link 0.11.2, "I Want One Two", 08-6-2002 -------------------------------------------------------------------------- This is an updated version to the 0.11.1 "Ocean's Eleventy-First" release from July 18th, and fixes quite a few bugs that people have reported with gnome-pilot and J-Pilot. Major Features: * pilot-xfer now has a more "usable" backup style, and the -q option now does something useful (this will be changing in the near future, enabling curses to control the backup "windowing") * First pass at native FreeBSD support from Anish Mistry (we need testers!) Other Features: * None at this time Bug Fixes: * install-todos -f didn't work at all in 0.11, fixed. * pilot-addresses didn't import the right csv format, fixed. * Updated the manpages and fixed some typos in the source documentation * ReadDBList was returning an incorrect value, confusing J-Pilot, fixed. * TCL version test was incorrect in ./confiure.in, fixed. * pi-addresses.h had an incorrect field ordering which caused the ouput csv to be incompatible with the record format, fixed. * Updates to allow pilot-link to build under BSD/OS 4.3 (Jeffrey C Honig) Known Problems: * Network Hotsync from Linux to Windows does not work -------------------------------------------------------------------------- pilot-link 0.11.1, "Ocean's Eleventy-first", 07-18-2002 -------------------------------------------------------------------------- This is a bugfix release to address some issues found in the 0.11 release from 7-12-2002. Major Features: * read-palmpix now takes arguments for output file type, "-t png" or "-t ppm" * read-notepad also updated to accept the same argument types Other Features: * Fixed some of the gcc-related warnings (more to come) * All of the language bindings (Perl, Python, Java, Tcl, Tk, iTcl) all default to off, unless specified. If you want to enable them, you must use --with-foo, where 'foo' is the binding of your choice, such as --with-perl Bug Fixes: * pilot-xfer -f didn't work at all in 0.11, fixed. * pilot-xfer -f bugfix for non-writable local files * Minor Python build fix Known Problems: * pilot-addresses -T header fix (don't import header into record) * pilot-xfer -f fix (support '-f FooDB' as 'FooDB.p{db|rc|qa} -------------------------------------------------------------------------- pilot-link 0.11, "Ocean's Eleven", 07-12-2002 -------------------------------------------------------------------------- This is a development release, primarily to test the new usb device support. Most of the USB devices are on /dev/ttyUSB1 (or usb/tts/1), except for the Sony PEG-S300 and 760C which are on /dev/ttyUSB0 (or usb/tts/0). Note that you must hit the sync button prior to running the app right now for USB devices. It is recommended that a kernel > 2.4.16 be used due to problems that existed in earlier drivers (may get a kernel oops). Major Features: * DLP argument parsing re-write * Better usb device support e.g. usb:/dev/ttyUSB1 Other Features: * Allow sync to proceed even if OS 4.x device has password set * Split out generic conduit library to libpisync * DLP regression test Bug Fixes: * Compile perl, python modules with correct lib dir * Lots of minor bug fixes, reorganization Known Problems (Please see doc/TODO for more details): * os2serial.c and winserial.c files are not yet ported to the new USB, serial, and Net protocol "recipes" * The "sys" protocol is not well tested * TCL/TK bindings are out of commission * PDB files with space filler records are not yet handled properly -------------------------------------------------------------------------- pilot-link 0.10.99, "Woodstock", 03-20-2002 -------------------------------------------------------------------------- This is a development release, primarily to test the new usb device support. Most of the USB devices are on /dev/ttyUSB1 (or usb/tts/1), except for the Sony PEG-S300 and 760C which are on /dev/ttyUSB0 (or usb/tts/0). Note that you must hit the sync button prior to running the app right now for USB devices. It is recommended that a kernel > 2.4.16 be used due to problems that existed in earlier drivers (may get a kernel oops). Major Features: * Support for new USB devices (like the Palm m500 and Sony PEG-N710C) * Updated Java bindings (David Goodenough) * Updated Python bindings (Rob Tillotson) * Application cleanup for consistency Other Features: * Generic device and protocol implementations * Complete Autoconf/Automake setup * C++ library is now shared (.so) and installed * Complete source tree re-organization * Runtime debug logging down to the packet level Bug Fixes: * Expense Preferences now pack/unpack correctly * Dozens of minor bug fixes, code reformatting, reordanization Known Problems (Please see doc/TODO for more details): * os2serial.c and winserial.c files are not yet ported to the new USB, serial, and Net protocol "recipes" * The "sys" protocol is not well tested * TCL/TK bindings are out of commission * PDB files with space filler records are not yet handled properly pilot-link-0.12.5-dfsg/Makefile.in0000644000175000017500000007066211333433244017160 0ustar rousseaurousseau# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ target_triplet = @target@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/pilot-link-pp.pc.in $(srcdir)/pilot-link.m4.in \ $(srcdir)/pilot-link.pc.in \ $(top_srcdir)/bindings/Perl/Makefile.PL.in \ $(top_srcdir)/bindings/Python/setup-standalone.py.in \ $(top_srcdir)/bindings/Python/setup.py.in \ $(top_srcdir)/configure AUTHORS COPYING COPYING.LIB ChangeLog \ INSTALL NEWS config.guess config.sub depcomp install-sh \ ltmain.sh missing ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/bluez.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/tcl.m4 \ $(top_srcdir)/m4/threads.m4 \ $(top_srcdir)/m4/vl_lib_readline.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h $(top_builddir)/include/pi-md5.h CONFIG_CLEAN_FILES = pilot-link.m4 pilot-link.pc pilot-link-pp.pc \ bindings/Perl/Makefile.PL bindings/Python/setup.py \ bindings/Python/setup-standalone.py CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(m4dir)" "$(DESTDIR)$(pkgconfigdir)" DATA = $(m4_DATA) $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck 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)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLUEZ_CFLAGS = @BLUEZ_CFLAGS@ BLUEZ_LIBS = @BLUEZ_LIBS@ CAT_ENTRY_END = @CAT_ENTRY_END@ CAT_ENTRY_START = @CAT_ENTRY_START@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOCBOOK_ROOT = @DOCBOOK_ROOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVA = @JAVA@ JAVABASE = @JAVABASE@ JAVAC = @JAVAC@ JAVA_VERSION = @JAVA_VERSION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PIC_LIBS = @PIC_LIBS@ PILOT_LINK_MAJOR = @PILOT_LINK_MAJOR@ PILOT_LINK_MINOR = @PILOT_LINK_MINOR@ PILOT_LINK_PATCH = @PILOT_LINK_PATCH@ PILOT_LINK_VERS = @PILOT_LINK_VERS@ PISOCK_AGE = @PISOCK_AGE@ PISOCK_CURRENT = @PISOCK_CURRENT@ PISOCK_REVISION = @PISOCK_REVISION@ PISYNC_AGE = @PISYNC_AGE@ PISYNC_CURRENT = @PISYNC_CURRENT@ PISYNC_REVISION = @PISYNC_REVISION@ PKG_CONFIG = @PKG_CONFIG@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ POPT_INCLUDES = @POPT_INCLUDES@ POPT_LIBS = @POPT_LIBS@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_H = @PYTHON_H@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RL_LIBS = @RL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ XML_CATALOG = @XML_CATALOG@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ builddir = @builddir@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ usb_libs = @usb_libs@ AUTOMAKE_OPTIONS = 1.6 SUBDIRS = popt \ libpisock \ libpisync \ include \ src \ bindings \ doc \ tests \ darwin m4dir = $(datadir)/aclocal m4_DATA = pilot-link.m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = pilot-link.pc ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ autogen.sh \ $(m4_DATA) \ pilot-link.pc.in \ pilot-link-pp.pc.in all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: 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'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu 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) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) 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) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 pilot-link.m4: $(top_builddir)/config.status $(srcdir)/pilot-link.m4.in cd $(top_builddir) && $(SHELL) ./config.status $@ pilot-link.pc: $(top_builddir)/config.status $(srcdir)/pilot-link.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ pilot-link-pp.pc: $(top_builddir)/config.status $(srcdir)/pilot-link-pp.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ bindings/Perl/Makefile.PL: $(top_builddir)/config.status $(top_srcdir)/bindings/Perl/Makefile.PL.in cd $(top_builddir) && $(SHELL) ./config.status $@ bindings/Python/setup.py: $(top_builddir)/config.status $(top_srcdir)/bindings/Python/setup.py.in cd $(top_builddir) && $(SHELL) ./config.status $@ bindings/Python/setup-standalone.py: $(top_builddir)/config.status $(top_srcdir)/bindings/Python/setup-standalone.py.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-m4DATA: $(m4_DATA) @$(NORMAL_INSTALL) test -z "$(m4dir)" || $(MKDIR_P) "$(DESTDIR)$(m4dir)" @list='$(m4_DATA)'; test -n "$(m4dir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(m4dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(m4dir)" || exit $$?; \ done uninstall-m4DATA: @$(NORMAL_UNINSTALL) @list='$(m4_DATA)'; test -n "$(m4dir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(m4dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(m4dir)" && rm -f $$files install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files # 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): @fail= 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; \ ($(am__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" $(RECURSIVE_CLEAN_TARGETS): @fail= 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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 || \ set "$$@" "$$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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -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 $(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-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(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) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(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 \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__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 all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(m4dir)" "$(DESTDIR)$(pkgconfigdir)"; 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-m4DATA install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: 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-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-m4DATA uninstall-pkgconfigDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-m4DATA \ install-man install-pdf install-pdf-am install-pkgconfigDATA \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-m4DATA \ uninstall-pkgconfigDATA # 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: pilot-link-0.12.5-dfsg/COPYING0000644000175000017500000004307607141126524016147 0ustar rousseaurousseau GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, 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 Appendix: 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) 19yy 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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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. pilot-link-0.12.5-dfsg/config.sub0000755000175000017500000010242511274160642017072 0ustar rousseaurousseau#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. timestamp='2009-06-11' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # 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. # Please send patches to . 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, 2006, 2007, 2008 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* | \ kopensolaris*-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 ;; -bluegene*) os=-cnk ;; -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 \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | 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 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) 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-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | 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[24]aeb-* | 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-* | tile-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # 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 ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; 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 ;; cr16) basic_machine=cr16-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 ;; dicos) basic_machine=i686-pc os=-dicos ;; 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 ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; 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 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; 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 ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; 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 ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; 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 ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; 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 ;; z80-*-coff) basic_machine=z80-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[24]aeb | 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* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -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* | -cegcc* \ | -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* | -drops*) # 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 ;; -dicos*) os=-dicos ;; -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 score-*) os=-elf ;; 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 ;; mep-*) os=-elf ;; 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 ;; -cnk*|-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: pilot-link-0.12.5-dfsg/configure.ac0000644000175000017500000005275011253426201017373 0ustar rousseaurousseau# This is free software, licensed under the GNU Public License V2. # See the file COPYING for details. AC_INIT(include/pi-version.h.in) AC_CONFIG_MACRO_DIR([m4]) dnl Initialize maintainer mode AM_MAINTAINER_MODE dnl Run all of the sane intltool tests dnl IT_PROG_INTLTOOL AC_PREFIX_DEFAULT(/usr/local) dnl ****************************** dnl Limit to a specific ac version dnl ****************************** AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(include/pi-md5.h) dnl ****************************** dnl Pilot Link Version dnl ****************************** PILOT_LINK_VERS=0 PILOT_LINK_MAJOR=12 PILOT_LINK_MINOR=5 PILOT_LINK_PATCH= AC_SUBST(PILOT_LINK_VERS) AC_SUBST(PILOT_LINK_MAJOR) AC_SUBST(PILOT_LINK_MINOR) AC_SUBST(PILOT_LINK_PATCH) VERSION="$PILOT_LINK_VERS.$PILOT_LINK_MAJOR.$PILOT_LINK_MINOR$PILOT_LINK_PATCH" dnl ****************************** dnl Pilot Link Library Version dnl libpisock.so.CURRENT.AGE.REVISION dnl Please see the following URL for details: dnl http://sources.redhat.com/autobook/autobook/autobook_91.html dnl ****************************** PISOCK_CURRENT=9 PISOCK_REVISION=2 PISOCK_AGE=0 AC_SUBST(PISOCK_CURRENT) AC_SUBST(PISOCK_REVISION) AC_SUBST(PISOCK_AGE) dnl ****************************** dnl Pilot Link Sync Library Version dnl libpisync.so dnl ****************************** PISYNC_CURRENT=1 PISYNC_REVISION=3 PISYNC_AGE=0 AC_SUBST(PISYNC_CURRENT) AC_SUBST(PISYNC_REVISION) AC_SUBST(PISYNC_AGE) dnl Eat -Werror so configure will run properly, if the user provided it enable_werror=no save_CFLAGS="$CFLAGS" CFLAGS=`echo $save_CFLAGS | sed -e s/-Werror//g` CXXFLAGS=`echo $save_CXXFLAGS | sed -e s/-Werror//g` if test "x$CFLAGS" != "x$save_CFLAGS"; then dnl -Werror was set; treat it as implicit --enable-werror below enable_werror="yes" fi dnl Check host type AC_CANONICAL_HOST AC_CANONICAL_SYSTEM AC_DEFINE_UNQUOTED(HOST_OS, "$host", [Host type]) AM_INIT_AUTOMAKE(pilot-link, [$VERSION]) dnl ****************************** dnl Checks for basic programs. dnl ****************************** AC_PROG_CC AC_PROG_INSTALL(install ginstall) AC_PROG_F77(g77 g77-3.2 g77-3.3 fl32 f77 fort77 xlf f90 xlf90) AM_PROG_LIBTOOL AC_PROG_YACC dnl ****************************** dnl Defaults for GCC dnl ****************************** if test "x$GCC" = "xyes"; then CFLAGS=${CFLAGS:-"-g2 -Wall"} fi dnl ****************************** dnl Platform-specific things dnl ****************************** dnl PIC_LIBS is flags needed to compile PIC, for shared libs dnl where some linker offsets are not allowed. Currently set dnl for FreeBSD-amd64 only. PIC_LIBS="" dnl null_device is the default NULL device on your system dnl (usually /dev/null or NUL). If yours is _not_ /dev/null, dnl set it in the platform-specific section below. null_device="/dev/null" case "$host" in *darwin*) dnl define MACOSX for code use CPPFLAGS="$CPPFLAGS -DMACOSX" dnl Use fink under MacOS X AC_MSG_CHECKING(for fink support) if test -d "/sw/lib" -a -d "/sw/include"; then CPPFLAGS="$CPPFLAGS -I/sw/include" LDFLAGS="$LDFLAGS -L/sw/lib" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi ;; amd64*freebsd*) dnl Need -fPIC for shared libs PIC_LIBS="-fPIC" ;; *solaris*) dnl Check if we need -lresolv for inet_pton AC_CHECK_FUNC(inet_pton,, [AC_CHECK_LIB(resolv,inet_pton,LIBS="-lresolv $LIBS")]) AC_CHECK_FUNC(pow,, [AC_CHECK_LIB(m,pow,LIBS="-lm $LIBS")]) ;; *) ;; esac AC_DEFINE_UNQUOTED(NULL_DEVICE, "$null_device", [Your system's bitbucket (usually /dev/null or NUL)]) AC_SUBST(PIC_LIBS) dnl ****************************** dnl Check if this was CVS source dnl ****************************** if test -d "${srcdir}/CVS" ; then PL_FROM_CVS=yes fi AM_CONDITIONAL(CVS_BUILD,[test -d "${srcdir}/CVS"]) dnl ****************************** dnl Pilot Link Checks dnl ****************************** AC_HEADER_STDC AC_C_CONST AC_HEADER_TIME AC_STRUCT_TM AC_PROG_GCC_TRADITIONAL AC_TYPE_SIGNAL AC_CHECK_HEADERS( dirent.h errno.h fcntl.h inttypes.h memory.h netdb.h \ netinet/in.h regex.h stdint.h stdlib.h string.h strings.h \ sys/ioctl_compat.h sys/ioctl.h sys/malloc.h sys/select.h \ sys/sockio.h sys/time.h sys/utsname.h unistd.h IOKit/IOBSD.h) AC_CHECK_HEADERS(ifaddrs.h inttypes.h) AC_CHECK_FUNCS( atexit cfmakeraw cfsetispeed cfsetospeed cfsetspeed dup2 \ gethostname inet_aton malloc memcpy memmove putenv sigaction \ snprintf strchr strdup strtok strtoul strerror uname) dnl Find optional libraries (borrowed from Tcl) tcl_checkBoth=0 AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) if test "$tcl_checkSocket" = 1; then AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", tcl_checkBoth=1) fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" AC_CHECK_FUNC( accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) fi AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])) AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) AC_CACHE_CHECK([for cispeed and cospeed members of struct termios], ac_cv_termios_cspeed, [AC_TRY_COMPILE( [#include ], [int main(void) { struct termios t;t.c_ispeed=t.c_ospeed=0;}], ac_cv_termios_cspeed=yes,ac_cv_termios_cspeed=no)]) if test $ac_cv_termios_cspeed = yes; then AC_DEFINE(TERMIOS_CSPEED, 1, [Define if we have termios(3) support]) fi AC_CHECK_SOCKLEN_T dnl ****************************** dnl pilot-link conduits dnl ****************************** AC_MSG_CHECKING(whether to enable userland conduits) AC_ARG_ENABLE(conduits, [ --enable-conduits Build the userland conduits], [enable_conduits="yes"], [enable_conduits="no"], ) AM_CONDITIONAL(ENABLE_CONDUITS,[test "x$enable_conduits" != "xno"]) AC_MSG_RESULT($enable_conduits) dnl ****************************** dnl PNG Support dnl ****************************** msg_png=no if test "x$enable_conduits" != "xno"; then have_png=no AC_ARG_WITH(libpng, [ --with-libpng Prefix where libpng is installed]) case $with_libpng in /*) PNG_CFLAGS="-I$withval/include" PNG_LIBS="-L$withval/lib" ;; esac save_CFLAGS="$CFLAGS" save_CPPFLAGS="$CPPFLAGS" save_LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS $PNG_CFLAGS" CPPFLAGS="$CPPFLAGS $PNG_CFLAGS" LDFLAGS="$LDFLAGS $PNG_LIBS" AC_CHECK_LIB(png, main, [have_png=yes; PNG_LIBS="$PNG_LIBS -lpng"],[have_png=no],[-lm]) if test "$have_png" = yes; then AC_CHECK_HEADER(png.h, , have_png=no) if test "$have_png" = yes; then AC_MSG_CHECKING(for png setjmp support) AC_EGREP_CPP(yes, [#include #ifdef PNG_SETJMP_SUPPORTED yes #endif], , have_png=no) AC_MSG_RESULT($have_png) if test "$have_png" = yes; then AC_DEFINE(HAVE_PNG, 1, [Define if we have PNG support]) have_png=yes msg_png=yes fi fi fi CFLAGS="$save_CFLAGS" CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" else have_png="none" PNG_CFLAGS= PNG_LIBS= fi AC_SUBST(PNG_CFLAGS) AC_SUBST(PNG_LIBS) dnl ****************************** dnl Threading support dnl ****************************** msg_threads=no PILOT_LINK_THREADS_SUPPORT if $use_threads; then msg_threads=yes fi dnl *************************************** dnl Test if building USB Support dnl for Linux, FreeBSD or Darwin (Mac OS X) dnl *************************************** have_libusb=no use_libusb=no usb_type= usb_libs= AC_ARG_ENABLE(libusb, AC_HELP_STRING([--enable-libusb Enable usage of libusb]), if test "x$enableval" != "xno" ; then AC_CHECK_LIB(usb, usb_open, [have_libusb=yes;],[have_libusb=no]) fi ) if test "$have_libusb" = yes; then AC_DEFINE(HAVE_USB, 1, [Define if we have USB support]) usb_type=libusb msg_usb="yes, libusb" case "$host" in *darwin*) usb_libs="-lusb -Wl,-framework,IOKit,-framework,CoreFoundation" ;; *) if test "$msg_threads" = "no"; then usb_libs="-lusb -lpthread" else usb_libs="-lusb" fi ;; esac else case "$host" in *linux*) AC_DEFINE(HAVE_USB, 1, [Define if we have USB support]) usb_type=linux msg_usb="yes, Linux" ;; *freebsd*) AC_DEFINE(HAVE_USB, 1, [Define if we have USB support]) usb_type=freebsd msg_usb="yes, FreeBSD" ;; *darwin*) AC_DEFINE(HAVE_USB, 1, [Define if we have USB support]) usb_type=darwin msg_usb="yes, Darwin" usb_libs="-Wl,-framework,IOKit,-framework,CoreFoundation" ;; esac fi AM_CONDITIONAL(WITH_USB, test x$usb_type) AM_CONDITIONAL(WITH_LIBUSB, test x$usb_type = xlibusb) AM_CONDITIONAL(WITH_LINUXUSB, test x$usb_type = xlinux) AM_CONDITIONAL(WITH_FREEBSDUSB, test x$usb_type = xfreebsd) AM_CONDITIONAL(WITH_DARWINUSB, test x$usb_type = xdarwin) AC_SUBST(usb_libs) dnl ****************************** dnl BlueZ Support dnl ****************************** have_bluez=no use_bluez=auto AC_ARG_WITH(bluez, AC_HELP_STRING([--with-bluez], [Enable use of BlueZ]), [use_bluez="$withval"]) if test "$use_bluez" != "no" ; then PKG_CHECK_MODULES([BLUEZ],[bluez],[ have_bluez=yes use_bluez=yes ],[ AC_MSG_RESULT([no pkgconfig package]) AC_BLUEZ([ have_bluez=yes use_bluez=yes ],[ test "$use_bluez" != "no" -a "$use_bluez" != "auto" \ && AC_MSG_ERROR([BlueZ explicitly requested, but no library found]) use_bluez=no have_bluez=no ]) ]) fi if test "$use_bluez" = "yes" ; then AC_DEFINE([HAVE_BLUEZ],[1],[Define if we build with BlueZ]) AC_SUBST([BLUEZ_CFLAGS]) AC_SUBST([BLUEZ_LIBS]) fi AM_CONDITIONAL([WITH_BLUEZ],[test "$use_bluez" = "yes"]) dnl ********************************* dnl Check for popt (use internal if needed) dnl ********************************* AC_ARG_WITH(included-popt, [ --with-included-popt use bundled popt library, not from system],, [with_included_popt="auto"] ) if test "x$enable_conduits" != "xno"; then if test "x$with_included_popt" != "xyes"; then dnl Determine if system popt is good enough save_LIBS="$LIBS" AC_CHECK_HEADER(popt.h, AC_CHECK_DECL(POPT_BIT_SET, AC_CHECK_LIB(popt, poptStrippedArgv,, [with_included_popt="yes"]), [with_included_popt="yes"], [#include ]), [with_included_popt="yes"] ) LIBS="$save_LIBS" fi AC_MSG_CHECKING(whether to use included popt) if test "x$with_included_popt" = "xyes"; then msg_popt="yes (internal)" AC_MSG_RESULT(yes) POPT_LIBS='$(top_builddir)/popt/libpopt.la' POPT_INCLUDES='-I$(top_srcdir)/popt' else AC_MSG_RESULT(no) msg_popt="yes (system)" POPT_LIBS="-lpopt" fi else with_included_popt="no" msg_popt="none" POPT_LIBS= POPT_INCLUDES= fi AM_CONDITIONAL(INCLUDED_POPT, test "x$with_included_popt" = "xyes") AC_SUBST(POPT_LIBS) AC_SUBST(POPT_INCLUDES) dnl ****************************** dnl iconv checking dnl ****************************** have_iconv=no AC_ARG_WITH(libiconv, [ --with-libiconv Prefix where libiconv is installed]) case $withval in /*) ICONV_CFLAGS="-I$withval/include" ICONV_LIBS="-L$withval/lib" ;; esac save_CFLAGS="$CFLAGS" save_LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS $ICONV_CFLAGS" LDFLAGS="$LDFLAGS $ICONV_LIBS" AC_CHECK_LIB( iconv, libiconv, [have_iconv=yes; ICONV_LIBS="$ICONV_LIBS -liconv"], [ AC_CHECK_FUNC(iconv, [ AC_CHECK_FUNCS(gnu_get_libc_version) AC_MSG_CHECKING(if system iconv handles CP1252) AC_TRY_RUN([ #include #include #include #ifdef HAVE_GNU_GET_LIBC_VERSION #include #endif int main (int argc, char **argv) { const char *pc = "\x66\x66\x66\x66\x66\x66\x66\xA9"; const char *utf8 = "\x66\x66\x66\x66\x66\x66\x66\xC2\xA9"; char transbuf[10], *trans = transbuf; iconv_t cd; size_t pc_len = strlen (pc), utf8_len = 10; size_t utf8_real_len = strlen (utf8); cd = iconv_open ("UTF-8", "CP1252"); if (!cd) exit (1); if (iconv (cd, &pc, &pc_len, &trans, &utf8_len) == -1 || pc_len != 0) exit (1); if (memcmp (utf8, transbuf, utf8_real_len) != 0) exit (1); exit (0); }], AC_MSG_RESULT(yes); have_iconv=yes, [AC_MSG_RESULT(no);], AC_MSG_RESULT(not cross compiling);)])]) dnl ## Fixed AC_TRY_RUN warning, missing third argument. -DD 22/01/2002 dnl dnl AC_TRY_RUN is a macro that's basically like an if-then-else structure. If dnl the test program (whose text is the first argument) succeeds, the second dnl argument is executed; if the test fails, the third argument is executed; and dnl if autoconf knows it is cross-compiling for another machine and therefore dnl can't run a test program at all, it doesn't try but just executes the fourth dnl argument. Usually that last alternative should be the most conservative dnl assumption. CFLAGS="$save_CFLAGS" LDFLAGS="$save_LDFLAGS" if test "$have_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if we have libiconv support]) msg_iconv=yes else msg_iconv=no fi AC_SUBST(ICONV_CFLAGS) AC_SUBST(ICONV_LIBS) dnl ****************************** dnl readline checking dnl ****************************** if test "x$enable_conduits" != "xno"; then VL_LIB_READLINE else msg_readline="none" fi dnl ****************************** dnl Perl dnl ****************************** use_perl=false #msg_perl=no AC_ARG_WITH(perl, [ --with-perl=perlexec use Perl [[default=no]]], , with_perl=no) if test "x$with_perl" = "xno"; then AC_MSG_CHECKING(if perl was enabled) AC_MSG_RESULT(no) PERL='' else if test "x$with_perl" != "xyes" && test "x$with_perl" != "x"; then PERL="$with_perl" else AC_CHECK_PROG(PERL, perl, perl) fi fi dnl Check if version of Perl is sufficient PERL_MINVERSION="5.000_00" if test "x$PERL" != "x"; then AC_MSG_CHECKING(for perl version greater than or equal to $PERL_MINVERSION) $PERL -e "exit ! eval 'use $PERL_MINVERSION; 1'" if test $? -ne 0; then AC_MSG_RESULT(no); use_perl=false else AC_MSG_RESULT(yes); PERL_VERSION=`$PERL -e 'print $]'` use_perl=true fi fi AM_CONDITIONAL(WITH_PERL, $use_perl) #if $use_perl; then # msg_perl=yes #fi AC_SUBST(PERL) dnl ****************************** dnl Java dnl ****************************** use_java=false # msg_java=no AC_ARG_WITH(java, [ --with-java=jdkbase use Java [[default=no]]], , with_java=no) if test "x$with_java" != "xno"; then AC_PATH_PROG(JAVAC, javac, , $with_java/bin:$PATH) AC_PATH_PROG(JAVA, java, , $with_java/bin:$PATH) AC_PATH_PROG(JAR, jar, ,$with_java/bin:$PATH) fi if test "x$JAVA" != "x" && test "x$JAVAC" != "x" && test "x$JAR" != "x"; then AC_MSG_CHECKING(for Java Development Kit) JAVABASE=`echo "$JAVAC" | sed -e "s/\/bin\/javac//"` if test -f "$JAVABASE/include/jni.h"; then use_java=true AC_MSG_RESULT(looks good) else AC_MSG_RESULT(not usable) fi fi AM_CONDITIONAL(WITH_JAVA, $use_java) if $use_java; then # msg_java=yes JAVA_VERSION=`java -version 2>&1 | grep '^java version' | awk -F\" '{print $2}'` # " This is here to stop the errors from mismatched quotes. fi AC_SUBST(JAVA) AC_SUBST(JAVAC) AC_SUBST(JAR) AC_SUBST(JAVABASE) AC_SUBST(JAVA_VERSION) dnl ****************************** dnl TCL dnl ****************************** PILOT_LINK_PATH_TCLCONFIG if $use_tcl; then PILOT_LINK_LOAD_TCLCONFIG PILOT_LINK_PUBLIC_TCL_HEADERS PILOT_LINK_PROG_TCLSH PILOT_LINK_PROG_WISH fi #AC_SUBST(TCL_INCLUDES) #AC_SUBST(TCL_LIB_FILE) #AC_SUBST(TCL_LIB_FLAG) #AC_SUBST(TCL_LIB_SPEC) #AC_SUBST(TCL_LIBS) #AC_SUBST(TCL_VERSION) #AC_SUBST(TCLSH_PROG) #AC_SUBST(WISH_PROG) AM_CONDITIONAL(WITH_TCL, $use_tcl) dnl ****************************** dnl Python dnl ****************************** use_python=false AC_ARG_WITH(python, [ --with-python=pybase use Python, [[default=no]]], , with_python=no) if test "x$with_python" != "xno"; then AC_PATH_PROGS(PYTHON, [python]) if test "x$PYTHON" != "x"; then AM_CHECK_PYTHON fi if test "x$PYTHON_H" = "xyes"; then AC_SUBST(PYTHON_VERSION) AC_SUBST(PYTHON_CFLAGS) AC_SUBST(PYTHON_LIBS) AC_SUBST(PYTHON_H) use_python=true else PYTHON_VERSION='' fi fi AM_CONDITIONAL(WITH_PYTHON, $use_python) if $use_python; then msg_python=yes fi dnl ************************************* dnl ElectricFence (optional) dnl ************************************* msg_efence=no AC_ARG_WITH(efence, [ --with-efence use ElectricFence, [[default=no]]], , with_efence=no) if test "x$with_efence" != "xno"; then AC_CHECK_LIB(efence, malloc, LIBS="$LIBS -lefence") if test "$ac_cv_lib_efence_malloc" = yes; then msg_efence=true else echo "Unable to locate ElectricFence malloc() debugging library!" echo "Please download from ftp://ftp.perens.com/pub/ElectricFence/" echo "You may also try omitting --with-efence when running configure." echo "" exit 1; fi fi dnl ************************************* dnl Runtime debugging dnl ************************************* set_debug=yes AC_ARG_ENABLE(debug, [ --disable-debug Shunt runtime debugging], [set_debug=no]) if test "${enable_debug+set}" = set; then if test "$enable_debug" = yes; then CFLAGS="-g $CFLAGS" set_debug=yes fi fi echo -n "Runtime debugging is " if test "$set_debug" = "yes"; then echo "enabled" AC_DEFINE(PI_DEBUG, 1, [Define if we have debugging enabled]) else echo "disabled" CFLAGS=`echo "$CFLAGS" | sed -e "s/-g //"` fi dnl ************************************* dnl Profiling information dnl ************************************* AC_ARG_ENABLE(profile, [ --enable-profile use gprof profiling [[default=no]]], CFLAGS="-pg $CFLAGS") dnl ************************************* dnl Check for xsltproc dnl ************************************* AM_CONDITIONAL(BUILD_XML,[test ! -d "{$srcdir}/CVS"]) # if test -d "${srcdir}/CVS" ; then AC_ARG_ENABLE([xsltproc], [AC_HELP_STRING([--enable-xsltproc], [Use xsltproc to build documentation [default=no]])], [enable_xsltproc="$enableval"], [enable_xsltproc=no]) if test x"$enable_xsltproc" = x"yes"; then AC_PATH_PROG([XSLTPROC], [xsltproc], [no]) if test x"$XSLTPROC" = x"no"; then enable_xsltproc=no fi fi AM_CONDITIONAL([ENABLE_XSLTPROC], [test x"$enable_xsltproc" = x"yes"]) # fi # now let's test to see if we can find the docbook-xsl stuff XSLTPROC_FLAGS="--nonet" AC_SUBST(XML_CATALOG) AC_SUBST(XSLTPROC_FLAGS) AC_SUBST(DOCBOOK_ROOT) AC_SUBST(CAT_ENTRY_START) AC_SUBST(CAT_ENTRY_END) AC_SUBST(XSLTPROC) dnl ************************************* dnl Extra warnings dnl ************************************* set_compile_warnings=no AC_ARG_ENABLE(compile-warnings, [ --enable-compile-warnings Enable verbose compiler warnings], set_compile_warnings=yes) if test "$GCC" = "yes" -a "$set_compile_warnings" != "no"; then CFLAGS="$CFLAGS \ -std=gnu99 -g -Wshadow -Wall -W -Waggregate-return -Wcast-align \ -Wcast-qual -Wnested-externs -Wpointer-arith -Wundef -Winline \ -Wbad-function-cast -pedantic -O0" fi case "$host" in *bsd*) AC_DEFINE(TTYPrompt, "/dev/cua[<0..n>]", [Define verbose tty device]) ;; *) AC_DEFINE(TTYPrompt, "/dev/tty[<0..n>]", [Define verbose tty device]) ;; esac dnl ************************************* dnl Promote warnings to errors dnl ************************************* dnl (already done) enable_werror=no AC_ARG_ENABLE(compile-werror, [ --enable-compile-werror Causes warnings to be treated as errors in GCC], enable_werror=yes) if test "x$GCC" = "xyes" -a "x$enable_werror" = "xyes"; then CFLAGS="$CFLAGS -Werror" fi AC_OUTPUT([ Makefile pilot-link.m4 pilot-link.pc pilot-link-pp.pc libpisock/Makefile libpisync/Makefile include/Makefile include/pi-version.h popt/Makefile src/Makefile src/prc/Makefile src/pix/Makefile bindings/Makefile bindings/Perl/Makefile.PL bindings/Python/setup.py bindings/Python/setup-standalone.py bindings/Java/Makefile bindings/Tcl/Makefile doc/Makefile doc/doxygen.cfg doc/xml/Makefile doc/xml/catalog.xml doc/xml/docbook.xsl doc/man/Makefile tests/Makefile darwin/Makefile ]) AC_MSG_RESULT([ Options detected/selected -------------------------. pilot-link version...... : $VERSION libpisock version....... : $PISOCK_CURRENT.$PISOCK_AGE.$PISOCK_REVISION libpisync version....... : $PISYNC_CURRENT.$PISYNC_AGE.$PISYNC_REVISION Build for host.......... : $host Extra Warnings.......... : $set_compile_warnings Direct USB support...... : $msg_usb BlueZ support........... : $use_bluez Thread-safe libpisock... : $msg_threads ElectricFence checks.... : $msg_efence CPPFLAGS................ : $CPPFLAGS CFLAGS.................. : $CFLAGS Userland Tools -------------------------. Build userland tools.... : $enable_conduits Support for popt........ : $msg_popt Readline support........ : $msg_readline PNG support............. : $msg_png Internal Language Support -------------------------. Iconv support........... : $msg_iconv External Language Support -------------------------. TCL support............. : $use_tcl $TCL_VERSION Java support............ : $use_java $JAVA_VERSION Python support.......... : $use_python $PYTHON_VERSION Perl support............ : $use_perl $PERL_VERSION ]) if [[ x"$PL_FROM_CVS" = xyes ]]; then echo " .----- NOTICE ------------------------------------------------." echo " | You are using pilot-link from CVS source. |" echo " | |" echo " | This is likely to be unstable, or contain some incomplete |" echo " | features, or just plain not work at all. Use it at your own |" echo " | risk. Please help us to fix any bugs you find, by reporting |" echo " | them back to us via email or at http://bugs.pilot-link.org/ |" echo " \`-------------------------------------------------------------'" echo "" fi pilot-link-0.12.5-dfsg/libpisock/0000755000175000017500000000000011333433323017055 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/libpisock/linuxusb.c0000644000175000017500000002344710513447542021113 0ustar rousseaurousseau/* * $Id: linuxusb.c,v 1.24 2006/10/12 14:21:22 desrod Exp $ * * linuxusb.c: device i/o for linux usb * * Copyright (c) 1996, 1997, D. Jeff Dionne & Kenneth Albanowski. * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this 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 #include #include #include #include "pi-debug.h" #include "pi-source.h" #include "pi-usb.h" #include "pi-error.h" #ifdef HAVE_SYS_IOCTL_COMPAT_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #ifndef O_NONBLOCK # define O_NONBLOCK 0 #endif static int u_open(pi_socket_t *ps, struct pi_sockaddr *addr, size_t addrlen); static int u_close(pi_socket_t *ps); static int u_write(pi_socket_t *ps, unsigned char *buf, size_t len, int flags); static int u_read(pi_socket_t *ps, pi_buffer_t *buf, size_t len, int flags); static int u_poll(pi_socket_t *ps, int timeout); static int u_flush(pi_socket_t *ps, int flags); void pi_usb_impl_init (struct pi_usb_impl *impl) { impl->open = u_open; impl->close = u_close; impl->write = u_write; impl->read = u_read; impl->flush = u_flush; impl->poll = u_poll; impl->wait_for_device = NULL; /* not implemented in linuxusb yet */ impl->changebaud = NULL; /* we don't need this one on linuxusb * as USB serial adapters redirect to serial ports */ impl->control_request = NULL; } /*********************************************************************** * * Function: u_open * * Summary: Open the usb port and establish a connection for * * Parameters: None * * Returns: The file descriptor * ***********************************************************************/ static int u_open(pi_socket_t *ps, struct pi_sockaddr *addr, size_t addrlen) { int fd, i; char *tty = addr->pi_device; if ((fd = open(tty, O_RDWR | O_NONBLOCK)) < 0) { ps->last_error = PI_ERR_GENERIC_SYSTEM; return PI_ERR_GENERIC_SYSTEM; /* errno already set */ } if (!isatty(fd)) { close(fd); errno = EINVAL; ps->last_error = PI_ERR_GENERIC_SYSTEM; return PI_ERR_GENERIC_SYSTEM; } if ((i = fcntl(fd, F_GETFL, 0)) != -1) { i &= ~O_NONBLOCK; fcntl(fd, F_SETFL, i); } if ((i = pi_socket_setsd(ps, fd)) < 0) return i; return fd; } /*********************************************************************** * * Function: u_close * * Summary: Close the open socket/file descriptor * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int u_close(pi_socket_t *ps) { LOG((PI_DBG_DEV, PI_DBG_LVL_INFO, "DEV CLOSE linuxusb fd: %d\n", ps->sd)); return close(ps->sd); } /*********************************************************************** * * Function: u_poll * * Summary: Poll the open socket/file descriptor * * Parameters: None * * Returns: 1 on success, PI_ERR_SOCK_TIMEOUT on timeout * ***********************************************************************/ static int u_poll(pi_socket_t *ps, int timeout) { struct timeval t; fd_set ready; FD_ZERO(&ready); FD_SET(ps->sd, &ready); /* If timeout == 0, wait forever for packet, otherwise wait till timeout milliseconds */ if (timeout == 0) select(ps->sd + 1, &ready, 0, 0, 0); else { t.tv_sec = timeout / 1000; t.tv_usec = (timeout % 1000) * 1000; select(ps->sd + 1, &ready, 0, 0, &t); } if (!FD_ISSET(ps->sd, &ready)) { /* otherwise throw out any current packet and return */ LOG((PI_DBG_DEV, PI_DBG_LVL_WARN, "DEV POLL linuxusb timeout\n")); errno = ETIMEDOUT; return pi_set_error(ps->sd, PI_ERR_SOCK_TIMEOUT); } LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "DEV POLL linuxusb found data on fd: %d\n", ps->sd)); return 1; } /*********************************************************************** * * Function: u_write * * Summary: Write to the open socket/file descriptor * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int u_write(pi_socket_t *ps, unsigned char *buf, size_t len, int flags) { int total, nwrote; struct pi_usb_data *data = (struct pi_usb_data *)ps->device->data; struct timeval t; fd_set ready; FD_ZERO(&ready); FD_SET(ps->sd, &ready); total = len; while (total > 0) { if (data->timeout == 0) select(ps->sd + 1, 0, &ready, 0, 0); else { t.tv_sec = data->timeout / 1000; t.tv_usec = (data->timeout % 1000) * 1000; if (select(ps->sd + 1, 0, &ready, 0, &t)) return pi_set_error(ps->sd, PI_ERR_SOCK_TIMEOUT); } if (!FD_ISSET(ps->sd, &ready)) { ps->state = PI_SOCK_CONN_BREAK; return pi_set_error(ps->sd, PI_ERR_SOCK_DISCONNECTED); } nwrote = write(ps->sd, buf, len); if (nwrote < 0) { ps->state = PI_SOCK_CONN_BREAK; return pi_set_error(ps->sd, PI_ERR_SOCK_DISCONNECTED); } total -= nwrote; } LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "DEV TX linuxusb wrote %d bytes\n", len)); return len; } /*********************************************************************** * * Function: u_read_buf * * Summary: read buffer * * Parameters: pi_socket_t*, char* to buffer, length of buffer * * Returns: number of bytes read * ***********************************************************************/ static int u_read_buf (pi_socket_t *ps, pi_buffer_t *buf, size_t len, int flags) { struct pi_usb_data *data = (struct pi_usb_data *)ps->device->data; size_t rbuf = data->buf_size; if (rbuf > len) rbuf = len; if (pi_buffer_append (buf, data->buf, rbuf) == NULL) { errno = ENOMEM; return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); } if (flags != PI_MSG_PEEK) { data->buf_size -= rbuf; if (data->buf_size > 0) memmove(data->buf, &data->buf[rbuf], data->buf_size); } LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "DEV RX linuxusb read %d bytes from read-ahead buffer\n", rbuf)); return rbuf; } /*********************************************************************** * * Function: u_read * * Summary: Read incoming data from the socket/file descriptor * * Parameters: pi_socket_t*, char* to buffer, buffer length, flags * * Returns: number of bytes read or negative otherwise * ***********************************************************************/ static int u_read(pi_socket_t *ps, pi_buffer_t *buf, size_t len, int flags) { ssize_t rbuf = 0, bytes; struct pi_usb_data *data = (struct pi_usb_data *)ps->device->data; struct timeval t; fd_set ready; /* check whether we have at least partial data in store */ if (data->buf_size) { rbuf = u_read_buf(ps, buf, len, flags); if (rbuf < 0) return rbuf; len -= rbuf; if (len == 0) return rbuf; } /* If timeout == 0, wait forever for packet, otherwise wait till timeout milliseconds */ FD_ZERO(&ready); FD_SET(ps->sd, &ready); if (data->timeout == 0) select(ps->sd + 1, &ready, 0, 0, 0); else { t.tv_sec = data->timeout / 1000; t.tv_usec = (data->timeout % 1000) * 1000; if (select(ps->sd + 1, &ready, 0, 0, &t) == 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_WARN, "DEV RX linuxusb timeout\n")); errno = ETIMEDOUT; return pi_set_error(ps->sd, PI_ERR_SOCK_TIMEOUT); } } /* If data is available in time, read it */ if (FD_ISSET(ps->sd, &ready)) { if (flags == PI_MSG_PEEK && len > 256) len = 256; if (pi_buffer_expect (buf, len) == NULL) { errno = ENOMEM; return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); } bytes = read(ps->sd, buf->data + buf->used, len); if (bytes > 0) { if (flags == PI_MSG_PEEK) { memcpy(data->buf + data->buf_size, buf->data + buf->used, bytes); data->buf_size += bytes; } buf->used += bytes; rbuf += bytes; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "DEV RX linuxusb read %d bytes\n", bytes)); } } else { LOG((PI_DBG_DEV, PI_DBG_LVL_WARN, "DEV RX linuxusb timeout\n")); errno = ETIMEDOUT; return pi_set_error(ps->sd, PI_ERR_SOCK_TIMEOUT); } return rbuf; } /*********************************************************************** * * Function: u_flush * * Summary: Flush incoming and/or outgoing data from the socket/file * descriptor * * Parameters: ps is of type pi_socket that contains the sd member which is * the file descriptor that the data in buf will be read. It * also contains the read buffer. * * flags is of type int and can be a combination of * PI_FLUSH_INPUT and PI_FLUSH_OUTPUT * * Returns: 0 * ***********************************************************************/ static int u_flush(pi_socket_t *ps, int flags) { char buf[256]; int fl; struct pi_usb_data *data = (struct pi_usb_data *) ps->device->data; if (flags & PI_FLUSH_INPUT) { /* clear internal buffer */ data->buf_size = 0; /* flush pending data */ if ((fl = fcntl(ps->sd, F_GETFL, 0)) != -1) { fcntl(ps->sd, F_SETFL, fl | O_NONBLOCK); while (recv(ps->sd, buf, sizeof(buf), 0) > 0) ; fcntl(ps->sd, F_SETFL, 0); } LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "DEV FLUSH linuxusb flushed input buffer\n")); } return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/Makefile.in0000644000175000017500000020132511333433244021127 0ustar rousseaurousseau# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ target_triplet = @target@ subdir = libpisock DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/bluez.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/tcl.m4 \ $(top_srcdir)/m4/threads.m4 \ $(top_srcdir)/m4/vl_lib_readline.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/include/pi-md5.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libpisock_la_DEPENDENCIES = am__libpisock_la_SOURCES_DIST = bluetooth.c unixserial.c usb.c \ darwinusb.c freebsdusb.c libusb.c linuxusb.c address.c \ appinfo.c connect.c contact.c cmp.c datebook.c debug.c dlp.c \ expense.c hinote.c inet.c location.c blob.c calendar.c mail.c \ md5.c memo.c money.c net.c notepad.c padp.c palmpix.c \ pi-buffer.c pi-file.c pi-header.c serial.c slp.c sys.c \ socket.c syspkt.c threadsafe.c todo.c utils.c veo.c \ versamail.c @WITH_BLUEZ_TRUE@am__objects_1 = libpisock_la-bluetooth.lo am__objects_2 = libpisock_la-unixserial.lo @WITH_DARWINUSB_FALSE@@WITH_FREEBSDUSB_FALSE@@WITH_LIBUSB_FALSE@@WITH_LINUXUSB_TRUE@am__objects_3 = libpisock_la-usb.lo \ @WITH_DARWINUSB_FALSE@@WITH_FREEBSDUSB_FALSE@@WITH_LIBUSB_FALSE@@WITH_LINUXUSB_TRUE@ libpisock_la-linuxusb.lo @WITH_DARWINUSB_FALSE@@WITH_FREEBSDUSB_FALSE@@WITH_LIBUSB_TRUE@am__objects_3 = libpisock_la-usb.lo \ @WITH_DARWINUSB_FALSE@@WITH_FREEBSDUSB_FALSE@@WITH_LIBUSB_TRUE@ libpisock_la-libusb.lo @WITH_DARWINUSB_FALSE@@WITH_FREEBSDUSB_TRUE@am__objects_3 = libpisock_la-usb.lo \ @WITH_DARWINUSB_FALSE@@WITH_FREEBSDUSB_TRUE@ libpisock_la-freebsdusb.lo @WITH_DARWINUSB_TRUE@am__objects_3 = libpisock_la-usb.lo \ @WITH_DARWINUSB_TRUE@ libpisock_la-darwinusb.lo am_libpisock_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ $(am__objects_3) libpisock_la-address.lo \ libpisock_la-appinfo.lo libpisock_la-connect.lo \ libpisock_la-contact.lo libpisock_la-cmp.lo \ libpisock_la-datebook.lo libpisock_la-debug.lo \ libpisock_la-dlp.lo libpisock_la-expense.lo \ libpisock_la-hinote.lo libpisock_la-inet.lo \ libpisock_la-location.lo libpisock_la-blob.lo \ libpisock_la-calendar.lo libpisock_la-mail.lo \ libpisock_la-md5.lo libpisock_la-memo.lo libpisock_la-money.lo \ libpisock_la-net.lo libpisock_la-notepad.lo \ libpisock_la-padp.lo libpisock_la-palmpix.lo \ libpisock_la-pi-buffer.lo libpisock_la-pi-file.lo \ libpisock_la-pi-header.lo libpisock_la-serial.lo \ libpisock_la-slp.lo libpisock_la-sys.lo libpisock_la-socket.lo \ libpisock_la-syspkt.lo libpisock_la-threadsafe.lo \ libpisock_la-todo.lo libpisock_la-utils.lo libpisock_la-veo.lo \ libpisock_la-versamail.lo libpisock_la_OBJECTS = $(am_libpisock_la_OBJECTS) libpisock_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libpisock_la_CFLAGS) \ $(CFLAGS) $(libpisock_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libpisock_la_SOURCES) DIST_SOURCES = $(am__libpisock_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLUEZ_CFLAGS = @BLUEZ_CFLAGS@ BLUEZ_LIBS = @BLUEZ_LIBS@ CAT_ENTRY_END = @CAT_ENTRY_END@ CAT_ENTRY_START = @CAT_ENTRY_START@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOCBOOK_ROOT = @DOCBOOK_ROOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVA = @JAVA@ JAVABASE = @JAVABASE@ JAVAC = @JAVAC@ JAVA_VERSION = @JAVA_VERSION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PIC_LIBS = @PIC_LIBS@ PILOT_LINK_MAJOR = @PILOT_LINK_MAJOR@ PILOT_LINK_MINOR = @PILOT_LINK_MINOR@ PILOT_LINK_PATCH = @PILOT_LINK_PATCH@ PILOT_LINK_VERS = @PILOT_LINK_VERS@ PISOCK_AGE = @PISOCK_AGE@ PISOCK_CURRENT = @PISOCK_CURRENT@ PISOCK_REVISION = @PISOCK_REVISION@ PISYNC_AGE = @PISYNC_AGE@ PISYNC_CURRENT = @PISYNC_CURRENT@ PISYNC_REVISION = @PISYNC_REVISION@ PKG_CONFIG = @PKG_CONFIG@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ POPT_INCLUDES = @POPT_INCLUDES@ POPT_LIBS = @POPT_LIBS@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_H = @PYTHON_H@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RL_LIBS = @RL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ XML_CATALOG = @XML_CATALOG@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ builddir = @builddir@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ usb_libs = @usb_libs@ INCLUDES = \ -I../include \ -I$(top_srcdir)/include bluetooth_FILES = \ bluetooth.c serial_FILES = \ unixserial.c serial_SOURCE = unixserial.c usb_FILES = \ usb.c \ libusb.c \ linuxusb.c \ freebsdusb.c \ darwinusb.c @WITH_DARWINUSB_TRUE@usb_SOURCE = usb.c darwinusb.c @WITH_FREEBSDUSB_TRUE@usb_SOURCE = usb.c freebsdusb.c @WITH_LIBUSB_TRUE@usb_SOURCE = usb.c libusb.c @WITH_LINUXUSB_TRUE@usb_SOURCE = usb.c linuxusb.c @WITH_BLUEZ_TRUE@bluetooth_SOURCE = bluetooth.c lib_LTLIBRARIES = libpisock.la # All new sources MUST be added here, or anything # building against libpisock will fail! libpisock_la_SOURCES = \ $(bluetooth_SOURCE) \ $(serial_SOURCE) \ $(usb_SOURCE) \ address.c \ appinfo.c \ connect.c \ contact.c \ cmp.c \ datebook.c \ debug.c \ dlp.c \ expense.c \ hinote.c \ inet.c \ location.c \ blob.c \ calendar.c \ mail.c \ md5.c \ memo.c \ money.c \ net.c \ notepad.c \ padp.c \ palmpix.c \ pi-buffer.c \ pi-file.c \ pi-header.c \ serial.c \ slp.c \ sys.c \ socket.c \ syspkt.c \ threadsafe.c \ todo.c \ utils.c \ veo.c \ versamail.c # Including PTHREAD_CFLAGS here is a dirty ugly kluge. It works. libpisock_la_LIBADD = \ @usb_libs@ @PTHREAD_LIBS@ @PTHREAD_CFLAGS@ @BLUEZ_LIBS@ libpisock_la_LDFLAGS = \ -export-dynamic -version-info $(PISOCK_CURRENT):$(PISOCK_REVISION):$(PISOCK_AGE) libpisock_la_CFLAGS = $(PIC_LIBS) @PTHREAD_CFLAGS@ @BLUEZ_CFLAGS@ EXTRA_DIST = $(bluetooth_FILES) $(serial_FILES) $(usb_FILES) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libpisock/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libpisock/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 $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libpisock.la: $(libpisock_la_OBJECTS) $(libpisock_la_DEPENDENCIES) $(libpisock_la_LINK) -rpath $(libdir) $(libpisock_la_OBJECTS) $(libpisock_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-address.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-appinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-blob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-bluetooth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-calendar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-cmp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-connect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-contact.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-darwinusb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-datebook.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-debug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-dlp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-expense.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-freebsdusb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-hinote.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-inet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-libusb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-linuxusb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-location.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-mail.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-md5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-memo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-money.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-net.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-notepad.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-padp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-palmpix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-pi-buffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-pi-file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-pi-header.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-serial.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-slp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-socket.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-sys.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-syspkt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-threadsafe.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-todo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-unixserial.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-usb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-veo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpisock_la-versamail.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libpisock_la-bluetooth.lo: bluetooth.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-bluetooth.lo -MD -MP -MF $(DEPDIR)/libpisock_la-bluetooth.Tpo -c -o libpisock_la-bluetooth.lo `test -f 'bluetooth.c' || echo '$(srcdir)/'`bluetooth.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-bluetooth.Tpo $(DEPDIR)/libpisock_la-bluetooth.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bluetooth.c' object='libpisock_la-bluetooth.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-bluetooth.lo `test -f 'bluetooth.c' || echo '$(srcdir)/'`bluetooth.c libpisock_la-unixserial.lo: unixserial.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-unixserial.lo -MD -MP -MF $(DEPDIR)/libpisock_la-unixserial.Tpo -c -o libpisock_la-unixserial.lo `test -f 'unixserial.c' || echo '$(srcdir)/'`unixserial.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-unixserial.Tpo $(DEPDIR)/libpisock_la-unixserial.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='unixserial.c' object='libpisock_la-unixserial.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-unixserial.lo `test -f 'unixserial.c' || echo '$(srcdir)/'`unixserial.c libpisock_la-usb.lo: usb.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-usb.lo -MD -MP -MF $(DEPDIR)/libpisock_la-usb.Tpo -c -o libpisock_la-usb.lo `test -f 'usb.c' || echo '$(srcdir)/'`usb.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-usb.Tpo $(DEPDIR)/libpisock_la-usb.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usb.c' object='libpisock_la-usb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-usb.lo `test -f 'usb.c' || echo '$(srcdir)/'`usb.c libpisock_la-darwinusb.lo: darwinusb.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-darwinusb.lo -MD -MP -MF $(DEPDIR)/libpisock_la-darwinusb.Tpo -c -o libpisock_la-darwinusb.lo `test -f 'darwinusb.c' || echo '$(srcdir)/'`darwinusb.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-darwinusb.Tpo $(DEPDIR)/libpisock_la-darwinusb.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='darwinusb.c' object='libpisock_la-darwinusb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-darwinusb.lo `test -f 'darwinusb.c' || echo '$(srcdir)/'`darwinusb.c libpisock_la-freebsdusb.lo: freebsdusb.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-freebsdusb.lo -MD -MP -MF $(DEPDIR)/libpisock_la-freebsdusb.Tpo -c -o libpisock_la-freebsdusb.lo `test -f 'freebsdusb.c' || echo '$(srcdir)/'`freebsdusb.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-freebsdusb.Tpo $(DEPDIR)/libpisock_la-freebsdusb.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='freebsdusb.c' object='libpisock_la-freebsdusb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-freebsdusb.lo `test -f 'freebsdusb.c' || echo '$(srcdir)/'`freebsdusb.c libpisock_la-libusb.lo: libusb.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-libusb.lo -MD -MP -MF $(DEPDIR)/libpisock_la-libusb.Tpo -c -o libpisock_la-libusb.lo `test -f 'libusb.c' || echo '$(srcdir)/'`libusb.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-libusb.Tpo $(DEPDIR)/libpisock_la-libusb.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libusb.c' object='libpisock_la-libusb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-libusb.lo `test -f 'libusb.c' || echo '$(srcdir)/'`libusb.c libpisock_la-linuxusb.lo: linuxusb.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-linuxusb.lo -MD -MP -MF $(DEPDIR)/libpisock_la-linuxusb.Tpo -c -o libpisock_la-linuxusb.lo `test -f 'linuxusb.c' || echo '$(srcdir)/'`linuxusb.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-linuxusb.Tpo $(DEPDIR)/libpisock_la-linuxusb.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='linuxusb.c' object='libpisock_la-linuxusb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-linuxusb.lo `test -f 'linuxusb.c' || echo '$(srcdir)/'`linuxusb.c libpisock_la-address.lo: address.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-address.lo -MD -MP -MF $(DEPDIR)/libpisock_la-address.Tpo -c -o libpisock_la-address.lo `test -f 'address.c' || echo '$(srcdir)/'`address.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-address.Tpo $(DEPDIR)/libpisock_la-address.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='address.c' object='libpisock_la-address.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-address.lo `test -f 'address.c' || echo '$(srcdir)/'`address.c libpisock_la-appinfo.lo: appinfo.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-appinfo.lo -MD -MP -MF $(DEPDIR)/libpisock_la-appinfo.Tpo -c -o libpisock_la-appinfo.lo `test -f 'appinfo.c' || echo '$(srcdir)/'`appinfo.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-appinfo.Tpo $(DEPDIR)/libpisock_la-appinfo.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='appinfo.c' object='libpisock_la-appinfo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-appinfo.lo `test -f 'appinfo.c' || echo '$(srcdir)/'`appinfo.c libpisock_la-connect.lo: connect.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-connect.lo -MD -MP -MF $(DEPDIR)/libpisock_la-connect.Tpo -c -o libpisock_la-connect.lo `test -f 'connect.c' || echo '$(srcdir)/'`connect.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-connect.Tpo $(DEPDIR)/libpisock_la-connect.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='connect.c' object='libpisock_la-connect.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-connect.lo `test -f 'connect.c' || echo '$(srcdir)/'`connect.c libpisock_la-contact.lo: contact.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-contact.lo -MD -MP -MF $(DEPDIR)/libpisock_la-contact.Tpo -c -o libpisock_la-contact.lo `test -f 'contact.c' || echo '$(srcdir)/'`contact.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-contact.Tpo $(DEPDIR)/libpisock_la-contact.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='contact.c' object='libpisock_la-contact.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-contact.lo `test -f 'contact.c' || echo '$(srcdir)/'`contact.c libpisock_la-cmp.lo: cmp.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-cmp.lo -MD -MP -MF $(DEPDIR)/libpisock_la-cmp.Tpo -c -o libpisock_la-cmp.lo `test -f 'cmp.c' || echo '$(srcdir)/'`cmp.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-cmp.Tpo $(DEPDIR)/libpisock_la-cmp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cmp.c' object='libpisock_la-cmp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-cmp.lo `test -f 'cmp.c' || echo '$(srcdir)/'`cmp.c libpisock_la-datebook.lo: datebook.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-datebook.lo -MD -MP -MF $(DEPDIR)/libpisock_la-datebook.Tpo -c -o libpisock_la-datebook.lo `test -f 'datebook.c' || echo '$(srcdir)/'`datebook.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-datebook.Tpo $(DEPDIR)/libpisock_la-datebook.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='datebook.c' object='libpisock_la-datebook.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-datebook.lo `test -f 'datebook.c' || echo '$(srcdir)/'`datebook.c libpisock_la-debug.lo: debug.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-debug.lo -MD -MP -MF $(DEPDIR)/libpisock_la-debug.Tpo -c -o libpisock_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-debug.Tpo $(DEPDIR)/libpisock_la-debug.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='debug.c' object='libpisock_la-debug.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c libpisock_la-dlp.lo: dlp.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-dlp.lo -MD -MP -MF $(DEPDIR)/libpisock_la-dlp.Tpo -c -o libpisock_la-dlp.lo `test -f 'dlp.c' || echo '$(srcdir)/'`dlp.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-dlp.Tpo $(DEPDIR)/libpisock_la-dlp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dlp.c' object='libpisock_la-dlp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-dlp.lo `test -f 'dlp.c' || echo '$(srcdir)/'`dlp.c libpisock_la-expense.lo: expense.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-expense.lo -MD -MP -MF $(DEPDIR)/libpisock_la-expense.Tpo -c -o libpisock_la-expense.lo `test -f 'expense.c' || echo '$(srcdir)/'`expense.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-expense.Tpo $(DEPDIR)/libpisock_la-expense.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='expense.c' object='libpisock_la-expense.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-expense.lo `test -f 'expense.c' || echo '$(srcdir)/'`expense.c libpisock_la-hinote.lo: hinote.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-hinote.lo -MD -MP -MF $(DEPDIR)/libpisock_la-hinote.Tpo -c -o libpisock_la-hinote.lo `test -f 'hinote.c' || echo '$(srcdir)/'`hinote.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-hinote.Tpo $(DEPDIR)/libpisock_la-hinote.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hinote.c' object='libpisock_la-hinote.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-hinote.lo `test -f 'hinote.c' || echo '$(srcdir)/'`hinote.c libpisock_la-inet.lo: inet.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-inet.lo -MD -MP -MF $(DEPDIR)/libpisock_la-inet.Tpo -c -o libpisock_la-inet.lo `test -f 'inet.c' || echo '$(srcdir)/'`inet.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-inet.Tpo $(DEPDIR)/libpisock_la-inet.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='inet.c' object='libpisock_la-inet.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-inet.lo `test -f 'inet.c' || echo '$(srcdir)/'`inet.c libpisock_la-location.lo: location.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-location.lo -MD -MP -MF $(DEPDIR)/libpisock_la-location.Tpo -c -o libpisock_la-location.lo `test -f 'location.c' || echo '$(srcdir)/'`location.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-location.Tpo $(DEPDIR)/libpisock_la-location.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='location.c' object='libpisock_la-location.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-location.lo `test -f 'location.c' || echo '$(srcdir)/'`location.c libpisock_la-blob.lo: blob.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-blob.lo -MD -MP -MF $(DEPDIR)/libpisock_la-blob.Tpo -c -o libpisock_la-blob.lo `test -f 'blob.c' || echo '$(srcdir)/'`blob.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-blob.Tpo $(DEPDIR)/libpisock_la-blob.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='blob.c' object='libpisock_la-blob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-blob.lo `test -f 'blob.c' || echo '$(srcdir)/'`blob.c libpisock_la-calendar.lo: calendar.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-calendar.lo -MD -MP -MF $(DEPDIR)/libpisock_la-calendar.Tpo -c -o libpisock_la-calendar.lo `test -f 'calendar.c' || echo '$(srcdir)/'`calendar.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-calendar.Tpo $(DEPDIR)/libpisock_la-calendar.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='calendar.c' object='libpisock_la-calendar.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-calendar.lo `test -f 'calendar.c' || echo '$(srcdir)/'`calendar.c libpisock_la-mail.lo: mail.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-mail.lo -MD -MP -MF $(DEPDIR)/libpisock_la-mail.Tpo -c -o libpisock_la-mail.lo `test -f 'mail.c' || echo '$(srcdir)/'`mail.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-mail.Tpo $(DEPDIR)/libpisock_la-mail.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mail.c' object='libpisock_la-mail.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-mail.lo `test -f 'mail.c' || echo '$(srcdir)/'`mail.c libpisock_la-md5.lo: md5.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-md5.lo -MD -MP -MF $(DEPDIR)/libpisock_la-md5.Tpo -c -o libpisock_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-md5.Tpo $(DEPDIR)/libpisock_la-md5.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='md5.c' object='libpisock_la-md5.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c libpisock_la-memo.lo: memo.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-memo.lo -MD -MP -MF $(DEPDIR)/libpisock_la-memo.Tpo -c -o libpisock_la-memo.lo `test -f 'memo.c' || echo '$(srcdir)/'`memo.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-memo.Tpo $(DEPDIR)/libpisock_la-memo.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='memo.c' object='libpisock_la-memo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-memo.lo `test -f 'memo.c' || echo '$(srcdir)/'`memo.c libpisock_la-money.lo: money.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-money.lo -MD -MP -MF $(DEPDIR)/libpisock_la-money.Tpo -c -o libpisock_la-money.lo `test -f 'money.c' || echo '$(srcdir)/'`money.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-money.Tpo $(DEPDIR)/libpisock_la-money.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='money.c' object='libpisock_la-money.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-money.lo `test -f 'money.c' || echo '$(srcdir)/'`money.c libpisock_la-net.lo: net.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-net.lo -MD -MP -MF $(DEPDIR)/libpisock_la-net.Tpo -c -o libpisock_la-net.lo `test -f 'net.c' || echo '$(srcdir)/'`net.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-net.Tpo $(DEPDIR)/libpisock_la-net.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='net.c' object='libpisock_la-net.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-net.lo `test -f 'net.c' || echo '$(srcdir)/'`net.c libpisock_la-notepad.lo: notepad.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-notepad.lo -MD -MP -MF $(DEPDIR)/libpisock_la-notepad.Tpo -c -o libpisock_la-notepad.lo `test -f 'notepad.c' || echo '$(srcdir)/'`notepad.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-notepad.Tpo $(DEPDIR)/libpisock_la-notepad.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='notepad.c' object='libpisock_la-notepad.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-notepad.lo `test -f 'notepad.c' || echo '$(srcdir)/'`notepad.c libpisock_la-padp.lo: padp.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-padp.lo -MD -MP -MF $(DEPDIR)/libpisock_la-padp.Tpo -c -o libpisock_la-padp.lo `test -f 'padp.c' || echo '$(srcdir)/'`padp.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-padp.Tpo $(DEPDIR)/libpisock_la-padp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='padp.c' object='libpisock_la-padp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-padp.lo `test -f 'padp.c' || echo '$(srcdir)/'`padp.c libpisock_la-palmpix.lo: palmpix.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-palmpix.lo -MD -MP -MF $(DEPDIR)/libpisock_la-palmpix.Tpo -c -o libpisock_la-palmpix.lo `test -f 'palmpix.c' || echo '$(srcdir)/'`palmpix.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-palmpix.Tpo $(DEPDIR)/libpisock_la-palmpix.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='palmpix.c' object='libpisock_la-palmpix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-palmpix.lo `test -f 'palmpix.c' || echo '$(srcdir)/'`palmpix.c libpisock_la-pi-buffer.lo: pi-buffer.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-pi-buffer.lo -MD -MP -MF $(DEPDIR)/libpisock_la-pi-buffer.Tpo -c -o libpisock_la-pi-buffer.lo `test -f 'pi-buffer.c' || echo '$(srcdir)/'`pi-buffer.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-pi-buffer.Tpo $(DEPDIR)/libpisock_la-pi-buffer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pi-buffer.c' object='libpisock_la-pi-buffer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-pi-buffer.lo `test -f 'pi-buffer.c' || echo '$(srcdir)/'`pi-buffer.c libpisock_la-pi-file.lo: pi-file.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-pi-file.lo -MD -MP -MF $(DEPDIR)/libpisock_la-pi-file.Tpo -c -o libpisock_la-pi-file.lo `test -f 'pi-file.c' || echo '$(srcdir)/'`pi-file.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-pi-file.Tpo $(DEPDIR)/libpisock_la-pi-file.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pi-file.c' object='libpisock_la-pi-file.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-pi-file.lo `test -f 'pi-file.c' || echo '$(srcdir)/'`pi-file.c libpisock_la-pi-header.lo: pi-header.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-pi-header.lo -MD -MP -MF $(DEPDIR)/libpisock_la-pi-header.Tpo -c -o libpisock_la-pi-header.lo `test -f 'pi-header.c' || echo '$(srcdir)/'`pi-header.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-pi-header.Tpo $(DEPDIR)/libpisock_la-pi-header.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pi-header.c' object='libpisock_la-pi-header.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-pi-header.lo `test -f 'pi-header.c' || echo '$(srcdir)/'`pi-header.c libpisock_la-serial.lo: serial.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-serial.lo -MD -MP -MF $(DEPDIR)/libpisock_la-serial.Tpo -c -o libpisock_la-serial.lo `test -f 'serial.c' || echo '$(srcdir)/'`serial.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-serial.Tpo $(DEPDIR)/libpisock_la-serial.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='serial.c' object='libpisock_la-serial.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-serial.lo `test -f 'serial.c' || echo '$(srcdir)/'`serial.c libpisock_la-slp.lo: slp.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-slp.lo -MD -MP -MF $(DEPDIR)/libpisock_la-slp.Tpo -c -o libpisock_la-slp.lo `test -f 'slp.c' || echo '$(srcdir)/'`slp.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-slp.Tpo $(DEPDIR)/libpisock_la-slp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='slp.c' object='libpisock_la-slp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-slp.lo `test -f 'slp.c' || echo '$(srcdir)/'`slp.c libpisock_la-sys.lo: sys.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-sys.lo -MD -MP -MF $(DEPDIR)/libpisock_la-sys.Tpo -c -o libpisock_la-sys.lo `test -f 'sys.c' || echo '$(srcdir)/'`sys.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-sys.Tpo $(DEPDIR)/libpisock_la-sys.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sys.c' object='libpisock_la-sys.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-sys.lo `test -f 'sys.c' || echo '$(srcdir)/'`sys.c libpisock_la-socket.lo: socket.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-socket.lo -MD -MP -MF $(DEPDIR)/libpisock_la-socket.Tpo -c -o libpisock_la-socket.lo `test -f 'socket.c' || echo '$(srcdir)/'`socket.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-socket.Tpo $(DEPDIR)/libpisock_la-socket.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='socket.c' object='libpisock_la-socket.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-socket.lo `test -f 'socket.c' || echo '$(srcdir)/'`socket.c libpisock_la-syspkt.lo: syspkt.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-syspkt.lo -MD -MP -MF $(DEPDIR)/libpisock_la-syspkt.Tpo -c -o libpisock_la-syspkt.lo `test -f 'syspkt.c' || echo '$(srcdir)/'`syspkt.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-syspkt.Tpo $(DEPDIR)/libpisock_la-syspkt.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='syspkt.c' object='libpisock_la-syspkt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-syspkt.lo `test -f 'syspkt.c' || echo '$(srcdir)/'`syspkt.c libpisock_la-threadsafe.lo: threadsafe.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-threadsafe.lo -MD -MP -MF $(DEPDIR)/libpisock_la-threadsafe.Tpo -c -o libpisock_la-threadsafe.lo `test -f 'threadsafe.c' || echo '$(srcdir)/'`threadsafe.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-threadsafe.Tpo $(DEPDIR)/libpisock_la-threadsafe.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='threadsafe.c' object='libpisock_la-threadsafe.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-threadsafe.lo `test -f 'threadsafe.c' || echo '$(srcdir)/'`threadsafe.c libpisock_la-todo.lo: todo.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-todo.lo -MD -MP -MF $(DEPDIR)/libpisock_la-todo.Tpo -c -o libpisock_la-todo.lo `test -f 'todo.c' || echo '$(srcdir)/'`todo.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-todo.Tpo $(DEPDIR)/libpisock_la-todo.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='todo.c' object='libpisock_la-todo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-todo.lo `test -f 'todo.c' || echo '$(srcdir)/'`todo.c libpisock_la-utils.lo: utils.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-utils.lo -MD -MP -MF $(DEPDIR)/libpisock_la-utils.Tpo -c -o libpisock_la-utils.lo `test -f 'utils.c' || echo '$(srcdir)/'`utils.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-utils.Tpo $(DEPDIR)/libpisock_la-utils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='libpisock_la-utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-utils.lo `test -f 'utils.c' || echo '$(srcdir)/'`utils.c libpisock_la-veo.lo: veo.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-veo.lo -MD -MP -MF $(DEPDIR)/libpisock_la-veo.Tpo -c -o libpisock_la-veo.lo `test -f 'veo.c' || echo '$(srcdir)/'`veo.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-veo.Tpo $(DEPDIR)/libpisock_la-veo.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='veo.c' object='libpisock_la-veo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-veo.lo `test -f 'veo.c' || echo '$(srcdir)/'`veo.c libpisock_la-versamail.lo: versamail.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -MT libpisock_la-versamail.lo -MD -MP -MF $(DEPDIR)/libpisock_la-versamail.Tpo -c -o libpisock_la-versamail.lo `test -f 'versamail.c' || echo '$(srcdir)/'`versamail.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpisock_la-versamail.Tpo $(DEPDIR)/libpisock_la-versamail.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='versamail.c' object='libpisock_la-versamail.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpisock_la_CFLAGS) $(CFLAGS) -c -o libpisock_la-versamail.lo `test -f 'versamail.c' || echo '$(srcdir)/'`versamail.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES # 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: pilot-link-0.12.5-dfsg/libpisock/todo.c0000644000175000017500000001563610552545410020204 0ustar rousseaurousseau/* * $Id: todo.c,v 1.28 2006/11/22 22:52:25 adridg Exp $ * * todo.c: Translate Palm ToDo application data formats * * Copyright (c) 1996, Kenneth Albanowski * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #include "pi-macros.h" #include "pi-todo.h" /* Maximum length of Description and Note fields */ #define DescMaxLength 256 #define NoteMaxLength 4096 /*********************************************************************** * * Function: free_ToDo * * Summary: Free the memory and filehandle from the record alloc. * * Parameters: ToDo_t* * * Returns: void * ***********************************************************************/ void free_ToDo(ToDo_t *todo) { if (todo->description != NULL) { free(todo->description); todo->description = NULL; } if (todo->note != NULL) { free(todo->note); todo->note = NULL; } } /*********************************************************************** * * Function: unpack_ToDo * * Summary: Unpack the ToDo structure from buffer into records * we can chew on. * * Parameters: ToDo_t*, pi_buffer_t * of buffer, todo type * * Returns: -1 on fail, 0 on success * ***********************************************************************/ int unpack_ToDo(ToDo_t *todo, const pi_buffer_t *buf, todoType type) { unsigned long d; int ofs; /* Note: There are possible timezone conversion problems related to the use of the due member of a struct ToDo. As it is kept in local (wall) time in struct tm's, the timezone of the Palm is irrelevant, _assuming_ that any UNIX program keeping time in time_t's converts them to the correct local time. If the Palm is in a different timezone than the UNIX box, it may not be simple to deduce that correct (desired) timezone. The easiest solution is to keep apointments in struct tm's, and out of time_t's. Of course, this might not actually be a help if you are constantly darting across timezones and trying to keep appointments. -- KJA */ if (type != todo_v1) return -1; if (buf == NULL || buf->data == NULL || buf->used < 3) return -1; d = (unsigned short int) get_short(buf->data); if (d != 0xffff) { todo->due.tm_year = (d >> 9) + 4; todo->due.tm_mon = ((d >> 5) & 15) - 1; todo->due.tm_mday = d & 31; todo->due.tm_hour = 0; todo->due.tm_min = 0; todo->due.tm_sec = 0; todo->due.tm_isdst = -1; mktime(&todo->due); todo->indefinite = 0; } else { todo->indefinite = 1; /* todo->due is invalid */ } todo->priority = get_byte(buf->data + 2); if (todo->priority & 0x80) { todo->complete = 1; todo->priority &= 0x7f; } else { todo->complete = 0; } ofs = 3; if (buf->used - ofs < 1) return -1; todo->description = strdup((char *) buf->data + ofs); ofs += strlen(todo->description) + 1; if (buf->used - ofs < 1) { free(todo->description); todo->description = 0; return -1; } todo->note = strdup((char *) buf->data + ofs); return 0; } /*********************************************************************** * * Function: pack_ToDo * * Summary: Pack the ToDo records into a structure * * Parameters: ToDo_t*, pi_buffer_t *buf of record, record type * * Returns: -1 on error, 0 on success. * ***********************************************************************/ int pack_ToDo(const ToDo_t *todo, pi_buffer_t *buf, todoType type) { int pos; size_t destlen = 3; if (todo == NULL || buf == NULL) return -1; if (type != todo_v1) return -1; if (todo->description) destlen += strlen(todo->description); destlen++; if (todo->note) destlen += strlen(todo->note); destlen++; pi_buffer_expect (buf, destlen); buf->used = destlen; if (todo->indefinite) { buf->data[0] = 0xff; buf->data[1] = 0xff; } else { set_short(buf->data, ((todo->due.tm_year - 4) << 9) | ((todo->due.tm_mon + 1) << 5) | todo-> due.tm_mday); } buf->data[2] = todo->priority; if (todo->complete) { buf->data[2] |= 0x80; } pos = 3; if (todo->description) { strcpy((char *) buf->data + pos, todo->description); pos += strlen(todo->description) + 1; } else { buf->data[pos++] = 0; } if (todo->note) { strcpy((char *) buf->data + pos, todo->note); pos += strlen(todo->note) + 1; } else { buf->data[pos++] = 0; } return 0; } /*********************************************************************** * * Function: unpack_ToDoAppInfo * * Summary: Unpack the ToDo AppInfo block from the structure * * Parameters: ToDoAppInfo_t*, char* to record, record length * * Returns: effective record length * ***********************************************************************/ int unpack_ToDoAppInfo(ToDoAppInfo_t *appinfo, const unsigned char *record, size_t len) { int i; unsigned char *start = record; appinfo->type = todo_v1; i = unpack_CategoryAppInfo(&appinfo->category, record, len); if (!i) return 0; record += i; len -= i; if (len < 4) return 0; appinfo->dirty = get_short(record); record += 2; appinfo->sortByPriority = get_byte(record); record += 2; return (record - start); } /*********************************************************************** * * Function: pack_ToDoAppInfo * * Summary: Pack the AppInfo block/record back into the structure * * Parameters: ToDoAppInfo_t*, char* to record, record length * * Returns: effective buffer length * ***********************************************************************/ int pack_ToDoAppInfo(const ToDoAppInfo_t *appinfo, unsigned char *record, size_t len) { int i; unsigned char *start = record; i = pack_CategoryAppInfo(&appinfo->category, record, len); if (!record) return i + 4; if (!i) return 0; record += i; len -= i; if (len < 4) return 0; set_short(record, appinfo->dirty); set_byte(record + 2, appinfo->sortByPriority); set_byte(record + 3, 0); /* gapfill */ record += 4; return (record - start); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/sys.c0000644000175000017500000002212110513447542020044 0ustar rousseaurousseau/* * $Id: sys.c,v 1.17 2006/10/12 14:21:22 desrod Exp $ * * sys.c: Pilot System Protocol * * (c) 1996, Kenneth Albanowski. * Derived from padp.c. * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this 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 #include #include #include #include #include "pi-debug.h" #include "pi-source.h" #include "pi-slp.h" #include "pi-sys.h" #include "pi-error.h" /* Declare function prototypes */ static int sys_flush(pi_socket_t *ps, int flags); static int sys_getsockopt(pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len); static int sys_setsockopt(pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len); /*********************************************************************** * * Function: sys_protocol_dup * * Summary: clones an existing pi_protocol struct * * Parameters: pi_protocol* * * Returns: pi_protocol_t* or NULL if operation failed * ***********************************************************************/ static pi_protocol_t * sys_protocol_dup (pi_protocol_t *prot) { pi_protocol_t *new_prot = NULL; pi_sys_data_t *data = NULL, *new_data = NULL; new_prot = (pi_protocol_t *)malloc (sizeof (pi_protocol_t)); if (new_prot != NULL) { new_data = (pi_sys_data_t *)malloc (sizeof (pi_sys_data_t)); if (new_data == NULL) { free(new_prot); new_prot = NULL; } } if (new_prot != NULL && new_data != NULL) { new_prot->level = prot->level; new_prot->dup = prot->dup; new_prot->free = prot->free; new_prot->read = prot->read; new_prot->write = prot->write; new_prot->flush = prot->flush; new_prot->getsockopt = prot->getsockopt; new_prot->setsockopt = prot->setsockopt; data = (pi_sys_data_t *)prot->data; new_data->txid = data->txid; new_prot->data = new_data; } return new_prot; } /*********************************************************************** * * Function: sys_protocol_free * * Summary: frees an existing pi_protocol struct * * Parameters: pi_protocol* * * Returns: void * ***********************************************************************/ static void sys_protocol_free (pi_protocol_t *prot) { ASSERT (prot != NULL); if (prot != NULL) { if (prot->data != NULL) free(prot->data); free(prot); } } /*********************************************************************** * * Function: sys_protocol * * Summary: creates and inits pi_protocol struct instance * * Parameters: void * * Returns: pi_protocol_t* or NULL if operation failed * ***********************************************************************/ pi_protocol_t * sys_protocol (void) { pi_protocol_t *prot = NULL; pi_sys_data_t *data = NULL; prot = (pi_protocol_t *)malloc (sizeof (pi_protocol_t)); if (prot != NULL) { data = (pi_sys_data_t *)malloc (sizeof (pi_sys_data_t)); if (data == NULL) { free(prot); prot = NULL; } } if (prot != NULL && data != NULL) { prot->level = PI_LEVEL_SYS; prot->dup = sys_protocol_dup; prot->free = sys_protocol_free; prot->read = sys_rx; prot->write = sys_tx; prot->flush = sys_flush; prot->getsockopt = sys_getsockopt; prot->setsockopt = sys_setsockopt; data->txid = 0x00; prot->data = data; } return prot; } /*********************************************************************** * * Function: sys_tx * * Summary: Send a system message * * Parameters: pi_socket_t*, char* to buffer, buffer length, flags * * Returns: 0 if success, nonzero otherwise * ***********************************************************************/ ssize_t sys_tx(pi_socket_t *ps, const unsigned char *buf, size_t len, int flags) { pi_protocol_t *prot, *next; pi_sys_data_t *data; int type, socket; size_t size; prot = pi_protocol(ps->sd, PI_LEVEL_SYS); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (pi_sys_data_t *)prot->data; next = pi_protocol_next(ps->sd, PI_LEVEL_SYS); if (next == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); if (!data->txid || data->txid == 0xff) data->txid = 0x11; /* some random # */ data->txid++; if (!data->txid || data->txid == 0xff) data->txid = 0x11; /* some random # */ type = PI_SLP_TYPE_RDCP; /* Fix me, allow socket type */ socket = PI_SLP_SOCK_CON; size = sizeof(type); pi_setsockopt(ps->sd, PI_LEVEL_SLP, PI_SLP_TYPE, &type, &size); pi_setsockopt(ps->sd, PI_LEVEL_SLP, PI_SLP_DEST, &socket, &size); pi_setsockopt(ps->sd, PI_LEVEL_SLP, PI_SLP_SRC, &socket, &size); size = sizeof(data->txid); pi_setsockopt(ps->sd, PI_LEVEL_SLP, PI_SLP_TXID, &data->txid, &size); len = next->write(ps, buf, len, flags); if (len >= 0) { CHECK(PI_DBG_SYS, PI_DBG_LVL_INFO, sys_dump_header(buf, 1)); CHECK(PI_DBG_SYS, PI_DBG_LVL_DEBUG, sys_dump(buf, len)); } return len; } /*********************************************************************** * * Function: sys_rx * * Summary: Receive system message * * Parameters: pi_socket_t*, char* to buffer, buffer length, flags * * Returns: Length of read or negative on error * ***********************************************************************/ ssize_t sys_rx(pi_socket_t *ps, pi_buffer_t *buf, size_t len, int flags) { pi_protocol_t *next, *prot; pi_sys_data_t *data; size_t data_len; prot = pi_protocol(ps->sd, PI_LEVEL_SYS); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (pi_sys_data_t *)prot->data; next = pi_protocol_next(ps->sd, PI_LEVEL_SYS); if (next == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data_len = next->read(ps, buf, len, flags); CHECK(PI_DBG_SYS, PI_DBG_LVL_INFO, sys_dump_header(buf->data, 0)); CHECK(PI_DBG_SYS, PI_DBG_LVL_DEBUG, sys_dump(buf->data, data_len)); return data_len; } /*********************************************************************** * * Function: sys_flush * * Summary: Flush input and output buffers * * Parameters: pi_socket_t*, flags * * Returns: A negative number on error, 0 otherwise * ***********************************************************************/ static int sys_flush(pi_socket_t *ps, int flags) { pi_protocol_t *prot, *next; prot = pi_protocol(ps->sd, PI_LEVEL_SYS); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); next = pi_protocol_next(ps->sd, PI_LEVEL_SYS); if (next == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); return next->flush(ps, flags); } /*********************************************************************** * * Function: sys_getsockopt * * Summary: get options on socket * * Parameters: pi_socket*, level, option name, option value, option length * * Returns: 0 for success * ***********************************************************************/ static int sys_getsockopt(pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len) { return 0; } /*********************************************************************** * * Function: sys_setsockopt * * Summary: get options on socket * * Parameters: pi_socket*, level, option name, option value, option length * * Returns: 0 for success * ***********************************************************************/ static int sys_setsockopt(pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len) { return 0; } /*********************************************************************** * * Function: sys_dump_header * * Summary: Dump SYS packet header * * Parameters: char* to data, RXTX boolean * * Returns: void * ***********************************************************************/ void sys_dump_header(const unsigned char *data, int rxtx) { LOG((PI_DBG_SYS, PI_DBG_LVL_NONE, "SYS %s\n", rxtx ? "TX" : "RX")); } /*********************************************************************** * * Function: sys_dump * * Summary: Dump SYS packet * * Parameters: char* to data, length * * Returns: void * ***********************************************************************/ void sys_dump(const unsigned char *data, size_t len) { pi_dumpdata((char *)&data[PI_SYS_HEADER_LEN], len); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/utils.c0000644000175000017500000002216010513447543020372 0ustar rousseaurousseau/* * $Id: utils.c,v 1.47 2006/10/12 14:21:23 desrod Exp $ * * utils.c: misc. stuff for dealing with packets. * * Portions Copyright (c) 1996, D. Jeff Dionne. * Portions Copyright (c) 1996, Kenneth Albanowski * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this 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 #include #include #include #include #include #include #include #include #include #include "pi-debug.h" #include "pi-source.h" void pi_timeout_to_timespec(int timeout, struct timespec *ts); void get_pilot_rate(int *establishrate, int *establishhighrate); int pi_timespec_to_timeout(const struct timespec *ts); int pi_timeout_expired(const struct timespec *ts); size_t palm_strftime(char *s, size_t max, const char *fmt, const struct tm *tm); /* this routine ruthlessly stolen verbatim from Brian J. Swetland */ /*********************************************************************** * * Function: crc16 * * Summary: Implementation of the CRC16 Cyclic Redundancy Check * * Parameters: None * * Returns: CRC + NULL * ***********************************************************************/ int crc16(unsigned char *ptr, int count) { int crc, i; crc = 0; while (--count >= 0) { crc = crc ^ (int) *ptr++ << 8; for (i = 0; i < 8; ++i) if (crc & 0x8000) crc = crc << 1 ^ 0x1021; else crc = crc << 1; } return (crc & 0xFFFF); } void get_pilot_rate(int *establishrate, int *establishhighrate) { /* Default PADP connection rate */ char *rate_env = getenv("PILOTRATE"); if (rate_env) { /* Establish high rate */ if (rate_env[0] == 'H') { *establishrate = atoi(rate_env + 1); *establishhighrate = 1; } else { *establishrate = atoi(rate_env); *establishhighrate = 0; } } else { *establishrate = -1; } } #ifndef HAVE_STRDUP char *strdup(const char *s) { char *result; size_t size = strlen(s) + 1; if (!(result = malloc(size))) { return NULL; } memcpy(result, s, size); return result; } #endif /* Borrowed from GNU sh-utils, and then probably from GNU libc */ #ifndef HAVE_PUTENV #if HAVE_GNU_LD # define environ __environ #else extern char **environ; #endif /* Put STRING, which is of the form "NAME=VALUE", in the environment */ int putenv(const char *string) { const char *const name_end = strchr(string, '='); register size_t size; register char **ep; if (name_end == NULL) { /* Remove the variable from the environment. */ size = strlen(string); for (ep = environ; *ep != NULL; ++ep) if (!strncmp(*ep, string, size) && (*ep)[size] == '=') { while (ep[1] != NULL) { ep[0] = ep[1]; ++ep; } *ep = NULL; return 0; } } size = 0; for (ep = environ; *ep != NULL; ++ep) if (!strncmp(*ep, string, name_end - string) && (*ep)[name_end - string] == '=') break; else ++size; if (*ep == NULL) { static char **last_environ = NULL; char **new_environ = (char **) malloc((size + 2) * sizeof(char *)); if (new_environ == NULL) return -1; (void) memcpy((void *) new_environ, (void *) environ, size * sizeof(char *)); new_environ[size] = (char *) string; new_environ[size + 1] = NULL; if (last_environ != NULL) free((void *) last_environ); last_environ = new_environ; environ = new_environ; } else *ep = (char *) string; return 0; } #endif #ifdef OS2 /* Replacement version of getenv(), because the one in the EMX 0.9c, fix03 dist appears to be busted when called from inside a DLL. (MJJ) */ char *getenv(const char *envar) { APIRET rc; unsigned char *envstring; /* just call the OS/2 function directly */ rc = DosScanEnv(envar, &envstring); if (rc) return NULL; else return envstring; } #endif #ifndef HAVE_INET_ATON /*********************************************************************** * * Function: inet_aton * * Summary: Manipulate our network address information * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int inet_aton(const char *cp, struct in_addr *addr) { register u_long val; register int base; register int n; register char c; u_int parts[4]; register u_int *pp = parts; for (;;) { /* Collect number up to ``.''. Values are specified as for C: 0x=hex, 0=octal, other=decimal. */ val = 0; base = 10; if (*cp == '0') { if (*++cp == 'x' || *cp == 'X') base = 16, cp++; else base = 8; } while ((c = *cp) != '\0') { if (isascii(c) && isdigit(c)) { val = (val * base) + (c - '0'); cp++; continue; } if (base == 16 && isascii(c) && isxdigit(c)) { val = (val << 4) + (c + 10 - (islower(c) ? 'a' : 'A')); cp++; continue; } break; } if (*cp == '.') { /* Internet format: a.b.c.d a.b.c (with c treated as 16-bits) a.b (with b treated as 24 bits) */ if (pp >= parts + 3 || val > 0xff) return (0); *pp++ = val, cp++; } else break; } /* Check for trailing characters. */ if (*cp && (!isascii(*cp) || !isspace(*cp))) return (0); /* Concoct the address according to the number of parts specified. */ n = pp - parts + 1; switch (n) { case 1: /* a -- 32 bits */ break; case 2: /* a.b -- 8.24 bits */ if (val > 0xffffff) return (0); val |= parts[0] << 24; break; case 3: /* a.b.c -- 8.8.16 bits */ if (val > 0xffff) return (0); val |= (parts[0] << 24) | (parts[1] << 16); break; case 4: /* a.b.c.d -- 8.8.8.8 bits */ if (val > 0xff) return (0); val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); break; } if (addr) addr->s_addr = htonl(val); return (1); } #endif char *printlong(unsigned long val) { static char buf[5]; set_long(buf, val); buf[4] = 0; return buf; } unsigned long makelong(char *c) { int l = strlen(c); char c2[4]; if (l >= 4) return get_long(c); memset(c2, ' ', 4); memcpy(c2, c, (size_t)l); return get_long(c2); } double get_float(void *buffer) { unsigned char *buf = buffer; unsigned long frac = get_long(buf); int expr = get_sshort(buf + 4), sign = get_byte(buf + 6); /* if (sign) f = frac; else f = -frac; return ldexp(f, exp); */ return ldexp(sign ? (double) frac : -(double) frac, expr); } void set_float(void *buffer, double value) { int expr, sign; unsigned char *buf = buffer; unsigned long frac; double r; /* Take absolute */ if (value < 0) { sign = 0; value = -value; } else sign = 0xFF; /* Convert mantissa to 32-bit integer, and take exponent */ r = ldexp(frexp(value, &expr), 32); frac = (unsigned long)r; expr -= 32; /* Store values in buffer */ set_long(buf, frac); set_sshort(buf + 4, expr); set_byte(buf + 6, sign); set_byte(buf + 7, 0); } int compareTm(struct tm *a, struct tm *b) { int date; date = a->tm_year - b->tm_year; if (date) return date; date = a->tm_mon - b->tm_mon; if (date) return date; date = a->tm_mday - b->tm_mday; if (date) return date; date = a->tm_hour - b->tm_hour; if (date) return date; date = a->tm_min - b->tm_min; if (date) return date; date = a->tm_sec - b->tm_sec; return date; } void pi_timeout_to_timespec(int timeout, struct timespec *ts) { /* convert a timeout value (in milliseconds) to an absolute timespec */ struct timeval now; gettimeofday(&now, NULL); ts->tv_sec = now.tv_sec + (long)(timeout / 1000); ts->tv_nsec = (now.tv_usec + ((long)timeout % 1000) * 1000) * 1000; if (ts->tv_nsec >= 1000000000) { ts->tv_nsec -= 1000000000; ts->tv_sec++; } } int pi_timespec_to_timeout(const struct timespec *ts) { /* convert an absolute timespec to a timeout value (in milliseconds) from now * returns a negative if the timeout expired already */ struct timeval now; gettimeofday(&now, NULL); return (int)(((double)ts->tv_sec * 1000.0 + (double)ts->tv_nsec / 1000000.0) - ((double)now.tv_sec * 1000.0 + (double)now.tv_usec / 1000.0)); } int pi_timeout_expired(const struct timespec *ts) { return pi_timespec_to_timeout(ts) <= 0; } /* Fix some issues with some locales reporting 2 or 4 digit years */ size_t palm_strftime(char *s, size_t max, const char *fmt, const struct tm *tm) { return strftime(s, max, fmt, tm); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/money.c0000644000175000017500000001306210513447542020361 0ustar rousseaurousseau/* * $Id: money.c,v 1.16 2006/10/12 14:21:22 desrod Exp $ * * money.c: Translate Pilot MoneyManager data formats * * Copyright (c) 1998, Rui Oliveira * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include "pi-macros.h" #include "pi-money.h" /*********************************************************************** * * Function: unpack_Transaction * * Summary: unpacks Transaction_t data * * Parameters: Transaction_t*, char* to buffer, length of buffer * * Returns: effective buffer length * ***********************************************************************/ int unpack_Transaction(Transaction_t *trans, unsigned char *buffer, size_t len) { unsigned char *p; if (len < 46) return 0; p = buffer; trans->flags = get_byte(p); p += 2; /* gap */ trans->checknum = get_short(p); p += 2; trans->amount = get_slong(p); p += 4; trans->total = get_slong(p); p += 4; trans->amountc = get_sshort(p); p += 2; trans->totalc = get_sshort(p); p += 2; trans->second = get_sshort(p); p += 2; trans->minute = get_sshort(p); p += 2; trans->hour = get_sshort(p); p += 2; trans->day = get_sshort(p); p += 2; trans->month = get_sshort(p); p += 2; trans->year = get_sshort(p); p += 2; trans->wday = get_sshort(p); p += 2; trans->repeat = get_byte(p); p += 1; trans->flags2 = get_byte(p); p += 1; trans->type = get_byte(p); p += 1; memcpy(trans->reserved, p, 2); p += 2; trans->xfer = get_byte(p); p += 1; strcpy(trans->description, (char *)p); p += 19; strcpy(trans->note, (char *)p); p += strlen((char *)p) + 1; return (p - buffer); } /*********************************************************************** * * Function: pack_Transaction * * Summary: unpacks Transaction_t data * * Parameters: Transaction_t*, char* to buffer, length of buffer * * Returns: effective buffer length * ***********************************************************************/ int pack_Transaction(struct Transaction *trans, unsigned char *buffer, size_t len) { size_t destlen = 46 + strlen(trans->note) + 1; unsigned char *p; if (!buffer) return destlen; if (len < destlen) return 0; p = buffer; set_byte(p, trans->flags); p += 1; set_byte(p, 0); p += 1; /* gap fill */ set_short(p, trans->checknum); p += 2; set_slong(p, trans->amount); p += 4; set_slong(p, trans->total); p += 4; set_sshort(p, trans->amountc); p += 2; set_sshort(p, trans->totalc); p += 2; set_sshort(p, trans->second); p += 2; set_sshort(p, trans->minute); p += 2; set_sshort(p, trans->hour); p += 2; set_sshort(p, trans->day); p += 2; set_sshort(p, trans->month); p += 2; set_sshort(p, trans->year); p += 2; set_sshort(p, trans->wday); p += 2; set_byte(p, trans->repeat); p += 1; set_byte(p, trans->flags2); p += 1; set_byte(p, trans->type); p += 1; /* gap fill */ set_short(p, 0); p += 2; set_byte(p, trans->xfer); p += 1; strcpy((char *)p, trans->description); p += 19; strcpy((char *)p, trans->note); p += strlen((char *)p) + 1; return (p - buffer); } /*********************************************************************** * * Function: unpack_MoneyAppInfo * * Summary: unpacks MoneyAppInfo_t data * * Parameters: MoneyAppInfo_t*, char* to buffer, length of buffer * * Returns: effective buffer length * ***********************************************************************/ int unpack_MoneyAppInfo(MoneyAppInfo_t *appinfo, unsigned char *buffer, size_t len) { int i, j; unsigned char *p; i = unpack_CategoryAppInfo(&appinfo->category, buffer, len); if (!i) return 0; p = (unsigned char *) (buffer + i); len -= i; if (len < 603) return 0; for (j = 0; j < 20; j++) { memcpy(appinfo->typeLabels[j], p, 10); p += 10; } for (j = 0; j < 20; j++) { memcpy(appinfo->tranLabels[j], p, 20); p += 20; } return i + 603; } /*********************************************************************** * * Function: pack_MoneyAppInfo * * Summary: packs MoneyAppInfo_t data * * Parameters: MoneyAppInfo_t*, char* to buffer, length of buffer * * Returns: effective buffer length * ***********************************************************************/ int pack_MoneyAppInfo(MoneyAppInfo_t *appinfo, unsigned char *buffer, size_t len) { int i, j; unsigned char *p; i = pack_CategoryAppInfo(&appinfo->category, buffer, len); if (!buffer) return i + 603; if (!i) return i; p = (unsigned char *) (buffer + i); len -= i; if (i < 603) return 0; for (j = 0; j < 20; j++) { memcpy(p, appinfo->typeLabels[j], 10); p += 10; } for (j = 0; j < 20; j++) { memcpy(p, appinfo->tranLabels[j], 20); p += 20; } return (i + 603); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/serial.c0000644000175000017500000004372410513447542020521 0ustar rousseaurousseau/* * $Id: serial.c,v 1.72 2006/10/12 14:21:22 desrod Exp $ * * serial.c: Interface layer to serial HotSync connections * * Copyright (c) 1996, 1997, D. Jeff Dionne & Kenneth Albanowski * Copyright (c) 1999, Tilo Christ * Copyright (c) 2005, Florent Pillet * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include /* Needed for Redhat 6.x machines */ #include #include "pi-debug.h" #include "pi-source.h" #include "pi-socket.h" #include "pi-serial.h" #include "pi-net.h" #include "pi-cmp.h" #include "pi-error.h" #include "pi-util.h" #ifdef OS2 #include #endif /* Declare prototypes */ static int pi_serial_connect(pi_socket_t *ps, struct sockaddr *addr, size_t addrlen); static int pi_serial_bind(pi_socket_t *ps, struct sockaddr *addr, size_t addrlen); static int pi_serial_listen(pi_socket_t *ps, int backlog); static int pi_serial_accept(pi_socket_t *ps, struct sockaddr *addr, size_t *addrlen); static int pi_serial_getsockopt(pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len); static int pi_serial_setsockopt(pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len); static int pi_serial_close(pi_socket_t *ps); extern int pi_socket_init(pi_socket_t *ps); /* Protocol Functions */ /*********************************************************************** * * Function: pi_serial_protocol_dup * * Summary: clones an existing pi_protocol struct * * Parameters: pi_protocol* * * Returns: pi_protocol_t* or NULL if operation failed * ***********************************************************************/ static pi_protocol_t* pi_serial_protocol_dup (pi_protocol_t *prot) { pi_protocol_t *new_prot; ASSERT (prot != NULL); new_prot = (pi_protocol_t *) malloc(sizeof (pi_protocol_t)); if (new_prot != NULL) { new_prot->level = prot->level; new_prot->dup = prot->dup; new_prot->free = prot->free; new_prot->read = prot->read; new_prot->write = prot->write; new_prot->flush = prot->flush; new_prot->getsockopt = prot->getsockopt; new_prot->setsockopt = prot->setsockopt; new_prot->data = NULL; } return new_prot; } /*********************************************************************** * * Function: pi_serial_protocol_free * * Summary: frees an existing pi_protocol struct * * Parameters: pi_protocol* * * Returns: void * ***********************************************************************/ static void pi_serial_protocol_free (pi_protocol_t *prot) { ASSERT (prot != NULL); if (prot != NULL) free(prot); } /*********************************************************************** * * Function: pi_serial_protocol * * Summary: creates and inits pi_protocol struct instance * * Parameters: pi_device_t* * * Returns: pi_protocol_t* or NULL if operation failed * ***********************************************************************/ static pi_protocol_t* pi_serial_protocol (pi_device_t *dev) { pi_protocol_t *prot; struct pi_serial_data *data; ASSERT (dev != NULL); prot = (pi_protocol_t *) malloc(sizeof (pi_protocol_t)); data = (struct pi_serial_data *)(dev->data); if (prot != NULL) { prot->level = PI_LEVEL_DEV; prot->dup = pi_serial_protocol_dup; prot->free = pi_serial_protocol_free; prot->read = data->impl.read; prot->write = data->impl.write; prot->flush = data->impl.flush; prot->getsockopt = pi_serial_getsockopt; prot->setsockopt = pi_serial_setsockopt; prot->data = NULL; } return prot; } /* Device Functions */ /*********************************************************************** * * Function: pi_serial_device_free * * Summary: frees an existing pi_device struct * * Parameters: pi_device_t* * * Returns: void * ***********************************************************************/ static void pi_serial_device_free (pi_device_t *dev) { ASSERT (dev != NULL); free(dev->data); free(dev); } /*********************************************************************** * * Function: pi_serial_device * * Summary: creates and inits pi_device struct instance * * Parameters: device type * * Returns: pi_device_t* or NULL if operation failed * ***********************************************************************/ pi_device_t* pi_serial_device (int type) { pi_device_t *dev; struct pi_serial_data *data; dev = (pi_device_t *) malloc(sizeof (pi_device_t)); if (dev == NULL) return NULL; data = (struct pi_serial_data *) malloc(sizeof (struct pi_serial_data)); if (data == NULL) { free(dev); return NULL; } dev->free = pi_serial_device_free; dev->protocol = pi_serial_protocol; dev->bind = pi_serial_bind; dev->listen = pi_serial_listen; dev->accept = pi_serial_accept; dev->connect = pi_serial_connect; dev->close = pi_serial_close; switch (type) { case PI_SERIAL_DEV: pi_serial_impl_init (&data->impl); break; default: pi_serial_impl_init (&data->impl); break; } data->buf_size = 0; data->rate = -1; data->establishrate = -1; data->establishhighrate = -1; data->timeout = 0; data->rx_bytes = 0; data->rx_errors = 0; data->tx_bytes = 0; data->tx_errors = 0; dev->data = data; return dev; } /*********************************************************************** * * Function: pi_serial_connect * * Summary: Connect socket to a given address * * Parameters: pi_socket*, sockaddr*, size_t * * Returns: A negative number on error, 0 otherwise * ***********************************************************************/ static int pi_serial_connect(pi_socket_t *ps, struct sockaddr *addr, size_t addrlen) { struct pi_serial_data *data = (struct pi_serial_data *)ps->device->data; struct pi_sockaddr *pa = (struct pi_sockaddr *) addr; int err; if (ps->type == PI_SOCK_STREAM) { if (ps->protocol == PI_PF_SYS) { data->establishrate = data->rate = 57600; } else { if (data->establishrate == -1) get_pilot_rate(&data->establishrate, &data->establishhighrate); /* Mandatory CMP connection rate */ data->rate = 9600; } } else if (ps->type == PI_SOCK_RAW) { /* Mandatory SysPkt connection rate */ data->establishrate = data->rate = 57600; } if ((err = data->impl.open(ps, pa, addrlen)) < 0) return err; /* errno already set */ ps->raddr = malloc(addrlen); memcpy(ps->raddr, addr, addrlen); ps->raddrlen = addrlen; ps->laddr = malloc(addrlen); memcpy(ps->laddr, addr, addrlen); ps->laddrlen = addrlen; if (ps->type == PI_SOCK_STREAM) { size_t size; switch (ps->cmd) { case PI_CMD_CMP: if (cmp_tx_handshake(ps) < 0) goto fail; size = sizeof(data->rate); pi_getsockopt(ps->sd, PI_LEVEL_CMP, PI_CMP_BAUD, &data->rate, &size); if ((err = data->impl.changebaud(ps)) < 0) goto fail; break; case PI_CMD_NET: if ((err = data->impl.changebaud(ps)) < 0) goto fail; break; case PI_CMD_SYS: if ((err = data->impl.changebaud(ps)) < 0) goto fail; break; } } ps->state = PI_SOCK_CONN_INIT; ps->command = 0; return 0; fail: return err; } /*********************************************************************** * * Function: pi_serial_bind * * Summary: Bind address to a local socket * * Parameters: pi_socket*, sockaddr*, size_t * * Returns: A negative number on error, 0 otherwise * ***********************************************************************/ static int pi_serial_bind(pi_socket_t *ps, struct sockaddr *addr, size_t addrlen) { struct pi_serial_data *data = (struct pi_serial_data *)ps->device->data; struct pi_sockaddr *pa = (struct pi_sockaddr *) addr; int err, count = 0; if (ps->type == PI_SOCK_STREAM) { if (data->establishrate == -1) get_pilot_rate(&data->establishrate, &data->establishhighrate); /* Mandatory CMP connection rate */ data->rate = 9600; } else if (ps->type == PI_SOCK_RAW) { /* Mandatory SysPkt connection rate */ data->establishrate = data->rate = 57600; } begin: if ((err = data->impl.open(ps, pa, addrlen)) < 0) { int save_errno = errno; #ifdef MAXPATHLEN char realport[MAXPATHLEN]; #else # ifdef PATH_MAX char realport[PATH_MAX]; # else char realport[4096]; # endif /* PATH_MAX */ #endif /* MAXPATHLEN */ realpath(pa->pi_device, realport); errno = save_errno; if (errno == ENOENT) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, " The device %s does not exist..\n", pa->pi_device)); LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, " Possible solution:\n\n\tmknod %s c " " \n\n", pa->pi_device)); } else if (errno == EACCES) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, " Please check the " "permissions on %s..\n", realport)); LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, " Possible solution:\n\n\tchmod 0666 " "%s\n\n", realport)); } else if (errno == ENODEV) { while (count <= 5) { if (isatty(fileno(stdout))) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "\r Port not connected," " sleeping for 2 seconds, ")); LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "%d retries..", 5-count)); } sleep(2); count++; goto begin; } LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "\n\n Device not found on %s, \ Did you hit HotSync?\n\n", realport)); } else if (errno == EISDIR) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, " The port specified must" " contain a device name, and %s was" " a directory.\n" " Please change that to reference a" " real device, and try" " again\n\n", pa->pi_device)); } return err; } ps->raddr = malloc(addrlen); memcpy(ps->raddr, addr, addrlen); ps->raddrlen = addrlen; ps->laddr = malloc(addrlen); memcpy(ps->laddr, addr, addrlen); ps->laddrlen = addrlen; return 0; } /*********************************************************************** * * Function: pi_serial_listen * * Summary: Prepare for incoming connections * * Parameters: pi_socket*, backlog * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int pi_serial_listen(pi_socket_t *ps, int backlog) { int result; struct pi_serial_data *data = (struct pi_serial_data *)ps->device->data; /* ps->rate has been set by bind */ result = data->impl.changebaud(ps); if (result == 0) ps->state = PI_SOCK_LISTEN; return result; } /*********************************************************************** * * Function: pi_serial_accept * * Summary: Accept an incoming connection * * Parameters: pi_socket*, sockaddr* * * Returns: Nothing * ***********************************************************************/ static int pi_serial_accept(pi_socket_t *ps, struct sockaddr *addr, size_t *addrlen) { struct pi_serial_data *data = (struct pi_serial_data *)ps->device->data; size_t size; int err; /* Wait for data */ #ifdef linux if (ps->accept_to) { /* shield against losing the first packet */ int result = data->impl.poll(ps, 1000); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s: %d, poll result: %d.\n", __FILE__, __LINE__, result)); if (result < 0) { char buf[] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }; data->impl.write(ps, buf, sizeof (buf), 1000); } } #endif if ((err = data->impl.poll(ps, ps->accept_to * 1000)) < 0) goto fail; data->timeout = ps->accept_to * 1000; pi_socket_init(ps); if (ps->type == PI_SOCK_STREAM) { struct timeval tv; unsigned char cmp_flags; switch (ps->cmd) { case PI_CMD_CMP: if ((err = cmp_rx_handshake(ps, data->establishrate, data->establishhighrate)) < 0) goto fail; /* propagate the long packet format flag to both command and non-command stacks */ size = sizeof(cmp_flags); pi_getsockopt(ps->sd, PI_LEVEL_CMP, PI_CMP_FLAGS, &cmp_flags, &size); if (cmp_flags & CMP_FL_LONG_PACKET_SUPPORT) { int use_long_format = 1; size = sizeof(int); pi_setsockopt(ps->sd, PI_LEVEL_PADP, PI_PADP_USE_LONG_FORMAT, &use_long_format, &size); ps->command ^= 1; pi_setsockopt(ps->sd, PI_LEVEL_PADP, PI_PADP_USE_LONG_FORMAT, &use_long_format, &size); ps->command ^= 1; } /* We always reconfigure our port, no matter what */ size = sizeof(data->rate); pi_getsockopt(ps->sd, PI_LEVEL_CMP, PI_CMP_BAUD, &data->rate, &size); if ((err = data->impl.changebaud(ps)) < 0) goto fail; /* Palm device needs some time to reconfigure its port */ tv.tv_sec = 0; tv.tv_usec = 50000; select(0, 0, 0, 0, &tv); break; case PI_CMD_NET: /* serial/network: make sure we don't split writes. set socket option * on both the command and non-command instances of the protocol */ #ifdef MACOSX /* We need to turn fragmentation OFF to improve Bluetooth performance * but this code is also used by USB on Linux and Freebsd * therefore, only compile it when running OS X */ { int split = 0; size_t chunksize = 0; size = sizeof (split); pi_setsockopt(ps->sd, PI_LEVEL_NET, PI_NET_SPLIT_WRITES, &split, &size); size = sizeof (chunksize); pi_setsockopt(ps->sd, PI_LEVEL_NET, PI_NET_WRITE_CHUNKSIZE, &chunksize, &size); ps->command ^= 1; size = sizeof (split); pi_setsockopt(ps->sd, PI_LEVEL_NET, PI_NET_SPLIT_WRITES, &split, &size); size = sizeof (chunksize); pi_setsockopt(ps->sd, PI_LEVEL_NET, PI_NET_WRITE_CHUNKSIZE, &chunksize, &size); ps->command ^= 1; } #endif if ((err = net_rx_handshake(ps)) < 0) goto fail; break; } ps->dlprecord = 0; } data->timeout = 0; ps->command = 0; ps->state = PI_SOCK_CONN_ACCEPT; return ps->sd; fail: return err; } /*********************************************************************** * * Function: pi_serial_getsockopt * * Summary: get options on socket * * Parameters: pi_socket*, level, option name, option value, option length * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int pi_serial_getsockopt(pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len) { struct pi_serial_data *data = (struct pi_serial_data *)ps->device->data; switch (option_name) { case PI_DEV_RATE: if (*option_len != sizeof (data->rate)) goto error; memcpy (option_value, &data->rate, sizeof (data->rate)); break; case PI_DEV_ESTRATE: if (*option_len != sizeof (data->establishrate)) goto error; memcpy (option_value, &data->establishrate, sizeof (data->establishrate)); break; case PI_DEV_HIGHRATE: if (*option_len != sizeof (data->establishhighrate)) goto error; memcpy (option_value, &data->establishhighrate, sizeof (data->establishhighrate)); break; case PI_DEV_TIMEOUT: if (*option_len != sizeof (data->timeout)) goto error; memcpy (option_value, &data->timeout, sizeof (data->timeout)); break; } return 0; error: errno = EINVAL; return pi_set_error(ps->sd, PI_ERR_GENERIC_ARGUMENT); } /*********************************************************************** * * Function: pi_serial_setsockopt * * Summary: set options on socket * * Parameters: pi_socket*, level, option name, option value, option length * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int pi_serial_setsockopt(pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len) { struct pi_serial_data *data = (struct pi_serial_data *)ps->device->data; /* FIXME: can't change stuff if already connected */ switch (option_name) { case PI_DEV_ESTRATE: if (*option_len != sizeof (data->establishrate)) goto error; memcpy (&data->establishrate, option_value, sizeof (data->establishrate)); break; case PI_DEV_HIGHRATE: if (*option_len != sizeof (data->establishhighrate)) goto error; memcpy (&data->establishhighrate, option_value, sizeof (data->establishhighrate)); break; case PI_DEV_TIMEOUT: if (*option_len != sizeof (data->timeout)) goto error; memcpy (&data->timeout, option_value, sizeof (data->timeout)); break; } return 0; error: errno = EINVAL; return pi_set_error(ps->sd, PI_ERR_GENERIC_ARGUMENT); } /*********************************************************************** * * Function: pi_serial_close * * Summary: Close a connection, destroy the socket * * Parameters: pi_socket* * * Returns: always 0 for success * ***********************************************************************/ static int pi_serial_close(pi_socket_t *ps) { struct pi_serial_data *data = (struct pi_serial_data *)ps->device->data; if (ps->sd) { data->impl.close (ps); ps->sd = 0; } if (ps->laddr) { free(ps->laddr); ps->laddr = NULL; } if (ps->raddr) { free(ps->raddr); ps->raddr = NULL; } return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/libusb.c0000644000175000017500000003730210563115776020523 0ustar rousseaurousseau/* * $Id: libusb.c,v 1.33 2007/02/09 16:06:22 desrod Exp $ * * libusb.c: device i/o for libusb * * Copyright (c) 2004 Zephaniah E. Hull & Florent Pillet. * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this 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 #include #include #include #include #include #include "pi-debug.h" #include "pi-source.h" #include "pi-usb.h" #include "pi-util.h" #ifdef HAVE_SYS_IOCTL_COMPAT_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #include #if defined(sun) && defined(__SVR4) #define __FUNCTION__ __func__ #endif static int u_open(struct pi_socket *ps, struct pi_sockaddr *addr, size_t addrlen); static int u_close(struct pi_socket *ps); static ssize_t u_write(struct pi_socket *ps, const unsigned char *buf, size_t len, int flags); static ssize_t u_read(struct pi_socket *ps, pi_buffer_t *buf, size_t len, int flags); static int u_read_i(struct pi_socket *ps, pi_buffer_t *buf, size_t len, int flags, int timeout); static int u_poll(struct pi_socket *ps, int timeout); static int u_wait_for_device(struct pi_socket *ps, int *timeout); static int u_flush(pi_socket_t *ps, int flags); static int u_control_request (pi_usb_data_t *usb_data, int request_type, int request, int value, int control_index, void *data, int size, int timeout); void pi_usb_impl_init (struct pi_usb_impl *impl) { impl->open = u_open; impl->close = u_close; impl->write = u_write; impl->read = u_read; impl->flush = u_flush; impl->poll = u_poll; impl->wait_for_device = u_wait_for_device; impl->changebaud = NULL; /* we don't need this one for libusb (yet) */ impl->control_request = u_control_request; } /*********************************************************************** * * Start of the device identification code. * ***********************************************************************/ static usb_dev_handle *USB_handle; static int USB_interface; static int USB_in_endpoint; static int USB_out_endpoint; static int USB_open (pi_usb_data_t *data) { usb_init (); return 1; } static int USB_poll (pi_usb_data_t *data) { struct usb_bus *bus; struct usb_device *dev; int ret; u_int8_t input_endpoint = 0xFF, output_endpoint = 0xFF; #ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP int first; #endif usb_find_busses (); usb_find_devices (); CHECK (PI_DBG_DEV, PI_DBG_LVL_DEBUG, usb_set_debug (2)); for (bus = usb_busses; bus; bus = bus->next) { for (dev = bus->devices; dev; dev = dev->next) { int i; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s: checking device %p\n", __FILE__, dev)); if (dev->descriptor.bNumConfigurations < 1) continue; if (!dev->config) continue; if (dev->config[0].bNumInterfaces < 1) continue; if (dev->config[0].interface[0].num_altsetting < 1) continue; if (dev->config[0].interface[0].altsetting[0].bNumEndpoints < 2) continue; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s: %d, 0x%04x 0x%04x.\n", __FILE__, __LINE__, dev->descriptor.idVendor, dev->descriptor.idProduct)); if (USB_check_device (data, dev->descriptor.idVendor, dev->descriptor.idProduct)) continue; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s: trying to open device %p\n", __FILE__, dev)); USB_handle = usb_open(dev); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s: USB_handle=%p\n", __FILE__, USB_handle)); data->ref = USB_handle; input_endpoint = output_endpoint = 0xFF; USB_in_endpoint = USB_out_endpoint = 0xFF; ret = USB_configure_device (data, &input_endpoint, &output_endpoint); if (ret < 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s: USB configure failed for familar device: 0x%04x 0x%04x. (LifeDrive issue?)\n", __FILE__, dev->descriptor.idVendor, dev->descriptor.idProduct)); usb_close(USB_handle); continue; } for (i = 0; i < dev->config[0].interface[0].altsetting[0].bNumEndpoints; i++) { struct usb_endpoint_descriptor *endpoint; u_int8_t address; endpoint = &dev->config[0].interface[0].altsetting[0].endpoint[i]; if (endpoint->wMaxPacketSize != 0x40) continue; if ((endpoint->bmAttributes & USB_ENDPOINT_TYPE_MASK) != USB_ENDPOINT_TYPE_BULK) continue; address = endpoint->bEndpointAddress; if ((address & USB_ENDPOINT_DIR_MASK)) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "In: 0x%x 0x%x.\n", address, input_endpoint)); if (input_endpoint == 0xFF) USB_in_endpoint = address; else if ((address & USB_ENDPOINT_ADDRESS_MASK) == input_endpoint) USB_in_endpoint = address; } else { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "Out: 0x%x 0x%x.\n", address, output_endpoint)); if (output_endpoint == 0xFF) USB_out_endpoint = address; else if ((address & USB_ENDPOINT_ADDRESS_MASK) == output_endpoint) USB_out_endpoint = address; } } if (USB_in_endpoint == 0xFF || USB_out_endpoint == 0xFF) { usb_close (USB_handle); continue; } LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "Config: %d, 0x%x 0x%x | 0x%x 0x%x.\n", ret, input_endpoint, output_endpoint, USB_in_endpoint, USB_out_endpoint)); USB_interface = dev->config[0].interface[0].altsetting[0].bInterfaceNumber; #ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP first = 1; claim: #endif i = usb_claim_interface (USB_handle, USB_interface); if (i < 0) { if (i == -EBUSY) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "Unable to claim device: Busy.\n")); #ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP if (first) { usb_detach_kernel_driver_np (USB_handle, USB_interface); first = 0; goto claim; } #endif } else if (i == -ENOMEM) LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "Unable to claim device: No memory.\n")); else LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "Unable to claim device: %d.\n", i)); usb_close (USB_handle); errno = -i; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s: %d.\n", __FILE__, __LINE__)); return 0; } LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s: %d.\n", __FILE__, __LINE__)); return 1; } } errno = ENODEV; CHECK (PI_DBG_DEV, PI_DBG_LVL_DEBUG, usb_set_debug (0)); return 0; } static int USB_close (void) { if (!USB_handle) return 0; usb_release_interface (USB_handle, USB_interface); usb_close (USB_handle); USB_handle = NULL; return 1; } /*********************************************************************** * * Start of the read thread code, please note that all of this runs * in a separate thread. * ***********************************************************************/ #define MAX_READ_SIZE 16384 #define AUTO_READ_SIZE 64 static char *RD_buffer = NULL; static size_t RD_buffer_size; static size_t RD_buffer_used; static pthread_mutex_t RD_buffer_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t RD_buffer_available_cond = PTHREAD_COND_INITIALIZER; static int RD_wanted; static int RD_running = 0; static char RD_usb_buffer[MAX_READ_SIZE]; static pthread_t RD_thread = 0; static void RD_do_read (int timeout) { int bytes_read, read_size; read_size = RD_wanted - RD_buffer_used; if (read_size < AUTO_READ_SIZE) read_size = AUTO_READ_SIZE; else if (read_size > MAX_READ_SIZE) read_size = MAX_READ_SIZE; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "Reading: len: %d, timeout: %d.\n", read_size, timeout)); bytes_read = usb_bulk_read (USB_handle, USB_in_endpoint, RD_usb_buffer, read_size, timeout); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s %d (%s): %d\n", __FILE__, __LINE__, __FUNCTION__, bytes_read)); if (bytes_read < 0) { if (bytes_read == -ENODEV) { LOG((PI_DBG_DEV, PI_DBG_LVL_NONE, "Device went byebye!\n")); RD_running = 0; return; #ifdef ELAST } else if (bytes_read == -(ELAST + 1)) { usb_clear_halt (USB_handle, USB_in_endpoint); return; #endif } else if (bytes_read == -ETIMEDOUT) return; LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "libusb: USB bulk read returned error code %d\n", bytes_read)); return; } if (!bytes_read) return; pthread_mutex_lock (&RD_buffer_mutex); if ((RD_buffer_used + bytes_read) > RD_buffer_size) { RD_buffer_size = ((RD_buffer_used + bytes_read + 0xfffe) & ~0xffff) - 1; /* 64k chunks. */ RD_buffer = realloc (RD_buffer, RD_buffer_size); } memcpy (RD_buffer + RD_buffer_used, RD_usb_buffer, bytes_read); RD_buffer_used += bytes_read; pthread_cond_broadcast (&RD_buffer_available_cond); pthread_mutex_unlock (&RD_buffer_mutex); } static void * RD_main (void *foo) { RD_buffer_used = 0; RD_buffer = NULL; RD_buffer_size = 0; pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL); while (RD_running == 1) { RD_do_read (0); } RD_running = 0; return NULL; } static int RD_start (void) { if (RD_thread || RD_running) return 0; RD_running = 1; pthread_create (&RD_thread, NULL, RD_main, NULL); return 1; } static int RD_stop (void) { if (!RD_thread && !RD_running) return 0; if (RD_running) RD_running = 0; if (RD_thread) { pthread_cancel(RD_thread); RD_thread = 0; } if (RD_thread || RD_running) return 0; return 1; } /*********************************************************************** * * Start of the glue code which makes this whole mess WORK. * ***********************************************************************/ static int u_open(struct pi_socket *ps, struct pi_sockaddr *addr, size_t addrlen) { pi_usb_data_t *data = (pi_usb_data_t *)ps->device->data; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s %d (%s).\n", __FILE__, __LINE__, __FUNCTION__)); if (RD_running) return -1; if (!USB_open (data)) return -1; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s %d (%s).\n", __FILE__, __LINE__, __FUNCTION__)); return 1; } static int u_close(struct pi_socket *ps) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s %d (%s).\n", __FILE__, __LINE__, __FUNCTION__)); RD_stop (); USB_close (); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s %d (%s).\n", __FILE__, __LINE__, __FUNCTION__)); return close (ps->sd); } static int u_wait_for_device(struct pi_socket *ps, int *timeout) { pi_usb_data_t *data = (pi_usb_data_t *)ps->device->data; struct timespec when; int ret = 0; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s %d (%s).\n", __FILE__, __LINE__, __FUNCTION__)); if (*timeout) pi_timeout_to_timespec (*timeout, &when); while (1) { ret = USB_poll (data); if (ret > 0) { /* Evil, calculate how much longer the timeout is. */ if (*timeout) { *timeout = pi_timespec_to_timeout (&when); if (*timeout <= 0) *timeout = 1; } if (!RD_start ()) { USB_close (); return -1; } return ret; } if (*timeout) { if (pi_timeout_expired(&when)) { *timeout = 1; return 0; } } usleep (500000); } return 0; } static int u_poll(struct pi_socket *ps, int timeout) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s %d (%s).\n", __FILE__, __LINE__, __FUNCTION__)); return u_read_i (ps, NULL, 1, PI_MSG_PEEK, timeout); } static ssize_t u_write(struct pi_socket *ps, const unsigned char *buf, size_t len, int flags) { int timeout = ((struct pi_usb_data *)ps->device->data)->timeout; int ret; if (!RD_running) return -1; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "Writing: len: %d, flags: %d, timeout: %d.\n", len, flags, timeout)); if (len <= 0) return 0; ret = usb_bulk_write (USB_handle, USB_out_endpoint, buf, len, timeout); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "Wrote: %d.\n", ret)); if (ret > 0) CHECK (PI_DBG_DEV, PI_DBG_LVL_DEBUG, pi_dumpdata (buf, ret)); return (ssize_t)ret; } static ssize_t u_read(struct pi_socket *ps, pi_buffer_t *buf, size_t len, int flags) { int ret; ret = u_read_i (ps, buf, len, flags, ((struct pi_usb_data *)ps->device->data)->timeout); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "Read: %d (%d).\n", ret, len)); if (ret > 0) CHECK (PI_DBG_DEV, PI_DBG_LVL_DEBUG, pi_dumpdata (buf->data, ret)); return (ssize_t)ret; } static int u_read_i(struct pi_socket *ps, pi_buffer_t *buf, size_t len, int flags, int timeout) { if (!RD_running) return PI_ERR_SOCK_DISCONNECTED; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s %d (%s): %d %d %d\n", __FILE__, __LINE__, __FUNCTION__, len, flags, timeout)); pthread_mutex_lock (&RD_buffer_mutex); if (flags & PI_MSG_PEEK && len > 256) len = 256; if (RD_buffer_used < len) { struct timeval now; struct timespec when, nownow; int last_used; gettimeofday(&now, NULL); when.tv_sec = now.tv_sec + timeout / 1000; when.tv_nsec = (now.tv_usec + (timeout % 1000) * 1000) * 1000; if (when.tv_nsec >= 1000000000) { when.tv_nsec -= 1000000000; when.tv_sec++; } RD_wanted = len; do { last_used = RD_buffer_used; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s %d (%s): %d %d.\n", __FILE__, __LINE__, __FUNCTION__, len, RD_buffer_used)); if (timeout) { gettimeofday(&now, NULL); nownow.tv_sec = now.tv_sec; nownow.tv_nsec = now.tv_usec * 1000; if ((nownow.tv_sec == when.tv_sec ? (nownow.tv_nsec > when.tv_nsec) : (nownow.tv_sec > when.tv_sec))) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s %d (%s): %d %d.\n", __FILE__, __LINE__, __FUNCTION__, len, RD_buffer_used)); break; } LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s %d (%s): %d %d.\n", __FILE__, __LINE__, __FUNCTION__, len, RD_buffer_used)); if (pthread_cond_timedwait (&RD_buffer_available_cond, &RD_buffer_mutex, &when) == ETIMEDOUT) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s %d (%s): %d %d.\n", __FILE__, __LINE__, __FUNCTION__, len, RD_buffer_used)); break; } } else pthread_cond_wait (&RD_buffer_available_cond, &RD_buffer_mutex); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s %d (%s): %d %d.\n", __FILE__, __LINE__, __FUNCTION__, len, RD_buffer_used)); } while (RD_buffer_used < len); RD_wanted = 0; } LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s %d (%s): %d %d.\n", __FILE__, __LINE__, __FUNCTION__, len, RD_buffer_used)); if (!RD_running) { pthread_mutex_unlock (&RD_buffer_mutex); return PI_ERR_SOCK_DISCONNECTED; } if (RD_buffer_used < len) len = RD_buffer_used; if (len && buf) { pi_buffer_append (buf, RD_buffer, len); if (!(flags & PI_MSG_PEEK)) { RD_buffer_used -= len; if (RD_buffer_used) memmove (RD_buffer, RD_buffer + len, RD_buffer_used); if ((RD_buffer_size - RD_buffer_used) > (1024 * 1024)) { /* If we have more then 1M free in the buffer, shrink it. */ RD_buffer_size = ((RD_buffer_used + 0xfffe) & ~0xffff) - 1; RD_buffer = realloc (RD_buffer, RD_buffer_size); } } } pthread_mutex_unlock (&RD_buffer_mutex); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s %d (%s).\n", __FILE__, __LINE__, __FUNCTION__)); return len; } static int u_flush(pi_socket_t *ps, int flags) { if (flags & PI_FLUSH_INPUT) { /* clear internal buffer */ pthread_mutex_lock (&RD_buffer_mutex); RD_buffer_used = 0; pthread_mutex_unlock (&RD_buffer_mutex); } return 0; } static int u_control_request (pi_usb_data_t *usb_data, int request_type, int request, int value, int control_index, void *data, int size, int timeout) { return usb_control_msg (usb_data->ref, request_type, request, value, control_index, data, size, timeout); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/contact.c0000644000175000017500000004112011206407417020656 0ustar rousseaurousseau/* $Id: contact.c,v 1.20 2009/02/23 11:59:16 nicholas Exp $ */ /******************************************************************************* * contact.c: Translate Palm contact data formats * Derived from a module of J-Pilot http://jpilot.org (jp-contact.c 1.10) * * Rewrite Copyright 2006, 2007 Judd Montgomery * Rewrite Copyright 2004, 2005 Joseph Carter * Copyright 2003, 2004 Judd Montgomery * * 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; version 2 of the License. * * 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 "pi-macros.h" #include "pi-contact.h" /*********************************************************************** * * Function: free_Contact * * Summary: Free the members of a contact structure * * Parameters: None * * Returns: Nothing * ***********************************************************************/ void free_Contact(struct Contact *c) { int i; for (i = 0; i < NUM_CONTACT_ENTRIES; i++) if (c->entry[i]) free(c->entry[i]); for (i = 0; i < MAX_CONTACT_BLOBS; i++) { if (c->blob[i]) { if (c->blob[i]->data) free(c->blob[i]->data); free(c->blob[i]); } } if (c->picture) free(c->picture); } #define hi(x) (((x) >> 4) & 0x0f) #define lo(x) ((x) & 0x0f) #define pair(x,y) (((x) << 4) | (y)) /*********************************************************************** * * Function: unpack_Contact * * Summary: Fill in the contact structure based on the raw record * data * * Parameters: None * * Returns: -1 on error, * The length of the data used from the buffer on success * ***********************************************************************/ int unpack_Contact(struct Contact *c, pi_buffer_t *buf, contactsType type) { unsigned long contents1; unsigned long contents2; unsigned char *Pbuf, *record; int i, field_num, len; unsigned int packed_date; unsigned int blob_count; if (buf == NULL || buf->data == NULL || buf->used < 17) return -1; if (type != contacts_v10 && type != contacts_v11) { /* Don't support anything else yet */ return -1; } record = Pbuf = buf->data; len = buf->used; for (i=0; iblob[i]=NULL; } c->picture=NULL; c->showPhone = hi(get_byte(Pbuf)); c->phoneLabel[6] = lo(get_byte(Pbuf)); c->phoneLabel[5] = hi(get_byte(Pbuf + 1)); c->phoneLabel[4] = lo(get_byte(Pbuf + 1)); c->phoneLabel[3] = hi(get_byte(Pbuf + 2)); c->phoneLabel[2] = lo(get_byte(Pbuf + 2)); c->phoneLabel[1] = hi(get_byte(Pbuf + 3)); c->phoneLabel[0] = lo(get_byte(Pbuf + 3)); c->addressLabel[2] = lo(get_byte(Pbuf + 4)); c->addressLabel[1] = hi(get_byte(Pbuf + 5)); c->addressLabel[0] = lo(get_byte(Pbuf + 5)); c->IMLabel[1] = hi(get_byte(Pbuf + 7)); c->IMLabel[0] = lo(get_byte(Pbuf + 7)); contents1 = get_long(record + 8); contents2 = get_long(record + 12); /* c->companyOffset = get_byte(record + 16); */ Pbuf += 17; len -= 17; field_num=0; for (i = 0; i < 28; i++, field_num++) { if (contents1 & (1 << i)) { if (len < 1) return 0; c->entry[field_num] = strdup((char *) Pbuf); Pbuf += strlen((char *) Pbuf) + 1; len -= strlen(c->entry[field_num]) + 1; } else { c->entry[field_num] = 0; } } for (i = 0; i < 11; i++, field_num++) { if (contents2 & (1 << i)) { if (len < 1) return 0; c->entry[field_num] = strdup((char *) Pbuf); Pbuf += strlen((char *) Pbuf) + 1; len -= strlen(c->entry[field_num]) + 1; } else { c->entry[field_num] = 0; } } /* I think one of these is a birthday flag and one is an alarm flag. * Since both are always set there is no way to know which is which. * It could be something like a flag for advanceUnits also. */ if ((contents2 & 0x0800) || (contents2 & 0x1000)) { c->birthdayFlag = 1; if (len < 1) return 0; packed_date = get_short(Pbuf); c->birthday.tm_year = ((packed_date & 0xFE00) >> 9) + 4; c->birthday.tm_mon = ((packed_date & 0x01E0) >> 5) - 1; c->birthday.tm_mday = (packed_date & 0x001F); c->birthday.tm_hour = 0; c->birthday.tm_min = 0; c->birthday.tm_sec = 0; c->birthday.tm_isdst= -1; mktime(&c->birthday); /* 2 bytes and a zero padding byte */ len -= 3; Pbuf += 3; c->advanceUnits = get_byte(Pbuf); len--; Pbuf++; } else { c->birthdayFlag = 0; } if (contents2 & 0x2000) { c->reminder = 1; if (len < 1) return 0; c->advance = get_byte(Pbuf); len -= 1; Pbuf += 1; } else { c->reminder = 0; c->advance = 0; } /* A blob of size zero would take 6 bytes */ blob_count=0; while (len >= 6) { if (blob_count >= MAX_CONTACT_BLOBS) { /* Too many blobs were found. */ return (Pbuf - record); } c->blob[blob_count] = malloc(sizeof(struct ContactBlob)); strncpy(c->blob[blob_count]->type, (char *)Pbuf, 4); c->blob[blob_count]->length = get_short(Pbuf+4); c->blob[blob_count]->data = malloc(c->blob[blob_count]->length); if (c->blob[blob_count]->data) { memcpy(c->blob[blob_count]->data, Pbuf+6, c->blob[blob_count]->length); } if (! strncmp(c->blob[blob_count]->type, BLOB_TYPE_PICTURE_ID, 4)) { if (!(c->picture)) { c->picture = malloc(sizeof(struct ContactPicture)); } c->picture->dirty = get_short(c->blob[blob_count]->data); c->picture->length = c->blob[blob_count]->length - 2; c->picture->data = c->blob[blob_count]->data + 2; } Pbuf += 6; len -= 6; Pbuf += c->blob[blob_count]->length; len -= c->blob[blob_count]->length; blob_count++; } return (Pbuf - record); } /*********************************************************************** * * Function: pack_Contact * * Summary: Fill in the raw contact record data based on the * contact structure * * Parameters: None * * Returns: -1 on error * The length of the buffer used on success * ***********************************************************************/ int pack_Contact(struct Contact *c, pi_buffer_t *buf, contactsType type) { int l, destlen = 17; unsigned char *Pbuf, *record; unsigned long contents1, contents2; int i; unsigned int field_i; unsigned long phoneflag; unsigned long typesflag; unsigned short packed_date; int companyOffset = 0; if (c == NULL || buf == NULL) return -1; if (type != contacts_v10 && type != contacts_v11) { /* Don't support anything else yet */ return -1; } for (i = 0; i < NUM_CONTACT_ENTRIES; i++) { if (c->entry[i]) { destlen += (strlen(c->entry[i]) + 1); } } if (c->birthdayFlag) { destlen += 3; if (c->reminder) { destlen += 2; } else { destlen += 1; } } /* Check for blobs */ for (i=0; iblob[i]) { destlen += c->blob[i]->length + 6; } } pi_buffer_expect(buf, destlen); record = buf->data; Pbuf = record + 17; phoneflag = 0; typesflag = 0; contents1 = contents2 = 0; field_i = 0; for (i = 0; i < 28; i++, field_i++) { if (c->entry[field_i] && strlen(c->entry[field_i])) { contents1 |= (1 << i); l = strlen(c->entry[field_i]) + 1; memcpy(Pbuf, c->entry[field_i], l); Pbuf += l; } } for (i = 0; i < 11; i++, field_i++) { if (c->entry[field_i] && strlen(c->entry[field_i])) { contents2 |= (1 << i); l = strlen(c->entry[field_i]) + 1; memcpy(Pbuf, c->entry[field_i], l); Pbuf += l; } } phoneflag = (((unsigned long) c->phoneLabel[0]) & 0xF) << 0; phoneflag |= (((unsigned long) c->phoneLabel[1]) & 0xF) << 4; phoneflag |= (((unsigned long) c->phoneLabel[2]) & 0xF) << 8; phoneflag |= (((unsigned long) c->phoneLabel[3]) & 0xF) << 12; phoneflag |= (((unsigned long) c->phoneLabel[4]) & 0xF) << 16; phoneflag |= (((unsigned long) c->phoneLabel[5]) & 0xF) << 20; phoneflag |= (((unsigned long) c->phoneLabel[6]) & 0xF) << 24; phoneflag |= (((unsigned long) c->showPhone) & 0xF) << 28; typesflag = (((unsigned long) c->IMLabel[0]) & 0xF) << 0; typesflag |= (((unsigned long) c->IMLabel[1]) & 0xF) << 4; typesflag |= (((unsigned long) c->addressLabel[0]) & 0xF) << 16; typesflag |= (((unsigned long) c->addressLabel[1]) & 0xF) << 20; typesflag |= (((unsigned long) c->addressLabel[2]) & 0xF) << 24; if (c->birthdayFlag) { contents2 |= 0x1800; packed_date = (((c->birthday.tm_year - 4) << 9) & 0xFE00) | (((c->birthday.tm_mon+1) << 5) & 0x01E0) | (c->birthday.tm_mday & 0x001F); set_short(Pbuf, packed_date); Pbuf += 2; set_byte(Pbuf, 0); /* padding byte in birthday date */ Pbuf += 1; if (c->reminder) { contents2 |= 0x2000; set_byte(Pbuf, c->advanceUnits); Pbuf += 1; set_byte(Pbuf, c->advance); Pbuf += 1; } else { set_byte(Pbuf, 0); Pbuf += 1; } } set_long(record, phoneflag); set_long(record + 4, typesflag); set_long(record + 8, contents1); set_long(record + 12, contents2); /* companyOffset is the offset from itself to the company field, * or zero if no company field. Its not useful to us at all. */ if (c->entry[2]) { companyOffset++; if (c->entry[0]) companyOffset += strlen(c->entry[0]) + 1; if (c->entry[1]) companyOffset += strlen(c->entry[1]) + 1; } set_byte(record + 16, companyOffset); /* Pack blobs */ for (i=0; iblob[i]) { memcpy(Pbuf, c->blob[i]->type, 4); Pbuf += 4; set_short(Pbuf, c->blob[i]->length); Pbuf += 2; memcpy(Pbuf, c->blob[i]->data, c->blob[i]->length); Pbuf += c->blob[i]->length; } } buf->used = Pbuf - record; return (buf->used); } /*********************************************************************** * * Function: Contact_add_blob * * Summary: Add a blob record to a Contact Record * * Parameters: None * * Returns: 0 on success * 1 on other error * ***********************************************************************/ int Contact_add_blob(struct Contact *c, struct ContactBlob *blob) { int i; for (i=0; iblob[i]) { continue; } c->blob[i] = malloc(sizeof(struct ContactBlob)); if (!c->blob[i]) return EXIT_FAILURE; c->blob[i]->data = malloc(blob->length); strncpy(c->blob[i]->type, blob->type, 4); c->blob[i]->length = blob->length; strncpy((char *)c->blob[i]->data, (char *)blob->data, blob->length); return EXIT_SUCCESS; } return EXIT_FAILURE; } /*********************************************************************** * * Function: Contact_add_picture * * Summary: Add a picture blob record to a Contact Record * This will add a blob, but not touch the picture structure * of the contact record * * Parameters: None * * Returns: 0 on success * 1 on other error * ***********************************************************************/ int Contact_add_picture(struct Contact *c, struct ContactPicture *p) { int i; if ((!p) || (p->length<1) || (!p->data)) { return EXIT_FAILURE; } for (i=0; iblob[i]) { continue; } c->blob[i] = malloc(sizeof(struct ContactBlob)); if (!c->blob[i]) return EXIT_FAILURE; c->blob[i]->data = malloc(p->length + 2); strncpy(c->blob[i]->type, BLOB_TYPE_PICTURE_ID, 4); c->blob[i]->length = p->length + 2; set_short(c->blob[i]->data, p->dirty); memcpy(c->blob[i]->data + 2, p->data, p->length); return EXIT_SUCCESS; } return EXIT_FAILURE; } /*********************************************************************** * * Function: unpack_ContactAppInfo * * Summary: Fill in the app info structure based on the raw app * info data * * Parameters: None * * Returns: -1 on error * The length of data used from the buffer on success * ***********************************************************************/ int unpack_ContactAppInfo(struct ContactAppInfo *ai, pi_buffer_t *buf) { int i, j, destlen; unsigned char *start, *Pbuf; int len; start = Pbuf = buf->data; len = buf->used; if (len == 1092) { ai->type = contacts_v10; ai->num_labels = NUM_CONTACT_V10_LABELS; ai->numCustoms = 9; /* not sure - but pi-contact.h <= 1.11 had 9 all the time */ } else if (len == 1156) { ai->type = contacts_v11; ai->num_labels = NUM_CONTACT_V11_LABELS; ai->numCustoms = 9; /* not sure - but pi-contact.h <= 1.11 had 9 all the time */ } else { fprintf(stderr, "contact.c: unpack_ContactAppInfo: ContactAppInfo size of %d incorrect\n", len); return -1; } /* 278 app info, 26 unknown, labels, county, sortBy */ destlen = 278 + 26 + (16 * ai->num_labels) + 2 + 2; if (buf->used < destlen) return -1; i = unpack_CategoryAppInfo(&ai->category, start, len); if (!i) return i; Pbuf += i; memcpy(ai->internal, Pbuf, 26); Pbuf += 26; memcpy(ai->labels, Pbuf, 16 * ai->num_labels); Pbuf += 16 * ai->num_labels; ai->country = get_byte(Pbuf); Pbuf += 2; ai->sortByCompany = get_byte(Pbuf); Pbuf += 2; /* These are the fields that go in drop down menus */ for (i = 4, j = 0; i < 11; i++, j++) { strcpy(ai->phoneLabels[j], ai->labels[i]); } strcpy(ai->phoneLabels[j], ai->labels[40]); for (i = 0; i < ai->numCustoms; i++) { strcpy(ai->customLabels[i], ai->labels[14 + i]); } strcpy(ai->addrLabels[0], ai->labels[23]); strcpy(ai->addrLabels[1], ai->labels[28]); strcpy(ai->addrLabels[2], ai->labels[33]); strcpy(ai->IMLabels[0], ai->labels[41]); strcpy(ai->IMLabels[1], ai->labels[42]); strcpy(ai->IMLabels[2], ai->labels[43]); strcpy(ai->IMLabels[3], ai->labels[44]); strcpy(ai->IMLabels[4], ai->labels[45]); return (Pbuf - start); } /*********************************************************************** * * Function: free_ContactAppInfo * * Summary: Unallocate dynamically sized parts of ContactAppInfo * (However, there are now none - provided for source compatibility) * * Parameters: struct ContactAppInfo *ai * * Returns: None * ***********************************************************************/ void free_ContactAppInfo (struct ContactAppInfo *ai) { } /*********************************************************************** * * Function: pack_ContactAppInfo * * Summary: Fill in the raw app info record data based on the * ContactAppInfo structure * * Parameters: None * * Returns: -1 on error * The length of the data used from the buffer on success. * ***********************************************************************/ int pack_ContactAppInfo(struct ContactAppInfo *ai, pi_buffer_t *buf) { int destlen; if (buf == NULL || buf->data == NULL) return -1; /* 278 app info, 26 unknown, labels, country, sortBy */ destlen = 278 + 26 + (16 * ai->num_labels) + 2 + 2; pi_buffer_expect(buf, destlen); buf->used = pack_CategoryAppInfo(&ai->category, buf->data, buf->allocated); if (buf->used != 278) return -1; pi_buffer_append(buf, ai->internal, 26); pi_buffer_append(buf, ai->labels, 16 * ai->num_labels); set_byte(buf->data + buf->used++, ai->country); /* Unknown field */ set_byte(buf->data + buf->used++, 0x00); set_byte(buf->data + buf->used++, ai->sortByCompany); /* Unknown field */ set_byte(buf->data + buf->used++, 0x00); return (buf->used); } pilot-link-0.12.5-dfsg/libpisock/pi-file.c0000644000175000017500000011413510513447542020562 0ustar rousseaurousseau/* * $Id: pi-file.c,v 1.72 2006/10/12 14:21:22 desrod Exp $ * * Pilot File Interface Library * Pace Willisson December 1996 * Additions by Kenneth Albanowski * Additions by Florent Pillet * * This is free software, licensed under the GNU Library Public License V2. * See the file COPYING.LIB for details. * * the following is extracted from the combined wisdom of * PDB by Kevin L. Flynn * install-prc by Brian J. Swetland, D. Jeff Dionne and Kenneth Albanowski * makedoc7 by Pat Beirne, * and the include files from the pilot SDK * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include "pi-debug.h" #include "pi-source.h" #include "pi-file.h" #include "pi-error.h" #undef FILEDEBUG #define pi_mktag(c1,c2,c3,c4) (((c1)<<24)|((c2)<<16)|((c3)<<8)|(c4)) /* header: 32 name 2 flags 2 version 4 creation time 4 modification time 4 backup time 4 modification number 4 app info offset 4 sort info offset 4 type 4 creator 4 uniq id seed (I think it is just garbage) 4 next record list id (normally 0, or ptr to extended hdr) 2 num records for this header Hypothetically plus 2 more bytes if an extended or perhaps secondary header (not supported) (In practice, this value is never set, instead it usually indicates a damaged file.) if the low bit of attr is on, then next thing is a list of resource entry descriptors: resource entry header 4 type 2 id 4 offset otherwise, if the low bit of attr is off, the next thing is a list of record entry decriptors: record entry header 4 offset 1 record attributes 3 unique id then two bytes of unknown purpose, \0\0 seems safe next, the app_info, if any, then the sort_info, if any then the space used the data. Every offset is an offset from the beginning of the file, and will point until this area. Each block starts at the given offset and ends at the beginning of the next block. The last block ends at the end of the file. */ #define PI_HDR_SIZE 78 #define PI_RESOURCE_ENT_SIZE 10 #define PI_RECORD_ENT_SIZE 8 /* Local prototypes */ static int pi_file_close_for_write(pi_file_t *pf); static void pi_file_free(pi_file_t *pf); static int pi_file_find_resource_by_type_id(const pi_file_t *pf, unsigned long restype, int resid, int *resindex); static pi_file_entry_t *pi_file_append_entry(pi_file_t *pf); static int pi_file_set_rbuf_size(pi_file_t *pf, size_t size); /* this seems to work, but what about leap years? */ /*#define PILOT_TIME_DELTA (((unsigned)(1970 - 1904) * 365 * 24 * 60 * 60) + 1450800)*/ /* Exact value of "Jan 1, 1970 0:00:00 GMT" - "Jan 1, 1904 0:00:00 GMT" */ #define PILOT_TIME_DELTA (unsigned)(2082844800) /* FIXME: These conversion functions apply no timezone correction. UNIX uses UTC for time_t's, while the Pilot uses local time for database backup time and appointments, etc. It is not particularly simple to convert between these in UNIX, especially since the Pilot's local time is unknown, and if syncing over political boundries, could easily be different then the local time on the UNIX box. Since the Pilot does not know what timezone it is in, there is no unambiguous way to correct for this. Worse, the creation date for a program is stored in the local time _of the computer which did the final linking of that program_. Again, the Pilot does not store the timezone information needed to reconstruct where/when this was. A better immediate tack would be to dissect these into struct tm's, and return those. --KJA */ time_t pilot_time_to_unix_time(unsigned long raw_time) { return (time_t) (raw_time - PILOT_TIME_DELTA); } unsigned long unix_time_to_pilot_time(time_t t) { return (unsigned long) ((unsigned long) t + PILOT_TIME_DELTA); } pi_file_t *pi_file_open(const char *name) { int i, file_size; pi_file_t *pf; struct DBInfo *ip; pi_file_entry_t *entp; unsigned char buf[PI_HDR_SIZE]; unsigned char *p; off_t offset, app_info_offset = 0, sort_info_offset = 0; if ((pf = calloc(1, sizeof (pi_file_t))) == NULL) return NULL; if ((pf->f = fopen(name, "rb")) == NULL) goto bad; fseek(pf->f, 0, SEEK_END); file_size = ftell(pf->f); fseek(pf->f, 0, SEEK_SET); if (fread(buf, PI_HDR_SIZE, 1, pf->f) != (size_t) 1) { LOG ((PI_DBG_API, PI_DBG_LVL_ERR, "FILE OPEN %s: can't read header\n", name)); goto bad; } p = buf; ip = &pf->info; memcpy(ip->name, p, 32); ip->flags = get_short(p + 32); ip->miscFlags = dlpDBMiscFlagRamBased; ip->version = get_short(p + 34); ip->createDate = pilot_time_to_unix_time(get_long(p + 36)); ip->modifyDate = pilot_time_to_unix_time(get_long(p + 40)); ip->backupDate = pilot_time_to_unix_time(get_long(p + 44)); ip->modnum = get_long(p + 48); app_info_offset = get_long(p + 52); sort_info_offset = get_long(p + 56); ip->type = get_long(p + 60); ip->creator = get_long(p + 64); pf->unique_id_seed = get_long(p + 68); /* record list header */ pf->next_record_list_id = get_long(p + 72); pf->num_entries = get_short(p + 76); LOG ((PI_DBG_API, PI_DBG_LVL_INFO, "FILE OPEN Name: '%s' Flags: 0x%4.4X Version: %d\n", ip->name, ip->flags, ip->version)); LOG ((PI_DBG_API, PI_DBG_LVL_DEBUG, " Creation date: %s", ctime(&ip->createDate))); LOG ((PI_DBG_API, PI_DBG_LVL_DEBUG, " Modification date: %s", ctime(&ip->modifyDate))); LOG ((PI_DBG_API, PI_DBG_LVL_DEBUG, " Backup date: %s", ctime(&ip->backupDate))); LOG ((PI_DBG_API, PI_DBG_LVL_DEBUG, " Appinfo Size: %d Sortinfo Size: %d\n", pf->app_info_size, pf->sort_info_size)); LOG ((PI_DBG_API, PI_DBG_LVL_DEBUG, " Type: '%s'", printlong(ip->type))); LOG ((PI_DBG_API, PI_DBG_LVL_DEBUG, " Creator: '%s' Seed: 0x%8.8lX\n", printlong(ip->creator), pf->unique_id_seed)); if (pf->next_record_list_id != 0) { LOG ((PI_DBG_API, PI_DBG_LVL_ERR, "FILE OPEN %s: this file is probably damaged\n", name)); goto bad; } if (ip->flags & dlpDBFlagResource) { pf->resource_flag = 1; pf->ent_hdr_size = PI_RESOURCE_ENT_SIZE; } else { pf->resource_flag = 0; pf->ent_hdr_size = PI_RECORD_ENT_SIZE; } if (pf->num_entries < 0) { LOG ((PI_DBG_API, PI_DBG_LVL_ERR, "FILE OPEN %s: bad header\n", name)); goto bad; } offset = file_size; if (pf->num_entries) { if ((pf->entries = calloc((size_t)pf->num_entries, sizeof *pf->entries)) == NULL) goto bad; for (i = 0, entp = pf->entries; i < pf->num_entries; i++, entp++) { if (fread(buf, (size_t) pf->ent_hdr_size, 1, pf->f) != (size_t) 1) goto bad; p = buf; if (pf->resource_flag) { entp->type = get_long(p); entp->resource_id = get_short(p + 4); entp->offset = get_long(p + 6); LOG ((PI_DBG_API, PI_DBG_LVL_DEBUG, "FILE OPEN Entry %d '%s' #%d @%X\n", i, printlong(entp->type), entp->resource_id, entp->offset)); } else { entp->offset = get_long(p); entp->attrs = get_byte(p + 4); entp->uid = get_treble(p + 5); LOG ((PI_DBG_API, PI_DBG_LVL_DEBUG, "FILE OPEN Entry %d UID: " "0x%8.8X Attrs: %2.2X Offset: @%X\n", i, (int) entp->uid, entp->attrs, entp->offset)); } } for (i = 0, entp = pf->entries + pf->num_entries - 1; i < pf->num_entries; i++, entp--) { entp->size = offset - entp->offset; offset = entp->offset; LOG ((PI_DBG_API, PI_DBG_LVL_DEBUG, "FILE OPEN Entry: %d Size: %d\n", pf->num_entries - i - 1, entp->size)); if (entp->size < 0 || (entp->offset + entp->size) > file_size) { LOG ((PI_DBG_API, PI_DBG_LVL_DEBUG, "FILE OPEN %s: Entry %d corrupt," " giving up\n", name, pf->num_entries - i - 1)); goto bad; } } } if (sort_info_offset) { pf->sort_info_size = offset - sort_info_offset; offset = sort_info_offset; } if (app_info_offset) { pf->app_info_size = offset - app_info_offset; offset = app_info_offset; } if (pf->app_info_size < 0 || (sort_info_offset + pf->sort_info_size) > file_size || pf->sort_info_size < 0 || (app_info_offset + pf->app_info_size) > file_size) { LOG ((PI_DBG_API, PI_DBG_LVL_ERR, "FILE OPEN %s: bad header " "(app_info @ %d size %d, " "sort_info @ %d size %d)\n", name, app_info_offset, pf->app_info_size, sort_info_offset, pf->sort_info_size)); goto bad; } if (pf->app_info_size == 0) pf->app_info = NULL; else { if ((pf->app_info = malloc((size_t) pf->app_info_size)) == NULL) goto bad; fseek(pf->f, (long)app_info_offset, SEEK_SET); if (fread(pf->app_info, 1, (size_t) pf->app_info_size, pf->f) != (size_t) pf->app_info_size) goto bad; } if (pf->sort_info_size == 0) pf->sort_info = NULL; else { if ((pf->sort_info = malloc((size_t)pf->sort_info_size)) == NULL) goto bad; fseek(pf->f, (long)sort_info_offset, SEEK_SET); if (fread(pf->sort_info, 1, (size_t) pf->sort_info_size, pf->f) != (size_t) pf->sort_info_size) goto bad; } return pf; bad: pi_file_close(pf); return NULL; } int pi_file_close(pi_file_t *pf) { int err; if (!pf) return PI_ERR_FILE_INVALID; if (pf->for_writing) pf->err = pi_file_close_for_write(pf); err = pf->err; pi_file_free(pf); return err; } void pi_file_get_info(const pi_file_t *pf, struct DBInfo *infop) { *infop = pf->info; } void pi_file_get_app_info(pi_file_t *pf, void **datap, size_t *sizep) { *datap = pf->app_info; *sizep = pf->app_info_size; } void pi_file_get_sort_info(pi_file_t *pf, void **datap, size_t *sizep) { *datap = pf->sort_info; *sizep = pf->sort_info_size; } int pi_file_read_resource_by_type_id(pi_file_t *pf, unsigned long restype, int resid, void **bufp, size_t *sizep, int *resindex) { int i, result; result = pi_file_find_resource_by_type_id(pf, restype, resid, &i); if (!result) return PI_ERR_FILE_NOT_FOUND; if (resindex) *resindex = i; return pi_file_read_resource(pf, i, bufp, sizep, NULL, NULL); } int pi_file_type_id_used(const pi_file_t *pf, unsigned long restype, int resid) { return pi_file_find_resource_by_type_id(pf, restype, resid, NULL); } int pi_file_read_resource(pi_file_t *pf, int i, void **bufp, size_t *sizep, unsigned long *type, int *idp) { pi_file_entry_t *entp; int result; if (pf->for_writing || !pf->resource_flag) return PI_ERR_FILE_INVALID; if (i < 0 || i >= pf->num_entries) return PI_ERR_GENERIC_ARGUMENT; entp = &pf->entries[i]; if (bufp) { if ((result = pi_file_set_rbuf_size(pf, (size_t) entp->size)) < 0) return result; fseek(pf->f, pf->entries[i].offset, SEEK_SET); if (fread(pf->rbuf, 1, (size_t) entp->size, pf->f) != (size_t) entp->size) return PI_ERR_FILE_ERROR; *bufp = pf->rbuf; } if (sizep) *sizep = entp->size; if (type) *type = entp->type; if (idp) *idp = entp->resource_id; return 0; } int pi_file_read_record(pi_file_t *pf, int recindex, void **bufp, size_t *sizep, int *recattrs, int *category, recordid_t * recuid) { int result; pi_file_entry_t *entp; if (pf->for_writing || pf->resource_flag) return PI_ERR_FILE_INVALID; if (recindex < 0 || recindex >= pf->num_entries) return PI_ERR_GENERIC_ARGUMENT; entp = &pf->entries[recindex]; if (bufp) { if ((result = pi_file_set_rbuf_size(pf, (size_t) entp->size)) < 0) { LOG((PI_DBG_API, PI_DBG_LVL_ERR, "FILE READ_RECORD Unable to set buffer size!\n")); return result; } fseek(pf->f, pf->entries[recindex].offset, SEEK_SET); if (fread(pf->rbuf, 1, (size_t) entp->size, pf->f) != (size_t) entp->size) { LOG((PI_DBG_API, PI_DBG_LVL_ERR, "FILE READ_RECORD Unable to read record!\n")); return PI_ERR_FILE_ERROR; } *bufp = pf->rbuf; } LOG ((PI_DBG_API, PI_DBG_LVL_INFO, "FILE READ_RECORD Record: %d Bytes: %d\n", recindex, entp->size)); if (sizep) *sizep = entp->size; if (recattrs) *recattrs = entp->attrs & 0xf0; if (category) *category = entp->attrs & 0xf; if (recuid) *recuid = entp->uid; return 0; } int pi_file_read_record_by_id(pi_file_t *pf, recordid_t uid, void **bufp, size_t *sizep, int *idxp, int *attrp, int *catp) { int i; struct pi_file_entry *entp; for (i = 0, entp = pf->entries; i < pf->num_entries; i++, entp++) { if (entp->uid == uid) { if (idxp) *idxp = i; return (pi_file_read_record (pf, i, bufp, sizep, attrp, catp, &uid)); } } return PI_ERR_FILE_NOT_FOUND; } int pi_file_id_used(const pi_file_t *pf, recordid_t uid) { int i; struct pi_file_entry *entp; for (i = 0, entp = pf->entries; i < pf->num_entries; i++, entp++) { if (entp->uid == uid) return 1; } return 0; } pi_file_t * pi_file_create(const char *name, const struct DBInfo *info) { pi_file_t *pf = calloc(1, sizeof(pi_file_t)); if (pf == NULL) return NULL; if ((pf->file_name = strdup(name)) == NULL) goto bad; pf->for_writing = 1; pf->info = *info; if (info->flags & dlpDBFlagResource) { pf->resource_flag = 1; pf->ent_hdr_size = PI_RESOURCE_ENT_SIZE; } else { pf->resource_flag = 0; pf->ent_hdr_size = PI_RECORD_ENT_SIZE; } pf->tmpbuf = pi_buffer_new(2048); if (pf->tmpbuf == NULL) goto bad; return (pf); bad: pi_file_free(pf); return NULL; } int pi_file_set_info(pi_file_t *pf, const struct DBInfo *ip) { if (!pf->for_writing) return PI_ERR_FILE_INVALID; if ((ip->flags & dlpDBFlagResource) != (pf->info.flags & dlpDBFlagResource)) return PI_ERR_FILE_INVALID; pf->info = *ip; return 0; } int pi_file_set_app_info(pi_file_t *pf, void *data, size_t size) { void *p; if (!size) { if (pf->app_info) free(pf->app_info); pf->app_info_size = 0; return 0; } if ((p = malloc(size)) == NULL) return PI_ERR_GENERIC_MEMORY; memcpy(p, data, size); if (pf->app_info) free(pf->app_info); pf->app_info = p; pf->app_info_size = size; return 0; } int pi_file_set_sort_info(pi_file_t *pf, void *data, size_t size) { void *p; if (!size) { if (pf->sort_info) free(pf->sort_info); pf->sort_info_size = 0; return 0; } if ((p = malloc(size)) == NULL) return PI_ERR_GENERIC_MEMORY; memcpy(p, data, size); if (pf->sort_info) free(pf->sort_info); pf->sort_info = p; pf->sort_info_size = size; return 0; } int pi_file_append_resource(pi_file_t *pf, void *data, size_t size, unsigned long restype, int resid) { pi_file_entry_t *entp; if (!pf->for_writing || !pf->resource_flag) return PI_ERR_FILE_INVALID; if (pi_file_type_id_used(pf, restype, resid)) return PI_ERR_FILE_ALREADY_EXISTS; entp = pi_file_append_entry(pf); if (entp == NULL) return PI_ERR_GENERIC_MEMORY; if (size && pi_buffer_append(pf->tmpbuf, data, size) == NULL) { pf->err = 1; return PI_ERR_GENERIC_MEMORY; } entp->size = size; entp->type = restype; entp->resource_id = resid; return size; } int pi_file_append_record(pi_file_t *pf, void *data, size_t size, int recattrs, int category, recordid_t recuid) { pi_file_entry_t *entp; if (!pf->for_writing || pf->resource_flag) return PI_ERR_FILE_INVALID; if (recuid && pi_file_id_used(pf, recuid)) return PI_ERR_FILE_ALREADY_EXISTS; entp = pi_file_append_entry(pf); if (entp == NULL) return PI_ERR_GENERIC_MEMORY; if (size && pi_buffer_append(pf->tmpbuf, data, size) == NULL) { pf->err = 1; return PI_ERR_GENERIC_MEMORY; } entp->size = size; entp->attrs = (recattrs & 0xf0) | (category & 0xf); entp->uid = recuid; return size; } void pi_file_get_entries(pi_file_t *pf, int *entries) { *entries = pf->num_entries; } int pi_file_retrieve(pi_file_t *pf, int socket, int cardno, progress_func report_progress) { int db = -1, result, old_device = 0; unsigned int j; struct DBInfo dbi; struct DBSizeInfo size_info; pi_buffer_t *buffer = NULL; pi_progress_t progress; pi_reset_errors(socket); memset(&size_info, 0, sizeof(size_info)); memset(&dbi, 0, sizeof(dbi)); /* Try to get more info on the database to retrieve. Note that * with some devices like the Tungsten T3 and shadowed databases * like AddressDB, the size_info is -wrong-. It doesn't reflect * the actual contents of the database except for the number of * records. Also, this call doesn't work pre-OS 3. */ if ((result = dlp_FindDBByName(socket, cardno, pf->info.name, NULL, NULL, &dbi, &size_info)) < 0) { if (result != PI_ERR_DLP_UNSUPPORTED) goto fail; old_device = 1; } if ((result = dlp_OpenDB (socket, cardno, dlpOpenRead | dlpOpenSecret, pf->info.name, &db)) < 0) goto fail; buffer = pi_buffer_new (DLP_BUF_SIZE); if (buffer == NULL) { result = pi_set_error(socket, PI_ERR_GENERIC_MEMORY); goto fail; } if (old_device) { int num_records; if ((result = dlp_ReadOpenDBInfo(socket, db, &num_records)) < 0) goto fail; size_info.numRecords = num_records; } memset(&progress, 0, sizeof(progress)); progress.type = PI_PROGRESS_RECEIVE_DB; progress.data.db.pf = pf; progress.data.db.size = size_info; if (size_info.appBlockSize || (dbi.miscFlags & dlpDBMiscFlagRamBased) || old_device) { /* what we're trying to do here is avoid trying to read an appBlock * from a ROM file, because this crashes on several devices. * Also, on several palmOne devices, the size info returned by the OS * is absolutely incorrect. This happens with some system shadow files * like AddressDB on T3, which actually do contain data and an appInfo * block but the system tells us there's no appInfo and nearly no data, * but still gives the accurate number of records. Seems to be bad * structure shadows in PACE. * In any case, the ultimate result is that: * 1. On devices pre-OS 3, we do always try to read the appInfo block * because dlp_FindDBByName() is unsupported so we can't find out if * there's an appInfo block * 2. On OS5+ devices, we're not sure that the appInfo size we have is * accurate. But if we try reading an appInfo block in ROM it may * crash the device * 3. Therefore, we only try to read the appInfo block if we are * working on a RAM file or we are sure that a ROM file has appInfo. */ result = dlp_ReadAppBlock(socket, db, 0, DLP_BUF_SIZE, buffer); if (result > 0) { pi_file_set_app_info(pf, buffer->data, (size_t)result); progress.transferred_bytes += result; if (report_progress && report_progress(socket, &progress) == PI_TRANSFER_STOP) { result = PI_ERR_FILE_ABORTED; goto fail; } } } if (pf->info.flags & dlpDBFlagResource) { for (j = 0; j < size_info.numRecords; j++) { int resource_id; unsigned long type; if ((result = dlp_ReadResourceByIndex(socket, db, j, buffer, &type, &resource_id)) < 0) goto fail; if ((result = pi_file_append_resource (pf, buffer->data, buffer->used, type, resource_id)) < 0) { pi_set_error(socket, result); goto fail; } progress.transferred_bytes += buffer->used; progress.data.db.transferred_records++; if (report_progress && report_progress(socket, &progress) == PI_TRANSFER_STOP) { result = pi_set_error(socket, PI_ERR_FILE_ABORTED); goto fail; } } } else for (j = 0; j < size_info.numRecords; j++) { int attr, category; unsigned long resource_id; if ((result = dlp_ReadRecordByIndex(socket, db, j, buffer, &resource_id, &attr, &category)) < 0) goto fail; progress.transferred_bytes += buffer->used; progress.data.db.transferred_records++; if (report_progress && report_progress(socket, &progress) == PI_TRANSFER_STOP) { result = pi_set_error(socket, PI_ERR_FILE_ABORTED); goto fail; } /* There is no way to restore records with these attributes, so there is no use in backing them up */ if (attr & (dlpRecAttrArchived | dlpRecAttrDeleted)) continue; if ((result = pi_file_append_record(pf, buffer->data, buffer->used, attr, category, resource_id)) < 0) { pi_set_error(socket, result); goto fail; } } pi_buffer_free(buffer); return dlp_CloseDB(socket, db); fail: if (db != -1 && pi_socket_connected(socket)) { int err = pi_error(socket); /* make sure we keep last error code */ int palmoserr = pi_palmos_error(socket); dlp_CloseDB(socket, db); pi_set_error(socket, err); /* then restore it afterwards */ pi_set_palmos_error(socket, palmoserr); } if (buffer != NULL) pi_buffer_free (buffer); if (result >= 0) { /* one of our pi_file* calls failed */ result = pi_set_error(socket, PI_ERR_FILE_ERROR); } return result; } int pi_file_install(pi_file_t *pf, int socket, int cardno, progress_func report_progress) { int db = -1, j, reset = 0, flags, version, freeai = 0, result, err1, err2; size_t l, size = 0; void *buffer; pi_progress_t progress; version = pi_version(socket); memset(&progress, 0, sizeof(progress)); progress.type = PI_PROGRESS_SEND_DB; progress.data.db.pf = pf; progress.data.db.size.numRecords = pf->num_entries; progress.data.db.size.dataBytes = pf->app_info_size; progress.data.db.size.appBlockSize = pf->app_info_size; progress.data.db.size.maxRecSize = pi_maxrecsize(socket); /* compute total size for progress reporting, and check that either records are 64k or less, or the handheld can accept large records. we do this prior to starting the install, to avoid messing the device up if we have to fail. */ for (j = 0; j < pf->num_entries; j++) { result = (pf->info.flags & dlpDBFlagResource) ? pi_file_read_resource(pf, j, 0, &size, 0, 0) : pi_file_read_record(pf, j, 0, &size, 0, 0, 0); if (result < 0) { LOG((PI_DBG_API, PI_DBG_LVL_ERR, "FILE INSTALL can't read all records/resources\n")); goto fail; } if (size > 65536 && version < 0x0104) { LOG((PI_DBG_API, PI_DBG_LVL_ERR, "FILE INSTALL Database contains" " record/resource over 64K!\n")); goto fail; } progress.data.db.size.dataBytes += size; } progress.data.db.size.totalBytes = progress.data.db.size.dataBytes + pf->ent_hdr_size * pf->num_entries + PI_HDR_SIZE + 2; /* Delete DB if it already exists */ dlp_DeleteDB(socket, cardno, pf->info.name); /* Set up DB flags */ flags = pf->info.flags; /* Judd - 25Nov99 - Graffiti hack We want to make sure that these 2 flags get set for this one */ if (pf->info.creator == pi_mktag('g', 'r', 'a', 'f')) { flags |= dlpDBFlagNewer; flags |= dlpDBFlagReset; } if (strcmp(pf->info.name, "Graffiti ShortCuts ") == 0) { flags |= 0x8000; /* Rewrite an open DB */ reset = 1; /* To be on the safe side */ } LOG((PI_DBG_API, PI_DBG_LVL_INFO, "FILE INSTALL Name: %s Flags: %8.8X\n", pf->info.name, flags)); /* Create DB */ if ((result = dlp_CreateDB (socket, pf->info.creator, pf->info.type, cardno, flags, pf->info.version, pf->info.name, &db)) < 0) { int retry = 0; /* Judd - 25Nov99 - Graffiti hack The dlpDBFlagNewer specifies that if a DB is open and cannot be deleted then it can be overwritten by a DB with a different name. The creator ID of "graf" is what really identifies a DB, not the name. We could call it JimBob and the palm would still find it and use it. */ if (strcmp(pf->info.name, "Graffiti ShortCuts ") == 0) { strcpy(pf->info.name, "Graffiti ShortCuts"); retry = 1; } else if (strcmp(pf->info.name, "Graffiti ShortCuts") == 0) { strcpy(pf->info.name, "Graffiti ShortCuts "); retry = 1; } else if (pf->info.creator == pi_mktag('g', 'r', 'a', 'f')) { /* Yep, someone has named it JimBob */ strcpy(pf->info.name, "Graffiti ShortCuts"); retry = 1; } if (retry) { /* Judd - 25Nov99 - Graffiti hack We changed the name, now we can try to write it again */ if ((result = dlp_CreateDB (socket, pf->info.creator, pf->info.type, cardno, flags, pf->info.version, pf->info.name, &db)) < 0) { return result; } } else { return result; } } pi_file_get_app_info(pf, &buffer, &l); /* Compensate for bug in OS 2.x Memo */ if (version > 0x0100 && strcmp(pf->info.name, "MemoDB") == 0 && l > 0 && l < 282) { /* Justification: The appInfo structure was accidentally lengthend in OS 2.0, but the Memo application does not check that it is long enough, hence the shorter block from OS 1.x will cause the 2.0 Memo application to lock up if the sort preferences are modified. This code detects the installation of a short app info block on a 2.0 machine, and lengthens it. This transformation will never lose information. */ void *b2 = calloc(1, 282); memcpy(b2, buffer, (size_t)l); buffer = b2; progress.data.db.size.appBlockSize = 282; l = 282; freeai = 1; } /* All system updates seen to have the 'ptch' type, so trigger a reboot on those */ if (pf->info.creator == pi_mktag('p', 't', 'c', 'h')) reset = 1; if (pf->info.flags & dlpDBFlagReset) reset = 1; /* Upload appInfo block */ if (l > 0) { if ((result = dlp_WriteAppBlock(socket, db, buffer, l)) < 0) { if (freeai) free(buffer); goto fail; } if (freeai) free(buffer); progress.transferred_bytes = l; if (report_progress && report_progress(socket, &progress) == PI_TRANSFER_STOP) { result = pi_set_error(socket, PI_ERR_FILE_ABORTED); goto fail; } } /* Upload resources / records */ if (pf->info.flags & dlpDBFlagResource) { for (j = 0; j < pf->num_entries; j++) { int resource_id; unsigned long type; if ((result = pi_file_read_resource(pf, j, &buffer, &size, &type, &resource_id)) < 0) goto fail; /* Skip empty resource, it cannot be installed */ if (size == 0) continue; if ((result = dlp_WriteResource(socket, db, type, resource_id, buffer, size)) < 0) goto fail; progress.transferred_bytes += size; progress.data.db.transferred_records++; if (report_progress && report_progress(socket, &progress) == PI_TRANSFER_STOP) { result = pi_set_error(socket, PI_ERR_FILE_ABORTED); goto fail; } /* If we see a 'boot' section, regardless of file type, require reset */ if (type == pi_mktag('b', 'o', 'o', 't')) reset = 1; } } else { for (j = 0; j < pf->num_entries; j++) { int attr, category; unsigned long resource_id; if ((result = pi_file_read_record(pf, j, &buffer, &size, &attr, &category, &resource_id)) < 0) goto fail; /* Old OS version cannot install deleted records, so don't even try */ if ((attr & (dlpRecAttrArchived | dlpRecAttrDeleted)) && version < 0x0101) continue; if ((result = dlp_WriteRecord(socket, db, attr, resource_id, category, buffer, size, 0)) < 0) goto fail; progress.transferred_bytes += size; progress.data.db.transferred_records++; if (report_progress && report_progress(socket, &progress) == PI_TRANSFER_STOP) { result = pi_set_error(socket, PI_ERR_FILE_ABORTED); goto fail; } } } if (reset) dlp_ResetSystem(socket); return dlp_CloseDB(socket, db); fail: /* save error codes then restore them after closing/deleting the DB */ err1 = pi_error(socket); err2 = pi_palmos_error(socket); LOG((PI_DBG_API, PI_DBG_LVL_ERR, "FILE INSTALL error: pilot-link " "0x%04x, PalmOS 0x%04x\n", err1, err2)); if (db != -1 && pi_socket_connected(socket)) dlp_CloseDB(socket, db); if (pi_socket_connected(socket)) dlp_DeleteDB(socket, cardno, pf->info.name); pi_set_error(socket, err1); pi_set_palmos_error(socket, err2); if (result >= 0) result = pi_set_error(socket, PI_ERR_FILE_ERROR); return result; } int pi_file_merge(pi_file_t *pf, int socket, int cardno, progress_func report_progress) { int db = -1, j, reset = 0, version, result; void *buffer; size_t size; pi_progress_t progress; version = pi_version(socket); memset(&progress, 0, sizeof(progress)); progress.type = PI_PROGRESS_SEND_DB; progress.data.db.pf = pf; progress.data.db.size.numRecords = pf->num_entries; progress.data.db.size.dataBytes = pf->app_info_size; progress.data.db.size.appBlockSize = pf->app_info_size; progress.data.db.size.maxRecSize = pi_maxrecsize(socket); if (dlp_OpenDB(socket, cardno, dlpOpenReadWrite | dlpOpenSecret, pf->info.name, &db) < 0) return pi_file_install(pf, socket, cardno, report_progress); /* compute total size for progress reporting, and check that either records are 64k or less, or the handheld can accept large records. we do this prior to starting the install, to avoid messing the device up if we have to fail. */ for (j = 0; j < pf->num_entries; j++) { result = (pf->info.flags & dlpDBFlagResource) ? pi_file_read_resource(pf, j, 0, &size, 0, 0) : pi_file_read_record(pf, j, 0, &size, 0, 0, 0); if (result < 0) { LOG((PI_DBG_API, PI_DBG_LVL_ERR, "FILE INSTALL can't read all records/resources\n")); goto fail; } if (size > 65536 && version < 0x0104) { LOG((PI_DBG_API, PI_DBG_LVL_ERR, "FILE INSTALL Database contains" " record/resource over 64K!\n")); result = pi_set_error(socket, PI_ERR_DLP_DATASIZE); goto fail; } progress.data.db.size.dataBytes += size; } progress.data.db.size.totalBytes = progress.data.db.size.dataBytes + pf->ent_hdr_size * pf->num_entries + PI_HDR_SIZE + 2; /* All system updates seen to have the 'ptch' type, so trigger a reboot on those */ if (pf->info.creator == pi_mktag('p', 't', 'c', 'h')) reset = 1; if (pf->info.flags & dlpDBFlagReset) reset = 1; /* Upload resources / records */ if (pf->info.flags & dlpDBFlagResource) { for (j = 0; j < pf->num_entries; j++) { int resource_id; unsigned long type; if ((result = pi_file_read_resource (pf, j, &buffer, &size, &type, &resource_id)) < 0) goto fail; if (size == 0) continue; if ((result = dlp_WriteResource (socket, db, type, resource_id, buffer, size)) < 0) goto fail; progress.transferred_bytes += size; progress.data.db.transferred_records++; if (report_progress && report_progress(socket, &progress) == PI_TRANSFER_STOP) { result = pi_set_error(socket, PI_ERR_FILE_ABORTED); goto fail; } /* If we see a 'boot' section, regardless of file type, require reset */ if (type == pi_mktag('b', 'o', 'o', 't')) reset = 1; } } else { for (j = 0; j < pf->num_entries; j++) { int attr, category; unsigned long resource_id; if ((result = pi_file_read_record(pf, j, &buffer, &size, &attr, &category, &resource_id)) < 0) goto fail; /* Old OS version cannot install deleted records, so don't even try */ if ((attr & (dlpRecAttrArchived | dlpRecAttrDeleted)) && version < 0x0101) continue; if ((result = dlp_WriteRecord(socket, db, attr, 0, category, buffer, size, 0)) < 0) goto fail; progress.transferred_bytes += size; progress.data.db.transferred_records++; if (report_progress && report_progress(socket, &progress) == PI_TRANSFER_STOP) { result = PI_ERR_FILE_ABORTED; goto fail; } } } if (reset) dlp_ResetSystem(socket); return dlp_CloseDB(socket, db); fail: if (db != -1 && pi_socket_connected(socket)) { int err1 = pi_error(socket); int err2 = pi_palmos_error(socket); dlp_CloseDB(socket, db); pi_set_error(socket, err1); pi_set_palmos_error(socket, err2); } if (result >= 0) result = pi_set_error(socket, PI_ERR_FILE_ERROR); return result; } /*********************************************************************************/ /* */ /* INTERNAL FUNCTIONS */ /* */ /*********************************************************************************/ /*********************************************************************** * * Function: pi_file_close_for_write * * Summary: Writes a file to disk * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int pi_file_close_for_write(pi_file_t *pf) { int i, offset; FILE *f; struct DBInfo *ip; struct pi_file_entry *entp; struct stat sbuf; unsigned char buf[512]; unsigned char *p; ip = &pf->info; if (pf->num_entries >= 64 * 1024) { LOG((PI_DBG_API, PI_DBG_LVL_ERR, "pi_file_close_for_write: too many entries " "for this implentation of pi-file: %d\n", pf->num_entries)); return PI_ERR_FILE_INVALID; } /* * Unlink instead of overwriting. * For the case of something along the lines of: * cp -lav backup_2005_05_27 backup_2005_05_28 * Then updating the new copy. * -- Warp. */ if (!stat (pf->file_name, &sbuf)) if (S_ISREG(sbuf.st_mode)) unlink (pf->file_name); if ((f = fopen(pf->file_name, "wb")) == NULL) return PI_ERR_FILE_ERROR; ip = &pf->info; offset = PI_HDR_SIZE + pf->num_entries * pf->ent_hdr_size + 2; p = buf; memcpy(p, ip->name, 32); set_short(p + 32, ip->flags); set_short(p + 34, ip->version); set_long(p + 36, unix_time_to_pilot_time(ip->createDate)); set_long(p + 40, unix_time_to_pilot_time(ip->modifyDate)); set_long(p + 44, unix_time_to_pilot_time(ip->backupDate)); set_long(p + 48, ip->modnum); set_long(p + 52, pf->app_info_size ? offset : 0); offset += pf->app_info_size; set_long(p + 56, pf->sort_info_size ? offset : 0); offset += pf->sort_info_size; set_long(p + 60, ip->type); set_long(p + 64, ip->creator); set_long(p + 68, pf->unique_id_seed); set_long(p + 72, pf->next_record_list_id); set_short(p + 76, pf->num_entries); if (fwrite(buf, PI_HDR_SIZE, 1, f) != 1) goto bad; for (i = 0, entp = pf->entries; i < pf->num_entries; i++, entp++) { entp->offset = offset; p = buf; if (pf->resource_flag) { set_long(p, entp->type); set_short(p + 4, entp->resource_id); set_long(p + 6, entp->offset); } else { set_long(p, entp->offset); set_byte(p + 4, entp->attrs); set_treble(p + 5, entp->uid); } if (fwrite(buf, (size_t) pf->ent_hdr_size, 1, f) != 1) goto bad; offset += entp->size; } /* This may just be packing */ fwrite("\0\0", 1, 2, f); if (pf->app_info && (fwrite(pf->app_info, 1,(size_t) pf->app_info_size, f) != (size_t) pf->app_info_size)) goto bad; if (pf->sort_info && (fwrite(pf->sort_info, 1, (size_t) pf->sort_info_size, f) != (size_t) pf->sort_info_size)) goto bad; fwrite(pf->tmpbuf->data, pf->tmpbuf->used, 1, f); fflush(f); if (ferror(f) || feof(f)) goto bad; fclose(f); return 0; bad: fclose(f); return PI_ERR_FILE_ERROR; } /*********************************************************************** * * Function: pi_file_free * * Summary: Flush and clean the file handles used * * Parameters: file handle pi_file_t* * * Returns: void * ***********************************************************************/ static void pi_file_free(pi_file_t *pf) { ASSERT (pf != NULL); if (pf->f != 0) fclose(pf->f); if (pf->app_info != NULL) free(pf->app_info); if (pf->sort_info != NULL) free(pf->sort_info); if (pf->entries != NULL) free(pf->entries); if (pf->file_name != NULL) free(pf->file_name); if (pf->rbuf != NULL) free(pf->rbuf); if (pf->tmpbuf != NULL) pi_buffer_free(pf->tmpbuf); /* in case caller forgets the struct has been freed... */ memset(pf, 0, sizeof(pi_file_t)); free(pf); } /*********************************************************************** * * Function: pi_file_set_rbuf_size * * Summary: set pi_file rbuf size * * Parameters: file handle pi_file_t*, rbuf size * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int pi_file_set_rbuf_size(pi_file_t *pf, size_t size) { size_t new_size; void *rbuf; if (size > (size_t)pf->rbuf_size) { if (pf->rbuf_size == 0) { new_size = size + 2048; rbuf = malloc(new_size); } else { new_size = size + 2048; rbuf = realloc(pf->rbuf, new_size); } if (rbuf == NULL) return PI_ERR_GENERIC_MEMORY; pf->rbuf_size = new_size; pf->rbuf = rbuf; } return 0; } /*********************************************************************** * * Function: pi_file_append_entry * * Summary: Internal function to extend entry list if necessary, * and return a pointer to the next available slot * * Parameters: None * * Returns: NULL on allocation error * ***********************************************************************/ static pi_file_entry_t *pi_file_append_entry(pi_file_t *pf) { int new_count; size_t new_size; struct pi_file_entry *new_entries; struct pi_file_entry *entp; if (pf->num_entries >= pf->num_entries_allocated) { if (pf->num_entries_allocated == 0) new_count = 100; else new_count = pf->num_entries_allocated * 3 / 2; new_size = new_count * sizeof *pf->entries; if (pf->entries == NULL) new_entries = malloc(new_size); else new_entries = realloc(pf->entries, new_size); if (new_entries == NULL) return NULL; pf->num_entries_allocated = new_count; pf->entries = new_entries; } entp = &pf->entries[pf->num_entries++]; memset(entp, 0, sizeof *entp); return entp; } static int pi_file_find_resource_by_type_id(const pi_file_t *pf, unsigned long restype, int resid, int *resindex) { int i; struct pi_file_entry *entp; if (!pf->resource_flag) return PI_ERR_FILE_INVALID; for (i = 0, entp = pf->entries; i < pf->num_entries; i++, entp++) { if (entp->type == restype && entp->resource_id == resid) { if (resindex) *resindex = i; return 1; } } return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/dlp.c0000644000175000017500000036365410552545410020024 0ustar rousseaurousseau/* * $Id: dlp.c,v 1.139 2006/11/07 20:42:36 adridg Exp $ * * dlp.c: Palm DLP protocol * * Copyright (c) 1996, 1997, Kenneth Albanowski * Copyright (c) 1998-2003, David Desrosiers, JP Rosevear and others * Copyright (c) 2004, 2005, 2006, Florent Pillet * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this 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 #include #include #ifdef HAVE_ERRNO_H #include #ifndef ENOMSG #define ENOMSG EINVAL /* For systems that don't provide ENOMSG. Use EINVAL instead. */ #endif #endif #include #include #include "pi-debug.h" #include "pi-source.h" #include "pi-dlp.h" #include "pi-syspkt.h" #define DLP_REQUEST_DATA(req, arg, offset) &req->argv[arg]->data[offset] #define DLP_RESPONSE_DATA(res, arg, offset) &res->argv[arg]->data[offset] #define get_date(ptr) (dlp_ptohdate((ptr))) #define set_date(ptr,val) (dlp_htopdate((val),(ptr))) #define RequireDLPVersion(sd,major,minor) \ if (pi_version(sd) < (((major)<<8) | (minor))) \ return dlpErrNotSupp /* This constant is being used during dlp_ReadResourceByType, dlp_ReadResourceByIndex, dlp_ReadRecordById, and dlp_ReadRecordByIndex * Scott Gruby discovered that on some devices, reading a record that has the maximum record size can lock up the device. * We'll read large records in two steps, getting the small amount of remaining data the second time. * Scott's tests showed that the value above (100 bytes) was enough of a safeguard to prevent device lockup */ #define RECORD_READ_SAFEGUARD_SIZE 100 /* Define prototypes */ #ifdef PI_DEBUG static void record_dump (unsigned long recID, unsigned int recIndex, int flags, int catID, const char *data, int data_len); #endif char *dlp_errorlist[] = { "No error", "General System error", "Illegal Function", "Out of memory", "Invalid parameter", "Not found", "None Open", "Already Open", "Too many Open", "Already Exists", "Cannot Open", "Record deleted", "Record busy", "Operation not supported", "-Unused-", "Read only", "Not enough space", "Limit exceeded", "Sync cancelled", "Bad arg wrapper", "Argument missing", "Bad argument size" }; /* Look at "Error codes" in VFSMgr.h in the Palm SDK for their implementation */ char * vfs_errorlist[] = { "No error", "Buffer Overflow", "Generic file error", "File reference is invalid", "File still open", "Permission denied", "File or folder already exists", "FileEOF", "File not found", "volumereference is invalid", "Volume still mounted", "No filesystem", "Bad data", "Non-empty directory", "Invalid path or filename", "Volume full - not enough space", "Unimplemented", "Not a directory", "Is a directory", "Directory not found", "Name truncated" }; /* Look at "Error codes" in ExpansionMgr.h in the Palm SDK for their implementation */ char * exp_errorlist[] = { "No error", "Unsupported Operation", "Not enough Power", "Card not present", "Invalid slotreference number", "Slot deallocated", "Card no sector read/write", "Card read only", "Card bad sector", "Protected sector", "Not open (slot driver)", "still open (slot driver)", "Unimplemented", "Enumeration empty", "Incompatible API version" }; #ifdef DLP_TRACE static int dlp_trace = 0; #endif static int dlp_version_major = PI_DLP_VERSION_MAJOR; static int dlp_version_minor = PI_DLP_VERSION_MINOR; #ifdef PI_DEBUG #define Trace(name) \ LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP sd=%d %s\n", sd, #name)); #ifdef __GNUC__ #define TraceX(name,format,...) \ LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP sd=%d %s " #format "\n", sd, #name, __VA_ARGS__)); #else #define TraceX(name,format,...) \ LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP sd=%d %s\n", sd, #name)); #endif #else #define Trace(name) #define TraceX(name,format,...) #endif #ifdef PI_DEBUG static void record_dump (unsigned long recID, unsigned int recIndex, int flags, int catID, const char *data, int data_len) { LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " ID: 0x%8.8lX, Index: %u, Category: %d\n" " Flags:%s%s%s%s%s%s (0x%2.2X), and %d bytes:\n", (unsigned long) recID, recIndex, catID, (flags & dlpRecAttrDeleted) ? " Deleted" : "", (flags & dlpRecAttrDirty) ? " Dirty" : "", (flags & dlpRecAttrBusy) ? " Busy" : "", (flags & dlpRecAttrSecret) ? " Secret" : "", (flags & dlpRecAttrArchived) ? " Archive" : "", (!flags) ? " None" : "", flags, data_len)); pi_dumpdata(data, (size_t)data_len); } #endif void dlp_set_protocol_version(int major, int minor) { dlp_version_major = major; dlp_version_minor = minor; } /*************************************************************************** * * Function: dlp_strerror * * Summary: lookup text for dlp error * * Parameters: error number * * Returns: char* to error text string * ***************************************************************************/ char *dlp_strerror(int error) { if (error < 0) error = -error; if ((unsigned int) error >= (sizeof(dlp_errorlist)/(sizeof(char *)))) return "Unknown error"; return dlp_errorlist[error]; } /*************************************************************************** * * Function: dlp_arg_new * * Summary: create a dlpArg instance * * Parameters: id_, length of data * * Returns: dlpArg* or NULL on failure * ***************************************************************************/ struct dlpArg *dlp_arg_new (int argID, size_t len) { struct dlpArg *arg; arg = (struct dlpArg *)malloc(sizeof (struct dlpArg)); if (arg != NULL) { arg->id_ = argID; arg->len = len; arg->data = NULL; if (len > 0) { arg->data = (char *)malloc (len); if (arg->data == NULL) { free(arg); arg = NULL; } } } return arg; } /*************************************************************************** * * Function: dlp_arg_free * * Summary: frees a dlpArg instance * * Parameters: dlpArg* * * Returns: void * ***************************************************************************/ void dlp_arg_free (struct dlpArg *arg) { if (arg != NULL) { if (arg->data != NULL) free (arg->data); free (arg); } } /*************************************************************************** * * Function: dlp_arg_len * * Summary: computes aggregate length of data members associated with an * array of dlpArg instances * * Parameters: number of dlpArg instances, dlpArg** * * Returns: aggregate length or -1 on error * ***************************************************************************/ int dlp_arg_len (int argc, struct dlpArg **argv) { int i, len = 0; for (i = 0; i < argc; i++) { struct dlpArg *arg = argv[i]; /* FIXME: shapiro: should these be < or <= ??? */ if (arg->len < PI_DLP_ARG_TINY_LEN && (arg->id_ & (PI_DLP_ARG_FLAG_SHORT | PI_DLP_ARG_FLAG_LONG)) == 0) len += 2; else if (arg->len < PI_DLP_ARG_SHORT_LEN && (arg->id_ & PI_DLP_ARG_FLAG_LONG) == 0) len += 4; else len += 6; len += arg->len; } return len; } /*************************************************************************** * * Function: dlp_request_new * * Summary: creates a new dlpRequest instance * * Parameters: dlpFunction command, number of dlpArgs, lengths of dlpArgs * data member * * Returns: dlpRequest* or NULL if failure * ***************************************************************************/ struct dlpRequest* dlp_request_new (enum dlpFunctions cmd, int argc, ...) { struct dlpRequest *req; va_list ap; int i, j; req = (struct dlpRequest *)malloc (sizeof (struct dlpRequest)); if (req != NULL) { req->cmd = cmd; req->argc = argc; req->argv = NULL; if (argc) { req->argv = (struct dlpArg **) malloc (sizeof (struct dlpArg *) * argc); if (req->argv == NULL) { free(req); return NULL; } } va_start (ap, argc); for (i = 0; i < argc; i++) { size_t len; len = va_arg (ap, size_t); req->argv[i] = dlp_arg_new (PI_DLP_ARG_FIRST_ID + i, len); if (req->argv[i] == NULL) { for (j = 0; j < i; j++) dlp_arg_free(req->argv[j]); free(req->argv); free(req); req = NULL; break; } } va_end (ap); } return req; } /*************************************************************************** * * Function: dlp_request_new_with_argid * * Summary: creates a new dlpRequest instance with argid * * Parameters: dlpFunction command, number of dlpArgs, argid, lengths of * dlpArgs data member * * Returns: dlpRequest* or NULL if failure * ***************************************************************************/ struct dlpRequest* dlp_request_new_with_argid (enum dlpFunctions cmd, int argid, int argc, ...) { struct dlpRequest *req; va_list ap; int i, j; req = (struct dlpRequest *) malloc (sizeof (struct dlpRequest)); if (req != NULL) { req->cmd = cmd; req->argc = argc; req->argv = NULL; if (argc) { req->argv = (struct dlpArg **) malloc (sizeof (struct dlpArg *) * argc); if (req->argv == NULL) { free(req); return NULL; } } va_start (ap, argc); for (i = 0; i < argc; i++) { size_t len; len = va_arg (ap, size_t); req->argv[i] = dlp_arg_new (argid + i, len); if (req->argv[i] == NULL) { for (j = 0; j < i; j++) dlp_arg_free(req->argv[j]); free(req->argv); free(req); req = NULL; break; } } va_end (ap); } return req; } /*************************************************************************** * * Function: dlp_response_new * * Summary: creates a new dlpResponse instance * * Parameters: dlpFunction command, number of dlpArg instances * * Returns: dlpResponse* or NULL if failure * ***************************************************************************/ struct dlpResponse *dlp_response_new (enum dlpFunctions cmd, int argc) { struct dlpResponse *res; res = (struct dlpResponse *) malloc (sizeof (struct dlpResponse)); if (res != NULL) { res->cmd = cmd; res->err = dlpErrNoError; res->argc = argc; res->argv = NULL; if (argc) { res->argv = (struct dlpArg **) malloc (sizeof (struct dlpArg *) * argc); if (res->argv == NULL) { free(res); return NULL; } /* zero-out argv so that in case of error during response read, dlp_response_free() won't try to free uninitialized ptrs */ memset(res->argv, 0, sizeof (struct dlpArg *) * argc); } } return res; } /*************************************************************************** * * Function: dlp_response_read * * Summary: reads dlp response * * Parameters: dlpResonse**, sd * * Returns: first dlpArg response length or -1 on error * ***************************************************************************/ ssize_t dlp_response_read (struct dlpResponse **res, int sd) { struct dlpResponse *response; unsigned char *buf; short argid; int i; ssize_t bytes; size_t len; pi_buffer_t *dlp_buf; dlp_buf = pi_buffer_new (DLP_BUF_SIZE); if (dlp_buf == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); bytes = pi_read (sd, dlp_buf, dlp_buf->allocated); /* buffer will grow as needed */ if (bytes < 0) { pi_buffer_free (dlp_buf); return bytes; } if (bytes < 4) { /* packet is probably incomplete */ #ifdef DEBUG LOG((PI_DBG_DLP, PI_DBG_LVL_ERR, "dlp_response_read: response too short (%d bytes)\n", bytes)); if (bytes) pi_dumpdata(dlp_buf->data, (size_t)dlp_buf->used); #endif return pi_set_error(sd, PI_ERR_DLP_COMMAND); } response = dlp_response_new ((enum dlpFunctions)(dlp_buf->data[0] & 0x7f), dlp_buf->data[1]); *res = response; /* note that in case an error occurs, we do not deallocate the response since callers already do it under all circumstances */ if (response == NULL) { pi_buffer_free (dlp_buf); return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); } response->err = (enum dlpErrors) get_short (&dlp_buf->data[2]); pi_set_palmos_error(sd, (int)response->err); /* FIXME: add bounds checking to make sure we don't access past * the end of the buffer in case the data is corrupt */ buf = dlp_buf->data + 4; for (i = 0; i < response->argc; i++) { argid = get_byte (buf) & 0x3f; if (get_byte(buf) & PI_DLP_ARG_FLAG_LONG) { if (pi_version(sd) < 0x0104) { /* we received a response from a device indicating that it would have transmitted a >64k data block but DLP versions prior to 1.4 don't have this capacity. In this case (as observed on a T3), there is NO length stored after the argid, it goes straigt to the data contents. We need to report that the data is too large to be transferred. */ pi_buffer_free (dlp_buf); return pi_set_error(sd, PI_ERR_DLP_DATASIZE); } len = get_long (&buf[2]); buf += 6; } else if (get_byte(buf) & PI_DLP_ARG_FLAG_SHORT) { len = get_short (&buf[2]); buf += 4; } else { argid = get_byte(buf); len = get_byte(&buf[1]); buf += 2; } response->argv[i] = dlp_arg_new (argid, len); if (response->argv[i] == NULL) { pi_buffer_free (dlp_buf); return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); } memcpy (response->argv[i]->data, buf, len); buf += len; } pi_buffer_free (dlp_buf); return response->argc ? response->argv[0]->len : 0; } /*************************************************************************** * * Function: dlp_request_write * * Summary: writes dlp request * * Parameters: dlpRequest**, sd * * Returns: response length or -1 on error * ***************************************************************************/ ssize_t dlp_request_write (struct dlpRequest *req, int sd) { unsigned char *exec_buf, *buf; int i; size_t len; len = dlp_arg_len (req->argc, req->argv) + 2; exec_buf = (unsigned char *) malloc (sizeof (unsigned char) * len); if (exec_buf == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte (&exec_buf[PI_DLP_OFFSET_CMD], req->cmd); set_byte (&exec_buf[PI_DLP_OFFSET_ARGC], req->argc); buf = &exec_buf[PI_DLP_OFFSET_ARGV]; for (i = 0; i < req->argc; i++) { struct dlpArg *arg = req->argv[i]; short argid = arg->id_; if (arg->len < PI_DLP_ARG_TINY_LEN && (argid & (PI_DLP_ARG_FLAG_SHORT | PI_DLP_ARG_FLAG_LONG)) == 0) { set_byte(&buf[0], argid | PI_DLP_ARG_FLAG_TINY); set_byte(&buf[1], arg->len); memcpy(&buf[2], arg->data, arg->len); buf += arg->len + 2; } else if (arg->len < PI_DLP_ARG_SHORT_LEN && (argid & PI_DLP_ARG_FLAG_LONG) == 0) { set_byte(&buf[0], argid | PI_DLP_ARG_FLAG_SHORT); set_byte(&buf[1], 0); set_short(&buf[2], arg->len); memcpy (&buf[4], arg->data, arg->len); buf += arg->len + 4; } else { set_byte (&buf[0], argid | PI_DLP_ARG_FLAG_LONG); set_byte(&buf[1], 0); set_long (&buf[2], arg->len); memcpy (&buf[6], arg->data, arg->len); buf += arg->len + 6; } } pi_flush(sd, PI_FLUSH_INPUT); if ((i = pi_write(sd, exec_buf, len)) < (ssize_t)len) { errno = -EIO; if (i >= 0 && i < (ssize_t)len) i = -1; } free (exec_buf); return i; } /*************************************************************************** * * Function: dlp_request_free * * Summary: frees a dlpRequest instance * * Parameters: dlpRequest* * * Returns: void * ***************************************************************************/ void dlp_request_free (struct dlpRequest *req) { int i; if (req == NULL) return; if (req->argv != NULL) { for (i = 0; i < req->argc; i++) { if (req->argv[i] != NULL) dlp_arg_free (req->argv[i]); } free (req->argv); } free (req); } /*************************************************************************** * * Function: dlp_response_free * * Summary: frees a dlpResponse instance * * Parameters: dlpResponse* * * Returns: void * ***************************************************************************/ void dlp_response_free (struct dlpResponse *res) { int i; if (res == NULL) return; if (res->argv != NULL) { for (i = 0; i < res->argc; i++) { if (res->argv[i] != NULL) dlp_arg_free (res->argv[i]); } free (res->argv); } free (res); } /*************************************************************************** * * Function: dlp_exec * * Summary: writes a dlp request and reads the response * * Parameters: dlpResponse* * * Returns: the number of response bytes, or -1 on error * ***************************************************************************/ int dlp_exec(int sd, struct dlpRequest *req, struct dlpResponse **res) { int bytes, result; *res = NULL; if ((result = dlp_request_write (req, sd)) < req->argc) { LOG((PI_DBG_DLP, PI_DBG_LVL_ERR, "DLP sd:%i dlp_request_write returned %i\n", sd, result)); errno = -EIO; return result; } if ((bytes = dlp_response_read (res, sd)) < 0) { LOG((PI_DBG_DLP, PI_DBG_LVL_ERR, "DLP sd:%i dlp_response_read returned %i\n", sd, bytes)); errno = -EIO; return bytes; } /* Check to make sure the response is for this command */ if ((*res)->cmd != req->cmd) { /* The Palm m130 and Tungsten T return the wrong code for VFSVolumeInfo */ /* Tungsten T5 (and maybe Treo 650) return dlpFuncEndOfSync for dlpFuncWriteResource */ /* In some cases, the Tapwave Zodiac returns dlpFuncReadRecord instead of dlpFuncReadRecordEx */ if ((req->cmd != dlpFuncVFSVolumeInfo || (*res)->cmd != dlpFuncVFSVolumeSize) && req->cmd != dlpFuncWriteResource /* T5 */ && req->cmd != dlpFuncReadRecord /* Zodiac */ && req->cmd != dlpFuncReadRecordEx) /* Zodiac */ { errno = -ENOMSG; LOG((PI_DBG_DLP, PI_DBG_LVL_DEBUG, "dlp_exec: result CMD 0x%02x doesn't match requested cmd 0x%02x\n", (unsigned)((*res)->cmd), (unsigned)req->cmd)); return pi_set_error(sd, PI_ERR_DLP_COMMAND); } } /* Check to make sure there was no error */ if ((*res)->err != dlpErrNoError) { errno = -ENOMSG; pi_set_palmos_error(sd, (int)((*res)->err)); return pi_set_error(sd, PI_ERR_DLP_PALMOS); } return bytes; } /* These conversion functions are strictly for use within the DLP layer. This particular date/time format does not occur anywhere else within the Palm or its communications. */ /* Notice: The dates in the DLP protocol are expressed as absolute dates/times, without any time zone information. For example if a file was created on the device at 19:32:48, the time members will be 19, 32 and 48. This simplifies things a lot since we don't need to to time zone conversions. The functions below convert a breakdown DLP date to and from a time_t expressed in the machine's local timezone. -- FP */ time_t dlp_ptohdate(const unsigned char *data) { struct tm t; /* Seems like year comes back as all zeros if the date is "empty" (but other fields can vary). And mktime() chokes on 1900 B.C. (result of 0 minus 1900), returning -1, which the higher level code can't deal with (passes it straight on to utime(), which simply leaves the file's timestamp "as-is"). So, since year 0 appears to mean "no date", we'll return an odd number that works out to precisely one day before the start of the Palm's clock (thus little chance of being run into by any Palm-based time stamp). */ if (data[0] == 0 && data[1] == 0) { /* This original calculation was wrong, and reported one day earlier than it was supposed to report. You can verify this with the following: perl -e '$date=localtime(0x83D8FE00); print $date,"\n"' return (time_t) 0x83D8FE00; // Wed Dec 30 16:00:00 1903 GMT Here are others, depending on what your system requirements are: return (time_t) 0x83D96E80; // Thu Dec 31 00:00:00 1903 GMT return (time_t) 0x00007080; // Thu Jan 1 00:00:00 1970 GMT Palm's own Conduit Development Kit references using 1/1/1904, so that's what we'll use here until something else breaks it. */ return (time_t) 0x83DAC000; /* Fri Jan 1 00:00:00 1904 GMT */ } memset(&t, 0, sizeof(t)); t.tm_sec = (int) data[6]; t.tm_min = (int) data[5]; t.tm_hour = (int) data[4]; t.tm_mday = (int) data[3]; t.tm_mon = (int) data[2] - 1; t.tm_year = (((int)data[0] << 8) | (int)data[1]) - 1900; t.tm_isdst = -1; return mktime(&t); } void dlp_htopdate(time_t time_interval, unsigned char *data) { /* @+ptrnegate@ */ int year; const struct tm *t; /* Fri Jan 1 00:00:00 1904 GMT */ time_t palm_epoch = 0x83DAC000; if (time_interval == palm_epoch) { memset(data, 0, 8); return; } t = localtime(&time_interval); ASSERT(t != NULL); year = t->tm_year + 1900; data[7] = (unsigned char) 0; /* packing spacer */ data[6] = (unsigned char) t->tm_sec; data[5] = (unsigned char) t->tm_min; data[4] = (unsigned char) t->tm_hour; data[3] = (unsigned char) t->tm_mday; data[2] = (unsigned char) (t->tm_mon + 1); data[0] = (unsigned char) (year >> 8); data[1] = (unsigned char) year; } int dlp_GetSysDateTime(int sd, time_t *t) { int result; struct dlpRequest *req; struct dlpResponse *res; Trace(dlp_GetSysDateTime); pi_reset_errors(sd); req = dlp_request_new(dlpFuncGetSysDateTime, 0); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { *t = dlp_ptohdate((const unsigned char *)DLP_RESPONSE_DATA (res, 0, 0)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP GetSysDateTime %s", ctime(t))); } dlp_response_free(res); return result; } int dlp_SetSysDateTime(int sd, time_t t) { int result; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_SetSysDateTime,"time=0x%08lx",t); pi_reset_errors(sd); req = dlp_request_new(dlpFuncSetSysDateTime, 1, 8); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); dlp_htopdate(t, (unsigned char *)DLP_REQUEST_DATA(req, 0, 0)); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } int dlp_ReadStorageInfo(int sd, int cardno, struct CardInfo *c) { int result; size_t len1, len2; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_ReadStorageInfo,"cardno=%d",cardno); pi_reset_errors(sd); req = dlp_request_new(dlpFuncReadStorageInfo, 1, 2); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), cardno); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { c->more = get_byte(DLP_RESPONSE_DATA(res, 0, 0)) || (get_byte(DLP_RESPONSE_DATA(res, 0, 3)) > 1); c->card = get_byte(DLP_RESPONSE_DATA(res, 0, 5)); c->version = get_byte(DLP_RESPONSE_DATA(res, 0, 6)); c->creation = get_date((const unsigned char *)DLP_RESPONSE_DATA(res, 0, 8)); c->romSize = get_long(DLP_RESPONSE_DATA(res, 0, 16)); c->ramSize = get_long(DLP_RESPONSE_DATA(res, 0, 20)); c->ramFree = get_long(DLP_RESPONSE_DATA(res, 0, 24)); len1 = get_byte(DLP_RESPONSE_DATA(res, 0, 28)); memcpy(c->name, DLP_RESPONSE_DATA(res, 0, 30), len1); c->name[len1] = '\0'; len2 = get_byte(DLP_RESPONSE_DATA(res, 0, 29)); memcpy(c->manufacturer, DLP_RESPONSE_DATA(res, 0, 30 + len1), len2); c->manufacturer[len2] = '\0'; LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP Read Cardno: %d, Card Version: %d, Creation time: %s", c->card, c->version, ctime(&c->creation))); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " Total ROM: %lu, Total RAM: %lu, Free RAM: %lu\n", c->romSize, c->ramSize, c->ramFree)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " Card name: '%s'\n", c->name)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " Manufacturer name: '%s'\n", c->manufacturer)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " More: %s\n", c->more ? "Yes" : "No")); } dlp_response_free (res); return result; } int dlp_ReadSysInfo(int sd, struct SysInfo *s) { int result; struct dlpRequest *req; struct dlpResponse *res; Trace(dlp_ReadSysInfo); pi_reset_errors(sd); req = dlp_request_new (dlpFuncReadSysInfo, 1, 4); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_short (DLP_REQUEST_DATA (req, 0, 0), dlp_version_major); set_short (DLP_REQUEST_DATA (req, 0, 2), dlp_version_minor); result = dlp_exec(sd, req, &res); dlp_request_free (req); if (result > 0) { s->romVersion = get_long (DLP_RESPONSE_DATA (res, 0, 0)); s->locale = get_long (DLP_RESPONSE_DATA (res, 0, 4)); /* The 8th byte is a filler byte */ s->prodIDLength = get_byte (DLP_RESPONSE_DATA (res, 0, 9)); memcpy(s->prodID, DLP_RESPONSE_DATA(res, 0, 10), s->prodIDLength); if (res->argc > 1) { /* response added in DLP 1.2 */ pi_socket_t *ps = find_pi_socket(sd); s->dlpMajorVersion = get_short (DLP_RESPONSE_DATA (res, 1, 0)); s->dlpMinorVersion = get_short (DLP_RESPONSE_DATA (res, 1, 2)); s->compatMajorVersion = get_short (DLP_RESPONSE_DATA (res, 1, 4)); s->compatMinorVersion = get_short (DLP_RESPONSE_DATA (res, 1, 6)); s->maxRecSize = get_long (DLP_RESPONSE_DATA (res, 1, 8)); /* update socket information */ ps->dlpversion = (s->dlpMajorVersion << 8) | s->dlpMinorVersion; ps->maxrecsize = s->maxRecSize; } else { s->dlpMajorVersion = 0; s->dlpMinorVersion = 0; s->compatMajorVersion = 0; s->compatMinorVersion = 0; s->maxRecSize = 0; } LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadSysInfo ROM Ver=0x%8.8lX Locale=0x%8.8lX\n", s->romVersion, s->locale)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " Product ID=0x%8.8lX\n", s->prodID)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " DLP Major Ver=0x%4.4lX DLP Minor Ver=0x%4.4lX\n", s->dlpMajorVersion, s->dlpMinorVersion)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " Compat Major Ver=0x%4.4lX Compat Minor Vers=0x%4.4lX\n", s->compatMajorVersion, s->compatMinorVersion)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " Max Rec Size=%ld\n", s->maxRecSize)); } dlp_response_free (res); return result; } int dlp_ReadDBList(int sd, int cardno, int flags, int start, pi_buffer_t *info) { int result, i, count; struct dlpRequest *req; struct dlpResponse *res; unsigned char *p; struct DBInfo db; TraceX(dlp_ReadDBList,"cardno=%d flags=0x%04x start=%d",cardno,flags,start); pi_reset_errors(sd); req = dlp_request_new (dlpFuncReadDBList, 1, 4); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); pi_buffer_clear (info); /* `multiple' only supported in DLP 1.2 and above */ if (pi_version(sd) < 0x0102) flags &= ~dlpDBListMultiple; set_byte(DLP_REQUEST_DATA(req, 0, 0), (unsigned char) flags); set_byte(DLP_REQUEST_DATA(req, 0, 1), (unsigned char) cardno); set_short(DLP_REQUEST_DATA(req, 0, 2), start); result = dlp_exec (sd, req, &res); dlp_request_free(req); if (result > 0) { p = (unsigned char *)DLP_RESPONSE_DATA(res, 0, 0); db.more = get_byte(p + 2); count = get_byte(p + 3); for (i=0; i < count; i++) { /* PalmOS 2.0 has additional flag */ if (pi_version(sd) > 0x0100) db.miscFlags = get_byte(p + 5); else db.miscFlags = 0; db.flags = get_short(p + 6); db.type = get_long(p + 8); db.creator = get_long(p + 12); db.version = get_short(p + 16); db.modnum = get_long(p + 18); db.createDate = get_date(p + 22); db.modifyDate = get_date(p + 30); db.backupDate = get_date(p + 38); db.index = get_short(p + 46); memset(db.name, 0, sizeof(db.name)); strncpy(db.name, (char *)(p + 48), 32); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadDBList Name: '%s', Version: %d, More: %s\n", db.name, db.version, db.more ? "Yes" : "No")); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " Creator: '%s'", printlong(db.creator))); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " Type: '%s' Flags: %s%s%s%s%s%s%s%s%s%s", printlong(db.type), (db.flags & dlpDBFlagResource) ? "Resource " : "", (db.flags & dlpDBFlagReadOnly) ? "ReadOnly " : "", (db.flags & dlpDBFlagAppInfoDirty) ? "AppInfoDirty " : "", (db.flags & dlpDBFlagBackup) ? "Backup " : "", (db.flags & dlpDBFlagReset) ? "Reset " : "", (db.flags & dlpDBFlagNewer) ? "Newer " : "", (db.flags & dlpDBFlagCopyPrevention) ? "CopyPrevention " : "", (db.flags & dlpDBFlagStream) ? "Stream " : "", (db.flags & dlpDBFlagOpen) ? "Open " : "", (!db.flags) ? "None" : "")); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " (0x%2.2X)\n", db.flags)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " Modnum: %ld, Index: %d, Creation date: 0x%08lx, %s", db.modnum, db.index, db.createDate, ctime(&db.createDate))); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " Modification date: 0x%08lx, %s", db.modifyDate, ctime(&db.modifyDate))); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " Backup date: 0x%08lx, %s", db.backupDate, ctime(&db.backupDate))); if (pi_buffer_append(info, &db, sizeof(db)) == NULL) { result = pi_set_error(sd, PI_ERR_GENERIC_MEMORY); break; } p += get_byte(p + 4); } } else { LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "Error in dlp_ReadDBList: %d\n", result)); } dlp_response_free (res); return result; } int dlp_FindDBInfo(int sd, int cardno, int start, const char *dbname, unsigned long type, unsigned long creator, struct DBInfo *info) { int i, j; pi_buffer_t *buf; TraceX(dlp_FindDBInfo,"cardno=%d start=%d",cardno,start); pi_reset_errors(sd); buf = pi_buffer_new (sizeof (struct DBInfo)); if (buf == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); if (start < 0x1000) { i = start; while (dlp_ReadDBList(sd, cardno, 0x80 | dlpDBListMultiple, i, buf) >= 0) { for (j=0; j < (int)(buf->used / sizeof(struct DBInfo)); j++) { memcpy (info, buf->data + j * sizeof(struct DBInfo), sizeof(struct DBInfo)); if ((!dbname || strcmp(info->name, dbname) == 0) && (!type || info->type == type) && (!creator || info->creator == creator)) goto found; i = info->index + 1; } } start = 0x1000; } i = start & 0xFFF; while (dlp_ReadDBList(sd, cardno, 0x40 | dlpDBListMultiple, i, buf) >= 0) { for (j=0; j < (int)(buf->used / sizeof(struct DBInfo)); j++) { memcpy (info, buf->data + j * sizeof(struct DBInfo), sizeof(struct DBInfo)); if ((!dbname || strcmp(info->name, dbname) == 0) && (!type || info->type == type) && (!creator || info->creator == creator)) { info->index |= 0x1000; goto found; } i = info->index + 1; } } pi_buffer_free (buf); return -1; found: pi_buffer_free (buf); return 0; } /*************************************************************************** * * Function: dlp_decode_finddb_response * * Summary: Response decoding for the three variants of dlp_FindDB * * Parameters: None * * Returns: Nothing * ***************************************************************************/ static void dlp_decode_finddb_response(struct dlpResponse *res, int *cardno, unsigned long *localid, int *dbhandle, struct DBInfo *info, struct DBSizeInfo *size) { int arg, argid; for (arg = 0; arg < res->argc; arg++) { argid = (res->argv[arg]->id_ & 0x7f) - PI_DLP_ARG_FIRST_ID; if (argid == 0) { if (cardno) *cardno = get_byte(DLP_RESPONSE_DATA(res, arg, 0)); if (localid) *localid = get_long(DLP_RESPONSE_DATA(res, arg, 2)); if (dbhandle) *dbhandle = get_long(DLP_RESPONSE_DATA(res, arg, 6)); if (info) { info->more = 0; info->miscFlags = get_byte(DLP_RESPONSE_DATA(res, arg, 11)); info->flags = get_short(DLP_RESPONSE_DATA(res, arg, 12)); info->type = get_long(DLP_RESPONSE_DATA(res, arg, 14)); info->creator = get_long(DLP_RESPONSE_DATA(res, arg, 18)); info->version = get_short(DLP_RESPONSE_DATA(res, arg, 22)); info->modnum = get_long(DLP_RESPONSE_DATA(res, arg, 24)); info->createDate = get_date((const unsigned char *)DLP_RESPONSE_DATA(res, arg, 28)); info->modifyDate = get_date((const unsigned char *)DLP_RESPONSE_DATA(res, arg, 36)); info->backupDate = get_date((const unsigned char *)DLP_RESPONSE_DATA(res, arg, 44)); info->index = get_short(DLP_RESPONSE_DATA(res, arg, 52)); strncpy(info->name, DLP_RESPONSE_DATA(res, arg, 54), 32); info->name[32] = '\0'; LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP FindDB Name: '%s', " "Version: %d, More: %s\n", info->name, info->version, info->more ? "Yes" : "No")); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " Creator: '%s'", printlong(info->creator))); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " Type: '%s' Flags: %s%s%s%s%s%s%s%s%s%s", printlong(info->type), (info->flags & dlpDBFlagResource) ? "Resource " : "", (info->flags & dlpDBFlagReadOnly) ? "ReadOnly " : "", (info->flags & dlpDBFlagAppInfoDirty) ? "AppInfoDirty " : "", (info->flags & dlpDBFlagBackup) ? "Backup " : "", (info->flags & dlpDBFlagReset) ? "Reset " : "", (info->flags & dlpDBFlagNewer) ? "Newer " : "", (info->flags & dlpDBFlagCopyPrevention) ? "CopyPrevention " : "", (info->flags & dlpDBFlagStream) ? "Stream " : "", (info->flags & dlpDBFlagOpen) ? "Open " : "", (!info->flags) ? "None" : "")); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " (0x%2.2X)\n", info->flags)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " Modnum: %ld, Index: %d, " "Creation date: %s", info->modnum, info->index, ctime(&info->createDate))); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " Modification date: %s", ctime(&info->modifyDate))); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " Backup date: %s", ctime(&info->backupDate))); } } else if (argid == 1) { if (size) { size->numRecords = get_long(DLP_RESPONSE_DATA(res, arg, 0)); size->totalBytes = get_long(DLP_RESPONSE_DATA(res, arg, 4)); size->dataBytes = get_long(DLP_RESPONSE_DATA(res, arg, 8)); size->appBlockSize = get_long(DLP_RESPONSE_DATA(res, arg, 12)); size->sortBlockSize = get_long(DLP_RESPONSE_DATA(res, arg, 16)); size->maxRecSize = get_long(DLP_RESPONSE_DATA(res, arg, 20)); } } } } int dlp_FindDBByName (int sd, int cardno, PI_CONST char *name, unsigned long *localid, int *dbhandle, struct DBInfo *info, struct DBSizeInfo *size) { int result; struct dlpRequest *req; struct dlpResponse *res; int flags = 0; TraceX(dlp_FindDBByName,"cardno=%d name='%s'",cardno,name); pi_reset_errors(sd); if (pi_version(sd) < 0x0102) return pi_set_error(sd, PI_ERR_DLP_UNSUPPORTED); req = dlp_request_new(dlpFuncFindDB, 1, 2 + (strlen(name) + 1)); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); if (localid || dbhandle || info) flags |= dlpFindDBOptFlagGetAttributes; if (size) flags |= dlpFindDBOptFlagGetSize; set_byte(DLP_REQUEST_DATA(req, 0, 0), flags); set_byte(DLP_REQUEST_DATA(req, 0, 1), cardno); strcpy(DLP_REQUEST_DATA(req, 0, 2), name); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) dlp_decode_finddb_response(res, NULL, localid, dbhandle, info, size); dlp_response_free(res); return result; } int dlp_FindDBByOpenHandle (int sd, int dbhandle, int *cardno, unsigned long *localid, struct DBInfo *info, struct DBSizeInfo *size) { int result; struct dlpRequest *req; struct dlpResponse *res; int flags = 0; Trace(dlp_FindDBByOpenHandle); pi_reset_errors(sd); if (pi_version(sd) < 0x0102) return pi_set_error(sd, PI_ERR_DLP_UNSUPPORTED); req = dlp_request_new_with_argid(dlpFuncFindDB, 0x21, 1, 2); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); /* Note: there is a bug in HotSync -- requesting the maxRecSize * crashes the device, so we don't. This is supposed to work only * for this variant of FindDB anyway. */ if (cardno || localid || info) flags |= dlpFindDBOptFlagGetAttributes; if (size) flags |= dlpFindDBOptFlagGetSize; set_byte(DLP_REQUEST_DATA(req, 0, 0), flags); set_byte(DLP_REQUEST_DATA(req, 0, 1), dbhandle); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) dlp_decode_finddb_response(res, cardno, localid, NULL, info, size); dlp_response_free(res); return result; } int dlp_FindDBByTypeCreator (int sd, unsigned long type, unsigned long creator, int start, int latest, int *cardno, unsigned long *localid, int *dbhandle, struct DBInfo *info, struct DBSizeInfo *size) { int result; struct dlpRequest *req; struct dlpResponse *res; int flags = 0, search_flags = 0; TraceX(dlp_FindDBByTypeCreator,"type='%4.4s' creator='%4.4s' start=%d latest=%d", (const char *)&type,(const char *)&creator,start,latest); pi_reset_errors(sd); if (pi_version(sd) < 0x0102) return pi_set_error(sd, PI_ERR_DLP_UNSUPPORTED); req = dlp_request_new_with_argid(dlpFuncFindDB, 0x22, 1, 10); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); if (cardno || localid || dbhandle || info) flags |= dlpFindDBOptFlagGetAttributes; if (size) flags |= (dlpFindDBOptFlagGetSize | dlpFindDBOptFlagMaxRecSize); if (start) search_flags |= dlpFindDBSrchFlagNewSearch; if (latest) search_flags |= dlpFindDBSrchFlagOnlyLatest; set_byte(DLP_REQUEST_DATA(req, 0, 0), flags); set_byte(DLP_REQUEST_DATA(req, 0, 1), search_flags); set_long(DLP_REQUEST_DATA(req, 0, 2), type); set_long(DLP_REQUEST_DATA(req, 0, 6), creator); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) dlp_decode_finddb_response(res, cardno, localid, dbhandle, info, size); dlp_response_free(res); return result; } int dlp_OpenDB(int sd, int cardno, int mode, PI_CONST char *name, int *dbhandle) { int result; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_OpenDB,"'%s'",name); pi_reset_errors(sd); req = dlp_request_new(dlpFuncOpenDB, 1, 2 + strlen(name) + 1); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), cardno); set_byte(DLP_REQUEST_DATA(req, 0, 1), mode); strcpy(DLP_REQUEST_DATA(req, 0, 2), name); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { *dbhandle = get_byte(DLP_RESPONSE_DATA(res, 0, 0)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "-> dlp_OpenDB dbhandle=%d\n", *dbhandle)); } dlp_response_free(res); return result; } int dlp_DeleteDB(int sd, int card, const char *name) { int result; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_DeleteDB,"%s",name); pi_reset_errors(sd); req = dlp_request_new(dlpFuncDeleteDB, 1, 2 + (strlen(name) + 1)); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), card); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0); strcpy(DLP_REQUEST_DATA(req, 0, 2), name); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } int dlp_CreateDB(int sd, unsigned long creator, unsigned long type, int cardno, int flags, unsigned int version, const char *name, int *dbhandle) { int result; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_CreateDB,"'%s' type='%4.4s' creator='%4.4s' flags=0x%04x version=%d", name,(const char *)&type,(const char *)&creator,flags,version); pi_reset_errors(sd); req = dlp_request_new(dlpFuncCreateDB, 1, 14 + (strlen(name) + 1)); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long(DLP_REQUEST_DATA(req, 0, 0), creator); set_long(DLP_REQUEST_DATA(req, 0, 4), type); set_byte(DLP_REQUEST_DATA(req, 0, 8), cardno); set_byte(DLP_REQUEST_DATA(req, 0, 9), 0); set_short(DLP_REQUEST_DATA(req, 0, 10), flags); set_short(DLP_REQUEST_DATA(req, 0, 12), version); strcpy(DLP_REQUEST_DATA(req, 0, 14), name); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0 && dbhandle) { *dbhandle = get_byte(DLP_RESPONSE_DATA(res, 0, 0)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP CreateDB Handle=%d\n", *dbhandle)); } dlp_response_free(res); return result; } int dlp_CloseDB(int sd, int dbhandle) { int result; struct dlpRequest *req; struct dlpResponse *res; Trace(dlp_CloseDB); pi_reset_errors(sd); req = dlp_request_new(dlpFuncCloseDB, 1, 1); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), (unsigned char) dbhandle); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } int dlp_CloseDB_All(int sd) { int result; struct dlpRequest *req; struct dlpResponse *res; Trace(dlp_CloseDB_All); pi_reset_errors(sd); req = dlp_request_new_with_argid(dlpFuncCloseDB, 0x21, 0); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } int dlp_CallApplication(int sd, unsigned long creator, unsigned long type, int action, size_t length, const void *data, unsigned long *retcode, pi_buffer_t *retbuf) { int result, version = pi_version(sd), previous_honor_rx_timeout, no_rx_timeout = 0; size_t data_len; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_CallApplication,"type='%4.4s' creator='%4.4s' action=0x%04x dataLength=%d", (const char *)&type,(const char *)&creator,action,(int)length); pi_reset_errors(sd); if (retbuf) pi_buffer_clear(retbuf); /* we are going to temporarily disable PI_SOCK_HONOR_RX_TIMEOUT * so that lengthy tasks on the device side don't cause a * connection timeout */ data_len = sizeof(previous_honor_rx_timeout); pi_getsockopt(sd, PI_LEVEL_SOCK, PI_SOCK_HONOR_RX_TIMEOUT, &previous_honor_rx_timeout, &data_len); if (version >= 0x0101) { /* PalmOS 2.0 call encoding */ if (length + 22 > DLP_BUF_SIZE) { LOG((PI_DBG_DLP, PI_DBG_LVL_ERR, "DLP CallApplication: data too large (>64k)")); pi_set_error(sd, PI_ERR_DLP_DATASIZE); return -131; } req = dlp_request_new_with_argid( dlpFuncCallApplication, 0x21, 1, 22 + length); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long(DLP_REQUEST_DATA(req, 0, 0), creator); set_long(DLP_REQUEST_DATA(req, 0, 4), type); set_short(DLP_REQUEST_DATA(req, 0, 8), action); set_long(DLP_REQUEST_DATA(req, 0, 10), length); set_long(DLP_REQUEST_DATA(req, 0, 14), 0); set_long(DLP_REQUEST_DATA(req, 0, 18), 0); if (length) memcpy(DLP_REQUEST_DATA(req, 0, 22), data, length); data_len = sizeof(no_rx_timeout); pi_setsockopt(sd, PI_LEVEL_SOCK, PI_SOCK_HONOR_RX_TIMEOUT, &no_rx_timeout, &data_len); result = dlp_exec(sd, req, &res); pi_setsockopt(sd, PI_LEVEL_SOCK, PI_SOCK_HONOR_RX_TIMEOUT, &previous_honor_rx_timeout, &data_len); dlp_request_free(req); if (result > 0) { data_len = res->argv[0]->len - 16; if (retcode) *retcode = get_long(DLP_RESPONSE_DATA(res, 0, 0)); if (retbuf) pi_buffer_append(retbuf, DLP_RESPONSE_DATA(res, 0, 16), data_len); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP CallApplication Result: %lu (0x%08lx), " "and %d bytes:\n", get_long(DLP_RESPONSE_DATA(res, 0, 0)), get_long(DLP_RESPONSE_DATA(res, 0, 0)), data_len)); CHECK(PI_DBG_DLP, PI_DBG_LVL_DEBUG, pi_dumpdata(DLP_RESPONSE_DATA(res, 0, 16), (size_t)data_len)); } } else { /* PalmOS 1.0 call encoding */ if (length + 8 > DLP_BUF_SIZE) { LOG((PI_DBG_DLP, PI_DBG_LVL_ERR, "DLP CallApplication: data too large (>64k)")); pi_set_error(sd, PI_ERR_DLP_DATASIZE); return -131; } req = dlp_request_new (dlpFuncCallApplication, 1, 8 + length); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long(DLP_REQUEST_DATA(req, 0, 0), creator); set_short(DLP_REQUEST_DATA(req, 0, 4), action); set_short(DLP_REQUEST_DATA(req, 0, 6), length); memcpy(DLP_REQUEST_DATA(req, 0, 8), data, length); data_len = sizeof(no_rx_timeout); pi_setsockopt(sd, PI_LEVEL_SOCK, PI_SOCK_HONOR_RX_TIMEOUT, &no_rx_timeout, &data_len); result = dlp_exec(sd, req, &res); pi_setsockopt(sd, PI_LEVEL_SOCK, PI_SOCK_HONOR_RX_TIMEOUT, &previous_honor_rx_timeout, &data_len); dlp_request_free(req); if (result > 0) { data_len = res->argv[0]->len - 6; if (retcode) *retcode = get_short(DLP_RESPONSE_DATA(res, 0, 2)); if (retbuf) pi_buffer_append(retbuf, DLP_RESPONSE_DATA(res, 0, 6), data_len); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP CallApplication Action: %d Result:" " %u (0x%04x), and %d bytes:\n", (int)get_short(DLP_RESPONSE_DATA(res, 0, 0)), (unsigned int)get_short(DLP_RESPONSE_DATA(res, 0, 2)), (unsigned int)get_short(DLP_RESPONSE_DATA(res, 0, 2)), data_len)); CHECK(PI_DBG_DLP, PI_DBG_LVL_DEBUG, pi_dumpdata(DLP_RESPONSE_DATA(res, 0, 6), (size_t)data_len)); } } dlp_response_free(res); return result; } int dlp_ResetSystem(int sd) { int result; struct dlpRequest *req; struct dlpResponse *res; Trace(dlp_ResetSystem); pi_reset_errors(sd); req = dlp_request_new(dlpFuncResetSystem, 0); result = dlp_exec(sd, req, &res); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); dlp_request_free(req); dlp_response_free(res); return result; } int dlp_AddSyncLogEntry(int sd, char *entry) { int result; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_AddSyncLogEntry,"%s",entry); pi_reset_errors(sd); req = dlp_request_new(dlpFuncAddSyncLogEntry, 1, strlen(entry) + 1); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); strcpy(DLP_REQUEST_DATA(req, 0, 0), entry); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); if (result > 0) { LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP AddSyncLogEntry Entry: \n %s\n", entry)); } return result; } int dlp_ReadOpenDBInfo(int sd, int dbhandle, int *records) { int result; struct dlpRequest *req; struct dlpResponse *res; Trace(dlp_ReadOpenDBInfo); pi_reset_errors(sd); req = dlp_request_new(dlpFuncReadOpenDBInfo, 1, 1); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { if (records) *records = get_short(DLP_RESPONSE_DATA(res, 0, 0)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadOpenDBInfo %d records\n", get_short(DLP_RESPONSE_DATA(res, 0, 0)))); } dlp_response_free(res); return result; } int dlp_SetDBInfo (int sd, int dbhandle, int flags, int clearFlags, unsigned int version, time_t createDate, time_t modifyDate, time_t backupDate, unsigned long type, unsigned long creator) { int result; struct dlpRequest *req; struct dlpResponse *res; Trace(dlp_SetDBInfo); pi_reset_errors(sd); if (pi_version(sd) < 0x0102) return pi_set_error(sd, PI_ERR_DLP_UNSUPPORTED); req = dlp_request_new(dlpFuncSetDBInfo, 1, 40); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0); set_short(DLP_REQUEST_DATA(req, 0, 2), clearFlags); set_short(DLP_REQUEST_DATA(req, 0, 4), flags); set_short(DLP_REQUEST_DATA(req, 0, 6), version); set_date((unsigned char *)DLP_REQUEST_DATA(req, 0, 8), createDate); set_date((unsigned char *)DLP_REQUEST_DATA(req, 0, 16), modifyDate); set_date((unsigned char *)DLP_REQUEST_DATA(req, 0, 24), backupDate); set_long(DLP_REQUEST_DATA(req, 0, 32), type); set_long(DLP_REQUEST_DATA(req, 0, 36), creator); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } int dlp_MoveCategory(int sd, int handle, int fromcat, int tocat) { int result; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_MoveCategory,"from %d to %d",fromcat,tocat); pi_reset_errors(sd); req = dlp_request_new(dlpFuncMoveCategory, 1, 4); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), handle); set_byte(DLP_REQUEST_DATA(req, 0, 1), fromcat); set_byte(DLP_REQUEST_DATA(req, 0, 2), tocat); set_byte(DLP_REQUEST_DATA(req, 0, 3), 0); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); if (result >= 0) { LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP MoveCategory Handle: %d, From: %d, To: %d\n", handle, fromcat, tocat)); } return result; } int dlp_OpenConduit(int sd) { int result; struct dlpRequest *req; struct dlpResponse *res; Trace(dlp_OpenConduit); pi_reset_errors(sd); req = dlp_request_new(dlpFuncOpenConduit, 0); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); /* if this was not done yet, this will read and cache the DLP version that the Palm is running. We need this when reading responses during record/resource transfers */ if (result >= 0) pi_version(sd); return result; } int dlp_EndOfSync(int sd, int status) { int result; pi_socket_t *ps; struct dlpRequest *req; struct dlpResponse *res; Trace(dlp_EndOfSync); pi_reset_errors(sd); ps = find_pi_socket(sd); if (ps == NULL) { errno = ESRCH; return PI_ERR_SOCK_INVALID; } req = dlp_request_new(dlpFuncEndOfSync, 1, 2); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_short(DLP_REQUEST_DATA(req, 0, 0), status); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); /* Messy code to set end-of-sync flag on socket so pi_close won't do it for us */ if (result == 0) ps->state = PI_SOCK_CONN_END; return result; } int dlp_AbortSync(int sd) { pi_socket_t *ps; Trace(dlp_AbortSync); pi_reset_errors(sd); /* Pretend we sent the sync end */ if ((ps = find_pi_socket(sd)) == NULL) { errno = ESRCH; return PI_ERR_SOCK_INVALID; } ps->state = PI_SOCK_CONN_END; return 0; } int dlp_WriteUserInfo(int sd, const struct PilotUser *User) { int result; struct dlpRequest *req; struct dlpResponse *res; int len; Trace(dlp_WriteUserInfo); pi_reset_errors(sd); len = strlen (User->username) + 1; req = dlp_request_new (dlpFuncWriteUserInfo, 1, 22 + len); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long(DLP_REQUEST_DATA(req, 0, 0), User->userID); set_long(DLP_REQUEST_DATA(req, 0, 4), User->viewerID); set_long(DLP_REQUEST_DATA(req, 0, 8), User->lastSyncPC); set_date((unsigned char *)DLP_REQUEST_DATA(req, 0, 12), User->lastSyncDate); set_byte(DLP_REQUEST_DATA(req, 0, 20), 0xff); set_byte(DLP_REQUEST_DATA(req, 0, 21), len); strcpy(DLP_REQUEST_DATA(req, 0, 22), User->username); result = dlp_exec (sd, req, &res); dlp_request_free (req); dlp_response_free (res); return result; } int dlp_ReadUserInfo(int sd, struct PilotUser *User) { int result; size_t userlen; struct dlpRequest *req; struct dlpResponse *res; Trace(dlp_ReadUserInfo); pi_reset_errors(sd); req = dlp_request_new (dlpFuncReadUserInfo, 0); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); result = dlp_exec (sd, req, &res); dlp_request_free (req); if (result > 0) { User->userID = get_long(DLP_RESPONSE_DATA (res, 0, 0)); User->viewerID = get_long(DLP_RESPONSE_DATA (res, 0, 4)); User->lastSyncPC = get_long(DLP_RESPONSE_DATA (res, 0, 8)); User->successfulSyncDate = get_date((const unsigned char *)DLP_RESPONSE_DATA (res, 0, 12)); User->lastSyncDate = get_date((const unsigned char *)DLP_RESPONSE_DATA (res, 0, 20)); userlen = get_byte(DLP_RESPONSE_DATA (res, 0, 28)); User->passwordLength = get_byte(DLP_RESPONSE_DATA (res, 0, 29)); memcpy(User->username, DLP_RESPONSE_DATA (res, 0, 30), userlen); memcpy(User->password, DLP_RESPONSE_DATA (res, 0, 30 + userlen), User->passwordLength); if (userlen < sizeof(User->username)) User->username[userlen] = '\0'; if (User->passwordLength < sizeof(User->password)) User->password[User->passwordLength] = '\0'; LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadUserInfo UID=0x%8.8lX VID=0x%8.8lX " "PCID=0x%8.8lX\n", User->userID, User->viewerID, User->lastSyncPC)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " Last Sync=%s Last Successful Sync=%s", ctime (&User->lastSyncDate), ctime (&User->successfulSyncDate))); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " Username=%s\n", User->username)); } dlp_response_free (res); return result; } int dlp_ReadNetSyncInfo(int sd, struct NetSyncInfo *i) { int result; struct dlpRequest *req; struct dlpResponse *res; Trace(dlp_ReadNetSyncInfo); pi_reset_errors(sd); if (pi_version(sd) < 0x0101) return pi_set_error(sd, PI_ERR_DLP_UNSUPPORTED); req = dlp_request_new(dlpFuncReadNetSyncInfo, 0); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); result = dlp_exec (sd, req, &res); dlp_request_free(req); if (result >= 0) { size_t str_offset = 24; i->lanSync = get_byte(DLP_RESPONSE_DATA(res, 0, 0)); i->hostName[0] = '\0'; memcpy(i->hostName, DLP_RESPONSE_DATA(res, 0, str_offset), get_short(DLP_RESPONSE_DATA(res, 0, 18))); str_offset += get_short(DLP_RESPONSE_DATA(res, 0, 18)); i->hostAddress[0] = '\0'; memcpy(i->hostAddress, DLP_RESPONSE_DATA(res, 0, str_offset), get_short(DLP_RESPONSE_DATA(res, 0, 20))); str_offset += get_short(DLP_RESPONSE_DATA(res, 0, 20)); i->hostSubnetMask[0] = '\0'; memcpy(i->hostSubnetMask, DLP_RESPONSE_DATA(res, 0, str_offset), get_short(DLP_RESPONSE_DATA(res, 0, 22))); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadNetSyncInfo Active: %d\n", i->lanSync ? 1 : 0)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " PC hostname: '%s', address '%s', mask '%s'\n", i->hostName, i->hostAddress, i->hostSubnetMask)); } dlp_response_free(res); return result; } int dlp_WriteNetSyncInfo(int sd, const struct NetSyncInfo *i) { int result, str_offset = 24; struct dlpRequest *req; struct dlpResponse *res; Trace(dlp_WriteNetSyncInfo); pi_reset_errors(sd); if (pi_version(sd) < 0x0101) return pi_set_error(sd, PI_ERR_DLP_UNSUPPORTED); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadNetSyncInfo Active: %d\n", i->lanSync ? 1 : 0)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " PC hostname: '%s', address '%s', mask '%s'\n", i->hostName, i->hostAddress, i->hostSubnetMask)); req = dlp_request_new(dlpFuncWriteNetSyncInfo, 1, 24 + strlen(i->hostName) + strlen(i->hostAddress) + strlen(i->hostSubnetMask) + 3); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); /* Change all settings */ set_byte(DLP_REQUEST_DATA(req, 0, 0), 0x80 | 0x40 | 0x20 | 0x10); set_byte(DLP_REQUEST_DATA(req, 0, 1), i->lanSync); set_long(DLP_REQUEST_DATA(req, 0, 2), 0); /* Reserved1 */ set_long(DLP_REQUEST_DATA(req, 0, 6), 0); /* Reserved2 */ set_long(DLP_REQUEST_DATA(req, 0, 10), 0); /* Reserved3 */ set_long(DLP_REQUEST_DATA(req, 0, 14), 0); /* Reserved4 */ set_short(DLP_REQUEST_DATA(req, 0, 18), strlen(i->hostName) + 1); set_short(DLP_REQUEST_DATA(req, 0, 20), strlen(i->hostAddress) + 1); set_short(DLP_REQUEST_DATA(req, 0, 22), strlen(i->hostSubnetMask) + 1); strcpy(DLP_REQUEST_DATA(req, 0, str_offset), i->hostName); str_offset += strlen(i->hostName) + 1; strcpy(DLP_REQUEST_DATA(req, 0, str_offset), i->hostAddress); str_offset += strlen(i->hostAddress) + 1; strcpy(DLP_REQUEST_DATA(req, 0, str_offset), i->hostSubnetMask); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } #ifdef _PILOT_SYSPKT_H int dlp_RPC(int sd, struct RPC_params *p, unsigned long *result) { int i, err = 0; long D0 = 0, A0 = 0; unsigned char *c; pi_buffer_t *dlp_buf; Trace(dlp_RPC); pi_reset_errors(sd); /* RPC through DLP breaks all the rules and isn't well documented to boot */ dlp_buf = pi_buffer_new (DLP_BUF_SIZE); if (dlp_buf == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); dlp_buf->data[0] = 0x2D; dlp_buf->data[1] = 1; dlp_buf->data[2] = 0; /* Unknown filler */ dlp_buf->data[3] = 0; InvertRPC(p); set_short(dlp_buf->data + 4, p->trap); set_long(dlp_buf->data + 6, D0); set_long(dlp_buf->data + 10, A0); set_short(dlp_buf->data + 14, p->args); c = dlp_buf->data + 16; for (i = p->args - 1; i >= 0; i--) { set_byte(c, p->param[i].byRef); c++; set_byte(c, p->param[i].size); c++; if (p->param[i].data) memcpy(c, p->param[i].data, p->param[i].size); c += p->param[i].size; if (p->param[i].size & 1) *c++ = 0; } if (pi_write(sd, dlp_buf->data, (size_t)(c - dlp_buf->data)) > 0) { err = 0; if (p->reply) { int l = pi_read(sd, dlp_buf, (size_t)(c - dlp_buf->data + 2)); if (l < 0) err = l; else if (l < 6) err = -1; else if (dlp_buf->data[0] != 0xAD) err = -2; else if (get_short(dlp_buf->data + 2)) { err = -get_short(dlp_buf->data + 2); pi_set_palmos_error(sd, -err); } else { D0 = get_long(dlp_buf->data + 8); A0 = get_long(dlp_buf->data + 12); c = dlp_buf->data + 18; for (i = p->args - 1; i >= 0; i--) { if (p->param[i].byRef && p->param[i].data) memcpy(p->param[i].data, c + 2, p->param[i].size); c += 2 + ((p->param[i].size + 1) & (unsigned)~1); } } } } pi_buffer_free (dlp_buf); UninvertRPC(p); if (result) { if (p->reply == RPC_PtrReply) { *result = A0; } else if (p->reply == RPC_IntReply) { *result = D0; } } return err; } int dlp_ReadFeature(int sd, unsigned long creator, int num, unsigned long *feature) { int result; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_ReadFeature,"creator='%4.4s' num=%d",(const char *)&creator,num); pi_reset_errors(sd); if (pi_version(sd) < 0x0101) { struct RPC_params p; int val; unsigned long errCode; if (feature == NULL) return 0; *feature = 0x12345678; PackRPC(&p, 0xA27B, RPC_IntReply, RPC_Long(creator), RPC_Short(num), RPC_LongPtr(feature), RPC_End); val = dlp_RPC(sd, &p, &errCode); if (val < 0) { LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadFeature Error: %s (%d)\n", dlp_errorlist[-val], val)); return val; } if (errCode) { LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadFeature FtrGet error 0x%8.8lX\n", res)); pi_set_palmos_error(sd, (int)errCode); return pi_set_error(sd, PI_ERR_DLP_PALMOS); } LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " DLP ReadFeature Feature: 0x%8.8lX\n", (unsigned long) *feature)); return 0; } Trace(dlp_ReadFeatureV2); req = dlp_request_new(dlpFuncReadFeature, 1, 6); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long(DLP_REQUEST_DATA(req, 0, 0), creator); set_short(DLP_REQUEST_DATA(req, 0, 4), num); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { if (feature) *feature = (unsigned long) get_long(DLP_RESPONSE_DATA(res, 0, 0)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadFeature Feature: 0x%8.8lX\n", (unsigned long) get_long(DLP_RESPONSE_DATA(res, 0, 0)))); } dlp_response_free(res); return result; } #endif /* IFDEF _PILOT_SYSPKT_H */ int dlp_GetROMToken(int sd, unsigned long token, void *buffer, size_t *size) { unsigned long result; struct RPC_params p; int val; unsigned long buffer_ptr; Trace(dlp_GetROMToken); pi_reset_errors(sd); #ifdef DLP_TRACE if (dlp_trace) { fprintf(stderr, " Wrote: Token: '%s'\n", printlong(token)); } #endif PackRPC(&p, 0xa340, RPC_IntReply, /* sysTrapHwrGetROMToken */ RPC_Short(0), RPC_Long(token), RPC_LongPtr(&buffer_ptr), RPC_ShortPtr(size), RPC_End); val = dlp_RPC(sd, &p, &result); #ifdef DLP_TRACE if (dlp_trace) { if (val < 0) fprintf(stderr, "Result: Error: %s (%d)\n", dlp_errorlist[-val], val); else if (result) fprintf(stderr, "FtrGet error 0x%8.8lX\n", (unsigned long) result); else fprintf(stderr, " Read: Buffer Ptr: 0x%8.8lX Size: %d\n", (unsigned long) buffer_ptr, *size); } #endif if (buffer) { ((unsigned char *)buffer)[*size] = 0; PackRPC(&p, 0xa026, RPC_IntReply, /* sysTrapMemMove */ RPC_Ptr(buffer, *size), RPC_Long(buffer_ptr), RPC_Long((unsigned long) *size), RPC_End); val = dlp_RPC(sd, &p, &result); } #ifdef DLP_TRACE if (dlp_trace) { if (val < 0) fprintf(stderr, "Result: Error: %s (%d)\n", dlp_errorlist[-val], val); else if (result) fprintf(stderr, "FtrGet error 0x%8.8lX\n", (unsigned long) result); else fprintf(stderr, " Read: Buffer: %s\n", buffer); } #endif if (val < 0) return val; if (result) return -((int)result); return result; } int dlp_ResetLastSyncPC(int sd) { int err; struct PilotUser User; Trace(dlp_ResetLastSyncPC); if ((err = dlp_ReadUserInfo(sd, &User)) < 0) return err; User.lastSyncPC = 0; return dlp_WriteUserInfo(sd, &User); } int dlp_ResetDBIndex(int sd, int dbhandle) { int result; pi_socket_t *ps; struct dlpRequest *req; struct dlpResponse *res; Trace(dlp_ResetDBIndex); pi_reset_errors(sd); if ((ps = find_pi_socket(sd)) == NULL) { errno = ESRCH; return PI_ERR_SOCK_INVALID; } ps->dlprecord = 0; req = dlp_request_new(dlpFuncResetRecordIndex, 1, 1); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } int dlp_ReadRecordIDList(int sd, int dbhandle, int sort, int start, int max, recordid_t * IDs, int *count) { int result; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_ReadRecordIDList,"sort=%d start=%d max=%d", sort,start,max); pi_reset_errors(sd); req = dlp_request_new(dlpFuncReadRecordIDList, 1, 6); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), sort ? 0x80 : 0); set_short(DLP_REQUEST_DATA(req, 0, 2), start); set_short(DLP_REQUEST_DATA(req, 0, 4), max); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { int ret, i; ret = get_short(DLP_RESPONSE_DATA(res, 0, 0)); for (i = 0; i < ret; i++) IDs[i] = get_long(DLP_RESPONSE_DATA(res, 0, 2 + (i * 4))); if (count) *count = ret; LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadRecordIDList %d IDs:\n", ret)); CHECK(PI_DBG_DLP, PI_DBG_LVL_DEBUG, pi_dumpdata(DLP_RESPONSE_DATA(res, 0, 2), (size_t)(ret * 4))); } dlp_response_free(res); return result; } int dlp_WriteRecord(int sd, int dbhandle, int flags, recordid_t recID, int catID, const void *data, size_t length, recordid_t *pNewRecID) { int result; struct dlpRequest *req; struct dlpResponse *res; Trace(dlp_WriteRecord); pi_reset_errors(sd); if (length == (size_t)-1) length = strlen((char *) data) + 1; if (pi_version(sd) >= 0x0104) { req = dlp_request_new(dlpFuncWriteRecordEx, 1, 12 + length); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0x80); /* "data included" */ set_long(DLP_REQUEST_DATA(req, 0, 2), recID); set_byte(DLP_REQUEST_DATA(req, 0, 6), flags); set_byte(DLP_REQUEST_DATA(req, 0, 7), catID); set_long(DLP_REQUEST_DATA(req, 0, 8), 0); memcpy(DLP_REQUEST_DATA(req, 0, 12), data, length); } else { if ((length + 8) > DLP_BUF_SIZE) { LOG((PI_DBG_DLP, PI_DBG_LVL_ERR, "DLP WriteRecord: data too large (>64k)")); return PI_ERR_DLP_DATASIZE; } req = dlp_request_new(dlpFuncWriteRecord, 1, 8 + length); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0x80); /* "data included" */ set_long(DLP_REQUEST_DATA(req, 0, 2), recID); set_byte(DLP_REQUEST_DATA(req, 0, 6), flags); set_byte(DLP_REQUEST_DATA(req, 0, 7), catID); memcpy(DLP_REQUEST_DATA(req, 0, 8), data, length); } result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { if (pNewRecID) *pNewRecID = get_long(DLP_RESPONSE_DATA(res, 0, 0)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP WriteRecord Record ID: 0x%8.8lX\n", get_long(DLP_RESPONSE_DATA(res, 0, 0)))); CHECK(PI_DBG_DLP, PI_DBG_LVL_DEBUG, record_dump( get_long(DLP_RESPONSE_DATA(res, 0, 0)), /* recID */ 0xffff, /* index */ flags, catID, (const char *)data, (int)length)); } dlp_response_free(res); return result; } int dlp_DeleteRecord(int sd, int dbhandle, int all, recordid_t recID) { int result, flags = all ? 0x80 : 0; struct dlpRequest *req; struct dlpResponse *res; Trace(dlp_DeleteRecord); pi_reset_errors(sd); req = dlp_request_new(dlpFuncDeleteRecord, 1, 6); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), flags); set_long(DLP_REQUEST_DATA(req, 0, 2), recID); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } int dlp_DeleteCategory(int sd, int dbhandle, int category) { int result; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_DeleteCategory,"category=%d",category); pi_reset_errors(sd); if (pi_version(sd) < 0x0101) { /* Emulate if not connected to PalmOS 2.0 */ int i, cat, attr; recordid_t id_; LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP DeleteCategory Emulating with: Handle: %d, " "Category: %d\n", dbhandle, category & 0xff)); for (i = 0; (result = dlp_ReadRecordByIndex(sd, dbhandle, i, NULL, &id_, &attr, &cat)) >= 0; i++) { if (cat != category || (attr & dlpRecAttrDeleted) || (attr & dlpRecAttrArchived)) continue; result = dlp_DeleteRecord(sd, dbhandle, 0, id_); if (result < 0) break; i--; /* Sigh, deleting record moves it to the end. */ } return result; } else { int flags = 0x40; req = dlp_request_new(dlpFuncDeleteRecord, 1, 6); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), flags); set_long(DLP_REQUEST_DATA(req, 0, 2), category & 0xff); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } } int dlp_ReadResourceByType(int sd, int dbhandle, unsigned long type, int resID, pi_buffer_t *buffer, int *resindex) { int result, data_len; struct dlpRequest *req; struct dlpResponse *res; int maxBufferSize = pi_maxrecsize(sd) - RECORD_READ_SAFEGUARD_SIZE; TraceX(dlp_ReadResourceByType,"type='%4.4s' resID=%d",(const char *)&type,resID); pi_reset_errors(sd); req = dlp_request_new_with_argid(dlpFuncReadResource, 0x21, 1, 12); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0); set_long(DLP_REQUEST_DATA(req, 0, 2), type); set_short(DLP_REQUEST_DATA(req, 0, 6), resID); set_short(DLP_REQUEST_DATA(req, 0, 8), 0); set_short(DLP_REQUEST_DATA(req, 0, 10), buffer ? maxBufferSize : 0); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { data_len = res->argv[0]->len - 10; if (resindex) *resindex = get_short(DLP_RESPONSE_DATA(res, 0, 6)); if (buffer) { pi_buffer_clear (buffer); pi_buffer_append (buffer, DLP_RESPONSE_DATA(res, 0, 10), (size_t)data_len); /* Some devices such as the Tungsten TX, Treo 650 and Treo 700p lock up if you try to read the entire record if the ** record is almost at the maximum record size. The following mitigates this and allows the record ** to be read in two chunks. */ if (data_len == maxBufferSize) { dlp_response_free(res); req = dlp_request_new_with_argid(dlpFuncReadResource, 0x21, 1, 12); if (req != NULL) { set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0); set_long(DLP_REQUEST_DATA(req, 0, 2), type); set_short(DLP_REQUEST_DATA(req, 0, 6), resID); set_short(DLP_REQUEST_DATA(req, 0, 8), maxBufferSize); /* Offset in record */ set_short(DLP_REQUEST_DATA(req, 0, 10), RECORD_READ_SAFEGUARD_SIZE); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { data_len = res->argv[0]->len - 10; /* number of bytes returned by the second read... */ pi_buffer_append (buffer, DLP_RESPONSE_DATA(res, 0, 10), (size_t)data_len); data_len += maxBufferSize; /* ...that add up to the bytes received in the first read */ } } } } LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadResourceByType Type: '%s', ID: %d, " "Index: %d, and %d bytes:\n", printlong(type), resID, get_short(DLP_RESPONSE_DATA(res, 0, 6)),(size_t)data_len)); CHECK(PI_DBG_DLP, PI_DBG_LVL_DEBUG, pi_dumpdata(DLP_RESPONSE_DATA(res, 0, 10),(size_t)data_len)); } else { data_len = result; } dlp_response_free(res); return data_len; } int dlp_ReadResourceByIndex(int sd, int dbhandle, unsigned int resindex, pi_buffer_t *buffer, unsigned long *type, int *resID) { int result, data_len, large = 0; struct dlpRequest *req; struct dlpResponse *res; int maxBufferSize = pi_maxrecsize(sd) - RECORD_READ_SAFEGUARD_SIZE; TraceX(dlp_ReadResourceByIndex,"resindex=%d",resindex); pi_reset_errors(sd); /* TapWave (DLP 1.4) implements a `large' version of dlpFuncReadResource, * which can return resources >64k */ if (pi_version(sd) >= 0x0104) { req = dlp_request_new (dlpFuncReadResourceEx, 1, 12); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0); set_short(DLP_REQUEST_DATA(req, 0, 2), resindex); set_long(DLP_REQUEST_DATA(req, 0, 4), 0); set_long(DLP_REQUEST_DATA(req, 0, 8), pi_maxrecsize(sd)); large = 1; } else { req = dlp_request_new (dlpFuncReadResource, 1, 8); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0); set_short(DLP_REQUEST_DATA(req, 0, 2), resindex); set_long(DLP_REQUEST_DATA(req, 0, 4), maxBufferSize); } result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { data_len = res->argv[0]->len - (large ? 12 : 10); if (type) *type = get_long(DLP_RESPONSE_DATA(res, 0, 0)); if (resID) *resID = get_short(DLP_RESPONSE_DATA(res, 0, 4)); if (buffer) { pi_buffer_clear (buffer); pi_buffer_append (buffer, DLP_RESPONSE_DATA(res, 0, large ? 12 : 10), (size_t)data_len); /* Some devices such as the Tungsten TX, Treo 650 and Treo 700p lock up if you try to read the entire record if the ** record is almost at the maximum record size. The following mitigates this and allows the record ** to be read in two chunks. */ if (data_len == maxBufferSize && !large) { dlp_response_free(res); req = dlp_request_new (dlpFuncReadResource, 1, 8); if (req != NULL) { set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0); set_short(DLP_REQUEST_DATA(req, 0, 2), resindex); set_short(DLP_REQUEST_DATA(req, 0, 4), maxBufferSize); /* Offset in record */ set_short(DLP_REQUEST_DATA(req, 0, 6), RECORD_READ_SAFEGUARD_SIZE); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { data_len = res->argv[0]->len - (large ? 12 : 10); /* number of bytes returned by the second read... */ pi_buffer_append (buffer, DLP_RESPONSE_DATA(res, 0, large ? 12 : 10), (size_t)data_len); data_len += maxBufferSize; /* ...that add up to the bytes received in the first read */ } } } } LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadResourceByIndex Type: '%s', ID: %d, " "Index: %d, and %d bytes:\n", printlong(get_long(DLP_RESPONSE_DATA(res, 0, 0))), get_short(DLP_RESPONSE_DATA(res, 0, 4)), resindex, data_len)); CHECK(PI_DBG_DLP, PI_DBG_LVL_DEBUG, pi_dumpdata(DLP_RESPONSE_DATA(res, 0, (large ? 12 : 10)), (size_t)data_len)); } else { data_len = result; } dlp_response_free(res); return data_len; } int dlp_WriteResource(int sd, int dbhandle, unsigned long type, int resID, const void *data, size_t length) { int result, large = 0; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_WriteResource,"'%4.4s' #%d",(const char *)&type,resID); pi_reset_errors(sd); /* TapWave (DLP 1.4) implements a `large' version of dlpFuncWriteResource, * which can store records >64k */ if (pi_version(sd) >= 0x0104) { req = dlp_request_new_with_argid(dlpFuncWriteResourceEx, PI_DLP_ARG_FIRST_ID | PI_DLP_ARG_FLAG_LONG, 1, 12 + length); large = 1; } else { if (length > 0xffff) length = 0xffff; req = dlp_request_new(dlpFuncWriteResource, 1, 10 + length); } if (req == NULL) { LOG((PI_DBG_DLP, PI_DBG_LVL_ERR, "DLP sd:%i large:%i dlp_request_new failed\n", sd, large)); return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); } set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0); set_long(DLP_REQUEST_DATA(req, 0, 2), type); set_short(DLP_REQUEST_DATA(req, 0, 6), resID); if (large) set_long (DLP_REQUEST_DATA(req, 0, 8), 0); /* device doesn't want length here (it computes it) */ else set_short(DLP_REQUEST_DATA(req, 0, 8), length); memcpy(DLP_REQUEST_DATA(req, 0, large ? 12 : 10), data, length); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } int dlp_DeleteResource(int sd, int dbhandle, int all, unsigned long restype, int resID) { int result, flags = all ? 0x80 : 0; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_DeleteResource,"restype='%4.4s' resID=%d all=%d", (const char *)&restype,resID,all); pi_reset_errors(sd); req = dlp_request_new(dlpFuncDeleteResource, 1, 8); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), flags); set_long(DLP_REQUEST_DATA(req, 0, 2), restype); set_short(DLP_REQUEST_DATA(req, 0, 6), resID); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } int dlp_ReadAppBlock(int sd, int dbhandle, int offset, int reqbytes, pi_buffer_t *retbuf) { int result, data_len; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_ReadAppBlock,"offset=%d reqbytes=%ld",offset,reqbytes); pi_reset_errors(sd); if (retbuf) pi_buffer_clear(retbuf); req = dlp_request_new(dlpFuncReadAppBlock, 1, 6); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0); set_short(DLP_REQUEST_DATA(req, 0, 2), offset); set_short(DLP_REQUEST_DATA(req, 0, 4), reqbytes); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result >= 0) { if (result < 2) data_len = PI_ERR_DLP_COMMAND; else { data_len = res->argv[0]->len - 2; if (retbuf && data_len) pi_buffer_append(retbuf, DLP_RESPONSE_DATA(res, 0, 2), (size_t)data_len); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadAppBlock %d bytes\n", data_len)); CHECK(PI_DBG_DLP, PI_DBG_LVL_DEBUG, pi_dumpdata(DLP_RESPONSE_DATA(res, 0, 2), (size_t)data_len)); } } else { data_len = result; } dlp_response_free(res); return data_len; } int dlp_WriteAppBlock(int sd, int dbhandle, const /* @unique@ */ void *data, size_t length) { int result; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_WriteAppBlock,"length=%ld",length); pi_reset_errors(sd); req = dlp_request_new(dlpFuncWriteAppBlock, 1, 4 + length); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0); set_short(DLP_REQUEST_DATA(req, 0, 2), length); if (length + 10 > DLP_BUF_SIZE) { LOG((PI_DBG_DLP, PI_DBG_LVL_ERR, "DLP WriteAppBlock: data too large (>64k)")); pi_set_error(sd, PI_ERR_DLP_DATASIZE); return -131; } if (length) memcpy(DLP_REQUEST_DATA(req, 0, 4), data, length); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } int dlp_ReadSortBlock(int sd, int dbhandle, int offset, int reqbytes, pi_buffer_t *retbuf) { int result, data_len; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_ReadSortBlock,"offset=%d reqbytes=%d",offset,reqbytes); pi_reset_errors(sd); if (retbuf) pi_buffer_clear(retbuf); req = dlp_request_new(dlpFuncReadSortBlock, 1, 6); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0); set_short(DLP_REQUEST_DATA(req, 0, 2), offset); set_short(DLP_REQUEST_DATA(req, 0, 4), reqbytes); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result >= 0) { if (result < 2) data_len = PI_ERR_DLP_COMMAND; else { data_len = res->argv[0]->len - 2; if (retbuf) pi_buffer_append(retbuf, DLP_RESPONSE_DATA(res, 0, 2), (size_t)data_len); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadSortBlock %d bytes\n", data_len)); CHECK(PI_DBG_DLP, PI_DBG_LVL_DEBUG, pi_dumpdata(DLP_RESPONSE_DATA(res, 0, 2), (size_t)data_len)); } } else { data_len = result; } dlp_response_free(res); return data_len; } int dlp_WriteSortBlock(int sd, int dbhandle, const /* @unique@ */ void *data, size_t length) { int result; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_WriteSortBlock,"length=%ld",length); pi_reset_errors(sd); req = dlp_request_new(dlpFuncWriteSortBlock, 1, 4 + length); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0); set_short(DLP_REQUEST_DATA(req, 0, 2), length); if (length + 10 > DLP_BUF_SIZE) { LOG((PI_DBG_DLP, PI_DBG_LVL_ERR, "DLP WriteSortBlock: data too large (>64k)")); pi_set_error(sd, PI_ERR_DLP_DATASIZE); return -131; } memcpy(DLP_REQUEST_DATA(req, 0, 4), data, length); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } int dlp_CleanUpDatabase(int sd, int dbhandle) { int result; struct dlpRequest *req; struct dlpResponse *res; Trace(dlp_CleanUpDatabase); pi_reset_errors(sd); req = dlp_request_new(dlpFuncCleanUpDatabase, 1, 1); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } int dlp_ResetSyncFlags(int sd, int dbhandle) { int result; struct dlpRequest *req; struct dlpResponse *res; Trace(dpl_ResetSyncFlags); pi_reset_errors(sd); req = dlp_request_new(dlpFuncResetSyncFlags, 1, 1); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } int dlp_ReadNextRecInCategory(int sd, int dbhandle, int category, pi_buffer_t *buffer, recordid_t *recuid, int *recindex, int *attr) { int result, data_len, flags; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_ReadNextRecInCategory,"category=%d",category); pi_reset_errors(sd); if (pi_version(sd) < 0x0101) { /* Emulate for PalmOS 1.0 */ int cat, rec; pi_socket_t *ps; LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadNextRecInCategory Emulating with: Handle: %d, " "Category: %d\n", dbhandle, category)); if ((ps = find_pi_socket(sd)) == 0) { errno = ESRCH; return -130; } for (;;) { /* Fetch next modified record (in any category) */ rec = dlp_ReadRecordByIndex(sd, dbhandle, ps->dlprecord, 0, 0, 0, &cat); if (rec < 0) break; if (cat != category) { ps->dlprecord++; continue; } rec = dlp_ReadRecordByIndex(sd, dbhandle, ps->dlprecord, buffer, recuid, attr, &cat); if (rec >= 0) { if (recindex) *recindex = ps->dlprecord; ps->dlprecord++; } else { /* If none found, reset modified pointer so that another search on a different (or the same!) category will work */ /* Freeow! Do _not_ reset, as the Palm itself does not! ps->dlprecord = 0; */ } break; } return rec; } req = dlp_request_new(dlpFuncReadNextRecInCategory, 1, 2); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), category); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { data_len = res->argv[0]->len - 10; if (recuid) *recuid = get_long(DLP_RESPONSE_DATA(res, 0, 0)); if (recindex) *recindex = get_short(DLP_RESPONSE_DATA(res, 0, 4)); if (attr) *attr = get_byte(DLP_RESPONSE_DATA(res, 0, 8)); if (buffer) { pi_buffer_clear (buffer); pi_buffer_append (buffer, DLP_RESPONSE_DATA(res, 0, 10), (size_t)data_len); } flags = get_byte(DLP_RESPONSE_DATA(res, 0, 8)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadNextRecInCategory ID: 0x%8.8lX, " "Index: %d, Category: %d\n" " Flags: %s%s%s%s%s%s (0x%2.2X) and %d bytes:\n", (unsigned long) get_long(DLP_RESPONSE_DATA(res, 0, 0)), get_short(DLP_RESPONSE_DATA(res, 0, 4)), (int) get_byte(DLP_RESPONSE_DATA(res, 0, 9)), (flags & dlpRecAttrDeleted) ? " Deleted" : "", (flags & dlpRecAttrDirty) ? " Dirty" : "", (flags & dlpRecAttrBusy) ? " Busy" : "", (flags & dlpRecAttrSecret) ? " Secret" : "", (flags & dlpRecAttrArchived) ? " Archive" : "", (!flags) ? " None" : "", flags, data_len)); CHECK(PI_DBG_DLP, PI_DBG_LVL_DEBUG, pi_dumpdata(DLP_RESPONSE_DATA(res, 0, 10), (size_t)data_len)); } else { data_len = result; } dlp_response_free(res); return data_len; } int dlp_ReadAppPreference(int sd, unsigned long creator, int prefID, int backup, int maxsize, void *buffer, size_t *size, int *version) { int result, data_len; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_ReadAppPreference,"creator='%4.4s' prefID=%d backup=%d maxsize=%d", (const char *)creator,prefID,backup,maxsize); pi_reset_errors(sd); if (pi_version(sd) < 0x0101) { /* Emulate on PalmOS 1.0 */ int db; pi_buffer_t *buf; LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadAppPreference Emulating with: Creator: '%s', " "Id: %d, Size: %d, Backup: %d\n", printlong(creator), prefID, buffer ? maxsize : 0, backup ? 0x80 : 0)); result = dlp_OpenDB(sd, 0, dlpOpenRead, "System Preferences", &db); if (result < 0) return result; buf = pi_buffer_new (1024); result = dlp_ReadResourceByType(sd, db, creator, prefID, buf,NULL); if (result < 0) { /* have to keep the previous error codes to properly return it */ int err1 = pi_error(sd); int err2 = pi_palmos_error(sd); pi_buffer_free (buf); if (err1 != PI_ERR_SOCK_DISCONNECTED) dlp_CloseDB(sd, db); pi_set_error(sd, err1); pi_set_palmos_error(sd, err2); return result; } if (size) *size = buf->used - 2; if (version) *version = get_short(buf->data); if (result > 2) { result -= 2; memcpy(buffer, buf->data + 2, (size_t)result); } else { result = 0; } pi_buffer_free (buf); dlp_CloseDB(sd, db); return result; } req = dlp_request_new(dlpFuncReadAppPreference, 1, 10); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long(DLP_REQUEST_DATA(req, 0, 0), creator); set_short(DLP_REQUEST_DATA(req, 0, 4), prefID); set_short(DLP_REQUEST_DATA(req, 0, 6), buffer ? maxsize : 0); set_byte(DLP_REQUEST_DATA(req, 0, 8), backup ? 0x80 : 0); set_byte(DLP_REQUEST_DATA(req, 0, 9), 0); /* Reserved */ result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { data_len = get_short(DLP_RESPONSE_DATA(res, 0, 4)); if (version) *version = get_short(DLP_RESPONSE_DATA(res, 0, 0)); if (size && !buffer) *size = get_short(DLP_RESPONSE_DATA(res, 0, 2)); /* Total sz */ if (size && buffer) *size = data_len; /* Size returned */ if (buffer) memcpy(buffer, DLP_RESPONSE_DATA(res, 0, 6), (size_t)data_len); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadAppPref Version: %d, " "Total size: %d, Read %d bytes:\n", get_short(DLP_RESPONSE_DATA(res, 0, 0)), get_short(DLP_RESPONSE_DATA(res, 0, 2)), get_short(DLP_RESPONSE_DATA(res, 0, 4)))); CHECK(PI_DBG_DLP, PI_DBG_LVL_DEBUG, pi_dumpdata(DLP_RESPONSE_DATA(res, 0, 6), (size_t)data_len)); } else { data_len = result; } dlp_response_free(res); return data_len; } int dlp_WriteAppPreference(int sd, unsigned long creator, int prefID, int backup, int version, const void *buffer, size_t size) { int result; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_WriteAppPreference,"creator='%4.4s' prefID=%d backup=%d version=%d size=%ld", (const char *)&creator,prefID,backup,version,size); pi_reset_errors(sd); if (pi_version(sd) < 0x0101) { /* Emulate on PalmOS 1.0 */ int db, err1, err2; if ((result = dlp_OpenDB(sd, 0, dlpOpenWrite, "System Preferences", &db)) < 0) return result; if (buffer && size) { unsigned char dlp_buf[DLP_BUF_SIZE]; memcpy(dlp_buf + 2, buffer, size); set_short(dlp_buf, version); result = dlp_WriteResource(sd, db, creator, prefID, dlp_buf, size); } else { result = dlp_WriteResource(sd, db, creator, prefID, NULL, 0); } err1 = pi_error(sd); err2 = pi_palmos_error(sd); if (err1 != PI_ERR_SOCK_DISCONNECTED) dlp_CloseDB(sd, db); if (result < 0) { /* restore previous error after DB close */ pi_set_error(sd, err1); pi_set_palmos_error(sd, err2); } return result; } req = dlp_request_new(dlpFuncWriteAppPreference, 1, 12 + size); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long(DLP_REQUEST_DATA(req, 0, 0), creator); set_short(DLP_REQUEST_DATA(req, 0, 4), prefID); set_short(DLP_REQUEST_DATA(req, 0, 6), version); set_short(DLP_REQUEST_DATA(req, 0, 8), size); set_byte(DLP_REQUEST_DATA(req, 0, 10), backup ? 0x80 : 0); set_byte(DLP_REQUEST_DATA(req, 0, 11), 0); /* Reserved */ if ((size + 12) > DLP_BUF_SIZE) { LOG((PI_DBG_DLP, PI_DBG_LVL_ERR, "DLP WriteAppPreferenceV2: data too large (>64k)")); return PI_ERR_DLP_DATASIZE; } memcpy(DLP_REQUEST_DATA(req, 0, 12), buffer, size); result = dlp_exec (sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } int dlp_ReadNextModifiedRecInCategory(int sd, int dbhandle, int category, pi_buffer_t *buffer, recordid_t *recID, int *recindex, int *attr) { int result, data_len; struct dlpRequest *req; struct dlpResponse *res; TraceX(dlp_ReadNextModifiedRecInCategory,"category=%d",category); pi_reset_errors(sd); if (pi_version(sd) < 0x0101) { /* Emulate for PalmOS 1.0 */ int cat; LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ReadNextModifiedRecInCategory" " Emulating with: Handle: %d, Category: %d\n", dbhandle, category)); do { /* Fetch next modified record (in any category) */ result = dlp_ReadNextModifiedRec(sd, dbhandle, buffer, recID, recindex, attr, &cat); /* If none found, reset modified pointer so that another search on a different (or the same!) category will start from the beginning */ /* Working on same assumption as ReadNextRecInCat, elide this: if (r < 0) dlp_ResetDBIndex(sd, fHandle); */ /* Loop until we fail to get a record or a record is found in the proper category */ } while (result >= 0 && cat != category); return result; } req = dlp_request_new(dlpFuncReadNextModifiedRecInCategory, 1, 2); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), category); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { data_len = res->argv[0]->len - 10; if (recID) *recID = get_long(DLP_RESPONSE_DATA(res, 0, 0)); if (recindex) *recindex = get_short(DLP_RESPONSE_DATA(res, 0, 4)); if (attr) *attr = get_byte(DLP_RESPONSE_DATA(res, 0, 8)); if (buffer) { pi_buffer_clear (buffer); pi_buffer_append (buffer, DLP_RESPONSE_DATA(res, 0, 10), (size_t)data_len); } CHECK(PI_DBG_DLP, PI_DBG_LVL_DEBUG, record_dump( get_long(DLP_RESPONSE_DATA(res, 0, 0)), /* recID */ get_short(DLP_RESPONSE_DATA(res, 0, 4)), /* index */ get_byte(DLP_RESPONSE_DATA(res, 0, 8)), /* flags */ get_byte(DLP_RESPONSE_DATA(res, 0, 9)), /* catID */ DLP_RESPONSE_DATA(res, 0, 10), data_len)); } else { data_len = result; } dlp_response_free(res); return data_len; } int dlp_ReadNextModifiedRec(int sd, int dbhandle, pi_buffer_t *buffer, recordid_t * recID, int *recindex, int *attr, int *category) { int result, data_len; struct dlpRequest *req; struct dlpResponse *res; Trace(dlp_ReadNextModifiedRec); pi_reset_errors(sd); req = dlp_request_new (dlpFuncReadNextModifiedRec, 1, 1); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); result = dlp_exec (sd, req, &res); dlp_request_free(req); if (result >= 0) { data_len = res->argv[0]->len -10; if (recID) *recID = get_long(DLP_RESPONSE_DATA(res, 0, 0)); if (recindex) *recindex = get_short(DLP_RESPONSE_DATA(res, 0, 4)); if (attr) *attr = get_byte(DLP_RESPONSE_DATA(res, 0, 8)); if (category) *category = get_byte(DLP_RESPONSE_DATA(res, 0, 9)); if (buffer) { pi_buffer_clear (buffer); pi_buffer_append (buffer, DLP_RESPONSE_DATA(res, 0, 10), (size_t)data_len); } CHECK(PI_DBG_DLP, PI_DBG_LVL_DEBUG, record_dump( get_long(DLP_RESPONSE_DATA(res, 0, 0)), /* recID */ get_short(DLP_RESPONSE_DATA(res, 0, 4)), /* index */ get_byte(DLP_RESPONSE_DATA(res, 0, 8)), /* flags */ get_byte(DLP_RESPONSE_DATA(res, 0, 9)), /* catID */ DLP_RESPONSE_DATA(res, 0, 10), data_len)); } else { data_len = result; } dlp_response_free(res); return data_len; } int dlp_ReadRecordById(int sd, int dbhandle, recordid_t recuid, pi_buffer_t *buffer, int *recindex, int *attr, int *category) { int result; struct dlpRequest *req; struct dlpResponse *res; int maxBufferSize = pi_maxrecsize(sd) - RECORD_READ_SAFEGUARD_SIZE; TraceX(dlp_ReadRecordById,"recuid=0x%08lx",recuid); pi_reset_errors(sd); req = dlp_request_new(dlpFuncReadRecord, 1, 10); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0); set_long(DLP_REQUEST_DATA(req, 0, 2), recuid); set_short(DLP_REQUEST_DATA(req, 0, 6), 0); /* Offset into record */ set_short(DLP_REQUEST_DATA(req, 0, 8), buffer ? maxBufferSize : 0); /* length to return */ result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { result = res->argv[0]->len - 10; if (recindex) *recindex = get_short(DLP_RESPONSE_DATA(res, 0, 4)); if (attr) *attr = get_byte(DLP_RESPONSE_DATA(res, 0, 8)); if (category) *category = get_byte(DLP_RESPONSE_DATA(res, 0, 9)); if (buffer) { pi_buffer_clear (buffer); pi_buffer_append (buffer, DLP_RESPONSE_DATA(res, 0, 10), (size_t)result); /* Some devices such as the Tungsten TX, Treo 650 and Treo 700p lock up if you try to read the entire record if the ** record is almost at the maximum record size. The following mitigates this and allows the record ** to be read in two chunks. */ if (result == maxBufferSize) { dlp_response_free(res); req = dlp_request_new(dlpFuncReadRecord, 1, 10); if (req != NULL) { set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0); set_long(DLP_REQUEST_DATA(req, 0, 2), recuid); set_short(DLP_REQUEST_DATA(req, 0, 6), maxBufferSize); /* Offset into record */ set_short(DLP_REQUEST_DATA(req, 0, 8), buffer ? RECORD_READ_SAFEGUARD_SIZE : 0); /* length to return */ result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { result = res->argv[0]->len - 10; pi_buffer_append (buffer, DLP_RESPONSE_DATA(res, 0, 10), (size_t)result); result += maxBufferSize; } } } } CHECK(PI_DBG_DLP, PI_DBG_LVL_DEBUG, record_dump( get_long(DLP_RESPONSE_DATA(res, 0, 0)), /* recID */ get_short(DLP_RESPONSE_DATA(res, 0, 4)), /* index */ get_byte(DLP_RESPONSE_DATA(res, 0, 8)), /* flags */ get_byte(DLP_RESPONSE_DATA(res, 0, 9)), /* catID */ DLP_RESPONSE_DATA(res, 0, 10), result)); } dlp_response_free(res); return result; } int dlp_ReadRecordByIndex(int sd, int dbhandle, int recindex, pi_buffer_t *buffer, recordid_t * recuid, int *attr, int *category) { int result, large = 0; struct dlpRequest *req; struct dlpResponse *res; int maxBufferSize = pi_maxrecsize(sd) - RECORD_READ_SAFEGUARD_SIZE; TraceX(dlp_ReadRecordByIndex,"recindex=%d",recindex); pi_reset_errors(sd); /* TapWave (DLP 1.4) implements a `large' version of dlpFuncReadRecord, * which can return records >64k */ if (pi_version(sd) >= 0x0104) { req = dlp_request_new_with_argid(dlpFuncReadRecordEx, 0x21, 1, 12); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0x00); set_short(DLP_REQUEST_DATA(req, 0, 2), recindex); set_long(DLP_REQUEST_DATA(req, 0, 4), 0); /* Offset into record */ set_long(DLP_REQUEST_DATA(req, 0, 8), pi_maxrecsize(sd)); /* length to return */ large = 1; } else { req = dlp_request_new_with_argid(dlpFuncReadRecord, 0x21, 1, 8); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0x00); set_short(DLP_REQUEST_DATA(req, 0, 2), recindex); set_short(DLP_REQUEST_DATA(req, 0, 4), 0); /* Offset into record */ set_short(DLP_REQUEST_DATA(req, 0, 6), buffer ? maxBufferSize : 0); /* length to return */ } result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { result = res->argv[0]->len - (large ? 14 : 10); if (recuid) *recuid = get_long(DLP_RESPONSE_DATA(res, 0, 0)); if (attr) *attr = get_byte(DLP_RESPONSE_DATA(res, 0, large ? 12 : 8)); if (category) *category = get_byte(DLP_RESPONSE_DATA(res, 0, large ? 13 : 9)); if (buffer) { pi_buffer_clear (buffer); pi_buffer_append (buffer, DLP_RESPONSE_DATA(res, 0, large ? 14 : 10), (size_t)result); /* Some devices such as the Tungsten TX, Treo 650 and Treo 700p lock up if you try to read the entire record if the ** record is almost at the maximum record size. The following mitigates this and allows the record ** to be read in two chunks. */ if (result == maxBufferSize && !large) { dlp_response_free(res); req = dlp_request_new_with_argid(dlpFuncReadRecord, 0x21, 1, 8); if (req != NULL) { set_byte(DLP_REQUEST_DATA(req, 0, 0), dbhandle); set_byte(DLP_REQUEST_DATA(req, 0, 1), 0x00); set_short(DLP_REQUEST_DATA(req, 0, 2), recindex); set_short(DLP_REQUEST_DATA(req, 0, 4), maxBufferSize); /* Offset into record */ set_short(DLP_REQUEST_DATA(req, 0, 6), buffer ? RECORD_READ_SAFEGUARD_SIZE : 0); /* length to return */ result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { result = res->argv[0]->len - (large ? 14 : 10); pi_buffer_append (buffer, DLP_RESPONSE_DATA(res, 0, large ? 14 : 10), (size_t)result); result += maxBufferSize; } } } } CHECK(PI_DBG_DLP, PI_DBG_LVL_DEBUG, record_dump( get_long(DLP_RESPONSE_DATA(res, 0, 0)), /* recUID */ get_short(DLP_RESPONSE_DATA(res, 0, 4)), /* index */ get_byte(DLP_RESPONSE_DATA(res, 0, large ? 12 : 8)), /* flags */ get_byte(DLP_RESPONSE_DATA(res, 0, large ? 13 : 9)), /* catID */ DLP_RESPONSE_DATA(res, 0, large ? 14 : 10), result)); } dlp_response_free(res); return result; } int dlp_ExpSlotEnumerate(int sd, int *numSlots, int *slotRefs) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); Trace(dlp_ExpSlotEnumerate); pi_reset_errors(sd); req = dlp_request_new(dlpFuncExpSlotEnumerate, 0); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { int slots, i; slots = get_short(DLP_RESPONSE_DATA (res, 0, 0)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ExpSlotEnumerate %d\n", slots)); if (slots) { for (i = 0; i < slots && i < *numSlots; i++) { slotRefs[i] = get_short(DLP_RESPONSE_DATA (res, 0, 2 + (2 * i))); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " %d Slot-Refnum %d\n", i, slotRefs[i])); } } *numSlots = slots; } dlp_response_free(res); return result; } int dlp_ExpCardPresent(int sd, int slotRef) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_ExpCardPresent,"slotRef=%d",slotRef); pi_reset_errors(sd); req = dlp_request_new (dlpFuncExpCardPresent, 1, 2); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_short(DLP_REQUEST_DATA(req, 0, 0), slotRef); result = dlp_exec (sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } int dlp_ExpCardInfo(int sd, int slotRef, unsigned long *flags, int *numStrings, char **strings) { int result; struct dlpRequest* req; struct dlpResponse* res; RequireDLPVersion(sd,1,2); TraceX(dlp_ExpCardInfo,"slotRef=%d",slotRef); pi_reset_errors(sd); req = dlp_request_new (dlpFuncExpCardInfo, 1, 2); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_short(DLP_REQUEST_DATA(req, 0, 0), slotRef); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { *flags = get_long(DLP_RESPONSE_DATA (res, 0, 0)); *numStrings = get_byte(DLP_RESPONSE_DATA (res, 0, 4)); if (strings && *numStrings) { int i, len, sz = 0; char *p = DLP_RESPONSE_DATA (res, 0, 8); for (i=0; i < *numStrings; i++, sz+=len, p+=len) len = strlen (p) + 1; *strings = (char *) malloc ((size_t)sz); if (*strings) memcpy (*strings, DLP_RESPONSE_DATA (res, 0, 8), (size_t)sz); else result = pi_set_error(sd, PI_ERR_GENERIC_MEMORY); } LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP ExpCardInfo flags: 0x%08lx numStrings: %d\n", *flags, *numStrings)); } dlp_response_free(res); return result; } int dlp_VFSGetDefaultDir(int sd, int volRefNum, const char *type, char *dir, int *len) { int result, buflen; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSGetDefaultDir,"volRefNum=%d",volRefNum); pi_reset_errors(sd); req = dlp_request_new(dlpFuncVFSGetDefaultDir, 1, 2 + (strlen(type) + 1)); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_short(DLP_REQUEST_DATA(req, 0, 0), volRefNum); strcpy(DLP_REQUEST_DATA(req, 0, 2), type); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { buflen = get_short(DLP_RESPONSE_DATA (res, 0, 0)); if (*len < buflen + 1) result = pi_set_error(sd, PI_ERR_DLP_BUFSIZE); else { if (buflen) strncpy(dir, DLP_RESPONSE_DATA (res, 0, 2), (size_t)buflen); else dir[0] = '\0'; *len = buflen; LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "Default dir is %s\n", dir)); } } dlp_response_free(res); return result; } int dlp_VFSImportDatabaseFromFile(int sd, int volRefNum, const char *path, int *cardno, unsigned long *localid) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSImportDatabaseFromFile,"volRefNum=%d path='%s'",volRefNum,path); pi_reset_errors(sd); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "Import file <%s>%d\n", path)); req = dlp_request_new(dlpFuncVFSImportDatabaseFromFile, 1, 2 + (strlen(path) + 1)); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_short(DLP_REQUEST_DATA(req, 0, 0), volRefNum); strcpy(DLP_REQUEST_DATA(req, 0, 2), path); result = dlp_exec(sd, req, &res); dlp_request_free(req); if (result > 0) { if (cardno) *cardno = get_short(DLP_RESPONSE_DATA (res, 0, 0)); if (localid) *localid = get_short(DLP_RESPONSE_DATA (res, 0, 2)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "Database imported as: cardNo:%d dbID:%d\n", get_short(DLP_RESPONSE_DATA (res, 0, 0)), get_short(DLP_RESPONSE_DATA (res, 0, 2)))); } dlp_response_free(res); return result; } int dlp_VFSExportDatabaseToFile(int sd, int volRefNum, const char *path, int cardno, unsigned int localid) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSExportDatabaseToFile,"cardno=%d localid=0x%08lx volRefNum=%d path='%s'", cardno,(long)localid,volRefNum,path); pi_reset_errors(sd); req = dlp_request_new(dlpFuncVFSExportDatabaseToFile, 1, 8 + (strlen(path) + 1)); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_short(DLP_REQUEST_DATA(req, 0, 0), volRefNum); set_short(DLP_REQUEST_DATA(req, 0, 2), cardno); set_long(DLP_REQUEST_DATA(req, 0, 4), localid); strcpy(DLP_REQUEST_DATA(req, 0, 8), path); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } int dlp_VFSFileCreate(int sd, int volRefNum, const char *name) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSFileCreate,"volRefNum=%d name='%s'",volRefNum,name); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSFileCreate, 1, 2 + (strlen(name) + 1)); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_short (DLP_REQUEST_DATA (req, 0, 0), volRefNum); strcpy (DLP_REQUEST_DATA (req, 0, 2), name); result = dlp_exec (sd, req, &res); dlp_request_free (req); dlp_response_free (res); return result; } int dlp_VFSFileOpen(int sd, int volRefNum, const char *path, int openMode, FileRef *fileRef) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSFileOpen,"volRefNum=%d mode=0x%04x path='%s'", volRefNum,openMode,path); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSFileOpen, 1, 4 + (strlen (path) + 1)); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_short (DLP_REQUEST_DATA (req, 0, 0), volRefNum); set_short (DLP_REQUEST_DATA (req, 0, 2), openMode); strcpy (DLP_REQUEST_DATA (req, 0, 4), path); result = dlp_exec (sd, req, &res); dlp_request_free (req); if (result > 0) { *fileRef = get_long(DLP_RESPONSE_DATA (res, 0, 0)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "OpenFileRef: 0x%x\n", *fileRef)); } dlp_response_free(res); return result; } int dlp_VFSFileClose(int sd, FileRef fileRef) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSFileClose,"fileRef=%ld",fileRef); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSFileClose, 1, 4); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long (DLP_REQUEST_DATA (req, 0, 0), fileRef); result = dlp_exec (sd, req, &res); dlp_request_free (req); dlp_response_free (res); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "Closed FileRef: %x\n", fileRef)); return result; } int dlp_VFSFileWrite(int sd, FileRef fileRef, const void *data, size_t len) { int result; struct dlpRequest *req; struct dlpResponse *res = NULL; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSFileWrite,"fileRef=%ld len=%ld",(long)fileRef,(long)len); pi_reset_errors(sd); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "Write to FileRef: %x bytes %d\n", fileRef, len)); req = dlp_request_new (dlpFuncVFSFileWrite, 1, 8); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long (DLP_REQUEST_DATA (req, 0, 0), fileRef); set_long (DLP_REQUEST_DATA (req, 0, 4), len); result = dlp_exec (sd, req, &res); dlp_request_free (req); if (result >= 0) { int bytes = pi_write (sd, data, len); result = bytes; if (result < (int)len) { LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "send failed %d\n", result)); } else { dlp_response_free (res); res = NULL; result = dlp_response_read (&res, sd); if (result > 0) { pi_set_palmos_error(sd, get_short(DLP_RESPONSE_DATA (res, 0, 2))); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "send success (%d) res 0x%04x!\n", len, pi_palmos_error(sd))); result = bytes; } } } dlp_response_free (res); return result; } int dlp_VFSFileRead(int sd, FileRef fileRef, pi_buffer_t *data, size_t len) { int result; struct dlpRequest *req; struct dlpResponse *res; size_t bytes = 0; int freeze_txid = 1; size_t opt_size = sizeof(int); RequireDLPVersion(sd,1,2); TraceX(dlp_VFSFileRead,"fileRef=%ld len=%ld",(long)fileRef,(long)len); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSFileRead, 1, 8); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long (DLP_REQUEST_DATA (req, 0, 0), fileRef); set_long (DLP_REQUEST_DATA (req, 0, 4), len); /* if we're using PADP, this socket option is required so that * the transfer can complete without error */ pi_setsockopt(sd, PI_LEVEL_PADP, PI_PADP_FREEZE_TXID, &freeze_txid, &opt_size); result = dlp_exec (sd, req, &res); dlp_request_free (req); pi_buffer_clear (data); if (result >= 0) { do { result = pi_read(sd, data, len); if (result > 0) { len -= result; bytes += result; } } while (result > 0 && len > 0); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "dlp_VFSFileRead: read %u bytes (last pi_read was %d)\n", (unsigned)bytes, result)); if (result >= 0) result = bytes; } dlp_response_free(res); freeze_txid = 0; pi_setsockopt(sd, PI_LEVEL_PADP, PI_PADP_FREEZE_TXID, &freeze_txid, &opt_size); return result; } int dlp_VFSFileDelete(int sd, int volRefNum, const char *path) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSFileDelete,"volRefNum=%d path='%s'",volRefNum,path); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSFileDelete, 1, 2 + (strlen (path) + 1)); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_short (DLP_REQUEST_DATA (req, 0, 0), volRefNum); strcpy (DLP_REQUEST_DATA (req, 0, 2), path); result = dlp_exec (sd, req, &res); dlp_request_free (req); dlp_response_free (res); return result; } int dlp_VFSFileRename(int sd, int volRefNum, const char *path, const char *newname) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSFileRename,"volRefNum=%d file '%s' renamed '%s'", volRefNum,path,rename); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSFileRename, 1, 4 + (strlen (path) + 1) + (strlen (newname) + 1)); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_short (DLP_REQUEST_DATA (req, 0, 0), volRefNum); set_short (DLP_REQUEST_DATA (req, 0, 2), 2); strcpy (DLP_REQUEST_DATA (req, 0, 4), path); strcpy (DLP_REQUEST_DATA (req, 0, 4 + (strlen(path) + 1)), newname); result = dlp_exec (sd, req, &res); dlp_request_free (req); dlp_response_free (res); return result; } int dlp_VFSFileEOF(int sd, FileRef fileRef) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSFileEOF,"fileRef=%ld",fileRef); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSFileEOF, 1, 4); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long (DLP_REQUEST_DATA (req, 0, 0), fileRef); result = dlp_exec (sd, req, &res); dlp_request_free (req); dlp_response_free (res); return result; } int dlp_VFSFileTell(int sd, FileRef fileRef,int *position) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSFileTell,"fileRef=%ld",fileRef); pi_reset_errors(sd); req = dlp_request_new(dlpFuncVFSFileTell, 1, 4); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long (DLP_REQUEST_DATA (req, 0, 0), fileRef); result = dlp_exec (sd, req, &res); dlp_request_free (req); if (result > 0) { *position = get_long (DLP_RESPONSE_DATA (res, 0, 0)); } dlp_response_free (res); return result; } int dlp_VFSFileGetAttributes (int sd, FileRef fileRef, unsigned long *attributes) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSFileGetAttributes,"fileRef=%ld",fileRef); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSFileGetAttributes, 1, 4); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long (DLP_REQUEST_DATA (req, 0, 0), fileRef); result = dlp_exec (sd, req, &res); dlp_request_free (req); if (result > 0) { *attributes = get_long (DLP_RESPONSE_DATA (res, 0, 0)); } dlp_response_free(res); return result; } int dlp_VFSFileSetAttributes(int sd, FileRef fileRef, unsigned long attributes) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSFileSetAttributes,"fileRef=%ld attributes=0x%08lx", fileRef,attributes); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSFileSetAttributes, 1, 8); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long (DLP_REQUEST_DATA (req, 0, 0), fileRef); set_long (DLP_REQUEST_DATA (req, 0, 4), attributes); result = dlp_exec (sd, req, &res); dlp_request_free (req); dlp_response_free (res); return result; } int dlp_VFSFileGetDate(int sd, FileRef fileRef, int which, time_t *date) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSFileGetDate,"fileRef=%ld which=%d",fileRef,which); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSFileGetDate, 1, 6); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long (DLP_REQUEST_DATA (req, 0, 0), fileRef); set_short (DLP_REQUEST_DATA (req, 0, 4), which); result = dlp_exec (sd, req, &res); dlp_request_free (req); if (result > 0) { *date = get_long (DLP_RESPONSE_DATA (res, 0, 0)) - 2082852000; LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "Requested date(%d): %d / %x calc %d / %x\n",which, get_long(DLP_RESPONSE_DATA (res, 0, 0)), get_long(DLP_RESPONSE_DATA (res, 0, 0)), *date,*date)); } dlp_response_free (res); return result; } int dlp_VFSFileSetDate(int sd, FileRef fileRef, int which, time_t date) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSFileSetDate,"fileRef=%ld which=%d date=0x%08lx", (long)fileRef,which,(long)date); pi_reset_errors(sd); req = dlp_request_new(dlpFuncVFSFileSetDate, 1, 10); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long (DLP_REQUEST_DATA(req, 0, 0), fileRef); set_short (DLP_REQUEST_DATA(req, 0, 4), which); set_long (DLP_REQUEST_DATA(req, 0, 6), date + 2082852000); result = dlp_exec (sd, req, &res); dlp_request_free (req); dlp_response_free (res); return result; } int dlp_VFSDirCreate(int sd, int volRefNum, const char *path) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSDirCreate,"volRefNum=%d path='%s'",volRefNum,path); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSDirCreate, 1, 2 + (strlen(path) + 1)); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_short (DLP_REQUEST_DATA (req, 0, 0), volRefNum); strcpy (DLP_REQUEST_DATA (req, 0, 2), path); result = dlp_exec (sd, req, &res); dlp_request_free (req); dlp_response_free (res); return result; } int dlp_VFSDirEntryEnumerate(int sd, FileRef dirRefNum, unsigned long *dirIterator, int *maxDirItems, struct VFSDirInfo *data) { unsigned int result, entries, from, at, slen, count; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSDirEntryEnumerate,"dirRef=%ld",dirRefNum); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSDirEntryEnumerate, 1, 12); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long (DLP_REQUEST_DATA (req, 0, 0), dirRefNum); set_long (DLP_REQUEST_DATA (req, 0, 4), *dirIterator); set_long (DLP_REQUEST_DATA (req, 0, 8), 8 + *maxDirItems * (4 + vfsMAXFILENAME)); result = dlp_exec (sd, req, &res); dlp_request_free (req); if (result > 0) { if (result) { *dirIterator = get_long (DLP_RESPONSE_DATA (res, 0, 0)); entries = get_long (DLP_RESPONSE_DATA (res, 0, 4)); } else { *dirIterator = vfsIteratorStop; entries = 0; } LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "%d results returnd (ilterator: %d)\n", entries, *dirIterator)); from = 8; count = 0; for (at = 0; at < entries; at++) { if (*maxDirItems > at) { data[at].attr = get_long(DLP_RESPONSE_DATA (res, 0, from)); /* fix for Sony sims (and probably devices too): they return the attributes in the high word of attr instead of the low word. We can safely shift it since the high 16 bits are not used for VFS flags */ if ((data[at].attr & 0x0000FFFF) == 0 && (data[at].attr & 0xFFFF0000) != 0) data[at].attr >>= 16; strncpy (data[at].name, DLP_RESPONSE_DATA(res, 0, from + 4), vfsMAXFILENAME); data[at].name[vfsMAXFILENAME-1] = 0; count++; } /* Zero terminated string. Strings that have an even length will be null terminated and have a pad byte. */ slen = strlen (DLP_RESPONSE_DATA(res, 0, from + 4)) + 1; if (slen & 1) slen++; /* make even stringlen + NULL */ /* 6 = 4 (attr) + 1 (NULL) -+ 1 (PADDING) */ from += slen + 4; } *maxDirItems = count; } dlp_response_free (res); return result; } int dlp_VFSVolumeFormat(int sd, unsigned char flags, int fsLibRef, struct VFSSlotMountParam *param) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); Trace(dlp_VFSVolumeFormat); pi_reset_errors(sd); req = dlp_request_new(dlpFuncVFSVolumeFormat, 1, 4); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); /* FIXME check sizes, list the mount params properly */ set_short(DLP_REQUEST_DATA(req, 0, 0), fsLibRef); set_short(DLP_REQUEST_DATA(req, 0, 2), sizeof(struct VFSSlotMountParam)); set_byte(DLP_REQUEST_DATA(req, 0, 4), flags); set_byte(DLP_REQUEST_DATA(req, 0, 4), 0); /* unused */ set_short(DLP_REQUEST_DATA(req, 0, 6), param->vfsMountParam.volRefNum); set_short(DLP_REQUEST_DATA(req, 0, 8), param->vfsMountParam.reserved); set_long(DLP_REQUEST_DATA(req, 0, 10), param->vfsMountParam.mountClass); set_short(DLP_REQUEST_DATA(req, 0, 14), param->slotLibRefNum); set_short(DLP_REQUEST_DATA(req, 0, 16), param->slotRefNum); result = dlp_exec(sd, req, &res); dlp_request_free(req); dlp_response_free(res); return result; } int dlp_VFSVolumeEnumerate(int sd, int *numVols, int *volRefs) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); Trace(dlp_VFSVolumeEnumerate); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSVolumeEnumerate, 0); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); result = dlp_exec (sd, req, &res); dlp_request_free (req); if (result > 0) { int vols, i; vols = get_short (DLP_RESPONSE_DATA (res, 0, 0)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP VFSVolumeEnumerate %d\n", vols)); if (vols) { for (i = 0; i < vols && i < *numVols; i++) { volRefs[i] = get_short (DLP_RESPONSE_DATA (res, 0, 2 + (2 * i))); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, " %d Volume-Refnum %d\n", i, volRefs[i])); } } *numVols = vols; } else *numVols = 0; dlp_response_free (res); return result; } int dlp_VFSVolumeInfo(int sd, int volRefNum, struct VFSInfo *volInfo) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSVolumeInfo,"volRefNum=%d",volRefNum); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSVolumeInfo, 1, 2); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_short (DLP_REQUEST_DATA(req, 0, 0), volRefNum); result = dlp_exec (sd, req, &res); dlp_request_free (req); if (result > 0) { volInfo->attributes = get_long (DLP_RESPONSE_DATA (res, 0, 0)); volInfo->fsType = get_long (DLP_RESPONSE_DATA (res, 0, 4)); volInfo->fsCreator = get_long (DLP_RESPONSE_DATA (res, 0, 8)); volInfo->mountClass = get_long (DLP_RESPONSE_DATA (res, 0, 12)); volInfo->slotLibRefNum = get_short (DLP_RESPONSE_DATA (res, 0, 16)); volInfo->slotRefNum = get_short (DLP_RESPONSE_DATA (res, 0, 18)); volInfo->mediaType = get_long (DLP_RESPONSE_DATA (res, 0, 20)); volInfo->reserved = get_long (DLP_RESPONSE_DATA (res, 0, 24)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "VFSVolumeInfo: fstype '%s' ", printlong(volInfo->fsType))); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "fscreator: '%s'\nSlotlibref %d Slotref %d\n", printlong(volInfo->fsCreator), volInfo->slotLibRefNum, volInfo->slotRefNum)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "Media: '%s'\n", printlong(volInfo->mediaType))); } dlp_response_free(res); return result; } int dlp_VFSVolumeGetLabel(int sd, int volRefNum, int *len, char *name) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSVolumeGetLabel,"volRefNum=%d",volRefNum); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSVolumeGetLabel, 1, 2); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_short (DLP_REQUEST_DATA (req, 0, 0), volRefNum); result = dlp_exec (sd, req, &res); dlp_request_free (req); if (result > 0) { strncpy(name, DLP_RESPONSE_DATA(res, 0, 0), (size_t)(*len - 1)); *len = strlen(name); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP VFSVolumeGetLabel %s\n", name)); } dlp_response_free(res); return result; } int dlp_VFSVolumeSetLabel(int sd, int volRefNum, const char *name) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSVolumeSetLabel,"volRefNum=%d name='%s'",volRefNum,name); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSVolumeSetLabel, 1, 2 + (strlen(name) + 1)); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_short (DLP_REQUEST_DATA (req, 0, 0), volRefNum); strcpy (DLP_REQUEST_DATA (req, 0, 2), name); result = dlp_exec (sd, req, &res); dlp_response_free (res); dlp_request_free (req); return result; } int dlp_VFSVolumeSize(int sd, int volRefNum, long *volSizeUsed, long *volSizeTotal) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSVolumeSize,"volRefNum=%d",volRefNum); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSVolumeSize, 1, 2); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_short (DLP_REQUEST_DATA (req, 0, 0), volRefNum); result = dlp_exec (sd, req, &res); dlp_request_free (req); if (result > 0) { *volSizeUsed = get_long (DLP_RESPONSE_DATA (res, 0, 0)); *volSizeTotal = get_long (DLP_RESPONSE_DATA (res, 0, 4)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP VFS Volume Size total: %d used: %d\n", *volSizeTotal, *volSizeUsed)); } dlp_response_free (res); return result; } int dlp_VFSFileSeek(int sd, FileRef fileRef, int origin, int offset) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSFileSeek,"fileRef=%ld origin=%d offset=%d", fileRef,origin,offset); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSFileSeek, 1, 10); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long (DLP_REQUEST_DATA (req, 0, 0), fileRef); set_short (DLP_REQUEST_DATA (req, 0, 4), origin); set_long (DLP_REQUEST_DATA (req, 0, 6), offset); result = dlp_exec (sd, req, &res); dlp_request_free (req); dlp_response_free (res); return result; } int dlp_VFSFileResize(int sd, FileRef fileRef, int newSize) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSFileResize,"fileRef=%ld newSize=%d",fileRef,newSize); pi_reset_errors(sd); req = dlp_request_new(dlpFuncVFSFileResize, 1, 8); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long(DLP_REQUEST_DATA(req, 0, 0), fileRef); set_long(DLP_REQUEST_DATA(req, 0, 4), newSize); result = dlp_exec(sd, req, &res); dlp_request_free (req); dlp_response_free (res); return result; } int dlp_VFSFileSize(int sd, FileRef fileRef, int *size) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1,2); TraceX(dlp_VFSFileSize,"fileRef=%ld",fileRef); pi_reset_errors(sd); req = dlp_request_new (dlpFuncVFSFileSize, 1, 4); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_long (DLP_REQUEST_DATA (req, 0, 0), fileRef); result = dlp_exec (sd, req, &res); dlp_request_free (req); if (result > 0) { *size = get_long (DLP_RESPONSE_DATA (res, 0, 0)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP VFS File Size: %d\n", *size)); } dlp_response_free (res); return result; } int dlp_ExpSlotMediaType(int sd, int slotNum, unsigned long *mediaType) { int result; struct dlpRequest *req; struct dlpResponse *res; RequireDLPVersion(sd,1, 4); TraceX(dlp_ExpSlotMediaType,"slotNum=%d",slotNum); pi_reset_errors(sd); req = dlp_request_new (dlpFuncExpSlotMediaType, 1, 2); if (req == NULL) return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); set_short (DLP_REQUEST_DATA (req, 0, 0), slotNum); result = dlp_exec (sd, req, &res); dlp_request_free (req); if (result > 0) { *mediaType = get_long (DLP_RESPONSE_DATA (res, 0, 0)); LOG((PI_DBG_DLP, PI_DBG_LVL_INFO, "DLP Media Type for slot %d: %4.4s\n", slotNum, mediaType)); } dlp_response_free (res); return result; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/unixserial.c0000644000175000017500000004202310513447543021415 0ustar rousseaurousseau/* * $Id: unixserial.c,v 1.53 2006/10/12 14:21:23 desrod Exp $ * * unixserial.c: tty line interface code for Pilot serial comms under UNIX * * Copyright (c) 1996, 1997, D. Jeff Dionne & Kenneth Albanowski. * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this 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 #include #include #include #include #include #include #include #include /* Needed for Redhat 6.x machines */ #include #include #include "pi-debug.h" #include "pi-source.h" #include "pi-serial.h" #include "pi-error.h" /* if this is running on a NeXT system... */ #ifdef NeXT #include #include #include #endif #ifdef HAVE_SYS_IOCTL_COMPAT_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #ifndef SGTTY #ifndef HAVE_CFMAKERAW #define cfmakeraw(ptr) (ptr)->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR\ |IGNCR|ICRNL|IXON);\ (ptr)->c_oflag &= ~OPOST;\ (ptr)->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);\ (ptr)->c_cflag &= ~(CSIZE|PARENB);\ (ptr)->c_cflag |= CS8 #endif #ifndef HAVE_CFSETSPEED #if defined(HAVE_CFSETISPEED) && defined(HAVE_CFSETOSPEED) #define cfsetspeed(t,speed) \ (cfsetispeed(t,speed) || cfsetospeed(t,speed)) #else static int cfsetspeed(struct termios *t, int speed) { #ifdef HAVE_TERMIOS_CSPEED t->c_ispeed = speed; t->c_ospeed = speed; #else t->c_cflag |= speed; #endif return 0; } #endif #endif #endif /* SGTTY */ #ifndef O_NONBLOCK # define O_NONBLOCK 0 #endif /* Linux versions "before 2.1.8 or so" fail to flush hardware FIFO on port close */ #ifdef linux # ifndef LINUX_VERSION_CODE # include # endif # ifndef LINUX_VERSION_CODE # define sleeping_beauty # else # if (LINUX_VERSION_CODE < 0x020108) # define sleeping_beauty # endif # endif #endif /* Unspecified NetBSD versions fail to flush hardware FIFO on port close */ #if defined(__NetBSD__) || defined (__OpenBSD__) # define sleeping_beauty #endif /* Unspecified BSD/OS versions fail to flush hardware FIFO on port close */ #ifdef __bsdi__ # define sleeping_beauty #endif /* SGI IRIX fails to flush hardware FIFO on port close */ #ifdef __sgi # define sleeping_beauty #endif /* Declare prototypes */ static int s_open(pi_socket_t *ps, struct pi_sockaddr *addr, size_t addrlen); static int s_close(pi_socket_t *ps); static int s_changebaud(pi_socket_t *ps); static ssize_t s_write(pi_socket_t *ps, const unsigned char *buf, size_t len, int flags); static ssize_t s_read(pi_socket_t *ps, pi_buffer_t *buf, size_t len, int flags); static int s_poll(pi_socket_t *ps, int timeout); static speed_t calcrate(int baudrate); void pi_serial_impl_init (struct pi_serial_impl *impl); static int s_flush(pi_socket_t *ps, int flags); #ifdef sleeping_beauty static void s_delay(time_t sec, suseconds_t usec); #endif /*********************************************************************** * * Function: s_open * * Summary: Open the serial port and establish a connection for * unix * * Parameters: pi_socket_t*, pi_socket_taddr*, size_t * * Returns: The file descriptor or negative on error * ***********************************************************************/ int s_open(pi_socket_t *ps, struct pi_sockaddr *addr, size_t addrlen) { int fd, i; char *tty = addr->pi_device; struct pi_serial_data *data = (struct pi_serial_data *)ps->device->data; #ifndef SGTTY struct termios tcn; #else struct sgttyb tcn; #endif if ((fd = open(tty, O_RDWR | O_NONBLOCK)) < 0) { ps->last_error = PI_ERR_GENERIC_SYSTEM; return PI_ERR_GENERIC_SYSTEM; /* errno already set */ } if (!isatty(fd)) { close(fd); errno = EINVAL; ps->last_error = PI_ERR_GENERIC_SYSTEM; return PI_ERR_GENERIC_SYSTEM; } #ifndef SGTTY /* Set the tty to raw and to the correct speed */ tcgetattr(fd, &tcn); data->tco = tcn; tcn.c_oflag = 0; tcn.c_iflag = IGNBRK | IGNPAR; tcn.c_cflag = CREAD | CLOCAL | CS8; cfsetspeed(&tcn, calcrate(data->rate)); tcn.c_lflag = NOFLSH; cfmakeraw(&tcn); for (i = 0; i < 16; i++) tcn.c_cc[i] = 0; tcn.c_cc[VMIN] = 1; tcn.c_cc[VTIME] = 0; tcsetattr(fd, TCSANOW, &tcn); #else /* Set the tty to raw and to the correct speed */ ioctl(fd, TIOCGETP, &tcn); data->tco = tcn; tcn.sg_flags = RAW; tcn.sg_ispeed = calcrate(data->rate); tcn.sg_ospeed = calcrate(data->rate); ioctl(fd, TIOCSETN, &tcn); #endif if ((i = fcntl(fd, F_GETFL, 0)) != -1) { i &= ~O_NONBLOCK; fcntl(fd, F_SETFL, i); } if ((i = pi_socket_setsd(ps, fd)) < 0) return i; return fd; } /*********************************************************************** * * Function: s_close * * Summary: Close the open socket/file descriptor * * Parameters: pi_socket_t* * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int s_close(pi_socket_t *ps) { #ifdef sleeping_beauty s_delay(2, 0); #endif #if 0 /* previous test would never allow this code to execute */ #ifndef SGTTY tcsetattr(ps->sd, TCSADRAIN, &data->tco); #else ioctl(ps->sd, TIOCSETP, &data->tco); #endif #endif LOG((PI_DBG_DEV, PI_DBG_LVL_INFO, "DEV CLOSE unixserial fd: %d\n", ps->sd)); return close(ps->sd); } /*********************************************************************** * * Function: s_poll * * Summary: poll the open socket/file descriptor * * Parameters: pi_socket_t*, timeout in milliseconds * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int s_poll(pi_socket_t *ps, int timeout) { struct pi_serial_data *data = (struct pi_serial_data *)ps->device->data; struct timeval t; fd_set ready; FD_ZERO(&ready); FD_SET(ps->sd, &ready); /* If timeout == 0, wait forever for packet, otherwise wait till timeout milliseconds */ if (timeout == 0) select(ps->sd + 1, &ready, 0, 0, 0); else { t.tv_sec = timeout / 1000; t.tv_usec = (timeout % 1000) * 1000; if (select(ps->sd + 1, &ready, 0, 0, &t) == 0) return pi_set_error(ps->sd, PI_ERR_SOCK_TIMEOUT); } if (!FD_ISSET(ps->sd, &ready)) { /* otherwise throw out any current packet and return */ LOG((PI_DBG_DEV, PI_DBG_LVL_WARN, "DEV POLL unixserial timeout\n")); data->rx_errors++; errno = ETIMEDOUT; return pi_set_error(ps->sd, PI_ERR_SOCK_TIMEOUT); } LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "DEV POLL unixserial found data on fd: %d\n", ps->sd)); return 0; } /*********************************************************************** * * Function: s_write * * Summary: Write to the open socket/file descriptor * * Parameters: pi_socket_t*, unsigned char* to buf, buf length * * Returns: number of bytes written or negative on error * ***********************************************************************/ static ssize_t s_write(pi_socket_t *ps, const unsigned char *buf, size_t len, int flags) { ssize_t total, nwrote; struct pi_serial_data *data = (struct pi_serial_data *)ps->device->data; struct timeval t; fd_set ready; FD_ZERO(&ready); FD_SET(ps->sd, &ready); total = len; while (total > 0) { if (data->timeout == 0) select(ps->sd + 1, 0, &ready, 0, 0); else { t.tv_sec = data->timeout / 1000; t.tv_usec = (data->timeout % 1000) * 1000; if (select(ps->sd + 1, 0, &ready, 0, &t) == 0) return pi_set_error(ps->sd, PI_ERR_SOCK_TIMEOUT); } if (!FD_ISSET(ps->sd, &ready)) return pi_set_error(ps->sd, PI_ERR_SOCK_TIMEOUT); nwrote = write(ps->sd, buf, len); if (nwrote < 0) { if (errno == EPIPE || errno == EBADF) { ps->state = PI_SOCK_CONN_BREAK; return pi_set_error(ps->sd, PI_ERR_SOCK_DISCONNECTED); } return pi_set_error(ps->sd, PI_ERR_SOCK_IO); } total -= nwrote; } data->tx_bytes += len; /* hack to slow things down so that the Visor will work */ usleep(10 + len); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "DEV TX unixserial wrote %d bytes\n", len)); return len; } /*********************************************************************** * * Function: s_read_buf * * Summary: read from data buffer * * Parameters: pi_socket_t*, pi_buffer_t* to buf, length to get * * Returns: number of bytes read * ***********************************************************************/ static size_t s_read_buf (pi_socket_t *ps, pi_buffer_t *buf, size_t len, int flags) { struct pi_serial_data *data = (struct pi_serial_data *)ps->device->data; size_t rbuf = data->buf_size; if (rbuf > len) rbuf = len; if (pi_buffer_append (buf, data->buf, rbuf) == NULL) { errno = ENOMEM; return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); } if (flags != PI_MSG_PEEK) { data->buf_size -= rbuf; if (data->buf_size > 0) memmove(data->buf, &data->buf[rbuf], data->buf_size); } LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "DEV RX unixserial read %d bytes from read-ahead buffer\n", rbuf)); return rbuf; } /*********************************************************************** * * Function: s_read * * Summary: Read incoming data from the socket/file descriptor * * Parameters: pi_socket_t*, pi_buffer_t* to buf, expect length, flags * * Returns: number of bytes read or negative on error * ***********************************************************************/ static ssize_t s_read(pi_socket_t *ps, pi_buffer_t *buf, size_t len, int flags) { ssize_t rbuf = 0, bytes; struct pi_serial_data *data = (struct pi_serial_data *)ps->device->data; struct timeval t; fd_set ready; /* check whether we have at least partial data in store */ if (data->buf_size) { rbuf = s_read_buf(ps, buf, len, flags); if (rbuf < 0) return rbuf; len -= rbuf; if (len == 0) return rbuf; } /* If timeout == 0, wait forever for packet, otherwise wait till timeout milliseconds */ FD_ZERO(&ready); FD_SET(ps->sd, &ready); if (data->timeout == 0) select(ps->sd + 1, &ready, 0, 0, 0); else { t.tv_sec = data->timeout / 1000; t.tv_usec = (data->timeout % 1000) * 1000; if (select(ps->sd + 1, &ready, 0, 0, &t) == 0) return pi_set_error(ps->sd, PI_ERR_SOCK_TIMEOUT); } /* If data is available in time, read it */ if (FD_ISSET(ps->sd, &ready)) { if (flags == PI_MSG_PEEK && len > 256) len = 256; if (pi_buffer_expect (buf, len) == NULL) { errno = ENOMEM; return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); } bytes = read(ps->sd, &buf->data[buf->used], len); if (bytes > 0) { if (flags == PI_MSG_PEEK) { memcpy(data->buf + data->buf_size, buf->data + buf->used, bytes); data->buf_size += bytes; } buf->used += bytes; data->rx_bytes += bytes; rbuf += bytes; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "DEV RX unixserial read %d bytes\n", bytes)); } else if (bytes < 0) { rbuf = bytes; } } else { LOG((PI_DBG_DEV, PI_DBG_LVL_WARN, "DEV RX unixserial timeout\n")); data->rx_errors++; errno = ETIMEDOUT; return pi_set_error(ps->sd, PI_ERR_SOCK_TIMEOUT); } return rbuf; } /*********************************************************************** * * Function: s_flush * * Summary: Flush incoming and/or outgoing data from the socket/file * descriptor * * Parameters: ps is of type pi_socket that contains the sd member which is * the file descriptor that the data in buf will be read. It * also contains the read buffer. * * flags is of type int and can be a combination of * PI_FLUSH_INPUT and PI_FLUSH_OUTPUT * * Returns: 0 * ***********************************************************************/ static int s_flush(pi_socket_t *ps, int flags) { int fl; char buf[256]; struct pi_serial_data *data = (struct pi_serial_data *) ps->device->data; if (flags & PI_FLUSH_INPUT) { /* clear internal buffer */ data->buf_size = 0; /* flush pending data (we assume the socket is in blocking mode) */ if ((fl = fcntl(ps->sd, F_GETFL, 0)) != -1) { fcntl(ps->sd, F_SETFL, fl | O_NONBLOCK); while (recv(ps->sd, buf, sizeof(buf), 0) > 0) ; fcntl(ps->sd, F_SETFL, fl); } LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "DEV FLUSH unixserial flushed input buffer\n")); } return 0; } #ifdef sleeping_beauty /*********************************************************************** * * Function: s_delay * * Summary: Delay for a given period of time * * Parameters: seconds, microseconds * * Returns: Nothing * ***********************************************************************/ static void s_delay(time_t sec, suseconds_t usec) { struct timeval tv; tv.tv_sec = sec; tv.tv_usec = usec; select(0, 0, 0, 0, &tv); } #endif /*********************************************************************** * * Function: s_changebaud * * Summary: Change the speed of the socket * * Parameters: pi_socket_t* * * Returns: 0 on success, negative otherwise * ***********************************************************************/ static int s_changebaud(pi_socket_t *ps) { struct pi_serial_data *data = (struct pi_serial_data *)ps->device->data; #ifndef SGTTY struct termios tcn; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "DEV SPEED unixserial switch to %d bps\n", (int)data->rate)); #ifdef sleeping_beauty s_delay(0, 200000); #endif /* Set the tty to the new speed */ if (tcgetattr(ps->sd, &tcn)) return pi_set_error(ps->sd, PI_ERR_GENERIC_SYSTEM); tcn.c_cflag = CREAD | CLOCAL | CS8; cfsetspeed(&tcn, calcrate(data->rate)); if (tcsetattr(ps->sd, TCSADRAIN, &tcn)) return pi_set_error(ps->sd, PI_ERR_GENERIC_SYSTEM); #else struct sgttyb tcn; if (ioctl(ps->sd, TIOCGETP, &tcn)) return pi_set_error(ps->sd, PI_ERR_GENERIC_SYSTEM); tcn.sg_ispeed = calcrate(data->rate); tcn.sg_ospeed = calcrate(data->rate); if (ioctl(ps->sd, TIOCSETN, &tcn)) return pi_set_error(ps->sd, PI_ERR_GENERIC_SYSTEM); #endif #ifdef sleeping_beauty s_delay(0, 200000); #endif return 0; } /*********************************************************************** * * Function: pi_serial_impl_init * * Summary: initialize function pointers for serial I/O operations * * Parameters: struct pi_serial_impl* * * Returns: void * ***********************************************************************/ void pi_serial_impl_init (struct pi_serial_impl *impl) { impl->open = s_open; impl->close = s_close; impl->changebaud = s_changebaud; impl->write = s_write; impl->read = s_read; impl->flush = s_flush; impl->poll = s_poll; } /*********************************************************************** * * Function: calcrate * * Summary: validates the selected baudrate * * Paramters: buadrate * * Returns: POSIX defined baudrate constant or terminates the process * if the requested baudrate is not supported. * ***********************************************************************/ static speed_t calcrate(int baudrate) { #ifdef B50 if (baudrate == 50) return B50; #endif #ifdef B75 if (baudrate == 75) return B75; #endif #ifdef B110 if (baudrate == 110) return B110; #endif #ifdef B134 if (baudrate == 134) return B134; #endif #ifdef B150 if (baudrate == 150) return B150; #endif #ifdef B200 if (baudrate == 200) return B200; #endif #ifdef B300 if (baudrate == 300) return B300; #endif #ifdef B600 if (baudrate == 600) return B600; #endif #ifdef B1200 if (baudrate == 1200) return B1200; #endif #ifdef B1800 if (baudrate == 1800) return B1800; #endif #ifdef B2400 if (baudrate == 2400) return B2400; #endif #ifdef B4800 if (baudrate == 4800) return B4800; #endif #ifdef B9600 if (baudrate == 9600) return B9600; #endif #ifdef B19200 else if (baudrate == 19200) return B19200; #endif #ifdef B38400 else if (baudrate == 38400) return B38400; #endif #ifdef B57600 else if (baudrate == 57600) return B57600; #endif #ifdef B76800 else if (baudrate == 76800) return B76800; #endif #ifdef B115200 else if (baudrate == 115200) return B115200; #endif #ifdef B230400 else if (baudrate == 230400) return B230400; #endif #ifdef B460800 else if (baudrate == 460800) return B460800; #endif LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "DEV Serial CHANGEBAUD Unable to set baud rate %d\n", baudrate)); abort(); /* invalid baud rate */ return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/usb.c0000644000175000017500000006342611206416142020024 0ustar rousseaurousseau/* * $Id: usb.c,v 1.57 2009/05/25 04:19:46 desrod Exp $ * * usb.c: Interface layer to serial HotSync connections * * Copyright (c) 1996, 1997, D. Jeff Dionne & Kenneth Albanowski * Copyright (c) 1999, Tilo Christ * Copyright (c) 2005, Florent Pillet * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include "pi-debug.h" #include "pi-source.h" #include "pi-usb.h" #include "pi-net.h" #include "pi-cmp.h" #include "pi-error.h" #include "pi-util.h" pi_protocol_t *pi_usb_protocol_dup (pi_protocol_t *prot); static int pi_usb_connect(pi_socket_t *ps, struct sockaddr *addr, size_t addrlen); static int pi_usb_bind(pi_socket_t *ps, struct sockaddr *addr, size_t addrlen); static int pi_usb_listen(pi_socket_t *ps, int backlog); static int pi_usb_accept(pi_socket_t *ps, struct sockaddr *addr, size_t *addrlen); static int pi_usb_getsockopt(pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len); static int pi_usb_setsockopt(pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len); static int pi_usb_close(pi_socket_t *ps); static int USB_configure_visor (pi_usb_data_t *dev, u_int8_t *input_pipe, u_int8_t *output_pipe); static int USB_configure_generic (pi_usb_data_t *dev, u_int8_t *input_pipe, u_int8_t *output_pipe); int pi_socket_init(pi_socket_t *ps); /* Protocol Functions */ /*********************************************************************** * * Function: pi_usb_protocol_dup * * Summary: creates a new copy of a USB pi_protocol instance * * Parameters: pi_protocol_t* * * Returns: new pi_protocol_t* or NULL if operation failed * ***********************************************************************/ pi_protocol_t * pi_usb_protocol_dup (pi_protocol_t *prot) { pi_protocol_t *new_prot; ASSERT(prot != NULL); new_prot = (pi_protocol_t *)malloc (sizeof (pi_protocol_t)); if (new_prot != NULL) { new_prot->level = prot->level; new_prot->dup = prot->dup; new_prot->free = prot->free; new_prot->read = prot->read; new_prot->write = prot->write; new_prot->flush = prot->flush; new_prot->getsockopt = prot->getsockopt; new_prot->setsockopt = prot->setsockopt; new_prot->data = NULL; } return new_prot; } /*********************************************************************** * * Function: pi_usb_protocol_free * * Summary: frees USB pi_protocol instance * * Parameters: pi_protocol_t* * * Returns: void * ***********************************************************************/ static void pi_usb_protocol_free (pi_protocol_t *prot) { ASSERT(prot != NULL); if (prot != NULL) free(prot); } /*********************************************************************** * * Function: pi_usb_protocol * * Summary: creates a new USB pi_protocol instance * * Parameters: pi_device_t* * * Returns: new pi_protocol_t* or NULL if operation failed * ***********************************************************************/ static pi_protocol_t * pi_usb_protocol (pi_device_t *dev) { pi_protocol_t *prot; pi_usb_data_t *data; ASSERT(dev != NULL); data = dev->data; prot = (pi_protocol_t *)malloc (sizeof (pi_protocol_t)); if (prot != NULL) { prot->level = PI_LEVEL_DEV; prot->dup = pi_usb_protocol_dup; prot->free = pi_usb_protocol_free; prot->read = data->impl.read; prot->write = data->impl.write; prot->flush = data->impl.flush; prot->getsockopt = pi_usb_getsockopt; prot->setsockopt = pi_usb_setsockopt; prot->data = NULL; } return prot; } /*********************************************************************** * * Function: pi_usb_device_free * * Summary: frees USB pi_device instance * * Parameters: pi_device_t* * * Returns: void * ***********************************************************************/ static void pi_usb_device_free (pi_device_t *dev) { pi_usb_data_t *data = (pi_usb_data_t *)dev->data; ASSERT(dev != NULL); if (data != NULL) free(data); if (dev != NULL) free(dev); } /*********************************************************************** * * Function: pi_usb_device * * Summary: creates a new USB pi_device instance * * Parameters: pi_device_t* * * Returns: new pi_device_t* or NULL if operation failed * ***********************************************************************/ pi_device_t * pi_usb_device (int type) { pi_device_t *dev; pi_usb_data_t *data; dev = (pi_device_t *)malloc (sizeof (pi_device_t)); if (dev != NULL) { data = (pi_usb_data_t *)malloc (sizeof (struct pi_usb_data)); if (data == NULL) { free(dev); dev = NULL; } else { dev->free = pi_usb_device_free; dev->protocol = pi_usb_protocol; dev->bind = pi_usb_bind; dev->listen = pi_usb_listen; dev->accept = pi_usb_accept; dev->connect = pi_usb_connect; dev->close = pi_usb_close; memset(data, 0, sizeof(struct pi_usb_data)); data->rate = -1; data->establishrate = -1; data->establishhighrate = 0; pi_usb_impl_init (&data->impl); dev->data = data; } } return dev; } /*********************************************************************** * * Function: pi_usb_connect * * Summary: Connect socket to a given address * * Parameters: pi_socket_t*, sockaddr*, socket length * * Returns: A negative number on error, 0 otherwise * ***********************************************************************/ static int pi_usb_connect(pi_socket_t *ps, struct sockaddr *addr, size_t addrlen) { struct pi_usb_data *data = (pi_usb_data_t *)ps->device->data; struct pi_sockaddr *pa = (struct pi_sockaddr *) addr; int result, timeout; size_t size; if (ps->type == PI_SOCK_STREAM) { if (ps->protocol == PI_PF_SYS) { data->establishrate = data->rate = 57600; } else { if (data->establishrate == -1) get_pilot_rate(&data->establishrate, &data->establishhighrate); /* Mandatory CMP connection rate */ data->rate = 9600; } } else if (ps->type == PI_SOCK_RAW) { /* Mandatory SysPkt connection rate */ data->establishrate = data->rate = 57600; } result = data->impl.open(ps, pa, addrlen); if (result < 0) goto fail; data->timeout = timeout = ps->accept_to * 1000; if (data->impl.wait_for_device) { result = data->impl.wait_for_device (ps, &timeout); if (result <= 0) goto fail; } ps->raddr = malloc(addrlen); memcpy(ps->raddr, addr, addrlen); ps->raddrlen = addrlen; ps->laddr = malloc(addrlen); memcpy(ps->laddr, addr, addrlen); ps->laddrlen = addrlen; if (ps->type == PI_SOCK_STREAM) { switch (ps->cmd) { case PI_CMD_CMP: if ((result = cmp_tx_handshake(ps)) < 0) goto fail; size = sizeof(data->rate); pi_getsockopt(ps->sd, PI_LEVEL_CMP, PI_CMP_BAUD, &data->rate, &size); if ((result = data->impl.changebaud(ps)) < 0) goto fail; break; case PI_CMD_NET: if ((result = net_tx_handshake(ps)) < 0) goto fail; break; } } ps->state = PI_SOCK_CONN_INIT; ps->command = 0; fail: return (result < 0) ? result : 0; } /*********************************************************************** * * Function: pi_usb_bind * * Summary: Bind address to a local socket * * Parameters: pi_socket_t*, sockaddr*, socket length * * Returns: A negative number on error, 0 otherwise * ***********************************************************************/ static int pi_usb_bind(pi_socket_t *ps, struct sockaddr *addr, size_t addrlen) { struct pi_usb_data *data = (pi_usb_data_t *)ps->device->data; struct pi_sockaddr *pa = (struct pi_sockaddr *) addr; int result; /* this rate stuff is only useful on platforms where USB-serial adapters * connect through the USB layer, not through a serial tty */ if (ps->type == PI_SOCK_STREAM) { if (data->establishrate == -1) get_pilot_rate(&data->establishrate, &data->establishhighrate); /* Mandatory CMP connection rate */ data->rate = 9600; } else if (ps->type == PI_SOCK_RAW) { /* Mandatory SysPkt connection rate */ data->establishrate = data->rate = 57600; } result = data->impl.open(ps, pa, addrlen); if (result < 0) return result; ps->raddr = malloc(addrlen); memcpy(ps->raddr, addr, addrlen); ps->raddrlen = addrlen; ps->laddr = malloc(addrlen); memcpy(ps->laddr, addr, addrlen); ps->laddrlen = addrlen; return 0; } /*********************************************************************** * * Function: pi_usb_listen * * Summary: Prepare for incoming connections * * Parameters: pi_socket_t*, backlog * * Returns: 0 * ***********************************************************************/ static int pi_usb_listen(pi_socket_t *ps, int backlog) { ps->state = PI_SOCK_LISTEN; return 0; } /*********************************************************************** * * Function: pi_usb_accept * * Summary: Accept an incoming connection * * Parameters: pi_socket_t*, sockaddr*, socket length * * Returns: pi_socket descriptor or negative on error * ***********************************************************************/ static int pi_usb_accept(pi_socket_t *ps, struct sockaddr *addr, size_t *addrlen) { struct pi_usb_data *data = (pi_usb_data_t *)ps->device->data; int result, timeout; size_t size; data->timeout = timeout = ps->accept_to * 1000; if (data->impl.wait_for_device) { result = data->impl.wait_for_device (ps, &timeout); if (result <= 0) return result; } /* Wait for data */ #ifdef LINUX /* * Evilish kluge, some palm devices won't send the initial * packets if we don't try and get them fairly quickly. * * Sending a 0 byte NET packet can get them talking again * in some cases though. */ result = data->impl.poll(ps, 1000); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s: %d, poll result: %d.\n", __FILE__, __LINE__, result)); if (result <= 0) { char buf[] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }; data->impl.write(ps, buf, sizeof (buf), 1000); } #endif result = data->impl.poll(ps, timeout); if (result <= 0) { if (result == 0) { return(PI_ERR_SOCK_LISTENER); } else { return result; } } pi_socket_init(ps); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s: %d, prot: 0x%x, type: 0x%x, cmd: 0x%x.\n", __FILE__, __LINE__, ps->protocol, ps->type, ps->cmd)); if (ps->type == PI_SOCK_STREAM) { struct timeval tv; unsigned char cmp_flags; switch (ps->cmd) { case PI_CMD_CMP: LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s: %d, cmp rx.\n", __FILE__, __LINE__)); if ((result = cmp_rx_handshake(ps, data->establishrate, data->establishhighrate)) < 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "usb.c: cmp_rx_handshake returned %d\n", result)); return result; } /* propagate the long packet format flag to both command and non-command stacks */ size = sizeof(cmp_flags); pi_getsockopt(ps->sd, PI_LEVEL_CMP, PI_CMP_FLAGS, &cmp_flags, &size); if (cmp_flags & CMP_FL_LONG_PACKET_SUPPORT) { int use_long_format = 1; size = sizeof(int); pi_setsockopt(ps->sd, PI_LEVEL_PADP, PI_PADP_USE_LONG_FORMAT, &use_long_format, &size); ps->command ^= 1; pi_setsockopt(ps->sd, PI_LEVEL_PADP, PI_PADP_USE_LONG_FORMAT, &use_long_format, &size); ps->command ^= 1; } /* reconfigure the port to match the negotiated speed */ size = sizeof(data->rate); pi_getsockopt(ps->sd, PI_LEVEL_CMP, PI_CMP_BAUD, &data->rate, &size); if (data->impl.changebaud != NULL) { if ((result = data->impl.changebaud(ps)) < 0) return result; /* handheld needs some time to reconfigure its port */ tv.tv_sec = 0; tv.tv_usec = 50000; select(0, 0, 0, 0, &tv); } break; case PI_CMD_NET: LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s: %d, net rx.\n", __FILE__, __LINE__)); if ((result = net_rx_handshake(ps)) < 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "usb.c: cmp_rx_handshake returned %d\n", result)); return result; } break; default: LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "%s: %d, unknown rx %x.\n", __FILE__, __LINE__,ps->cmd)); break; } ps->dlprecord = 0; } data->timeout = 0; ps->command = 0; ps->state = PI_SOCK_CONN_ACCEPT; return ps->sd; } /*********************************************************************** * * Function: pi_usb_getsockopt * * Summary: get options on USB socket * * Parameters: pi_socket*, level, option name, option value, option length * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int pi_usb_getsockopt(pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len) { pi_usb_data_t *data = (pi_usb_data_t *)ps->device->data; switch (option_name) { case PI_DEV_RATE: if (*option_len != sizeof (data->rate)) goto fail; memcpy (option_value, &data->rate, sizeof (data->rate)); break; case PI_DEV_ESTRATE: if (*option_len != sizeof (data->establishrate)) goto fail; memcpy (option_value, &data->establishrate, sizeof (data->establishrate)); break; case PI_DEV_HIGHRATE: if (*option_len != sizeof (data->establishhighrate)) goto fail; memcpy (option_value, &data->establishhighrate, sizeof (data->establishhighrate)); break; case PI_DEV_TIMEOUT: if (*option_len != sizeof (data->timeout)) goto fail; memcpy (option_value, &data->timeout, sizeof (data->timeout)); break; } return 0; fail: errno = EINVAL; return pi_set_error(ps->sd, PI_ERR_GENERIC_ARGUMENT); } /*********************************************************************** * * Function: pi_usb_setsockopt * * Summary: set options on USB socket * * Parameters: pi_socket*, level, option name, option value, option length * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int pi_usb_setsockopt(pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len) { pi_usb_data_t *data = (pi_usb_data_t *)ps->device->data; switch (option_name) { case PI_DEV_ESTRATE: if (*option_len != sizeof (data->establishrate)) goto fail; memcpy (&data->establishrate, option_value, sizeof (data->establishrate)); break; case PI_DEV_HIGHRATE: if (*option_len != sizeof (data->establishhighrate)) goto fail; memcpy (&data->establishhighrate, option_value, sizeof (data->establishhighrate)); break; case PI_DEV_TIMEOUT: if (*option_len != sizeof (data->timeout)) goto fail; memcpy (&data->timeout, option_value, sizeof (data->timeout)); break; } return 0; fail: errno = EINVAL; return pi_set_error(ps->sd, PI_ERR_GENERIC_ARGUMENT); } /*********************************************************************** * * Function: pi_usb_close * * Summary: Close a connection, destroy the socket * * Parameters: pi_socket_t* * * Returns: 0 * ***********************************************************************/ static int pi_usb_close(pi_socket_t *ps) { pi_usb_data_t *data = (pi_usb_data_t *)ps->device->data; if (ps->sd != 0) { data->impl.close (ps); ps->sd = 0; } if (ps->laddr != NULL) { free(ps->laddr); ps->laddr = NULL; } if (ps->raddr != NULL) { free(ps->raddr); ps->raddr = NULL; } return 0; } /* * Start of the identification and init code. */ /* * This is the table of USB devices that we know about, what they are, and * some flags. * * This table helps us determine whether a connecting USB device is one we'd * like to talk to. * */ pi_usb_dev_t known_devices[] = { /* Sony */ { .vendor = 0x054c, .product = 0x0038, .idstr = "Sony S S320 and other Palm OS 3.5 devices", .flags = USB_INIT_SONY_CLIE, }, { .vendor = 0x054c, .product = 0x0066, .idstr = "Sony T, SJ series, and other Palm OS 4.0 devices", }, { .vendor = 0x054c, .product = 0x0095, .idstr = "Sony S360", }, { .vendor = 0x054c, .product = 0x000a, .idstr = "Sony NR and other Palm OS 4.1 devices", }, { .vendor = 0x054c, .product = 0x009a, .idstr = "Sony NR70V/U", .flags = USB_INIT_SONY_CLIE, }, { .vendor = 0x054c, .product = 0x00da, .idstr = "Sony NX", }, { .vendor = 0x054c, .product = 0x00e9, .idstr = "Sony NZ", }, { .vendor = 0x054c, .product = 0x0144, .idstr = "Sony UX", }, { .vendor = 0x054c, .product = 0x0169, .idstr = "Sony TJ", .flags = USB_INIT_SONY_CLIE, }, /* AlphaSmart */ { .vendor = 0x081e, .product = 0xdf00, .idstr = "Alphasmart Dana", }, /* HANDSPRING (vendor 0x082d) */ { .vendor = 0x082d, .product = 0x0100, .idstr = "Visor, Treo 300", .flags = USB_INIT_VISOR, }, { .vendor = 0x082d, .product = 0x0200, .idstr = "Treo", }, { .vendor = 0x082d, .product = 0x0300, .idstr = "Treo 600", }, /* PalmOne, Palm Inc */ { .vendor = 0x0830, .product = 0x0001, .idstr = "m500", }, { .vendor = 0x0830, .product = 0x0002, .idstr = "m505", }, { .vendor = 0x0830, .product = 0x0003, .idstr = "m515", }, { .vendor = 0x0830, .product = 0x0010, }, { .vendor = 0x0830, .product = 0x0011, }, { .vendor = 0x0830, .product = 0x0020, .idstr = "i705", }, { .vendor = 0x0830, .product = 0x0030, .idstr = "Tungsten|Z", }, { .vendor = 0x0830, .product = 0x0031, .idstr = "Tungsten|W", }, { .vendor = 0x0830, .product = 0x0040, .idstr = "m125", }, { .vendor = 0x0830, .product = 0x0050, .idstr = "m130", }, { .vendor = 0x0830, .product = 0x0051, }, { .vendor = 0x0830, .product = 0x0052, }, { .vendor = 0x0830, .product = 0x0053, }, { .vendor = 0x0830, .product = 0x0060, .idstr = "Tungsten series, Zire 71", }, { .vendor = 0x0830, .product = 0x0061, .idstr = "Zire 31, 72, Z22", .flags = USB_INIT_TAPWAVE, }, { .vendor = 0x0830, .product = 0x0062, }, { .vendor = 0x0830, .product = 0x0063, }, { .vendor = 0x0830, .product = 0x0070, .idstr = "Zire", }, { .vendor = 0x0830, .product = 0x0071, }, { .vendor = 0x0830, .product = 0x0080, .idstr = "m100", .flags = USB_INIT_NONE, }, { .vendor = 0x0830, .product = 0x0099, }, { .vendor = 0x0830, .product = 0x0100, }, /* GARMIN */ { .vendor = 0x091e, .product = 0x0004, .idstr = "IQUE 3600", }, /* Kyocera */ { .vendor = 0x0c88, .product = 0x0021, .idstr = "7135 Smartphone", }, { .vendor = 0x0c88, .product = 0xa226, .idstr = "6035 Smartphone", }, /* Tapwave */ { .vendor = 0x12ef, .product = 0x0100, .idstr = "Zodiac, Zodiac2", .flags = USB_INIT_TAPWAVE, }, /* ACEECA */ { .vendor = 0x4766, .product = 0x0001, .idstr = "MEZ1000", }, /* Samsung */ { .vendor = 0x04e8, .product = 0x8001, .idstr = "i330", }, }; int USB_check_device (pi_usb_data_t *dev, u_int16_t vendor, u_int16_t product) { unsigned int i; for (i = 0; i < (sizeof (known_devices) / sizeof (known_devices[0])); i++) { if (known_devices[i].vendor == vendor) { if (!known_devices[i].product || known_devices[i].product == product) { dev->dev.flags |= known_devices[i].flags; return 0; } } } return -1; } /* * Device configuration, ugh. */ int USB_configure_device (pi_usb_data_t *dev, u_int8_t *input_pipe, u_int8_t *output_pipe) { int ret; u_int32_t flags = dev->dev.flags; *input_pipe = 0xff; *output_pipe = 0xff; /* * Device specific magic incantations * * Many devices agree on talking only if you say the "magic" incantation first. * Usually, it's a control request or a sequence of control requests * */ if (flags & USB_INIT_NONE) return 0; if (flags & USB_INIT_VISOR) ret = USB_configure_visor (dev, input_pipe, output_pipe); else if (flags & USB_INIT_SONY_CLIE) { /* according to linux code, PEG S-300 awaits these two requests */ /* USB_REQ_GET_CONFIGURATION */ ret = dev->impl.control_request (dev, 0x80, 0x08, 0, 0, NULL, 1, 0); if (ret < 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "usb: Sony USB_REQ_GET_CONFIGURATION failed (err=%08x)\n", ret)); } /* USB_REQ_GET_INTERFACE */ ret = dev->impl.control_request (dev, 0x80, 0x0A, 0, 0, NULL, 1, 0); if (ret < 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "usb: Sony USB_REQ_GET_INTERFACE failed (err=%08x)\n", ret)); } } else { /* other devices will either accept or deny this generic call */ ret = USB_configure_generic (dev, input_pipe, output_pipe); if (ret < 0) { return -1; } } /* query bytes available. Not that we really care, but most devices expect to receive this before they agree on talking to us. */ if (!(flags & USB_INIT_TAPWAVE)) { unsigned char ba[2] = { 0 }; ret = dev->impl.control_request (dev, 0xc2, GENERIC_REQUEST_BYTES_AVAILABLE, 0, 0, &ba[0], 2, 0); if (ret < 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "usb: GENERIC_REQUEST_BYTES_AVAILABLE failed (err=%08x)\n", ret)); /* configuration have to fail to skip this device - or LifeDrive(?) devices will hang */ return -1; } LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "GENERIC_REQUEST_BYTES_AVAILABLE returns 0x%02x%02x\n", ba[0], ba[1])); } return 0; } static int USB_configure_visor (pi_usb_data_t *dev, u_int8_t *input_pipe, u_int8_t *output_pipe) { int i, ret; visor_connection_info_t ci; ret = dev->impl.control_request (dev, 0xc2, VISOR_GET_CONNECTION_INFORMATION, 0, 0, &ci, sizeof (ci), 0); if (ret < 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "usb: VISOR_GET_CONNECTION_INFORMATION failed (err=%08x)\n", ret)); } else { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "usb: VISOR_GET_CONNECTION_INFORMATION, num_ports=%d\n", ci.num_ports)); if (ci.num_ports > 2) ci.num_ports = 2; for (i=0; i < ci.num_ports; i++) { char *function_str; switch (ci.connections[i].port_function_id) { case VISOR_FUNCTION_GENERIC: function_str="GENERIC"; break; case VISOR_FUNCTION_DEBUGGER: function_str="DEBUGGER"; break; case VISOR_FUNCTION_HOTSYNC: function_str="HOTSYNC"; break; case VISOR_FUNCTION_CONSOLE: function_str="CONSOLE"; break; case VISOR_FUNCTION_REMOTE_FILE_SYS: function_str="REMOTE_FILE_SYSTEM"; break; default: function_str="UNKNOWN"; break; } LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "\t[%d] port_function_id=0x%02x (%s)\n", i, ci.connections[i].port_function_id, function_str)); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "\t[%d] port=%d\n", i, ci.connections[i].port)); } } return ret; } static int USB_configure_generic (pi_usb_data_t *dev, u_int8_t *input_pipe, u_int8_t *output_pipe) { int i, ret; int hotsync = 0; palm_ext_connection_info_t ci; u_int32_t flags = dev->dev.flags; ret = dev->impl.control_request (dev, 0xc2, PALM_GET_EXT_CONNECTION_INFORMATION, 0, 0, &ci, sizeof (ci), 0); if (ret < 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "usb: PALM_GET_EXT_CONNECTION_INFORMATION failed (err=%08x)\n", ret)); } else { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "usb: PALM_GET_EXT_CONNECTION_INFORMATION, num_ports=%d, endpoint_numbers_different=%d\n", ci.num_ports, ci.endpoint_numbers_different)); for (i=0; i < ci.num_ports; i++) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "\t[%d] port_function_id='%c%c%c%c'\n", i, ci.connections[i].port_function_id[0], ci.connections[i].port_function_id[1], ci.connections[i].port_function_id[2], ci.connections[i].port_function_id[3])); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "\t[%d] port=%d\n", i, ci.connections[i].port)); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "\t[%d] endpoint_info=%d\n", i, ci.connections[i].endpoint_info)); if (!memcmp(ci.connections[i].port_function_id, "cnys", 4)) { /* found hotsync port */ hotsync = 1; /* 'sync': we found the pipes to use for synchronization force find_interfaces to select this one rather than another one */ if (ci.endpoint_numbers_different) { if (input_pipe) *input_pipe = ci.connections[i].endpoint_info >> 4; if (output_pipe) *output_pipe = ci.connections[i].endpoint_info & 0x0f; } else { if (input_pipe) *input_pipe = ci.connections[i].port; if (output_pipe) *output_pipe = ci.connections[i].port; } } } if (!hotsync) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "usb: PALM_GET_EXT_CONNECTION_INFORMATION - no hotsync port found.\n", ret)); return -1; } } if (flags & USB_INIT_TAPWAVE) { /* * Tapwave: for Zodiac, the TwUSBD.sys driver on Windows sends * the ext-connection-info packet two additional times. */ ret = dev->impl.control_request (dev, 0xc2, PALM_GET_EXT_CONNECTION_INFORMATION, 0, 0, &ci, sizeof (ci), 0); ret = dev->impl.control_request (dev, 0xc2, PALM_GET_EXT_CONNECTION_INFORMATION, 0, 0, &ci, sizeof (ci), 0); } return ret; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/cmp.c0000644000175000017500000004041710552545407020017 0ustar rousseaurousseau/* * $Id: cmp.c,v 1.41 2006/11/07 21:13:24 adridg Exp $ * * cmp.c: Pilot Connection Management Protocol * * Copyright (c) 1996, Kenneth Albanowski. * Copyright (c) 1999, Tilo Christ * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ #ifdef HAVE_CONFIG_H #include #endif #include #include "pi-debug.h" #include "pi-source.h" #include "pi-socket.h" #include "pi-padp.h" #include "pi-cmp.h" #include "pi-error.h" /* Declare prototypes */ static int cmp_flush(pi_socket_t *ps, int flags); static int cmp_getsockopt(pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len); static int cmp_setsockopt(pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len); static pi_protocol_t *cmp_protocol_dup (pi_protocol_t *prot); static void cmp_protocol_free (pi_protocol_t *prot); /* Protocol Functions */ /*********************************************************************** * * Function: cmp_protocol_dup * * Summary: clones an existing pi_protocol struct * * Parameters: pi_protocol_t* * * Returns: pi_protocol_t* or NULL if operation failed * ***********************************************************************/ static pi_protocol_t* cmp_protocol_dup (pi_protocol_t *prot) { pi_protocol_t *new_prot; struct pi_cmp_data *data, *new_data; new_prot = (pi_protocol_t *)malloc (sizeof (pi_protocol_t)); new_data = (struct pi_cmp_data *)malloc (sizeof (struct pi_cmp_data)); if ( (new_prot != NULL) && (new_data != NULL) ) { new_prot->level = prot->level; new_prot->dup = prot->dup; new_prot->free = prot->free; new_prot->read = prot->read; new_prot->write = prot->write; new_prot->flush = prot->flush; new_prot->getsockopt = prot->getsockopt; new_prot->setsockopt = prot->setsockopt; data = (struct pi_cmp_data *)prot->data; new_data->type = data->type; new_data->flags = data->flags; new_data->version = data->version; new_data->baudrate = data->baudrate; new_prot->data = new_data; } else if (new_prot != NULL) { free(new_prot); new_prot = NULL; } else if (new_data != NULL) { free(new_data); new_data = NULL; } return new_prot; } /*********************************************************************** * * Function: cmp_protocol_free * * Summary: frees an existing pi_protocol struct * * Parameters: pi_protocol_t* * * Returns: void * ***********************************************************************/ static void cmp_protocol_free (pi_protocol_t *prot) { if (prot != NULL) { if (prot->data != NULL) free(prot->data); free(prot); } } /*********************************************************************** * * Function: cmp_protocol * * Summary: creates and inits pi_protocol struct instance * * Parameters: void * * Returns: pi_protocol_t* or NULL if operation failed * ***********************************************************************/ pi_protocol_t* cmp_protocol (void) { pi_protocol_t *prot; struct pi_cmp_data *data; prot = (pi_protocol_t *)malloc (sizeof (pi_protocol_t)); data = (struct pi_cmp_data *)malloc (sizeof (struct pi_cmp_data)); if (prot != NULL && data != NULL) { prot->level = PI_LEVEL_CMP; prot->dup = cmp_protocol_dup; prot->free = cmp_protocol_free; prot->read = cmp_rx; prot->write = cmp_tx; prot->flush = cmp_flush; prot->getsockopt = cmp_getsockopt; prot->setsockopt = cmp_setsockopt; data->type = 0; data->flags = 0; data->version = 0; data->baudrate = 0; prot->data = data; } else if (prot != NULL) { free(prot); prot = NULL; } else if (data != NULL) { free(data); data = NULL; } return prot; } /*********************************************************************** * * Function: cmp_rx_handshake * * Summary: establishes RX handshake * * Parameters: pi_socket_t*, baudrate, hirate enable * * Returns: 0 for success, negative otherwise * ***********************************************************************/ int cmp_rx_handshake(pi_socket_t *ps, int establishrate, int establishhighrate) { pi_protocol_t *prot; struct pi_cmp_data *data; pi_buffer_t *buf; int bytes; prot = pi_protocol(ps->sd, PI_LEVEL_CMP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (struct pi_cmp_data *)prot->data; /* Read the cmp packet */ buf = pi_buffer_new (PI_CMP_HEADER_LEN); if (buf == NULL) { errno = ENOMEM; return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); } bytes = cmp_rx(ps, buf, PI_CMP_HEADER_LEN, 0); pi_buffer_free (buf); if (bytes < 0) return bytes; if ((data->version & 0xFF00) == 0x0100) { if (establishrate != -1) { if (establishrate > data->baudrate) { if (establishhighrate) { LOG((PI_DBG_CMP, PI_DBG_LVL_INFO, "CMP Establishing higher rate %ul (%ul)\n", establishrate, data->baudrate)); data->baudrate = establishrate; } } else { data->baudrate = establishrate; } } if ((bytes = cmp_init(ps, data->baudrate)) < 0) return bytes; } else { /* 0x80 means the comm version wasn't compatible */ LOG((PI_DBG_CMP, PI_DBG_LVL_ERR, "CMP Incompatible Version\n")); cmp_abort(ps, 0x80); errno = ECONNREFUSED; return pi_set_error(ps->sd, PI_ERR_PROT_INCOMPATIBLE); } return 0; } /*********************************************************************** * * Function: cmp_tx_handshake * * Summary: establishes TX handshake * * Parameters: pi_socket_t* * * Returns: >= 0 for success, negative otherwise * ***********************************************************************/ int cmp_tx_handshake(pi_socket_t *ps) { pi_protocol_t *prot; struct pi_cmp_data *data; int result; prot = pi_protocol(ps->sd, PI_LEVEL_CMP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (struct pi_cmp_data *)prot->data; if ((result = cmp_wakeup(ps, 38400)) < 0) /* Assume box can't go over 38400 */ return result; if ((result = cmp_rx(ps, NULL, 0, 0)) < 0) return result; /* failed to read, errno already set */ switch (data->type) { case PI_CMP_TYPE_INIT: return 0; case PI_CMP_TYPE_ABRT: LOG((PI_DBG_CMP, PI_DBG_LVL_NONE, "CMP Aborted by other end\n")); errno = -EIO; return pi_set_error(ps->sd, PI_ERR_PROT_ABORTED); } return PI_ERR_PROT_INCOMPATIBLE; } /*********************************************************************** * * Function: cmp_tx * * Summary: Transmit CMP Packets * * Parameters: pi_socket_t*, char* to buf, buf length, flags * * Returns: A negative number on error, 0 otherwise * ***********************************************************************/ ssize_t cmp_tx(pi_socket_t *ps, const unsigned char *buf, size_t len, int flags) { int bytes, type; size_t size; pi_protocol_t *prot, *next; struct pi_cmp_data *data; unsigned char cmp_buf[PI_CMP_HEADER_LEN]; prot = pi_protocol(ps->sd, PI_LEVEL_CMP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (struct pi_cmp_data *)prot->data; next = pi_protocol_next(ps->sd, PI_LEVEL_CMP); if (next == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); type = padData; size = sizeof(type); pi_setsockopt(ps->sd, PI_LEVEL_PADP, PI_PADP_TYPE, &type, &size); set_byte(&cmp_buf[PI_CMP_OFFSET_TYPE], data->type); set_byte(&cmp_buf[PI_CMP_OFFSET_FLGS], data->flags); set_short(&cmp_buf[PI_CMP_OFFSET_VERS], data->version > PI_CMP_VERSION ? PI_CMP_VERSION : data->version); set_short(&cmp_buf[PI_CMP_OFFSET_RESV], 0); set_long(&cmp_buf[PI_CMP_OFFSET_BAUD], data->baudrate); CHECK(PI_DBG_CMP, PI_DBG_LVL_INFO, cmp_dump(cmp_buf, 1)); bytes = next->write(ps, cmp_buf, PI_CMP_HEADER_LEN, flags); if (bytes < 10) return (bytes < 0) ? bytes : pi_set_error(ps->sd, PI_ERR_PROT_ABORTED); return 0; } /*********************************************************************** * * Function: cmp_rx * * Summary: Receive CMP packets * * Parameters: None * * Returns: A negative number on error, 0 otherwise * ***********************************************************************/ ssize_t cmp_rx(pi_socket_t *ps, pi_buffer_t *msg, size_t len, int flags) { int bytes; pi_protocol_t *prot, *next; struct pi_cmp_data *data; LOG((PI_DBG_CMP, PI_DBG_LVL_DEBUG, "CMP RX len=%d flags=0x%02x\n", len, flags)); prot = pi_protocol(ps->sd, PI_LEVEL_CMP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (struct pi_cmp_data *)prot->data; next = pi_protocol_next(ps->sd, PI_LEVEL_CMP); if (next == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); bytes = next->read(ps, msg, len, flags); if (bytes < 10) return pi_set_error(ps->sd, (bytes < 0) ? bytes : PI_ERR_PROT_ABORTED); CHECK(PI_DBG_CMP, PI_DBG_LVL_INFO, cmp_dump(msg->data, 0)); data->type = get_byte(&msg->data[PI_CMP_OFFSET_TYPE]); data->flags = get_byte(&msg->data[PI_CMP_OFFSET_FLGS]); data->version = get_short(&msg->data[PI_CMP_OFFSET_VERS]); data->baudrate = get_long(&msg->data[PI_CMP_OFFSET_BAUD]); return 0; } /*********************************************************************** * * Function: cmp_flush * * Summary: Flush input and output buffers * * Parameters: pi_socket_t*, flags * * Returns: A negative number on error, 0 otherwise * ***********************************************************************/ static int cmp_flush(pi_socket_t *ps, int flags) { pi_protocol_t *prot, *next; prot = pi_protocol(ps->sd, PI_LEVEL_CMP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); next = pi_protocol_next(ps->sd, PI_LEVEL_CMP); if (next == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); return next->flush(ps, flags); } /*********************************************************************** * * Function: cmp_init * * Summary: Initialize the socket for CMP transmission * * Parameters: pi_socket_t*, baudrate * * Returns: Number of packets transmitted * ***********************************************************************/ int cmp_init(pi_socket_t *ps, int baudrate) { pi_protocol_t *prot; struct pi_cmp_data *data; prot = pi_protocol(ps->sd, PI_LEVEL_CMP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (struct pi_cmp_data *)prot->data; data->type = PI_CMP_TYPE_INIT; data->flags = CMP_FL_LONG_PACKET_SUPPORT; if (baudrate != 9600) data->flags = CMP_FL_CHANGE_BAUD_RATE; data->baudrate = baudrate; return cmp_tx(ps, NULL, 0, 0); } /*********************************************************************** * * Function: cmp_abort * * Summary: Abort a CMP session in progress * * Parameters: pi_socket_t* * * Returns: Number of PADP packets transmitted or negative on error * ***********************************************************************/ int cmp_abort(pi_socket_t *ps, int reason) { pi_protocol_t *prot; struct pi_cmp_data *data; prot = pi_protocol(ps->sd, PI_LEVEL_CMP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (struct pi_cmp_data *)prot->data; data->type = PI_CMP_TYPE_ABRT; data->flags = reason; LOG((PI_DBG_CMP, PI_DBG_LVL_NONE, "CMP ABORT\n")); return cmp_tx (ps, NULL, 0, 0); } /*********************************************************************** * * Function: cmp_wakeup * * Summary: Wakeup the CMP listener process * * Parameters: pi_socket_t* * * Returns: Number of PADP packets transmitted or negative on error * ***********************************************************************/ int cmp_wakeup(pi_socket_t *ps, int maxbaud) { pi_protocol_t *prot; struct pi_cmp_data *data; prot = pi_protocol(ps->sd, PI_LEVEL_CMP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (struct pi_cmp_data *)prot->data; data->type = PI_CMP_TYPE_WAKE; data->flags = 0; data->version = PI_CMP_VERSION; data->baudrate = maxbaud; return cmp_tx(ps, NULL, 0, 0); } /*********************************************************************** * * Function: cmp_getsockopt * * Summary: get options on socket * * Parameters: pi_socket*, level, option name, option value, option length * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int cmp_getsockopt(pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len) { pi_protocol_t *prot; struct pi_cmp_data *data; (void) level; prot = pi_protocol(ps->sd, PI_LEVEL_CMP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (struct pi_cmp_data *)prot->data; switch (option_name) { case PI_CMP_TYPE: if (*option_len != sizeof (data->type)) goto error; memcpy (option_value, &data->type, sizeof (data->type)); *option_len = sizeof (data->type); break; case PI_CMP_FLAGS: if (*option_len != sizeof (data->flags)) goto error; memcpy (option_value, &data->flags, sizeof (data->flags)); *option_len = sizeof (data->flags); break; case PI_CMP_VERS: if (*option_len != sizeof (data->version)) goto error; memcpy (option_value, &data->version, sizeof (data->version)); *option_len = sizeof (data->version); break; case PI_CMP_BAUD: if (*option_len != sizeof (data->baudrate)) goto error; memcpy (option_value, &data->baudrate, sizeof (data->baudrate)); *option_len = sizeof (data->baudrate); break; } return 0; error: errno = EINVAL; return pi_set_error(ps->sd, PI_ERR_GENERIC_ARGUMENT); } /*********************************************************************** * * Function: cmp_setsockopt * * Summary: set options on socket * * Parameters: pi_socket*, level, option name, option value, option length * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int cmp_setsockopt(pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len) { pi_protocol_t *prot; struct pi_padp_data *data; (void) level; prot = pi_protocol(ps->sd, PI_LEVEL_PADP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (struct pi_padp_data *)prot->data; if (option_name == PI_PADP_TYPE) { if (*option_len != sizeof (data->type)) goto error; memcpy (&data->type, option_value, sizeof (data->type)); *option_len = sizeof (data->type); } return 0; error: errno = EINVAL; return pi_set_error(ps->sd, PI_ERR_GENERIC_ARGUMENT); } /*********************************************************************** * * Function: cmp_dump * * Summary: Dump the CMP packet frames * * Parameters: char* to cmp packet, TX boolean * * Returns: void * ***********************************************************************/ void cmp_dump(const unsigned char *cmp, int rxtx) { char *type; (void) rxtx; switch (get_byte(&cmp[PI_CMP_OFFSET_TYPE])) { case PI_CMP_TYPE_WAKE: type = "WAKE"; break; case PI_CMP_TYPE_INIT: type = "INIT"; break; case PI_CMP_TYPE_ABRT: type = "ABRT"; break; default: type = "UNK"; break; } LOG((PI_DBG_CMP, PI_DBG_LVL_NONE, "CMP %s %s Type: 0x%02x Flags: 0x%02x Version: 0x%04x Baud: %d\n", rxtx ? "TX" : "RX", type, get_byte(&cmp[PI_CMP_OFFSET_TYPE]), get_byte(&cmp[PI_CMP_OFFSET_FLGS]), get_long(&cmp[PI_CMP_OFFSET_VERS]), get_long(&cmp[PI_CMP_OFFSET_BAUD]))); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/hinote.c0000644000175000017500000001036510513447542020523 0ustar rousseaurousseau/* * $Id: hinote.c,v 1.22 2006/10/12 14:21:22 desrod Exp $ * * hinote.c: Translate Hi-Note data formats * * Copyright 1997 Bill Goodman * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include "pi-hinote.h" /*********************************************************************** * * Function: free_HiNoteNote * * Summary: frees HiNoteNote_t members * * Parameters: HiNoteNote_t* * * Returns: void * ***********************************************************************/ void free_HiNoteNote(HiNoteNote_t *hinote) { if (hinote->text != NULL) { free(hinote->text); hinote->text = NULL; } } /*********************************************************************** * * Function: unpack_HiNoteNote * * Summary: Unpack a HiNote record * * Parameters: HiNoteNote_t*, char* to buffer, buffer length * * Returns: effective buffer length * ***********************************************************************/ int unpack_HiNoteNote(HiNoteNote_t *hinote, unsigned char *buffer, int len) { if (len < 3) return 0; hinote->flags = buffer[0]; hinote->level = buffer[1]; hinote->text = strdup((char *) &buffer[2]); return strlen((char *) &buffer[2]) + 3; } /*********************************************************************** * * Function: pack_HiNoteNote * * Summary: Pack a HiNote record * * Parameters: HiNoteNote_t* * * Returns: Nothing * ***********************************************************************/ int pack_HiNoteNote(HiNoteNote_t *hinote, unsigned char *buffer, int len) { int destlen; destlen = 3; if (hinote->text) destlen += strlen(hinote->text); if (!buffer) return destlen; if (len < destlen) return 0; buffer[0] = hinote->flags; buffer[1] = hinote->level; if (hinote->text) strcpy((char *) &buffer[2], hinote->text); else { buffer[2] = 0; } return destlen; } /*********************************************************************** * * Function: unpack_HiNoteAppInfo * * Summary: Unpack the HiNote AppInfo block * * Parameters: HiNoteAppInfo_t*, char* to record, record length * * Returns: effective buffer length * ***********************************************************************/ int unpack_HiNoteAppInfo(HiNoteAppInfo_t *appinfo, unsigned char *record, size_t len) { int i, idx; unsigned char *start; start = record; i = unpack_CategoryAppInfo(&appinfo->category, record, len); if (!i) return i; record += i; len -= i; if (len < 48) return 0; for (idx = 0; i < 48; i++) appinfo->reserved[i] = *record++; return (record - start); } /*********************************************************************** * * Function: pack_HiNoteAppInfo * * Summary: Pack the HiNote AppInfo block * * Parameters: HiNoteAppInfo_t*, char* record, length of record * * Returns: effective record length * ***********************************************************************/ int pack_HiNoteAppInfo(HiNoteAppInfo_t *appinfo, unsigned char *record, size_t len) { int i, idx; unsigned char *start = record; i = pack_CategoryAppInfo(&appinfo->category, record, len); if (i == 0) /* category pack failed */ return 0; if (!record) return i + 48; record += i; len -= i; if (len < 48) return (record - start); for (idx = 0; i < 48; i++) *record++ = appinfo->reserved[i]; return (record - start); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/connect.c0000644000175000017500000000676610513447542020700 0ustar rousseaurousseau/* * $Id: connect.c,v 1.60 2006/10/12 14:21:22 desrod Exp $ * * connect.c: Palm Serial, USB, IR connection routines * * Copyright (c) 2001, David A. Desrosiers * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #ifdef HAVE_IFADDRS_H #include #endif #include #include #include "pi-socket.h" #include "pi-dlp.h" #include "pi-header.h" /*********************************************************************** * * Function: pilot_connect [DEPRECATED] * * Summary: Connect to a Palm device. * * Parameters: port. Communications port through which the Palm device is * connected. * * Returns: Socket descriptor of type 'client_sd', if successful. * Returns 1, if the connection can not be established. * * 'port' is allowed to be NULL for the pi_bind call because pi_bind will * check your PILOTPORT environment variable. If port is NULL and the * attempt to connect fails for any reason, we simply assume the user didn't * provide one, because pilot_connect doesn't have a way of knowing, for the * time being. * * This function is deprecated because it doesn't really belong in libpisock. * It will remain at least until it has been properly replaced. * ***********************************************************************/ int pilot_connect(const char *port) { int sd = -1, /* Socket, formerly parent/client_socket */ result; struct SysInfo sys_info; fprintf(stderr, "\n"); fprintf(stderr," DEPRECATED: The application is calling pilot_connect()\n"); if ((sd = pi_socket(PI_AF_PILOT, PI_SOCK_STREAM, PI_PF_DLP)) < 0) { fprintf(stderr, "\n Unable to create socket '%s'\n", port); return -1; } result = pi_bind(sd, port); if (result < 0) { if (port == NULL) fprintf(stderr, " No port specified\n"); else fprintf(stderr, " Unable to bind to port: %s\n", port); fprintf(stderr, " Please use --help for more information\n\n"); return result; } if (isatty(fileno(stdout))) { printf("\n Listening for incoming connection on %s... ", port); fflush(stdout); } if (pi_listen(sd, 1) < 0) { fprintf(stderr, "\n Error listening on %s\n", port); pi_close(sd); return -1; } sd = pi_accept(sd, 0, 0); if (sd < 0) { fprintf(stderr, "\n Error accepting data on %s\n", port); pi_close(sd); return -1; } if (isatty(fileno(stdout))) { printf("connected!\n\n"); } if (dlp_ReadSysInfo(sd, &sys_info) < 0) { fprintf(stderr, "\n Error read system info on %s\n", port); pi_close(sd); return -1; } dlp_OpenConduit(sd); return sd; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/Makefile.am0000644000175000017500000000276611206407417021130 0ustar rousseaurousseauINCLUDES = \ -I../include \ -I$(top_srcdir)/include bluetooth_FILES = \ bluetooth.c serial_FILES = \ unixserial.c serial_SOURCE = unixserial.c usb_FILES = \ usb.c \ libusb.c \ linuxusb.c \ freebsdusb.c \ darwinusb.c if WITH_LIBUSB usb_SOURCE = usb.c libusb.c endif if WITH_LINUXUSB usb_SOURCE = usb.c linuxusb.c endif if WITH_FREEBSDUSB usb_SOURCE = usb.c freebsdusb.c endif if WITH_DARWINUSB usb_SOURCE = usb.c darwinusb.c endif if WITH_BLUEZ bluetooth_SOURCE = bluetooth.c endif lib_LTLIBRARIES = libpisock.la # All new sources MUST be added here, or anything # building against libpisock will fail! libpisock_la_SOURCES = \ $(bluetooth_SOURCE) \ $(serial_SOURCE) \ $(usb_SOURCE) \ address.c \ appinfo.c \ connect.c \ contact.c \ cmp.c \ datebook.c \ debug.c \ dlp.c \ expense.c \ hinote.c \ inet.c \ location.c \ blob.c \ calendar.c \ mail.c \ md5.c \ memo.c \ money.c \ net.c \ notepad.c \ padp.c \ palmpix.c \ pi-buffer.c \ pi-file.c \ pi-header.c \ serial.c \ slp.c \ sys.c \ socket.c \ syspkt.c \ threadsafe.c \ todo.c \ utils.c \ veo.c \ versamail.c # Including PTHREAD_CFLAGS here is a dirty ugly kluge. It works. libpisock_la_LIBADD = \ @usb_libs@ @PTHREAD_LIBS@ @PTHREAD_CFLAGS@ @BLUEZ_LIBS@ libpisock_la_LDFLAGS = \ -export-dynamic -version-info $(PISOCK_CURRENT):$(PISOCK_REVISION):$(PISOCK_AGE) libpisock_la_CFLAGS = $(PIC_LIBS) @PTHREAD_CFLAGS@ @BLUEZ_CFLAGS@ EXTRA_DIST = $(bluetooth_FILES) $(serial_FILES) $(usb_FILES) pilot-link-0.12.5-dfsg/libpisock/md5.c0000644000175000017500000001702710513447542017724 0ustar rousseaurousseau/* * $Id: md5.c,v 1.9 2006/10/12 14:21:22 desrod Exp $ * * LICENSE: Public Domain * * This code implements the MD5 message-digest algorithm. The algorithm is * due to Ron Rivest. This code was written by Colin Plumb in 1993, no * copyright is claimed. This code is in the public domain; do with it what * you wish. * * Equivalent code is available from RSA Data Security, Inc. This code has * been tested against that, and is equivalent, except that you don't need * to include two pages of legalese with every copy. * * To compute the message digest of a chunk of bytes, declare an MD5Context * structure, pass it to MD5Init, call MD5Update as needed on buffers full * of bytes, and then call MD5Final, which will fill a supplied 16-byte * array with the digest. * * Modified by Ian Jackson in 1995 so as not to use Colin Plumb's * 'usuals.h'. Arranged for byteSwap to be compiled and called even on * little-endian machines, as performance isn't critical here. * */ #include /* for memcpy() */ #include "pi-md5.h" /* * Note: this code is harmless but does nothing on little-endian machines. */ void byteSwap(UINT32 * buf, unsigned words) { UINT8 *p = (UINT8 *) buf; do { *buf++ = (UINT32) ((unsigned) p[3] << 8 | p[2]) << 16 | ((unsigned) p[1] << 8 | p[0]); p += 4; } while (--words); } /* * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious * initialization constants. */ void MD5Init(struct MD5Context *ctx) { ctx->buf[0] = 0x67452301; ctx->buf[1] = 0xefcdab89; ctx->buf[2] = 0x98badcfe; ctx->buf[3] = 0x10325476; ctx->bytes[0] = 0; ctx->bytes[1] = 0; } /* * Update context to reflect the concatenation of another buffer full * of bytes. */ void MD5Update(struct MD5Context *ctx, UINT8 const *buf, unsigned len) { UINT32 t; /* Update byte count */ t = ctx->bytes[0]; if ((ctx->bytes[0] = t + len) < t) ctx->bytes[1]++; /* Carry from low to high */ t = 64 - (t & 0x3f); /* Space available in ctx->in (at least 1) */ if (t > len) { memcpy((UINT8 *) ctx->in + 64 - t, buf, len); return; } /* First chunk is an odd size */ memcpy((UINT8 *) ctx->in + 64 - t, buf, t); byteSwap(ctx->in, 16); MD5Transform(ctx->buf, ctx->in); buf += t; len -= t; /* Process data in 64-byte chunks */ while (len >= 64) { memcpy(ctx->in, buf, 64); byteSwap(ctx->in, 16); MD5Transform(ctx->buf, ctx->in); buf += 64; len -= 64; } /* Handle any remaining bytes of data. */ memcpy(ctx->in, buf, len); } /* * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ void MD5Final(UINT8 digest[16], struct MD5Context *ctx) { int count = ctx->bytes[0] & 0x3f; /* Number of bytes in ctx->in */ UINT8 *p = (UINT8 *) ctx->in + count; /* Set the first char of padding to 0x80. There is always room. */ *p++ = 0x80; /* Bytes of padding needed to make 56 bytes (-8..55) */ count = 56 - 1 - count; if (count < 0) { /* Padding forces an extra block */ memset(p, 0, (size_t)(count + 8)); byteSwap(ctx->in, 16); MD5Transform(ctx->buf, ctx->in); p = (UINT8 *) ctx->in; count = 56; } memset(p, 0, (size_t)count); byteSwap(ctx->in, 14); /* Append length in bits and transform */ ctx->in[14] = ctx->bytes[0] << 3; ctx->in[15] = ctx->bytes[1] << 3 | ctx->bytes[0] >> 29; MD5Transform(ctx->buf, ctx->in); byteSwap(ctx->buf, 4); memcpy(digest, ctx->buf, 16); memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ } #ifndef ASM_MD5 /* The four core functions - F1 is optimized somewhat */ /* #define F1(x, y, z) (x & y | ~x & z) */ #define F1(x, y, z) (z ^ (x & (y ^ z))) #define F2(x, y, z) F1(z, x, y) #define F3(x, y, z) (x ^ y ^ z) #define F4(x, y, z) (y ^ (x | ~z)) /* This is the central step in the MD5 algorithm. */ #define MD5STEP(f,w,x,y,z,in,s) \ (w += f(x,y,z) + in, w = (w<>(32-s)) + x) /* * The core of the MD5 algorithm, this alters an existing MD5 hash to * reflect the addition of 16 longwords of new data. MD5Update blocks * the data and converts bytes into longwords for this routine. */ void MD5Transform(UINT32 buf[4], UINT32 const in[16]) { register UINT32 a, b, c, d; a = buf[0]; b = buf[1]; c = buf[2]; d = buf[3]; MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); buf[0] += a; buf[1] += b; buf[2] += c; buf[3] += d; } #endif /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/notepad.c0000644000175000017500000001564710513447542020677 0ustar rousseaurousseau/* * $Id: notepad.c,v 1.14 2006/10/12 14:21:22 desrod Exp $ * * notepad.c: Translate Palm NotePad application data formats * * Copyright (c) 2002, Angus Ainslie * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #include "pi-macros.h" #include "pi-notepad.h" /*********************************************************************** * * Function: free_NotePad * * Summary: Free the memory and filehandle from the record alloc. * ***********************************************************************/ void free_NotePad( NotePad_t *a ) { if( a->flags & NOTEPAD_FLAG_NAME ) { /* fprintf( stderr, "Freeing name: %s\n", a->name ); */ free(a->name); } if( a->flags & NOTEPAD_FLAG_BODY ) { /* fprintf( stderr, "Freeing data\n" ); */ free(a->data); } } /*********************************************************************** * * Function: unpack_NotePad * * Summary: Unpack the NotePad structure into records we can chew on * ***********************************************************************/ int unpack_NotePad(NotePad_t *notepad, unsigned char *buffer, size_t len) { unsigned char *start = buffer; notepad->createDate.sec = (unsigned short int) get_short(buffer); buffer += 2; notepad->createDate.min = (unsigned short int) get_short(buffer); buffer += 2; notepad->createDate.hour = (unsigned short int) get_short(buffer); buffer += 2; notepad->createDate.day = (unsigned short int) get_short(buffer); buffer += 2; notepad->createDate.month = (unsigned short int) get_short(buffer); buffer += 2; notepad->createDate.year = (unsigned short int) get_short(buffer); buffer += 2; notepad->createDate.s = (unsigned short int) get_short(buffer); buffer += 2; notepad->changeDate.sec = (unsigned short int) get_short(buffer); buffer += 2; notepad->changeDate.min = (unsigned short int) get_short(buffer); buffer += 2; notepad->changeDate.hour = (unsigned short int) get_short(buffer); buffer += 2; notepad->changeDate.day = (unsigned short int) get_short(buffer); buffer += 2; notepad->changeDate.month = (unsigned short int) get_short(buffer); buffer += 2; notepad->changeDate.year = (unsigned short int) get_short(buffer); buffer += 2; notepad->changeDate.s = (unsigned short int) get_short(buffer); buffer += 2; notepad->flags = (unsigned short int) get_short(buffer); buffer += 2; /* fprintf( stderr, "flags: 0x%x\n", notepad->flags ); */ if( notepad->flags & NOTEPAD_FLAG_ALARM ) { /* fprintf( stderr, "Getting Alarm\n" ); */ notepad->alarmDate.sec = (unsigned short int) get_short(buffer); buffer += 2; notepad->alarmDate.min = (unsigned short int) get_short(buffer); buffer += 2; notepad->alarmDate.hour = (unsigned short int) get_short(buffer); buffer += 2; notepad->alarmDate.day = (unsigned short int) get_short(buffer); buffer += 2; notepad->alarmDate.month = (unsigned short int) get_short(buffer); buffer += 2; notepad->alarmDate.year = (unsigned short int) get_short(buffer); buffer += 2; notepad->alarmDate.s = (unsigned short int) get_short(buffer); buffer += 2; } if( notepad->flags & NOTEPAD_FLAG_NAME ) { /* fprintf( stderr, "Getting Name\n" ); */ notepad->name = strdup((char *) buffer); buffer += strlen( notepad->name ) + 1; if( (strlen( notepad->name ) + 1)%2 == 1) buffer++; } else { notepad->name = NULL; } if( notepad->flags & NOTEPAD_FLAG_BODY ) { /* fprintf( stderr, "Getting Body\n" ); */ notepad->body.bodyLen = get_long( buffer ); buffer += 4; notepad->body.width = get_long( buffer ); buffer += 4; notepad->body.height = get_long( buffer ); buffer += 4; notepad->body.l1 = get_long( buffer ); buffer += 4; notepad->body.dataType = get_long( buffer ); buffer += 4; notepad->body.dataLen = get_long( buffer ); buffer += 4; notepad->data = malloc( notepad->body.dataLen ); if( notepad->data == NULL ) { fprintf( stderr, "Body data alloc failed\n" ); return( 0 ); } memcpy( notepad->data, buffer, notepad->body.dataLen ); } return ( buffer - start ); /* FIXME: return real length */ } /*********************************************************************** * * Function: pack_NotePad * * Summary: Pack the NotePad records into a structure * ***********************************************************************/ int pack_NotePad(NotePad_t *notepad, unsigned char *buf, size_t len) { return( 0 ); } /*********************************************************************** * * Function: unpack_NotePadAppInfo * * Summary: Unpack the NotePad AppInfo block from the structure * ***********************************************************************/ int unpack_NotePadAppInfo(NotePadAppInfo_t *appinfo, unsigned char *record, size_t len) { int i; unsigned char *start = record; i = unpack_CategoryAppInfo( &appinfo->category, record, len ); if (!i) return 0; record += i; len -= i; if (len < 4) return 0; appinfo->dirty = get_short(record); record += 2; appinfo->sortByPriority = get_byte(record); record += 2; return (record - start); } /*********************************************************************** * * Function: pack_NotePadAppInfo * * Summary: Pack the AppInfo block/record back into the structure * ***********************************************************************/ int pack_NotePadAppInfo(NotePadAppInfo_t *appinfo, unsigned char *record, size_t len) { int i; unsigned char *start = record; i = pack_CategoryAppInfo(&appinfo->category, record, len); if (!record) return i + 4; if (!i) return 0; record += i; len -= i; if (len < 4) return 0; set_short(record, appinfo->dirty); set_byte(record + 2, appinfo->sortByPriority); set_byte(record + 3, 0); /* gapfill */ record += 4; return (record - start); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/syspkt.c0000644000175000017500000005037710513447543020602 0ustar rousseaurousseau/* * $Id: syspkt.c,v 1.41 2006/10/12 14:21:23 desrod Exp $ * * syspkt.c: Pilot SysPkt manager * * (c) 1996, Kenneth Albanowski. * Derived from padp.c. * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this 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 #include #include #include #include #include #include #include #include "pi-source.h" #include "pi-syspkt.h" #include "pi-slp.h" #include "pi-serial.h" #include "pi-error.h" /* Declare prototypes */ static int sys_PackRegisters(void *data, struct Pilot_registers *r); /*********************************************************************** * * Function: sys_UnpackState * * Summary: Get the state command * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int sys_UnpackState(void *buffer, struct Pilot_state *s) { int idx; unsigned char *data = buffer; s->reset = get_short(data); s->exception = get_short(data + 2); memcpy(s->func_name, data + 152, 32); memcpy(s->instructions, data + 78, 30); s->func_name[32 - 1] = 0; s->func_start = get_long(data + 144); s->func_end = get_long(data + 148); sys_UnpackRegisters(data + 4, &s->regs); for (idx = 0; idx < 6; idx++) { s->breakpoint[idx].address = get_long(data + 108 + idx * 6); s->breakpoint[idx].enabled = get_byte(data + 112 + idx * 6); } s->trap_rev = get_short(data + 184); return 0; } /*********************************************************************** * * Function: sys_UnpackRegisters * * Summary: Read the register commands * * Parameters: None * * Returns: 0 * ***********************************************************************/ int sys_UnpackRegisters(void *data, struct Pilot_registers *r) { unsigned char *buffer = data; r->D[0] = get_long(buffer + 0); r->D[1] = get_long(buffer + 4); r->D[2] = get_long(buffer + 8); r->D[3] = get_long(buffer + 12); r->D[4] = get_long(buffer + 16); r->D[5] = get_long(buffer + 20); r->D[6] = get_long(buffer + 24); r->D[7] = get_long(buffer + 28); r->A[0] = get_long(buffer + 32); r->A[1] = get_long(buffer + 36); r->A[2] = get_long(buffer + 40); r->A[3] = get_long(buffer + 44); r->A[4] = get_long(buffer + 48); r->A[5] = get_long(buffer + 52); r->A[6] = get_long(buffer + 56); r->USP = get_long(buffer + 60); r->SSP = get_long(buffer + 64); r->PC = get_long(buffer + 68); r->SR = get_short(buffer + 72); return 0; } /*********************************************************************** * * Function: sys_PackRegisters * * Summary: Pack the register commands * * Parameters: None * * Returns: 0 * ***********************************************************************/ static int sys_PackRegisters(void *data, struct Pilot_registers *r) { int idx; unsigned char *buffer = data; for (idx = 0; idx < 8; idx++) set_long(buffer + idx * 4, r->D[idx]); for (idx = 0; idx < 7; idx++) set_long(buffer + 32 + idx * 4, r->A[idx]); set_long(buffer + 60, r->USP); set_long(buffer + 64, r->SSP); set_long(buffer + 68, r->PC); set_short(buffer + 72, r->SR); return 0; } /*********************************************************************** * * Function: sys_Continue * * Summary: Define the Continue command * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int sys_Continue(int sd, struct Pilot_registers *r, struct Pilot_watch *w) { char buf[94]; buf[0] = 0; buf[1] = 0; buf[2] = 0; buf[3] = 0; buf[4] = 0x07; buf[5] = 0; /* gapfill */ if (!r) return pi_write(sd, buf, 6); sys_PackRegisters(buf + 6, r); set_byte(buf + 80, (w != 0) ? 1 : 0); set_byte(buf + 81, 0); set_long(buf + 82, w ? w->address : 0); set_long(buf + 86, w ? w->length : 0); set_long(buf + 90, w ? w->checksum : 0); return pi_write(sd, buf, 94); } /*********************************************************************** * * Function: sys_Step * * Summary: Single-step command * * Parameters: None * * Returns: Socket, command, 6 bytes * ***********************************************************************/ int sys_Step(int sd) { char buf[94]; buf[0] = 0; buf[1] = 0; buf[2] = 0; buf[3] = 0; buf[4] = 0x03; buf[5] = 0; /* gapfill */ return pi_write(sd, buf, 6); } /*********************************************************************** * * Function: sys_SetBreakpoints * * Summary: Set the breakpoints (0x0C, 0x8C) * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int sys_SetBreakpoints(int sd, struct Pilot_breakpoint *b) { int idx; pi_buffer_t *buf; buf = pi_buffer_new (94); if (buf == NULL) { errno = ENOMEM; return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); } buf->data[0] = 0; buf->data[1] = 0; buf->data[2] = 0; buf->data[3] = 0; buf->data[4] = 0x0c; buf->data[5] = 0; /* gapfill */ for (idx = 0; idx < 6; idx++) { set_long(buf->data + 6 + idx * 6, b[idx].address); set_byte(buf->data + 10 + idx * 6, b[idx].enabled); set_byte(buf->data + 11 + idx * 6, 0); } pi_write(sd, buf->data, 42); idx = pi_read(sd, buf, 6); if (idx <= 0 || buf->data[4] != (unsigned char) 0x8c) { pi_buffer_free (buf); return 0; } pi_buffer_free (buf); return 1; } /*********************************************************************** * * Function: sys_SetTrapBreaks * * Summary: Set the Trap Breaks (0x11, 0x91) * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int sys_SetTrapBreaks(int sd, int *traps) { int idx; pi_buffer_t *buf; buf = pi_buffer_new (32); if (buf == NULL) { errno = ENOMEM; return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); } buf->data[0] = 0; buf->data[1] = 0; buf->data[2] = 0; buf->data[3] = 0; buf->data[4] = 0x11; buf->data[5] = 0; /* gapfill */ for (idx = 0; idx < 5; idx++) { set_short(buf->data + 6 + idx * 2, traps[idx]); } pi_write(sd, buf->data, 16); idx = pi_read(sd, buf, 6); if ((idx <= 0) || (buf->data[4] != (unsigned char) 0x91)) { pi_buffer_free (buf); return 0; } pi_buffer_free (buf); return 1; } /*********************************************************************** * * Function: sys_GetTrapBreaks * * Summary: Get the Trap Breaks (0x10, 0x90) * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int sys_GetTrapBreaks(int sd, int *traps) { int idx; pi_buffer_t *buf; buf = pi_buffer_new (32); if (buf == NULL) { errno = ENOMEM; return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); } buf->data[0] = 0; buf->data[1] = 0; buf->data[2] = 0; buf->data[3] = 0; buf->data[4] = 0x10; buf->data[5] = 0; /* gapfill */ pi_write(sd, buf->data, 6); idx = pi_read(sd, buf, 16); if ((idx < 16) || (buf->data[4] != (unsigned char) 0x90)) { pi_buffer_free (buf); return 0; } for (idx = 0; idx < 5; idx++) { traps[idx] = get_short(buf->data + 6 + idx * 2); } pi_buffer_free (buf); return 1; } /*********************************************************************** * * Function: sys_ToggleDbgBreaks * * Summary: Enable the DbgBreaks command (0x0D, 0x8D) * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int sys_ToggleDbgBreaks(int sd) { int idx; pi_buffer_t *buf; unsigned char byte; buf = pi_buffer_new (32); if (buf == NULL) { errno = ENOMEM; return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); } buf->data[0] = 0; buf->data[1] = 0; buf->data[2] = 0; buf->data[3] = 0; buf->data[4] = 0x0d; buf->data[5] = 0; /* gapfill */ pi_write(sd, buf->data, 6); idx = pi_read(sd, buf, 7); if ((idx < 7) || (buf->data[4] != (unsigned char) 0x8d)) { pi_buffer_free (buf); return 0; } byte = get_byte(buf->data + 6); pi_buffer_free (buf); return byte; } /*********************************************************************** * * Function: sys_QueryState * * Summary: Query the state (uh) * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int sys_QueryState(int sd) { char buf[6]; buf[0] = 0; buf[1] = 0; buf[2] = 0; buf[3] = 0; buf[4] = 0; buf[5] = 0; /* gapfill */ return pi_write(sd, buf, 2); } /*********************************************************************** * * Function: sys_ReadMemory * * Summary: Read memory (0x01, 0x81) * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int sys_ReadMemory(int sd, unsigned long addr, unsigned long len, void *dest) { int result; unsigned long todo, done; pi_buffer_t *buf; buf = pi_buffer_new (0xFFFF); if (buf == NULL) { errno = ENOMEM; return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); } done = 0; do { todo = len; if (todo > 256) todo = 256; buf->data[0] = 0; buf->data[1] = 0; buf->data[2] = 0; buf->data[3] = 0; buf->data[4] = 0x01; buf->data[5] = 0; /* gapfill */ set_long(buf->data + 6, addr + done); set_short(buf->data + 10, todo); pi_write(sd, buf->data, 12); result = pi_read(sd, buf, todo + 6); if (result < 0) { pi_buffer_free (buf); return done; } if ((buf->data[4] == 0x81) && ((unsigned int) result == todo + 6)) { memcpy(((char *) dest) + done, buf->data + 6, todo); done += todo; } else { pi_buffer_free (buf); return done; } } while (done < len); pi_buffer_free (buf); return done; } /*********************************************************************** * * Function: sys_WriteMemory * * Summary: Write memory (0x02, 0x82) * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int sys_WriteMemory(int sd, unsigned long addr, unsigned long len, void *src) { int result; unsigned long todo, done; pi_buffer_t *buf; buf = pi_buffer_new (0xFFFF); if (buf == NULL) { errno = ENOMEM; return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); } done = 0; do { todo = len; if (todo > 256) todo = 256; buf->data[0] = 0; buf->data[1] = 0; buf->data[2] = 0; buf->data[3] = 0; buf->data[4] = 0x02; buf->data[5] = 0; /* gapfill */ set_long(buf->data + 6, addr); set_short(buf->data + 10, len); memcpy(buf->data + 12, (char *)src + done, todo); pi_write(sd, buf->data, len + 12); result = pi_read(sd, buf, 6); if (result < 0) { pi_buffer_free (buf); return done; } if ((buf->data[4] == (unsigned char)0x82) && ((unsigned long) result == todo + 6)) { ; } else { pi_buffer_free (buf); return done; } } while (done < len); pi_buffer_free (buf); return done; } /*********************************************************************** * * Function: sys_Find * * Summary: Searches a range of addresses for data (0x13, 0x80) * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int sys_Find(int sd, unsigned long startaddr, unsigned long stopaddr, size_t len, int caseinsensitive, void *data, unsigned long *found) { int result; unsigned char byte; pi_buffer_t *buf; buf = pi_buffer_new (len + 17); if (buf == NULL) { errno = ENOMEM; return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); } buf->data[0] = 0; buf->data[1] = 0; buf->data[2] = 0; buf->data[3] = 0; buf->data[4] = 0x11; buf->data[5] = 0; /* gapfill */ set_long(buf->data + 6, startaddr); set_long(buf->data + 10, stopaddr); set_short(buf->data + 14, len); set_byte(buf->data + 16, caseinsensitive); memcpy(buf->data + 17, data, len); pi_write(sd, buf->data, len + 17); result = pi_read(sd, buf, 12); if (result < 0) { pi_buffer_free (buf); return result; } if (found) *found = get_long(buf->data + 6); byte = get_byte(buf->data + 10); pi_buffer_free (buf); return byte; } /*********************************************************************** * * Function: sys_RemoteEvent * * Summary: Parameters sent from host to target to feed pen and * keyboard events. They do not require a response. * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int sys_RemoteEvent(int sd, int penDown, int x, int y, int keypressed, int keymod, int keyasc, int keycode) { char buf[16]; /* Offset 1, 3 and 9 are padding */ set_byte(&buf[0], 0x0D); /* RemoteEvtCommand */ set_byte(&buf[1], 0); set_byte(&buf[2], penDown); set_byte(&buf[3], 0); set_short(&buf[4], x); set_short(&buf[6], y); set_byte(&buf[8], keypressed); set_byte(&buf[9], 0); set_short(&buf[10], keymod); set_short(&buf[12], keyasc); set_short(&buf[14], keycode); return pi_write(sd, buf, 16); } /*********************************************************************** * * Function: sys_RPC * * Summary: Remote Procedure calls (0x0A, 0x8A) * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int sys_RPC(int sd, int sockaddr, int trap, long *D0, long *A0, int params, struct RPC_param *param, int reply) { int idx; unsigned char *c; pi_buffer_t *buf; buf = pi_buffer_new (4096); if (buf == NULL) { errno = ENOMEM; return pi_set_error(sd, PI_ERR_GENERIC_MEMORY); } buf->data[0] = sockaddr; /* 0 for debug, 1 for console */ buf->data[1] = sockaddr; buf->data[2] = 0; buf->data[4] = 0x0a; buf->data[5] = 0; set_short(buf->data + 6, trap); set_long(buf->data + 8, *D0); set_long(buf->data + 12, *A0); set_short(buf->data + 16, params); c = buf->data + 18; for (idx = params - 1; idx >= 0; idx--) { set_byte(c, param[idx].byRef); c++; set_byte(c, param[idx].size); c++; if (param[idx].data) memcpy(c, param[idx].data, param[idx].size); c += param[idx].size; if (param[idx].size & 1) *c++ = 0; } if (sockaddr == 3) set_short(buf->data + 4, c - buf->data - 6); pi_write(sd, buf->data + 4,(size_t)(c - buf->data - 4)); if (reply) { int l = pi_read(sd, buf, 4096); if (l < 0) { pi_buffer_free (buf); return l; } if (buf->data[0] != (unsigned char)0x8a) { pi_buffer_free (buf); return pi_set_error(sd, -2); } *D0 = get_long(buf->data + 4); *A0 = get_long(buf->data + 8); c = buf->data + 14; for (idx = params - 1; idx >= 0; idx--) { if (param[idx].byRef && param[idx].data) memcpy(param[idx].data, c + 2, param[idx].size); c += 2 + ((get_byte(c + 1) + 1) & ~1); } } pi_buffer_free (buf); return 0; } /*********************************************************************** * * Function: RPC * * Summary: Deprecated * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int RPC(int sd, int sockaddr, int trap, int reply, ...) { int idx = 0, j, RPC_arg[20]; va_list ap; struct RPC_param p[20]; long D0 = 0, A0 = 0; va_start(ap, reply); for (;;) { int type = va_arg(ap, int); if (type == 0) break; if (type < 0) { p[idx].byRef = 0; p[idx].size = -type; RPC_arg[idx] = va_arg(ap, int); p[idx].data = &RPC_arg[idx]; p[idx].invert = 0; } else { void *c = va_arg(ap, void *); p[idx].byRef = 1; p[idx].size = type; p[idx].data = c; p[idx].invert = va_arg(ap, int); if (p[idx].invert) { if (p[idx].size == 2) { int *s = c; *s = htons(*s); } else { int *l = c; *l = htonl(*l); } } } idx++; } va_end(ap); if (sys_RPC(sd, sockaddr, trap, &D0, &A0, idx, p, reply != 2) < 0) return pi_error(sd); for (j = 0; j < idx; j++) { if (p[j].invert) { void *c = p[j].data; if (p[j].size == 2) { int *s = c; *s = htons(*s); } else { int *l = c; *l = htonl(*l); } } } if (reply) return A0; return D0; } /*********************************************************************** * * Function: PackRPC * * Summary: Pack the RPC structure for transmission * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int PackRPC(struct RPC_params *p, int trap, int reply, ...) { int idx = 0; va_list ap; p->trap = trap; p->reply = reply; va_start(ap, reply); for (;;) { int type = (int) va_arg(ap, int); if (type == 0) break; if (type < 0) { p->param[idx].byRef = 0; p->param[idx].size = -type; p->param[idx].arg = (int) va_arg(ap, int); p->param[idx].data = &p->param[idx].arg; p->param[idx].invert = 0; } else { void *c = (void *) va_arg(ap, void *); p->param[idx].byRef = 1; p->param[idx].size = type; p->param[idx].data = c; p->param[idx].invert = (int) va_arg(ap, int); } idx++; } p->args = idx; va_end(ap); return 0; } /*********************************************************************** * * Function: UninvertRPC * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ void UninvertRPC(struct RPC_params *p) { int j; for (j = 0; j < p->args; j++) { if (p->param[j].invert) { void *c = p->param[j].data; if ((p->param[j].invert == 2) && (p->param[j].size == 2)) { int *s = c; *s = htons(*s) >> 8; } else if (p->param[j].size == 2) { int *s = c; *s = htons(*s); } else { long *l = c; *l = htonl(*l); } } } } /*********************************************************************** * * Function: InvertRPC * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ void InvertRPC(struct RPC_params *p) { int j; for (j = 0; j < p->args; j++) { if (p->param[j].invert) { void *c = p->param[j].data; if ((p->param[j].invert == 2) && (p->param[j].size == 2)) { int *s = c; *s = ntohs(*s) >> 8; } else if (p->param[j].size == 2) { int *s = c; *s = ntohs(*s); } else { long *l = c; *l = ntohl((unsigned) *l); } } } } /*********************************************************************** * * Function: DoRPC * * Summary: Actually execute the RPC query/response * * Parameters: None * * Returns: Nothing * ***********************************************************************/ unsigned long DoRPC(int sd, int sockaddr, struct RPC_params *p, int *error) { int err; long D0 = 0, A0 = 0; InvertRPC(p); err = sys_RPC(sd, sockaddr, p->trap, &D0, &A0, p->args, &p->param[0], p->reply); UninvertRPC(p); if (error) *error = err; if (p->reply == RPC_PtrReply) return A0; else if (p->reply == RPC_IntReply) return D0; else return err; } /*********************************************************************** * * Function: RPC_Int_Void * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int RPC_Int_Void(int sd, int trap) { return RPC(sd, 1, trap, 0, RPC_End); } /*********************************************************************** * * Function: RPC_Ptr_Void * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int RPC_Ptr_Void(int sd, int trap) { return RPC(sd, 1, trap, 1, RPC_End); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/pi-header.c0000644000175000017500000000424410513447542021072 0ustar rousseaurousseau/* * $Id: pi-header.c,v 1.25 2006/10/12 14:21:22 desrod Exp $ * * pi-header.c: Splash for the version/etc. * * Copyright (c) 2000, David A. Desrosiers * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this 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 #include #include "pi-version.h" #include "pi-header.h" void print_splash(const char *progname) { char *patchlevel = ""; fprintf(stderr," DEPRECATED: The application is calling print_splash()\n"); #ifdef PILOT_LINK_PATCH patchlevel = PILOT_LINK_PATCH; #endif printf(" .--------------------------------------------.\n" " | (c) Copyright 1996-2006, pilot-link team |\n" " | Join the pilot-link lists to help out. |\n" " `--------------------------------------------'\n" " This is %s, from pilot-link version %d.%d.%d%s\n\n" " Build target..: %s\n" " Build date....: %s %s\n\n", progname, PILOT_LINK_VERSION, PILOT_LINK_MAJOR, PILOT_LINK_MINOR, patchlevel, HOST_OS, __DATE__, __TIME__); printf(" pilot-link %d.%d.%d%s is covered under the GPL/LGPL\n", PILOT_LINK_VERSION, PILOT_LINK_MAJOR, PILOT_LINK_MINOR, patchlevel); printf(" See the file COPYING under docs for more info.\n\n" " Please use --help for more detailed options.\n"); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/calendar.c0000644000175000017500000004143111333421636021001 0ustar rousseaurousseau/* * $Id: calendar.c,v 1.4 2010-01-17 00:38:47 judd Exp $ * * calendar.c - Support for PalmOne Calendar application (CalendarDB-PDat), * this is a copy of datebook.c with the calendar fields added. * * (c) 2008, Jon Schewe * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #include "pi-macros.h" #include "pi-calendar.h" #define alarmFlag 64 #define repeatFlag 32 #define noteFlag 16 #define exceptFlag 8 #define descFlag 4 #define locFlag 2 /*********************************************************************** * * Function: new_CalendarEvent * * Summary: Create empty calendar event * * Parameters: CalendarEvent_t* * * Returns: void * ***********************************************************************/ void new_CalendarEvent(CalendarEvent_t *a) { int i = 0; a->event = 0; a->begin.tm_hour = 0; a->begin.tm_min = 0; a->begin.tm_sec = 0; a->begin.tm_year = 2000; a->begin.tm_mon = 0; a->begin.tm_mday = 0; a->begin.tm_isdst = -1; a->end.tm_hour = 0; a->end.tm_min = 0; a->end.tm_sec = 0; a->end.tm_year = 2000; a->end.tm_mon = 0; a->end.tm_mday = 0; a->end.tm_isdst = -1; a->alarm = 0; a->advance = 0; a->advanceUnits = 0; a->repeatType = 0; a->repeatForever = 0; a->repeatEnd.tm_hour = 0; a->repeatEnd.tm_min = 0; a->repeatEnd.tm_sec = 0; a->repeatEnd.tm_year = 2000; a->repeatEnd.tm_mon = 0; a->repeatEnd.tm_mday = 0; a->repeatEnd.tm_isdst = -1; a->repeatFrequency = 0; a->repeatDay = 0; for (i = 0; i < 7; i++) { a->repeatDays[i] = 0; } a->repeatWeekstart = 0; a->exceptions = 0; a->exception = NULL; a->description = NULL; a->note = NULL; a->location = NULL; a->tz = NULL; /* initialize the blobs to NULL */ for (i=0; iblob[i]=NULL; } } /*********************************************************************** * * Function: copy_CalendarEvent * * Summary: Copy the data from one calendar event to another. The destination * calendar event must already be cleared, either by creating new or by * calling free_CalendarEvent on it first. * * Parameters: CalendarEvent_t*, CalendarEvent_t* * * Returns: int -1 on failure (errno will be set), 0 on success * ***********************************************************************/ int copy_CalendarEvent(const CalendarEvent_t *source, CalendarEvent_t *dest) { int i = 0; dest->event = source->event; memcpy(&(dest->begin), &(source->begin), sizeof(struct tm)); memcpy(&(dest->end), &(source->end), sizeof(struct tm)); dest->alarm = source->alarm; dest->advance = source->advance; dest->advanceUnits = source->advanceUnits; dest->repeatType = source->repeatType; dest->repeatForever = source->repeatForever; memcpy(&(dest->repeatEnd), &(source->repeatEnd), sizeof(struct tm)); dest->repeatFrequency = source->repeatFrequency; dest->repeatDay = source->repeatDay; for (i = 0; i < 7; i++) { dest->repeatDays[i] = source->repeatDays[i]; } dest->repeatWeekstart = source->repeatWeekstart; dest->exceptions = source->exceptions; if(source->exceptions > 0) { dest->exception = (struct tm*)malloc(source->exceptions * sizeof(struct tm)); if(NULL == dest->exception) { errno = ENOMEM; return -1; } for(i=0; iexceptions; i++) { memcpy(&(dest->exception[i]), &(source->exception[i]), sizeof(struct tm)); } } if(NULL != source->description) { dest->description = strdup(source->description); } else { dest->description = NULL; } if(NULL != source->note) { dest->note = strdup(source->note); } else { dest->note = NULL; } if(NULL != source->location) { dest->location = strdup(source->location); } else { dest->location = NULL; } /* copy the blobs */ for (i=0; iblob[i] != NULL) { dest->blob[i] = dup_Blob(source->blob[i]); if(NULL == dest->blob[i]) { return -1; } } else { dest->blob[i] = NULL; } } if(source->tz != NULL) { dest->tz = dup_Timezone(source->tz); if(NULL == dest->tz) { return -1; } } else { dest->tz = NULL; } return 0; } /*********************************************************************** * * Function: free_CalendarEvent * * Summary: Frees members of the calendar event structure * * Parameters: CalendarEvent_t* * * Returns: void * ***********************************************************************/ void free_CalendarEvent(CalendarEvent_t *a) { int i; if (a->exception != NULL) { free(a->exception); a->exception = NULL; } if (a->description != NULL) { free(a->description); a->description = NULL; } if (a->note != NULL) { free(a->note); a->note = NULL; } if(a->location != NULL) { free(a->location); a->location = NULL; } if(NULL != a->tz) { free_Timezone(a->tz); free(a->tz); } for(i=0; iblob[i]) { free_Blob(a->blob[i]); free(a->blob[i]); a->blob[i] = NULL; } } } /*********************************************************************** * * Function: unpack_CalendarEvent * * Summary: Fill in the calendar event structure based on the raw * record data * * Parameters: CalendarEvent_t*, pi_buffer_t * of buffer, calendarType * * Returns: -1 on fail, 0 on success * ***********************************************************************/ int unpack_CalendarEvent(CalendarEvent_t *a, const pi_buffer_t *buf, calendarType type) { int iflags, j, destlen, i, result; unsigned char *p2; unsigned long d; destlen = 8; if (type != calendar_v1) return -1; if (buf == NULL || buf->data == NULL || buf->used < destlen) { return -1; } a->begin.tm_hour = get_byte(buf->data); a->begin.tm_min = get_byte(buf->data + 1); a->begin.tm_sec = 0; d = (unsigned short int) get_short(buf->data + 4); a->begin.tm_year = (d >> 9) + 4; a->begin.tm_mon = ((d >> 5) & 15) - 1; a->begin.tm_mday = d & 31; a->begin.tm_isdst = -1; a->end = a->begin; a->end.tm_hour = get_byte(buf->data + 2); a->end.tm_min = get_byte(buf->data + 3); if (get_short(buf->data) == 0xffff) { a->event = 1; a->begin.tm_hour = 0; a->begin.tm_min = 0; a->end.tm_hour = 0; a->end.tm_min = 0; } else { a->event = 0; } mktime(&a->begin); mktime(&a->end); iflags = get_byte(buf->data + 6); /* buf->data+7 is gapfill */ p2 = (unsigned char *) buf->data + 8; if (iflags & alarmFlag) { a->alarm = 1; a->advance = get_byte(p2); p2 += 1; a->advanceUnits = get_byte(p2); p2 += 1; } else { a->alarm = 0; a->advance = 0; a->advanceUnits = 0; } if (iflags & repeatFlag) { int i, on; a->repeatType = (enum calendarRepeatType) get_byte(p2); p2 += 2; d = (unsigned short int) get_short(p2); p2 += 2; if (d == 0xffff) a->repeatForever = 1; /* repeatEnd is invalid */ else { a->repeatEnd.tm_year = (d >> 9) + 4; a->repeatEnd.tm_mon = ((d >> 5) & 15) - 1; a->repeatEnd.tm_mday = d & 31; a->repeatEnd.tm_min = 0; a->repeatEnd.tm_hour = 0; a->repeatEnd.tm_sec = 0; a->repeatEnd.tm_isdst = -1; mktime(&a->repeatEnd); a->repeatForever = 0; } a->repeatFrequency = get_byte(p2); p2++; on = get_byte(p2); p2++; a->repeatDay = (enum calendarDayOfMonthType) 0; for (i = 0; i < 7; i++) a->repeatDays[i] = 0; if (a->repeatType == calendarRepeatMonthlyByDay) a->repeatDay = (enum calendarDayOfMonthType) on; else if (a->repeatType == calendarRepeatWeekly) for (i = 0; i < 7; i++) a->repeatDays[i] = !!(on & (1 << i)); a->repeatWeekstart = get_byte(p2); p2++; p2++; } else { int i; a->repeatType = (enum calendarRepeatType) 0; a->repeatForever = 1; /* repeatEnd is invalid */ a->repeatFrequency = 0; a->repeatDay = (enum calendarDayOfMonthType) 0; for (i = 0; i < 7; i++) a->repeatDays[i] = 0; a->repeatWeekstart = 0; } if (iflags & exceptFlag) { a->exceptions = get_short(p2); p2 += 2; a->exception = malloc(sizeof(struct tm) * a->exceptions); for (j = 0; j < a->exceptions; j++, p2 += 2) { d = (unsigned short int) get_short(p2); a->exception[j].tm_year = (d >> 9) + 4; a->exception[j].tm_mon = ((d >> 5) & 15) - 1; a->exception[j].tm_mday = d & 31; a->exception[j].tm_hour = 0; a->exception[j].tm_min = 0; a->exception[j].tm_sec = 0; a->exception[j].tm_isdst = -1; mktime(&a->exception[j]); } } else { a->exceptions = 0; a->exception = 0; } if (iflags & descFlag) { a->description = strdup((char *)p2); p2 += strlen((char *)p2) + 1; } else a->description = 0; if (iflags & noteFlag) { a->note = strdup((char *)p2); p2 += strlen((char *)p2) + 1; } else { a->note = 0; } if (iflags & locFlag) { a->location = strdup((char *)p2); p2 += strlen((char *)p2) + 1; } else { a->location = 0; } /* initialize the blobs to NULL */ for (i=0; iblob[i]=NULL; } if(p2 - buf->data < buf->used) { uint8_t blob_count; /* read the blobs */ a->tz = NULL; for(blob_count = 0; buf->used - (p2 - buf->data) > 6; ++blob_count) { if(blob_count >= MAX_BLOBS) { /* too many blobs were found */ printf("Error, found more than %d blobs: %d\n", MAX_BLOBS, blob_count); return -1; } a->blob[blob_count] = (Blob_t *)malloc(sizeof(Blob_t)); result = unpack_Blob_p(a->blob[blob_count], p2, 0); if(-1 == result) { return -1; } else { p2 += result; } //printf("DEBUG: record %s read in blob[%d] of size %d\n", a->description, blob_count, a->blob[blob_count]->length); /* if it's a timezone blob store it */ if (0 == memcmp(a->blob[blob_count]->type, BLOB_TYPE_CALENDAR_TIMEZONE_ID, 4)) { int result; if(NULL != a->tz) { printf("Warning: Found more than one timezone blob! Freeing the previous one and starting again\n"); free_Timezone(a->tz); free(a->tz); } a->tz = (Timezone_t *)malloc(sizeof(Timezone_t)); result = unpack_Timezone_p(a->tz, a->blob[blob_count]->data, 0); if(-1 == result) { printf("Error unpacking timezone blob\n"); return -1; } else if(result != a->blob[blob_count]->length) { printf("Read the wrong number of bytes for a timezone expected %d but was %d\n", a->blob[blob_count]->length, result); return -1; } } } if(p2 - buf->data < buf->used) { printf("Extra data found %ld bytes\n", (buf->used - (p2 - buf->data))); return -1; } } else { a->tz = NULL; } return 0; } /*********************************************************************** * * Function: pack_CalendarEvent * * Summary: Fill in the raw calendar event record data based on the * calendar event structure. * * Parameters: CalendarEvent_t*, pi_buffer_t*, calendarType * * Returns: -1 on error (bad arguments, mostyle) or 0 on success. * The buffer is sized to accomodate the required data. * ***********************************************************************/ int pack_CalendarEvent(const CalendarEvent_t *a, pi_buffer_t *buf, calendarType type) { int iflags, destlen = 8; char *pos; if (type != calendar_v1) return -1; if (a == NULL || buf == NULL) return -1; if (a->alarm) destlen += 2; if (a->repeatType) destlen += 8; if (a->exceptions) destlen += 2 + 2 * a->exceptions; if (a->note) destlen += strlen(a->note) + 1; if (a->description) destlen += strlen(a->description) + 1; if (a->location) destlen += strlen(a->location) + 1; pi_buffer_expect (buf, destlen); buf->used = destlen; set_byte(buf->data, a->begin.tm_hour); set_byte(buf->data + 1, a->begin.tm_min); set_byte(buf->data + 2, a->end.tm_hour); set_byte(buf->data + 3, a->end.tm_min); set_short(buf->data + 4, ((a-> begin.tm_year - 4) << 9) | ((a->begin.tm_mon + 1) << 5) | a->begin. tm_mday); if (a->event) { set_long(buf->data, 0xffffffff); } iflags = 0; pos = (char *) buf->data + 8; if (a->alarm) { iflags |= alarmFlag; set_byte(pos, a->advance); set_byte(pos + 1, a->advanceUnits); pos += 2; } if (a->repeatType) { int i, on; iflags |= repeatFlag; if (a->repeatType == calendarRepeatMonthlyByDay) on = a->repeatDay; else if (a->repeatType == calendarRepeatWeekly) { on = 0; for (i = 0; i < 7; i++) if (a->repeatDays[i]) on |= 1 << i; } else on = 0; set_byte(pos, a->repeatType); set_byte(pos + 1, 0); pos += 2; if (a->repeatForever) set_short(pos, 0xffff); else set_short(pos, ((a-> repeatEnd.tm_year - 4) << 9) | ((a->repeatEnd.tm_mon + 1) << 5) | a->repeatEnd. tm_mday); pos += 2; set_byte(pos, a->repeatFrequency); pos++; set_byte(pos, on); pos++; set_byte(pos, a->repeatWeekstart); pos++; set_byte(pos, 0); pos++; } if (a->exceptions) { int i; iflags |= exceptFlag; set_short(pos, a->exceptions); pos += 2; for (i = 0; i < a->exceptions; i++, pos += 2) set_short(pos, ((a-> exception[i].tm_year - 4) << 9) | ((a->exception[i].tm_mon + 1) << 5) | a-> exception[i].tm_mday); } if (a->description != NULL) { iflags |= descFlag; strcpy(pos, a->description); pos += strlen(pos) + 1; } if (a->note != NULL) { iflags |= noteFlag; strcpy(pos, a->note); pos += strlen(pos) + 1; } if (a->location != NULL) { iflags |= locFlag; strcpy(pos, a->location); pos += strlen(pos) + 1; } set_byte(buf->data + 6, iflags); set_byte(buf->data + 7, 0); /* gapfill */ /* Calendar stuff */ uint8_t blob_index; //write out the blobs for(blob_index = 0; blob_index < MAX_BLOBS; ++blob_index) { if(NULL != a->blob[blob_index]) { pack_Blob(a->blob[blob_index], buf); } } return 0; } /*********************************************************************** * * Function: unpack_CalendarAppInfo * * Summary: Fill in the app info structure based on the raw app * info data * * Parameters: CalendarAppInfo_t*, char* to record, record length * * Returns: 0 on error, the length of the data used from the * buffer otherwise * ***********************************************************************/ int unpack_CalendarAppInfo(CalendarAppInfo_t *ai, pi_buffer_t *buf) { int i; int len; unsigned char *record; int used; len = buf->used; record = buf->data; used = unpack_CategoryAppInfo(&ai->category, record, len); if (!used) return 0; record += used; len -= used; if (len < 2) return 0; ai->startOfWeek = get_byte(record); // alignment byte record += 2; used += 2; for(i=0; i<18; ++i) { ai->internal[i] = get_byte(record); record++; used++; } ai->type = calendar_v1; return used; } /*********************************************************************** * * Function: pack_CalendarAppInfo * * Summary: Fill in the raw app info record data based on the app * info structure * * Parameters: AppointmentAppInfo*, char* to buffer, buffer length * * Returns: The length of the buffer required if record is NULL, * or 0 on error, the length of the data used from the * buffer otherwise * ***********************************************************************/ int pack_CalendarAppInfo(const CalendarAppInfo_t *ai, pi_buffer_t *buf) { int i; int len; unsigned char *record; if (!buf) { return 298; } /* AppInfo size should be 298, 300 will do */ len = 300; pi_buffer_expect(buf, 300); buf->used = pack_CategoryAppInfo(&ai->category, buf->data, buf->allocated); if (!buf->used) return 0; record = buf->data + buf->used; len -= buf->used; if (len < 2) return 0; set_short(record, 0); set_byte(record, ai->startOfWeek); record += 2; buf->used += 2; for(i=0; i<18; ++i) { set_byte(record, ai->internal[i]); record ++; buf->used ++; } return (record - buf->data); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/inet.c0000644000175000017500000003476310513447542020204 0ustar rousseaurousseau/* * $Id: inet.c,v 1.61 2006/10/12 14:21:22 desrod Exp $ * * inet.c: Interface layer to TCP/IP NetSync connections * * Copyright (c) 1997, Kenneth Albanowski * Copyright (c) 1999, Tilo Christ * Copyright (c) 1999, John Franks * Copyright (c) 2004, 2005 Florent Pillet * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include "pi-debug.h" #include "pi-source.h" #include "pi-inet.h" #include "pi-cmp.h" #include "pi-net.h" /* Declare prototypes */ static void pi_inet_device_free (pi_device_t *dev); static pi_protocol_t* pi_inet_protocol (pi_device_t *dev); static pi_protocol_t* pi_inet_protocol_dup (pi_protocol_t *prot); static void pi_inet_protocol_free (pi_protocol_t *prot); static int pi_inet_close(pi_socket_t *ps); static int pi_inet_connect(pi_socket_t *ps, struct sockaddr *addr, size_t addrlen); static int pi_inet_bind(pi_socket_t *ps, struct sockaddr *addr, size_t addrlen); static int pi_inet_listen(pi_socket_t *ps, int backlog); static int pi_inet_accept(pi_socket_t *ps, struct sockaddr *addr, size_t *addrlen); static ssize_t pi_inet_read(pi_socket_t *ps, pi_buffer_t *msg, size_t len, int flags); static ssize_t pi_inet_write(pi_socket_t *ps, const unsigned char *msg, size_t len, int flags); static int pi_inet_getsockopt(pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len); static int pi_inet_setsockopt(pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len); static int pi_inet_flush(pi_socket_t *ps, int flags); extern int pi_socket_init(pi_socket_t *ps); pi_device_t* pi_inet_device (int type) { pi_device_t *dev = NULL; pi_inet_data_t *data = NULL; dev = (pi_device_t *)malloc (sizeof (pi_device_t)); if (dev != NULL) { data = (pi_inet_data_t *)malloc (sizeof (pi_inet_data_t)); if (data == NULL) { free(dev); dev = NULL; } } if (dev != NULL && data != NULL) { dev->free = pi_inet_device_free; dev->protocol = pi_inet_protocol; dev->bind = pi_inet_bind; dev->listen = pi_inet_listen; dev->accept = pi_inet_accept; dev->connect = pi_inet_connect; dev->close = pi_inet_close; data->timeout = 0; data->rx_bytes = 0; data->rx_errors = 0; data->tx_bytes = 0; data->tx_errors = 0; dev->data = data; } return dev; } static void pi_inet_device_free (pi_device_t *dev) { ASSERT (dev != NULL); if (dev != NULL) { if (dev->data != NULL) free(dev->data); free(dev); } } static pi_protocol_t* pi_inet_protocol (pi_device_t *dev) { pi_protocol_t *prot; pi_inet_data_t *data; ASSERT (dev != NULL); data = dev->data; prot = (pi_protocol_t *)malloc (sizeof (pi_protocol_t)); if (prot != NULL) { prot->level = PI_LEVEL_DEV; prot->dup = pi_inet_protocol_dup; prot->free = pi_inet_protocol_free; prot->read = pi_inet_read; prot->write = pi_inet_write; prot->flush = pi_inet_flush; prot->getsockopt = pi_inet_getsockopt; prot->setsockopt = pi_inet_setsockopt; prot->data = NULL; } return prot; } static pi_protocol_t* pi_inet_protocol_dup (pi_protocol_t *prot) { pi_protocol_t *new_prot; ASSERT (prot != NULL); new_prot = (pi_protocol_t *)malloc (sizeof (pi_protocol_t)); if (new_prot != NULL) { new_prot->level = prot->level; new_prot->dup = prot->dup; new_prot->free = prot->free; new_prot->read = prot->read; new_prot->write = prot->write; new_prot->flush = prot->flush; new_prot->getsockopt = prot->getsockopt; new_prot->setsockopt = prot->setsockopt; new_prot->data = NULL; } return new_prot; } static void pi_inet_protocol_free (pi_protocol_t *prot) { ASSERT (prot != NULL); if (prot != NULL) free(prot); } static int pi_inet_bind(pi_socket_t *ps, struct sockaddr *addr, size_t addrlen) { int opt, sd, err; size_t optlen; struct pi_sockaddr *paddr = (struct pi_sockaddr *) addr; struct sockaddr_in serv_addr; char *device = paddr->pi_device, *port = NULL; /* Figure out the addresses to allow */ memset(&serv_addr, 0, sizeof(serv_addr)); serv_addr.sin_family = AF_INET; if (strlen(device) > 1 && strncmp(device, "any", 3)) { serv_addr.sin_addr.s_addr = inet_addr(device); if (serv_addr.sin_addr.s_addr == (in_addr_t)-1) { struct hostent *hostent = gethostbyname(device); if (!hostent) return pi_set_error(ps->sd, PI_ERR_GENERIC_SYSTEM); memcpy((char *) &serv_addr.sin_addr.s_addr, hostent->h_addr, (size_t)hostent->h_length); } } else { serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); } if ((port = strchr(device, ':')) != NULL) { serv_addr.sin_port = htons(atoi(++port)); } else { serv_addr.sin_port = htons(14238); } sd = socket(AF_INET, SOCK_STREAM, 0); if (sd < 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "DEV BIND Inet: Unable to create socket\n")); return pi_set_error(ps->sd, PI_ERR_GENERIC_SYSTEM); } if ((err = pi_socket_setsd (ps, sd)) < 0) return err; opt = 1; optlen = sizeof(opt); if (setsockopt(ps->sd, SOL_SOCKET, SO_REUSEADDR, (void *) &opt, (int)optlen) < 0) { return pi_set_error(ps->sd, PI_ERR_GENERIC_SYSTEM); } if (bind(ps->sd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) return pi_set_error(ps->sd, PI_ERR_GENERIC_SYSTEM); LOG((PI_DBG_DEV, PI_DBG_LVL_INFO, "DEV BIND Inet Bound to %s\n", device)); ps->raddr = malloc(addrlen); memcpy(ps->raddr, addr, addrlen); ps->raddrlen = addrlen; ps->laddr = malloc(addrlen); memcpy(ps->laddr, addr, addrlen); ps->laddrlen = addrlen; return 0; } static int pi_inet_connect(pi_socket_t *ps, struct sockaddr *addr, size_t addrlen) { int sd, err; struct pi_sockaddr *paddr = (struct pi_sockaddr *) addr; struct sockaddr_in serv_addr; char *device = paddr->pi_device; /* Figure out the addresses to allow */ memset(&serv_addr, 0, sizeof(serv_addr)); serv_addr.sin_family = AF_INET; if (strlen(device) > 1) { serv_addr.sin_addr.s_addr = inet_addr(device); if (serv_addr.sin_addr.s_addr == (in_addr_t)-1) { struct hostent *hostent = gethostbyname(device); if (!hostent) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "DEV CONNECT Inet: Unable" " to determine host\n")); return pi_set_error(ps->sd, PI_ERR_GENERIC_SYSTEM); } memcpy((char *) &serv_addr.sin_addr.s_addr, hostent->h_addr, (size_t)hostent->h_length); } } else { serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); } serv_addr.sin_port = htons(14238); sd = socket(AF_INET, SOCK_STREAM, 0); if (sd < 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "DEV CONNECT Inet: Unable to create socket\n")); return pi_set_error(ps->sd, PI_ERR_GENERIC_SYSTEM); } if ((err = pi_socket_setsd (ps, sd)) < 0) return err; if (connect (ps->sd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "DEV CONNECT Inet: Unable to connect\n")); return pi_set_error(ps->sd, PI_ERR_GENERIC_SYSTEM); } ps->raddr = malloc(addrlen); memcpy(ps->raddr, addr, addrlen); ps->raddrlen = addrlen; ps->laddr = malloc(addrlen); memcpy(ps->laddr, addr, addrlen); ps->laddrlen = addrlen; switch (ps->cmd) { case PI_CMD_CMP: if ((err = cmp_tx_handshake(ps)) < 0) goto fail; break; case PI_CMD_NET: if ((err = net_tx_handshake(ps)) < 0) goto fail; break; } ps->state = PI_SOCK_CONN_INIT; ps->command = 0; LOG((PI_DBG_DEV, PI_DBG_LVL_INFO, "DEV CONNECT Inet: Connected\n")); return 0; fail: return err; } static int pi_inet_listen(pi_socket_t *ps, int backlog) { int result; result = listen(ps->sd, backlog); if (result == 0) ps->state = PI_SOCK_LISTEN; return result; } static int pi_inet_accept(pi_socket_t *ps, struct sockaddr *addr, size_t *addrlen) { int sd, err, split = 0, chunksize = 0; size_t len, size; pl_socklen_t l = 0; unsigned char cmp_flags; if (addrlen) l = *addrlen; sd = accept(ps->sd, addr, &l); if (addrlen) *addrlen = l; if (sd < 0) { pi_set_error(ps->sd, sd); err = PI_ERR_GENERIC_SYSTEM; goto fail; } pi_socket_setsd(ps, sd); pi_socket_init(ps); switch (ps->cmd) { case PI_CMD_CMP: if ((err = cmp_rx_handshake(ps, 57600, 0)) < 0) goto fail; /* propagate the long packet format flag to both command and non-command stacks */ size = sizeof(cmp_flags); pi_getsockopt(ps->sd, PI_LEVEL_CMP, PI_CMP_FLAGS, &cmp_flags, &size); if (cmp_flags & CMP_FL_LONG_PACKET_SUPPORT) { int use_long_format = 1; size = sizeof(int); pi_setsockopt(ps->sd, PI_LEVEL_PADP, PI_PADP_USE_LONG_FORMAT, &use_long_format, &size); ps->command ^= 1; pi_setsockopt(ps->sd, PI_LEVEL_PADP, PI_PADP_USE_LONG_FORMAT, &use_long_format, &size); ps->command ^= 1; } break; case PI_CMD_NET: /* network: make sure we don't split writes. set socket option * on both the command and non-command instances of the protocol */ len = sizeof (split); pi_setsockopt(ps->sd, PI_LEVEL_NET, PI_NET_SPLIT_WRITES, &split, &len); len = sizeof (chunksize); pi_setsockopt(ps->sd, PI_LEVEL_NET, PI_NET_WRITE_CHUNKSIZE, &chunksize, &len); ps->command ^= 1; len = sizeof (split); pi_setsockopt(ps->sd, PI_LEVEL_NET, PI_NET_SPLIT_WRITES, &split, &len); len = sizeof (chunksize); pi_setsockopt(ps->sd, PI_LEVEL_NET, PI_NET_WRITE_CHUNKSIZE, &chunksize, &len); ps->command ^= 1; if ((err = net_rx_handshake(ps)) < 0) goto fail; break; } ps->state = PI_SOCK_CONN_ACCEPT; ps->command = 0; ps->dlprecord = 0; LOG((PI_DBG_DEV, PI_DBG_LVL_INFO, "DEV INET ACCEPT accepted\n")); return ps->sd; fail: return err; } static int pi_inet_close(pi_socket_t *ps) { if (ps->sd) { close(ps->sd); ps->sd = 0; } if (ps->laddr) { free(ps->laddr); ps->laddr = NULL; } if (ps->raddr) { free(ps->raddr); ps->raddr = NULL; } return 0; } static int pi_inet_flush(pi_socket_t *ps, int flags) { char buf[256]; int fl; if (flags & PI_FLUSH_INPUT) { if ((fl = fcntl(ps->sd, F_GETFL, 0)) != -1) { fcntl(ps->sd, F_SETFL, fl | O_NONBLOCK); while (recv(ps->sd, buf, sizeof(buf), 0) > 0) ; fcntl(ps->sd, F_SETFL, fl); } } return 0; } static ssize_t pi_inet_write(pi_socket_t *ps, const unsigned char *msg, size_t len, int flags) { int total, nwrote; pi_inet_data_t *data = (pi_inet_data_t *)ps->device->data; struct timeval t; fd_set ready; FD_ZERO(&ready); FD_SET(ps->sd, &ready); total = len; while (total > 0) { if (data->timeout == 0) { if (select(ps->sd + 1, 0, &ready, 0, 0) < 0 && errno == EINTR) continue; } else { t.tv_sec = data->timeout / 1000; t.tv_usec = (data->timeout % 1000) * 1000; if (select(ps->sd + 1, 0, &ready, 0, &t) == 0) return pi_set_error(ps->sd, PI_ERR_SOCK_TIMEOUT); } if (!FD_ISSET(ps->sd, &ready)) { ps->state = PI_SOCK_CONN_BREAK; return pi_set_error(ps->sd, PI_ERR_SOCK_DISCONNECTED); } nwrote = write(ps->sd, msg, len); if (nwrote < 0) { /* test errno to properly set the socket error */ if (errno == EPIPE || errno == EBADF) { ps->state = PI_SOCK_CONN_BREAK; return pi_set_error(ps->sd, PI_ERR_SOCK_DISCONNECTED); } return pi_set_error(ps->sd, PI_ERR_SOCK_IO); } total -= nwrote; } data->tx_bytes += len; LOG((PI_DBG_DEV, PI_DBG_LVL_INFO, "DEV TX Inet Bytes: %d\n", len)); return len; } static ssize_t pi_inet_read(pi_socket_t *ps, pi_buffer_t *msg, size_t len, int flags) { int r, fl = 0; pi_inet_data_t *data = (pi_inet_data_t *)ps->device->data; fd_set ready; struct timeval t; if (pi_buffer_expect (msg, len) == NULL) { errno = ENOMEM; return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); } if (flags == PI_MSG_PEEK) fl = MSG_PEEK; FD_ZERO(&ready); FD_SET(ps->sd, &ready); /* If timeout == 0, wait forever for packet, otherwise wait till timeout milliseconds */ if (data->timeout == 0) select(ps->sd + 1, &ready, 0, 0, 0); else { t.tv_sec = data->timeout / 1000; t.tv_usec = (data->timeout % 1000) * 1000; if (select(ps->sd + 1, &ready, 0, 0, &t) == 0) return pi_set_error(ps->sd, PI_ERR_SOCK_TIMEOUT); } /* If data is available in time, read it */ if (FD_ISSET(ps->sd, &ready)) { r = recv(ps->sd, msg->data + msg->used, len, fl); if (r < 0) { if (errno == EPIPE || errno == EBADF) { ps->state = PI_SOCK_CONN_BREAK; return pi_set_error(ps->sd, PI_ERR_SOCK_DISCONNECTED); } return pi_set_error(ps->sd, PI_ERR_SOCK_IO); } data->rx_bytes += r; msg->used += r; LOG((PI_DBG_DEV, PI_DBG_LVL_INFO, "DEV RX Inet Bytes: %d\n", r)); return r; } /* otherwise throw out any current packet and return */ LOG((PI_DBG_DEV, PI_DBG_LVL_WARN, "DEV RX Inet timeout\n")); data->rx_errors++; return 0; } static int pi_inet_getsockopt(pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len) { pi_inet_data_t *data = (pi_inet_data_t *)ps->device->data; switch (option_name) { case PI_DEV_TIMEOUT: if (*option_len != sizeof (data->timeout)) { errno = EINVAL; return pi_set_error(ps->sd, PI_ERR_GENERIC_ARGUMENT); } memcpy (option_value, &data->timeout, sizeof (data->timeout)); *option_len = sizeof (data->timeout); break; } return 0; } static int pi_inet_setsockopt(pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len) { pi_inet_data_t *data = (pi_inet_data_t *)ps->device->data; switch (option_name) { case PI_DEV_TIMEOUT: if (*option_len != sizeof (data->timeout)) { errno = EINVAL; return pi_set_error(ps->sd, PI_ERR_GENERIC_ARGUMENT); } memcpy (&data->timeout, option_value, sizeof (data->timeout)); break; } return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/net.c0000644000175000017500000004565210513447542020032 0ustar rousseaurousseau/* * $Id: net.c,v 1.45 2006/10/12 14:21:22 desrod Exp $ * * net.c: Protocol for NetSync connections * * Copyright (c) 1997, Kenneth Albanowski * Copyright (c) 1999, Tilo Christ * Copyright (c) 1999, John Franks * Copyright (c) 2004, 2005 Florent Pillet * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this 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 #include #include #include #include #include "pi-debug.h" #include "pi-source.h" #include "pi-net.h" #include "pi-error.h" #define PI_NET_TIMEOUT 30*1000 static int net_flush(pi_socket_t *ps, int flags); static int net_getsockopt(pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len); static int net_setsockopt(pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len); /*********************************************************************** * * Function: net_protocol_dup * * Summary: clones an existing pi_protocol struct * * Parameters: pi_protocol_t* * * Returns: pi_protocol_t* or NULL if operation failed * ***********************************************************************/ static pi_protocol_t *net_protocol_dup (pi_protocol_t *prot) { pi_protocol_t *new_prot = NULL; pi_net_data_t *data = NULL, *new_data = NULL; ASSERT(prot != NULL); new_prot = (pi_protocol_t *)malloc (sizeof (pi_protocol_t)); if (new_prot != NULL) { new_data = (pi_net_data_t *)malloc (sizeof (pi_net_data_t)); if (new_data == NULL) { free(new_prot); new_prot = NULL; } } if (new_prot != NULL && new_data != NULL) { new_prot->level = prot->level; new_prot->dup = prot->dup; new_prot->free = prot->free; new_prot->read = prot->read; new_prot->write = prot->write; new_prot->flush = prot->flush; new_prot->getsockopt = prot->getsockopt; new_prot->setsockopt = prot->setsockopt; data = (pi_net_data_t *)prot->data; new_data->type = data->type; new_data->split_writes = data->split_writes; new_data->write_chunksize = data->write_chunksize; new_data->txid = data->txid; new_prot->data = new_data; } return new_prot; } /*********************************************************************** * * Function: net_protocol_free * * Summary: frees an existing pi_protocol struct * * Parameters: pi_protocol* * * Returns: void * ***********************************************************************/ static void net_protocol_free (pi_protocol_t *prot) { ASSERT (prot != NULL); if (prot != NULL) { if (prot->data != NULL) free(prot->data); free(prot); } } /*********************************************************************** * * Function: net_protocol * * Summary: creates and inits pi_protocol struct instance * * Parameters: void * * Returns: pi_protocol_t* or NULL if operation failed * ***********************************************************************/ pi_protocol_t *net_protocol (void) { pi_protocol_t *prot = NULL; pi_net_data_t *data = NULL; prot = (pi_protocol_t *)malloc (sizeof (pi_protocol_t)); if (prot != NULL) { data = (pi_net_data_t *)malloc (sizeof (pi_net_data_t)); if (data == NULL) { free(prot); prot = NULL; } } if (prot != NULL && data != NULL) { prot->level = PI_LEVEL_NET; prot->dup = net_protocol_dup; prot->free = net_protocol_free; prot->read = net_rx; prot->write = net_tx; prot->flush = net_flush; prot->getsockopt = net_getsockopt; prot->setsockopt = net_setsockopt; data->type = PI_NET_TYPE_DATA; data->split_writes = 1; /* write packet header and data separately */ data->write_chunksize = 4096; /* and push data in 4k chunks. Required for some USB devices */ data->txid = 0x00; prot->data = data; } return prot; } /*********************************************************************** * * Function: net_rx_handshake * * Summary: RX handshake * * Parameters: pi_socket_t* * * Returns: 0 for success, negative otherwise * ***********************************************************************/ int net_rx_handshake(pi_socket_t *ps) { static const unsigned char msg1[] = /* 50 bytes */ "\x12\x01\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00" "\x24\xff\xff\xff\xff\x3c\x00\x3c\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\xc0\xa8\xa5\x1f\x04\x27\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; static const unsigned char msg2[] = /* 46 bytes */ "\x13\x01\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00" "\x20\xff\xff\xff\xff\x00\x3c\x00\x3c\x00\x00\x00\x00" "\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00"; pi_buffer_t *buffer; int err; buffer = pi_buffer_new (256); if (buffer == NULL) { errno = ENOMEM; return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); } if ((err = net_rx(ps, buffer, 256, 0)) >= 0 && (err = net_tx(ps, msg1, 50, 0)) >= 0 && (err = net_rx(ps, buffer, 50, 0)) >= 0 && (err = net_tx(ps, msg2, 46, 0)) >= 0 && (err = net_rx(ps, buffer, 8, 0)) >= 0) { pi_buffer_free (buffer); return 0; } pi_buffer_free (buffer); return err; } /*********************************************************************** * * Function: net_tx_handshake * * Summary: TX handshake * * Parameters: pi_socket_t* * * Returns: 0 for success, negative otherwise * ***********************************************************************/ int net_tx_handshake(pi_socket_t *ps) { static const unsigned char msg1[] = /* 22 bytes */ "\x90\x01\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00" "\x08\x01\x00\x00\x00\x00\x00\x00\x00"; static const unsigned char msg2[] = /* 50 bytes */ "\x92\x01\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00" "\x24\xff\xff\xff\xff\x00\x3c\x00\x3c\x40\x00\x00\x00" "\x01\x00\x00\x00\xc0\xa8\xa5\x1e\x04\x01\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; static const unsigned char msg3[] = /* 8 bytes */ "\x93\x00\x00\x00\x00\x00\x00\x00"; pi_buffer_t *buffer; int err; buffer = pi_buffer_new (256); if (buffer == NULL) { errno = ENOMEM; return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); } if ((err = net_tx(ps, msg1, 22, 0)) >= 0 && (err = net_rx(ps, buffer, 256, 0)) >= 0 && (err = net_tx(ps, msg2, 50, 0)) >= 0 && (err = net_rx(ps, buffer, 256, 0)) >= 0 && (err = net_tx(ps, msg3, 8, 0)) >= 0) { pi_buffer_free (buffer); return 0; } pi_buffer_free (buffer); return err; } /*********************************************************************** * * Function: net_flush * * Summary: Flush input and output buffers * * Parameters: pi_socket_t*, flags * * Returns: A negative number on error, 0 otherwise * ***********************************************************************/ int net_flush(pi_socket_t *ps, int flags) { pi_protocol_t *prot, *next; prot = pi_protocol(ps->sd, PI_LEVEL_NET); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); next = pi_protocol_next(ps->sd, PI_LEVEL_NET); if (next == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); return next->flush(ps, flags); } /*********************************************************************** * * Function: net_tx * * Summary: Transmit NET Packets * * Parameters: pi_socket_t*, char* to buf, buf length, flags * * Returns: A negative number on error, 0 otherwise * ***********************************************************************/ ssize_t net_tx(pi_socket_t *ps, const unsigned char *msg, size_t len, int flags) { int bytes, offset, remain, tosend; pi_protocol_t *prot, *next; pi_net_data_t *data; unsigned char *buf; prot = pi_protocol(ps->sd, PI_LEVEL_NET); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (pi_net_data_t *)prot->data; next = pi_protocol_next(ps->sd, PI_LEVEL_NET); if (next == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); /* Create the header */ buf = (unsigned char *) malloc(PI_NET_HEADER_LEN + len); if (buf == NULL) return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); buf[PI_NET_OFFSET_TYPE] = data->type; if (data->type == PI_NET_TYPE_TCKL) buf[PI_NET_OFFSET_TXID] = 0xff; else buf[PI_NET_OFFSET_TXID] = data->txid; set_long(&buf[PI_NET_OFFSET_SIZE], len); memcpy(&buf[PI_NET_HEADER_LEN], msg, len); /* Write the header and body, possibly in one write, or in two, * or in more, depending on the current options. Crucial options * here are `split_writes' and `write_chunksize' in this protocol's * data (use net_setsockopt() to set them). */ if (data->split_writes) { /* Bugfix for USB send problems. If connected over * USB, do the following: * - send the 6 bytes of header first * - split the rest of data into chunks if the write_chunksize opt is set * This is what Palm Desktop does on Windows for the Zire 72 * (uses split writes and 4k chunks) * -- FP */ bytes = next->write(ps, buf, PI_NET_HEADER_LEN, flags); if (bytes < PI_NET_HEADER_LEN) { free(buf); return bytes; } offset = PI_NET_HEADER_LEN; remain = len; } else { offset = 0; remain = PI_NET_HEADER_LEN + len; } while (remain > 0) { if (data->write_chunksize) tosend = (remain > data->write_chunksize) ? data->write_chunksize : remain; else tosend = remain; bytes = next->write(ps, &buf[offset], tosend, flags); if (bytes < tosend) { free(buf); return bytes; } remain -= bytes; offset += bytes; } CHECK(PI_DBG_NET, PI_DBG_LVL_INFO, net_dump_header(buf, 1, ps->sd)); CHECK(PI_DBG_NET, PI_DBG_LVL_DEBUG, pi_dumpdata((char *)msg, len)); free(buf); return len; } /*********************************************************************** * * Function: net_rx * * Summary: Receive NET Packets * * Parameters: ps --> socket to read from * msg <-- malloc()ed buffer containing the data * len --> unused * flags --> unused * * Returns: A negative number on error, 0 on timeout, otherwise the * length of the received packet. * ***********************************************************************/ ssize_t net_rx(pi_socket_t *ps, pi_buffer_t *msg, size_t len, int flags) { int bytes, total_bytes, packet_len, timeout, honor_rx_timeout; size_t size; pi_protocol_t *prot, *next; pi_buffer_t *header; pi_net_data_t *data; prot = pi_protocol(ps->sd, PI_LEVEL_NET); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (pi_net_data_t *)prot->data; next = pi_protocol_next(ps->sd, PI_LEVEL_NET); if (next == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); size = sizeof(honor_rx_timeout); pi_getsockopt(ps->sd, PI_LEVEL_SOCK, PI_SOCK_HONOR_RX_TIMEOUT, &honor_rx_timeout, &size); timeout = honor_rx_timeout ? PI_NET_TIMEOUT : 0; size = sizeof(timeout); pi_setsockopt(ps->sd, PI_LEVEL_DEV, PI_DEV_TIMEOUT, &timeout, &size); header = pi_buffer_new (PI_NET_HEADER_LEN); if (header == NULL) { errno = ENOMEM; return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); } /* loop until we find a non-tickle packet (if the other end sends us a tickle, we would receive it prior to getting the expected reply to one of our commands, so we need to make sure tickle packets don't get in the way) */ total_bytes = 0; while (!total_bytes) { if (data->txid == 0) { /* Peek to see if it is a headerless packet */ bytes = next->read(ps, header, 1, flags); if (bytes <= 0) { pi_buffer_free (header); return bytes; } LOG ((PI_DBG_NET, PI_DBG_LVL_INFO, "NET RX (%i): Checking for headerless packet %d\n", ps->sd, header->data[0])); if (header->data[0] == 0x90) { /* Cause the header bytes to be skipped */ LOG ((PI_DBG_NET, PI_DBG_LVL_INFO, "NET RX (%i): Headerless packet\n", ps->sd)); total_bytes = PI_NET_HEADER_LEN; header->data[PI_NET_OFFSET_TYPE] = PI_NET_TYPE_DATA; header->data[PI_NET_OFFSET_TXID] = 0x01; set_long (&header->data[PI_NET_OFFSET_SIZE], 21); break; } else { total_bytes += bytes; } } /* bytes in what's left of the header */ while (total_bytes < PI_NET_HEADER_LEN) { bytes = next->read(ps, header, (size_t)(PI_NET_HEADER_LEN - total_bytes), flags); if (bytes <= 0) { pi_buffer_free (header); return bytes; } total_bytes += bytes; } packet_len = get_long(&header->data[PI_NET_OFFSET_SIZE]); data->type = header->data[PI_NET_OFFSET_TYPE]; switch (data->type) { case PI_NET_TYPE_TCKL: if (packet_len != 0) { LOG ((PI_DBG_NET, PI_DBG_LVL_ERR, "NET RX (%i): tickle packet with non-zero length\n", ps->sd)); pi_buffer_free(header); return pi_set_error(ps->sd, PI_ERR_PROT_BADPACKET); } /* valid tickle packet; continue reading. */ LOG((PI_DBG_NET, PI_DBG_LVL_DEBUG, "NET RX (%i): received tickle packet\n", ps->sd)); total_bytes = 0; header->used = 0; break; case PI_NET_TYPE_DATA: /* move on to reading the rest of the packet */ break; default: LOG ((PI_DBG_NET, PI_DBG_LVL_ERR, "NET RX (%i): Unknown packet type\n", ps->sd)); CHECK(PI_DBG_NET, PI_DBG_LVL_INFO, pi_dumpdata((char *)header->data, PI_NET_HEADER_LEN)); pi_buffer_free(header); return pi_set_error(ps->sd, PI_ERR_PROT_BADPACKET); } } total_bytes = 0; packet_len = get_long(&header->data[PI_NET_OFFSET_SIZE]); /* shield against absurd packet lengths */ if (packet_len < 0 || packet_len > 0x100000L) { /* we see an invalid packet */ next->flush(ps, PI_FLUSH_INPUT); LOG ((PI_DBG_NET, PI_DBG_LVL_ERR, "NET RX (%i): Invalid packet length (%ld)\n", ps->sd, packet_len)); pi_buffer_free(header); return pi_set_error(ps->sd, PI_ERR_PROT_BADPACKET); } /* read the actual packet data */ while (total_bytes < packet_len) { bytes = next->read(ps, msg, (size_t)(packet_len - total_bytes), flags); if (bytes < 0) { pi_buffer_free (header); return bytes; } total_bytes += bytes; } CHECK(PI_DBG_NET, PI_DBG_LVL_INFO, net_dump_header(header->data, 0, ps->sd)); CHECK(PI_DBG_NET, PI_DBG_LVL_DEBUG, net_dump(header->data, msg->data)); /* Update the transaction id */ if (ps->state == PI_SOCK_CONN_INIT || ps->command == 1) data->txid = header->data[PI_NET_OFFSET_TXID]; else { data->txid++; if (data->txid == 0xff) data->txid = 1; } pi_buffer_free (header); return packet_len; } /*********************************************************************** * * Function: net_getsockopt * * Summary: get options on socket * * Parameters: pi_socket*, level, option name, option value, option length * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int net_getsockopt(pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len) { pi_protocol_t *prot; pi_net_data_t *data; prot = pi_protocol(ps->sd, PI_LEVEL_NET); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (pi_net_data_t *)prot->data; switch (option_name) { case PI_NET_TYPE: if (*option_len != sizeof (data->type)) { errno = EINVAL; return pi_set_error(ps->sd, PI_ERR_GENERIC_ARGUMENT); } memcpy (option_value, &data->type, sizeof (data->type)); *option_len = sizeof (data->type); break; } return 0; } /*********************************************************************** * * Function: net_setsockopt * * Summary: set options on socket * * Parameters: pi_socket*, level, option name, option value, option length * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int net_setsockopt(pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len) { pi_protocol_t *prot; pi_net_data_t *data; prot = pi_protocol(ps->sd, PI_LEVEL_NET); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (pi_net_data_t *)prot->data; switch (option_name) { case PI_NET_TYPE: if (*option_len != sizeof (data->type)) { errno = EINVAL; return pi_set_error(ps->sd, PI_ERR_GENERIC_ARGUMENT); } memcpy (&data->type, option_value, sizeof (data->type)); break; /* this option, when set to != 0, instructs NET to separately * write the NET header and the data block. Data can be further * sent in chunks by also setting PI_NET_WRITE_CHUNKSIZE below. */ case PI_NET_SPLIT_WRITES: if (*option_len != sizeof (data->split_writes)) { errno = EINVAL; return pi_set_error(ps->sd, PI_ERR_GENERIC_ARGUMENT); } memcpy (&data->split_writes, option_value, sizeof(data->split_writes)); break; /* this option, when set to != 0, instructs NET to write the * packet data in chunks of the given maximum size. If * PI_NET_SPLIT_WRITES is not set, and this option is set, we * chunk the whole write (including the NET header) */ case PI_NET_WRITE_CHUNKSIZE: if (*option_len != sizeof (data->write_chunksize)) { errno = EINVAL; return pi_set_error(ps->sd, PI_ERR_GENERIC_ARGUMENT); } memcpy (&data->write_chunksize, option_value, sizeof(data->write_chunksize)); break; } return 0; } /*********************************************************************** * * Function: net_dump_header * * Summary: Dump the NET packet header * * Parameters: char* to net packet, TX boolean * * Returns: void * ***********************************************************************/ void net_dump_header(unsigned char *data, int rxtx, int sd) { LOG((PI_DBG_NET, PI_DBG_LVL_NONE, "NET %s sd=%i type=%d txid=0x%.2x len=0x%.4x\n", rxtx ? "TX" : "RX", sd, get_byte(&data[PI_NET_OFFSET_TYPE]), get_byte(&data[PI_NET_OFFSET_TXID]), get_long(&data[PI_NET_OFFSET_SIZE]))); } /*********************************************************************** * * Function: net_dump * * Summary: Dump the NET packet * * Parameters: char* to net packet * * Returns: void * ***********************************************************************/ void net_dump(unsigned char *header, unsigned char *data) { size_t size; size = get_long(&header[PI_NET_OFFSET_SIZE]); pi_dumpdata((char *)data, size); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/datebook.c0000644000175000017500000002632210552545407021027 0ustar rousseaurousseau/* * $Id: datebook.c,v 1.36 2006/11/22 22:52:25 adridg Exp $ * * datebook.c: Translate Pilot datebook data formats * * Copyright (c) 1996, Kenneth Albanowski * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #include "pi-macros.h" #include "pi-datebook.h" #define alarmFlag 64 #define repeatFlag 32 #define noteFlag 16 #define exceptFlag 8 #define descFlag 4 char *DatebookAlarmTypeNames[] = { "Minutes", "Hours", "Days", NULL }; char *DatebookRepeatTypeNames[] = { "None", "Daily", "Weekly", "MonthlyByDay", "MonthlyByDate", "Yearly", NULL }; /* dom1stSun = REM Sun 1 dom1stMon = Rem Mon 1 dom2ndSun = REM Sun 8 domLastSun = REM Sun 1 -7 */ /*********************************************************************** * * Function: free_Appointment * * Summary: Frees members of the appointment structure * * Parameters: Appointment_t* * * Returns: void * ***********************************************************************/ void free_Appointment(Appointment_t *a) { if (a->exception != NULL) { free(a->exception); a->exception = NULL; } if (a->description != NULL) { free(a->description); a->description = NULL; } if (a->note != NULL) { free(a->note); a->note = NULL; } } /*********************************************************************** * * Function: unpack_Appointment * * Summary: Fill in the appointment structure based on the raw * record data * * Parameters: Appointment_t*, pi_buffer_t * of buffer, datebook type * * Returns: -1 on fail, 0 on success * ***********************************************************************/ int unpack_Appointment(Appointment_t *a, const pi_buffer_t *buf, datebookType type) { int iflags, j, destlen; unsigned char *p2; unsigned long d; /* Note: There are possible timezone conversion problems related to the use of the begin, end, repeatEnd, and exception[] members of a struct Appointment. As they are kept in local (wall) time in struct tm's, the timezone of the Pilot is irrelevant, _assuming_ that any UNIX program keeping time in time_t's converts them to the correct local time. If the Pilot is in a different timezone than the UNIX box, it may not be simple to deduce that correct (desired) timezone. The easiest solution is to keep apointments in struct tm's, and out of time_t's. Of course, this might not actually be a help if you are constantly darting across timezones and trying to keep appointments. -- KJA */ destlen = 8; if (type != datebook_v1) return -1; if (buf == NULL || buf->data == NULL || buf->used < destlen) return -1; a->begin.tm_hour = get_byte(buf->data); a->begin.tm_min = get_byte(buf->data + 1); a->begin.tm_sec = 0; d = (unsigned short int) get_short(buf->data + 4); a->begin.tm_year = (d >> 9) + 4; a->begin.tm_mon = ((d >> 5) & 15) - 1; a->begin.tm_mday = d & 31; a->begin.tm_isdst = -1; a->end = a->begin; a->end.tm_hour = get_byte(buf->data + 2); a->end.tm_min = get_byte(buf->data + 3); if (get_short(buf->data) == 0xffff) { a->event = 1; a->begin.tm_hour = 0; a->begin.tm_min = 0; a->end.tm_hour = 0; a->end.tm_min = 0; } else { a->event = 0; } mktime(&a->begin); mktime(&a->end); iflags = get_byte(buf->data + 6); /* buf->data+7 is gapfill */ p2 = (unsigned char *) buf->data + 8; if (iflags & alarmFlag) { a->alarm = 1; a->advance = get_byte(p2); p2 += 1; a->advanceUnits = get_byte(p2); p2 += 1; } else { a->alarm = 0; a->advance = 0; a->advanceUnits = 0; } if (iflags & repeatFlag) { int i, on; a->repeatType = (enum repeatTypes) get_byte(p2); p2 += 2; d = (unsigned short int) get_short(p2); p2 += 2; if (d == 0xffff) a->repeatForever = 1; /* repeatEnd is invalid */ else { a->repeatEnd.tm_year = (d >> 9) + 4; a->repeatEnd.tm_mon = ((d >> 5) & 15) - 1; a->repeatEnd.tm_mday = d & 31; a->repeatEnd.tm_min = 0; a->repeatEnd.tm_hour = 0; a->repeatEnd.tm_sec = 0; a->repeatEnd.tm_isdst = -1; mktime(&a->repeatEnd); a->repeatForever = 0; } a->repeatFrequency = get_byte(p2); p2++; on = get_byte(p2); p2++; a->repeatDay = (enum DayOfMonthType) 0; for (i = 0; i < 7; i++) a->repeatDays[i] = 0; if (a->repeatType == repeatMonthlyByDay) a->repeatDay = (enum DayOfMonthType) on; else if (a->repeatType == repeatWeekly) for (i = 0; i < 7; i++) a->repeatDays[i] = !!(on & (1 << i)); a->repeatWeekstart = get_byte(p2); p2++; p2++; } else { int i; a->repeatType = (enum repeatTypes) 0; a->repeatForever = 1; /* repeatEnd is invalid */ a->repeatFrequency = 0; a->repeatDay = (enum DayOfMonthType) 0; for (i = 0; i < 7; i++) a->repeatDays[i] = 0; a->repeatWeekstart = 0; } if (iflags & exceptFlag) { a->exceptions = get_short(p2); p2 += 2; a->exception = malloc(sizeof(struct tm) * a->exceptions); for (j = 0; j < a->exceptions; j++, p2 += 2) { d = (unsigned short int) get_short(p2); a->exception[j].tm_year = (d >> 9) + 4; a->exception[j].tm_mon = ((d >> 5) & 15) - 1; a->exception[j].tm_mday = d & 31; a->exception[j].tm_hour = 0; a->exception[j].tm_min = 0; a->exception[j].tm_sec = 0; a->exception[j].tm_isdst = -1; mktime(&a->exception[j]); } } else { a->exceptions = 0; a->exception = 0; } if (iflags & descFlag) { a->description = strdup((char *)p2); p2 += strlen((char *)p2) + 1; } else a->description = 0; if (iflags & noteFlag) { a->note = strdup((char *)p2); p2 += strlen((char *)p2) + 1; } else { a->note = 0; } return 0; } /*********************************************************************** * * Function: pack_Appointment * * Summary: Fill in the raw appointment record data based on the * appointment structure. * * Parameters: Appointment_t*, pi_buffer_t*, datebook database version * from the datebookType enumeration -- only v1 is supported * for now. * * Returns: -1 on error (bad arguments, mostyle) or 0 on success. * The buffer is sized to accomodate the required data. * ***********************************************************************/ int pack_Appointment(const Appointment_t *a, pi_buffer_t *buf, datebookType type) { int iflags, destlen = 8; char *pos; if (a == NULL || buf == NULL) return -1; if (type != datebook_v1) return -1; if (a->alarm) destlen += 2; if (a->repeatType) destlen += 8; if (a->exceptions) destlen += 2 + 2 * a->exceptions; if (a->note) destlen += strlen(a->note) + 1; if (a->description) destlen += strlen(a->description) + 1; pi_buffer_expect (buf, destlen); buf->used = destlen; set_byte(buf->data, a->begin.tm_hour); set_byte(buf->data + 1, a->begin.tm_min); set_byte(buf->data + 2, a->end.tm_hour); set_byte(buf->data + 3, a->end.tm_min); set_short(buf->data + 4, ((a-> begin.tm_year - 4) << 9) | ((a->begin.tm_mon + 1) << 5) | a->begin. tm_mday); if (a->event) { set_long(buf->data, 0xffffffff); } iflags = 0; pos = (char *) buf->data + 8; if (a->alarm) { iflags |= alarmFlag; set_byte(pos, a->advance); set_byte(pos + 1, a->advanceUnits); pos += 2; } if (a->repeatType) { int i, on; iflags |= repeatFlag; if (a->repeatType == repeatMonthlyByDay) on = a->repeatDay; else if (a->repeatType == repeatWeekly) { on = 0; for (i = 0; i < 7; i++) if (a->repeatDays[i]) on |= 1 << i; } else on = 0; set_byte(pos, a->repeatType); set_byte(pos + 1, 0); pos += 2; if (a->repeatForever) set_short(pos, 0xffff); else set_short(pos, ((a-> repeatEnd.tm_year - 4) << 9) | ((a->repeatEnd.tm_mon + 1) << 5) | a->repeatEnd. tm_mday); pos += 2; set_byte(pos, a->repeatFrequency); pos++; set_byte(pos, on); pos++; set_byte(pos, a->repeatWeekstart); pos++; set_byte(pos, 0); pos++; } if (a->exceptions) { int i; iflags |= exceptFlag; set_short(pos, a->exceptions); pos += 2; for (i = 0; i < a->exceptions; i++, pos += 2) set_short(pos, ((a-> exception[i].tm_year - 4) << 9) | ((a->exception[i].tm_mon + 1) << 5) | a-> exception[i].tm_mday); } if (a->description != NULL) { iflags |= descFlag; strcpy(pos, a->description); pos += strlen(pos) + 1; } if (a->note != NULL) { iflags |= noteFlag; strcpy(pos, a->note); pos += strlen(pos) + 1; } set_byte(buf->data + 6, iflags); set_byte(buf->data + 7, 0); /* gapfill */ return 0; } /*********************************************************************** * * Function: unpack_AppointmentAppInfo * * Summary: Fill in the app info structure based on the raw app * info data * * Parameters: AppointmentAppInfo_t*, char* to record, record length * * Returns: The necessary length of the buffer if record is NULL, * or 0 on error, the length of the data used from the * buffer otherwise * ***********************************************************************/ int unpack_AppointmentAppInfo(AppointmentAppInfo_t *ai, const unsigned char *record, size_t len) { int i; i = unpack_CategoryAppInfo(&ai->category, record, len); if (!i) return 0; record += i; len -= i; if (len < 2) return 0; ai->startOfWeek = get_byte(record); return i + 2; } /*********************************************************************** * * Function: pack_AppointmentAppInfo * * Summary: Fill in the raw app info record data based on the app * info structure * * Parameters: AppointmentAppInfo*, char* to buffer, buffer length * * Returns: The length of the buffer required if record is NULL, * or 0 on error, the length of the data used from the * buffer otherwise * ***********************************************************************/ int pack_AppointmentAppInfo(const AppointmentAppInfo_t *ai, unsigned char *record, size_t len) { int i; unsigned char *start = record; i = pack_CategoryAppInfo(&ai->category, record, len); if (!record) return i + 2; if (!i) return i; record += i; len -= i; if (len < 2) return 0; set_short(record, 0); set_byte(record, ai->startOfWeek); record += 2; return (record - start); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/darwinusb.c0000644000175000017500000020447710552545407021246 0ustar rousseaurousseau/* * $Id: darwinusb.c,v 1.66 2006/11/09 10:26:21 fpillet Exp $ * * darwinusb.c: I/O support for Darwin (Mac OS X) USB * * Copyright (c) 2004-2006, Florent Pillet. * * libpisock interface modeled after linuxusb.c by Jeff Dionne and * Kenneth Albanowski * Some structures & defines extracted from Linux "visor.c", * which is Copyright (C) 1999 - 2003 Greg Kroah-Hartman (greg@kroah.com) * KLSI adapter (PalmConnect USB) support implemented thanks for the * Linux implementation made by Utz-Uwe Haus (haus@uuhaus.de) * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ /* Theory of operation * * Darwin IOKit is different from traditional unix i/o. It is much more * structured, and also more complex. * * One of the strengths of IOKit is IOUSBLib which allows talking to USB * devices directly from userland code, without the need to write a driver. * This is the way we do it here. * * Here is what we do: * - We start a separate thread which will handle the USB communications. The * main (controlling) thread exposes start, stop, poll, read and write * functions. These function take care of controlling the USB thread. * - We register for "device added" notifications. These notifications are * sent by the IOKit to registered clients when a new device shows up. We * use a matching dictionary to restrict the devices we're interested in to * USB devices (IOUSBDevice class) * - When we get notified that a new device showed up, we check the USB vendor * ID and product ID and only accept those that are known to be Palm OS * devices * - We then examine the device interfaces and select the pipes we're going to * use for input and output. * - We register for notifications coming from the device. When the device * goes away, our notification callback is called and we can cleanly close * things. * - Once everything is initialized, we fire a first "read" from the read * pipe. Subsequent reads are fired directly from the previous read's * completion routine [1]. * - In case the thread or application is aborted, the IOKit will clean things * up for us. * * [1] Reading is done asynchronously and in a chained way: we fire a read * with ReadPipeAsync(). Once the read completes (or fails), our * completion routine is called. As long as the read is not "aborted" * (which means the device has been disconnected), we fire another read * from the read_completion() function. * * All read data fills a buffer which is independantly consumed by the * main thread. This way, we get the maximum read throughput by making * sure that any data received from the device is fetched as soon as * possible and made available to the main thread. * * Writes, in the contrary, are synchronous for now. I can make them async * as well, though I have not explored the implications for the libpisock * code yet. This could speed things up a bit as well, though. */ #include #include #include #include #include #include #include #include #include "pi-debug.h" #include "pi-source.h" #include "pi-usb.h" #include "pi-util.h" /* Define this to make debug logs include USB debug info */ #ifdef PI_DEBUG #define DEBUG_USB 1 #endif #undef DEBUG_USB /* comment out to leave debug enabled */ /* Macro to log more information when debugging USB. Note that this is for * my own use, mostly, as the info logged is primarily being used to * debug complex thread/usb issues */ #ifdef DEBUG_USB #define ULOG(a) LOG(a) #else #define ULOG(a) do {} while(0) #endif /* These values are somewhat tricky. Priming reads with a size of exactly one * USB packet works best (no timeouts). Probably best to leave these as they are. */ #define MAX_AUTO_READ_SIZE 4096 #define AUTO_READ_SIZE 64 /* Options */ #if HAVE_PTHREAD static int accept_multiple_simultaneous_connections = 1; /* enabled by default when compiling with --enable-threads */ #else static int accept_multiple_simultaneous_connections = 0; /* disabled by default, set to 1 to enable */ #endif /* IOKit interface */ static IONotificationPortRef usb_notify_port; static io_iterator_t usb_device_added_iter; /* RunLoop / threading management */ static CFRunLoopRef usb_run_loop = 0; static pthread_mutex_t usb_run_loop_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t usb_thread_ready_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t usb_thread_ready_cond = PTHREAD_COND_INITIALIZER; static pthread_mutex_t usb_connections_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t usb_connection_added_cond = PTHREAD_COND_INITIALIZER; static pthread_t usb_thread = 0; /* Device interface linked list */ typedef struct usb_connection_t { struct usb_connection_t *next; /* linked list */ struct pi_socket *ps; /* the pilot-link socket we're associated with (if already paired) */ /* refcount management */ pthread_mutex_t ref_count_mutex; int ref_count; IOUSBInterfaceInterface190 **interface; /* IOUSBInterface190 is 1.9.0 available on OS X 10.2 and later */ IOUSBDeviceInterface **device; io_object_t device_notification; /* for device removal */ unsigned short vendorID; /* connected USB device vendor ID */ unsigned short productID; /* connected USB device product ID */ unsigned short dev_flags; /* copy of the flags from the acceptedDevices structure */ int opened; /* set to != 0 if the connection is opened */ int device_present; int read_pending; /* set to 1 when a prime_read() has been issued and the read_completion() has not been called yet */ int in_pipe_ref; /* pipe for reads */ int in_pipe_bulk_size; /* max packet size of bulk packets on input */ int out_pipe_ref; /* pipe for writes */ int out_pipe_bulk_size; /* size of bulk packets on the out pipe (used when talking with a PalmConnect USB serial adapter) */ /* these provide hints about the size of the next read */ int auto_read_size; /* if != 0, prime reads to the input pipe to get data permanently */ int read_ahead_size; /* when waiting for big chunks of data, used as a hint to make bigger read requests */ int last_read_ahead_size; /* also need this to properly compute the size of the next read */ unsigned long total_bytes_read; /* total number of bytes received since connection was opened */ unsigned long total_bytes_written; /* total number of bytes sent since connection was opened */ pthread_mutex_t read_queue_mutex; pthread_cond_t read_queue_data_avail_cond; char *read_queue; /* stores completed reads, grows by 64k chunks */ size_t read_queue_size; size_t read_queue_used; char read_buffer[MAX_AUTO_READ_SIZE]; } usb_connection_t; static usb_connection_t *usb_connections = NULL; /* linked list of active connections */ /* USB control requests we send to the devices * Got them from linux/drivers/usb/serial/visor.h */ #define GENERIC_REQUEST_BYTES_AVAILABLE 0x01 #define GENERIC_CLOSE_NOTIFICATION 0x02 #define VISOR_GET_CONNECTION_INFORMATION 0x03 #define PALM_GET_EXT_CONNECTION_INFORMATION 0x04 /* Structures defining the info a device returns * Got them from linux/drivers/usb/serial/visor.h */ typedef struct { UInt16 num_ports; struct { UInt8 port_function_id; UInt8 port; } connections[8]; } visor_connection_info; /* struct visor_connection_info.connection[x].port defines: */ #define VISOR_ENDPOINT_1 0x01 #define VISOR_ENDPOINT_2 0x02 /* struct visor_connection_info.connection[x].port_function_id defines: */ #define VISOR_FUNCTION_GENERIC 0x00 #define VISOR_FUNCTION_DEBUGGER 0x01 #define VISOR_FUNCTION_HOTSYNC 0x02 #define VISOR_FUNCTION_CONSOLE 0x03 #define VISOR_FUNCTION_REMOTE_FILE_SYS 0x04 typedef struct { UInt8 num_ports; UInt8 endpoint_numbers_different; UInt16 reserved1; struct { UInt32 port_function_id; UInt8 port; UInt8 endpoint_info; UInt16 reserved; } connections[8]; } palm_ext_connection_info; /* PalmConnect USB specific information * Extracted from Linux kl5kusb105 Copyright (C) 2001 Utz-Uwe Haus * Using documentation Utz-Uwe provided */ enum { /* Values for KLSI_GET/SET_COMM_DESCRIPTOR */ KLSI_BAUD_115200 = 0, KLSI_BAUD_57600 = 1, KLSI_BAUD_38400 = 2, KLSI_BAUD_28800 = 3, KLSI_BAUD_19200 = 4, KLSI_BAUD_14400 = 5, KLSI_BAUD_9600 = 6, KLSI_BAUD_7200 = 7, KLSI_BAUD_4800 = 8, KLSI_BAUD_2400 = 9, KLSI_BAUD_1200 = 10, KLSI_BAUD_600 = 11, KLSI_BAUD_230400 = 12, KLSI_PARITY_NONE = 0, KLSI_PARITY_ODD = 1, KLSI_PARITY_EVEN = 2, KLSI_PARITY_MARK = 3, KLSI_STOPBITS_0 = 0, KLSI_STOPBITS_2 = 2, /* Handshake values for KLSI_GET_HANDSHAKE_LINES */ KLSI_GETHS_DCD = 0x80, /* Data Carrier Detect */ KLSI_GETHS_RI = 0x40, /* Ring Indicator */ KLSI_GETHS_DSR = 0x20, /* Data Set Ready */ KLSI_GETHS_CTS = 0x10, /* Clear To Send */ /* Handshake values for KLST_SET_HANDSHAKE_LINES */ KLSI_SETHS_RTS = 0x02, /* Ready To Send */ KLSI_SETHS_DTR = 0x01, /* Data Terminal Ready */ /* Flow control values */ KLSI_FLOW_USE_RTS = 0x01, /* use RTS/CTS */ KLSI_FLOW_USE_DSR = 0x02, /* use DSR/CD */ KLSI_FLOW_USE_XON = 0x04 /* use XON/XOFF */ }; #define KLSI_GET_COMM_DESCRIPTOR 0 #define KLSI_SET_COMM_DESCRIPTOR 1 #define KLSI_GET_HANDSHAKE_LINES 2 #define KLSI_SET_HANDSHAKE_LINES 3 #define KLSI_GET_FLOWCONTROL 4 #define KLSI_SET_FLOWCONTROL 5 typedef struct { unsigned char DCBLength __attribute__((packed)); unsigned char BaudRateIndex __attribute__((packed)); unsigned char DataBits __attribute__((packed)); unsigned char Parity __attribute__((packed)); unsigned char StopBits __attribute__((packed)); } klsi_port_settings; /* Some vendor and product codes we use */ #define VENDOR_SONY 0x054c #define VENDOR_KEYSPAN 0x06cd #define VENDOR_HANDSPRING 0x082d #define VENDOR_PALMONE 0x0830 #define VENDOR_TAPWAVE 0x12ef #define PRODUCT_PALMCONNECT_USB 0x0080 #define PRODUCT_HANDSPRING_VISOR 0x0100 #define PRODUCT_SONY_CLIE_3_5 0x0038 /* This table helps us determine whether a connecting USB device is * one we'd like to talk to. Don't forget to update it as new * devices come out. To accept ALL the devices from a vendor, add * an entry with the vendorID and 0xFFFF as productID. */ #define FLAG_ANSWERS_CONN_INFO 0x0001 /* device is known to answer connection information requests */ #define FLAG_USE_FIRST_PAIR 0x0002 /* thanks to dumb programmers at Palm, the connection information doesn't match the actual pipes being used. If this flag is set, always try to use the first endoints pair */ #define FLAG_USE_SECOND_PAIR 0x0004 /* ditto */ #define FLAG_ANSWERS_PALM_CONN_INFO 0x0008 /* means that if the device doesn't answer PALM_EXT_CONNECTION_INFORMATION, don't try the visor variant (for stupid PalmOne handhelds) */ #define FLAG_REJECT 0x8000 /* device is known but not supported yet */ static struct { unsigned short vendorID; unsigned short productID; unsigned short flags; } acceptedDevices[] = { /* Sony */ {0x054c, 0x0038}, /* Sony Palm OS 3.5 devices, S300 */ {0x054c, 0x0066}, /* Sony T, S320, SJ series, and other Palm OS 4.0 devices */ {0x054c, 0x0095}, /* Sony S360 */ {0x054c, 0x000a}, /* Sony NR and other Palm OS 4.1 devices */ {0x054c, 0x009a}, /* Sony NR70V/U */ {0x054c, 0x00da}, /* Sony NX */ {0x054c, 0x00e9}, /* Sony NZ */ {0x054c, 0x0144}, /* Sony UX */ {0x054c, 0x0169}, /* Sony TJ */ /* Keyspan serial-to-USB PDA adapter */ {0x06cd, 0x0103, FLAG_REJECT}, /* ID sent by an adapter which firmware has not been uploaded yet */ {0x06cd, 0x0104, FLAG_REJECT}, /* ID sent by an adapter with proper firmware uploaded */ /* AlphaSmart */ {0x081e, 0xdf00}, /* Dana */ /* HANDSPRING (vendor 0x082d) */ {0x082d, 0x0100}, /* Visor */ {0x082d, 0x0200}, /* Treo */ {0x082d, 0x0300, FLAG_ANSWERS_CONN_INFO}, /* Treo 600 */ /* PalmOne, Palm Inc */ {0x0830, 0x0001, FLAG_ANSWERS_CONN_INFO}, /* m500 */ {0x0830, 0x0002, FLAG_ANSWERS_CONN_INFO}, /* m505 */ {0x0830, 0x0003, FLAG_ANSWERS_CONN_INFO}, /* m515 */ {0x0830, 0x0010}, {0x0830, 0x0011}, {0x0830, 0x0020}, /* i705 */ {0x0830, 0x0030}, {0x0830, 0x0031}, /* Tungsten|W */ {0x0830, 0x0040}, /* m125 */ {0x0830, 0x0050}, /* m130 */ {0x0830, 0x0051}, {0x0830, 0x0052}, {0x0830, 0x0053}, {0x0830, 0x0060, FLAG_ANSWERS_CONN_INFO}, /* Tungsten series, Zire 71 */ {0x0830, 0x0061, FLAG_ANSWERS_PALM_CONN_INFO | FLAG_USE_FIRST_PAIR}, /* Zire 22, 31, 72, T|5, T|X, LifeDrive, Treo 650 -- for T|X and LD, they don't answer to the PALM_EXT_CONNECTION_INFORMATION control code. In this case we revert to using the first pair of pipes */ {0x0830, 0x0062}, {0x0830, 0x0063}, {0x0830, 0x0070, FLAG_ANSWERS_CONN_INFO}, /* Zire */ {0x0830, 0x0071}, {0x0830, 0x0080}, /* palmOne serial adapter */ {0x0830, 0x0099}, {0x0830, 0x0100}, /* GARMIN */ {0x091e, 0x0004}, /* IQUE 3600 */ /* Kyocera */ {0x0c88, 0x0021}, /* 7135 Smartphone */ {0x0c88, 0xa226}, /* 6035 Smartphone */ /* Tapwave */ {0x12ef, 0x0100, FLAG_ANSWERS_CONN_INFO}, /* Zodiac, Zodiac2 */ /* ACEECA */ {0x4766, 0x0001}, /* MEZ1000 */ /* Fossil */ {0x0e67, 0x0002}, /* Abacus wrist PDA */ /* Samsung */ {0x04e8, 0x8001} /* I330 */ }; /* local prototypes */ static int change_refcount(usb_connection_t *c, int increment); static void stop_listening(usb_connection_t *c); static IOReturn control_request (IOUSBDeviceInterface **dev, UInt8 requestType, UInt8 request, UInt16 value, UInt16 index, void *pData, UInt16 maxReplyLength); static void device_added (void *refCon, io_iterator_t iterator); static void device_notification (usb_connection_t *connexion, io_service_t service, natural_t messageType, void *messageArgument); static void read_completion (usb_connection_t *connexion, IOReturn result, void *arg0); static int accepts_device (unsigned short vendor, unsigned short product, unsigned short *flags); static IOReturn configure_device (IOUSBDeviceInterface **dev, unsigned short vendor, unsigned short product, unsigned short flags, int *port_number, int *input_pipe_number, int *output_pipe_number, int *pipe_info_retrieved); static IOReturn find_interfaces (usb_connection_t *usb, IOUSBDeviceInterface **dev, unsigned short vendor, unsigned short product, unsigned short accept_flags, int port_number, int input_pipe_number, int output_pipe_number, int pipe_info_retrieved); static int prime_read (usb_connection_t *connexion); static IOReturn read_visor_connection_information (IOUSBDeviceInterface **dev, int *port_number, int *input_pipe, int *output_pipe); static IOReturn decode_generic_connection_information(palm_ext_connection_info *ci, int *port_number, int *input_pipe, int *output_pipe); static IOReturn read_generic_connection_information (IOUSBDeviceInterface **dev, int *port_number, int *input_pipe_number, int *output_pipe_number); static IOReturn klsi_set_portspeed(IOUSBDeviceInterface **dev, int speed); /***************************************************************************/ /* */ /* GLOBAL DARWINUSB OPTIONS FOR CLIENT CODE */ /* */ /***************************************************************************/ void darwinusb_setoptions(int multiple_connections_support) { accept_multiple_simultaneous_connections = multiple_connections_support; } /***************************************************************************/ /* */ /* CONNECTIONS LINKED LIST MANAGEMENT */ /* */ /***************************************************************************/ static void add_connection(usb_connection_t *c) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: adding connection %p to linked list\n", c)); pthread_mutex_lock(&usb_connections_mutex); c->next = usb_connections; usb_connections = c; //pthread_cond_signal(&usb_connection_added_cond); pthread_mutex_unlock(&usb_connections_mutex); } static int remove_connection(usb_connection_t *c) { /* remove the connection from the linked list if it exists * and return != 0. Otherwise return 0. Don't free the * connection structure or variables. */ usb_connection_t *previous = NULL, *elem; pthread_mutex_lock(&usb_connections_mutex); elem = usb_connections; while (elem && elem != c) { previous = elem; elem = elem->next; } if (elem) { if (previous) previous->next = elem->next; else usb_connections = elem->next; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: removed connection %p from linked list\n", c)); } pthread_mutex_unlock(&usb_connections_mutex); return elem != NULL; } static int device_already_in_use(IOUSBDeviceInterface **device) { usb_connection_t *elem; pthread_mutex_lock(&usb_connections_mutex); elem = usb_connections; while (elem != NULL && elem->device != device) elem = elem->next; pthread_mutex_unlock(&usb_connections_mutex); return elem != NULL; } static usb_connection_t* connection_for_socket(pi_socket_t *ps) { /* if there is no active connection associated with this socket, * try to associate the first unassociated connection */ usb_connection_t *c = ((pi_usb_data_t *)ps->device->data)->ref; if (change_refcount(c, +1) > 0) return c; pthread_mutex_lock(&usb_connections_mutex); c = usb_connections; while (c && (c->ps != NULL || c->opened == 0 || c->total_bytes_read == 0)) /* skip connections which are being disposed of (opened=0) */ c = c->next; if (change_refcount(c, +1) <= 0) c = NULL; else { c->ps = ps; ((pi_usb_data_t *)ps->device->data)->ref = c; } pthread_mutex_unlock(&usb_connections_mutex); return c; } static int change_refcount(usb_connection_t *c, int increment) { /* update the refcount on the connection structure. If the refcount becomes * zero, call the stop_listening() function */ int rc; if (c == NULL) return 0; if (pthread_mutex_lock(&c->ref_count_mutex) != 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: connection %p, can't lock ref_count_mutex (ref_count=%d)\n",c,c->ref_count_mutex)); return 0; } rc = c->ref_count = c->ref_count + increment; if (rc < 0) LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: connection %p's refcount became < 0 (%d)\n", c, c->ref_count)); if (rc == 0) { if (remove_connection(c)) stop_listening(c); } else pthread_mutex_unlock(&c->ref_count_mutex); return rc; } /***************************************************************************/ /* */ /* INTERNAL ROUTINES */ /* */ /***************************************************************************/ static int start_listening(void) { mach_port_t masterPort; CFMutableDictionaryRef matchingDict; CFRunLoopSourceRef runLoopSource; kern_return_t kr; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: start_listening for connections\n")); /* first create a master_port for my task */ kr = IOMasterPort (MACH_PORT_NULL, &masterPort); if (kr || !masterPort) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: couldn't create a master IOKit Port(%08x)\n", kr)); return PI_ERR_GENERIC_SYSTEM; } /* Set up the matching criteria for the devices we're interested in * Interested in instances of class IOUSBDevice and its subclasses * Since we are supporting many USB devices, we just get notifications * for all USB devices and sort out the ones that we want later. */ matchingDict = IOServiceMatching (kIOUSBDeviceClassName); if (!matchingDict) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: can't create a USB matching dictionary\n")); mach_port_deallocate (mach_task_self(), masterPort); return PI_ERR_GENERIC_SYSTEM; } /* Create a notification port and add its run loop event source to our run loop * This is how async notifications get set up. */ usb_notify_port = IONotificationPortCreate (masterPort); runLoopSource = IONotificationPortGetRunLoopSource (usb_notify_port); CFRunLoopAddSource(CFRunLoopGetCurrent(), runLoopSource, kCFRunLoopDefaultMode); /* Set up a notifications to be called when a raw device is first matched by I/O Kit */ kr = IOServiceAddMatchingNotification ( usb_notify_port, kIOFirstMatchNotification, matchingDict, device_added, NULL, &usb_device_added_iter); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: added service matching notification (kr=0x%08lx)\n", kr)); /* Iterate once to get already-present devices and arm the notification */ device_added (NULL, usb_device_added_iter); /* Now done with the master_port */ mach_port_deallocate (mach_task_self(), masterPort); return 0; } static void stop_listening(usb_connection_t *c) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: stop_listening for connection %p\n",c)); c->opened = 0; c->in_pipe_ref = 0; c->out_pipe_ref = 0; if (c->ps) { /* we do this because if the connection abruptly ends before pilot-link notices, * we want to avoid pi_close() trying to do a dlp_EndOfSync() */ c->ps->state = PI_SOCK_CLOSE; if (c->ps->device != NULL && c->ps->device->data != NULL) ((pi_usb_data_t *)c->ps->device->data)->ref = NULL; } c->ps = NULL; if (c->device_notification) { IOObjectRelease (c->device_notification); c->device_notification = 0; } if (c->interface) { (*c->interface)->USBInterfaceClose (c->interface); (*c->interface)->Release(c->interface); c->interface = NULL; } if (c->device) { (*c->device)->USBDeviceClose (c->device); (*c->device)->Release(c->device); c->device = NULL; } pthread_mutex_destroy(&c->read_queue_mutex); pthread_mutex_destroy(&c->ref_count_mutex); free(c); } static void * usb_thread_run(void *foo) { if (start_listening() == 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: usb_thread_run, starting...\n")); /* obtain the CFRunLoop for this thread */ pthread_mutex_lock(&usb_run_loop_mutex); usb_run_loop = CFRunLoopGetCurrent(); pthread_mutex_unlock(&usb_run_loop_mutex); /* signal main thread that init was successful */ pthread_mutex_lock(&usb_thread_ready_mutex); pthread_cond_broadcast(&usb_thread_ready_cond); pthread_mutex_unlock(&usb_thread_ready_mutex); CFRunLoopRun(); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: usb_thread_run, done with runloop\n")); pthread_mutex_lock(&usb_run_loop_mutex); usb_run_loop = 0; pthread_mutex_unlock(&usb_run_loop_mutex); if (usb_device_added_iter) { IOObjectRelease (usb_device_added_iter); usb_device_added_iter = 0; } if (usb_notify_port) { IONotificationPortDestroy(usb_notify_port); usb_notify_port = NULL; } /* decrement the refcount of each structure. If there * was a pending read, decrement once more since * prime_read() increments the refcount */ usb_connection_t *elem, *next, *prev = NULL; pthread_mutex_lock(&usb_connections_mutex); elem = usb_connections; while (elem != NULL) { next = elem->next; pthread_mutex_lock(&elem->ref_count_mutex); elem->ref_count--; if (elem->read_pending) elem->ref_count--; if (elem < 0) LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: while stopping usb_thread, connection %p's refcount became < 0 (%d)", elem, elem->ref_count)); if (elem == 0) { if (prev != NULL) prev->next = next; else usb_connections = next; stop_listening(elem); elem = NULL; } else { pthread_mutex_unlock(&elem->ref_count_mutex); prev = elem; } } pthread_mutex_unlock(&usb_connections_mutex); usb_thread = 0; usb_run_loop = NULL; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: usb_thread_run, exited.\n")); } else { /* signal main thread that init failed */ usb_thread = 0; usb_run_loop = NULL; pthread_mutex_lock(&usb_thread_ready_mutex); pthread_cond_signal(&usb_thread_ready_cond); pthread_mutex_unlock(&usb_thread_ready_mutex); } return NULL; } static void device_added (void *refCon, io_iterator_t iterator) { kern_return_t kr; io_service_t ioDevice; IOCFPlugInInterface **plugInInterface = NULL; IOUSBDeviceInterface **dev = NULL; HRESULT res; SInt32 score; UInt16 vendor, product; unsigned short accept_flags; int port_number = 0xff, input_pipe_number = 0xff, output_pipe_number = 0xff, pipe_info_retrieved = 0; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: device_added\n")); while ((ioDevice = IOIteratorNext (iterator))) { if (usb_connections != NULL && !accept_multiple_simultaneous_connections) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: new device plugged but we already have a running connection\n")); IOObjectRelease (ioDevice); continue; } kr = IOCreatePlugInInterfaceForService (ioDevice, kIOUSBDeviceUserClientTypeID, kIOCFPlugInInterfaceID, &plugInInterface, &score); if (kr != kIOReturnSuccess || !plugInInterface) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: -> unable to create a plugin (kr=0x%08x)\n", kr)); IOObjectRelease (ioDevice); continue; } res = (*plugInInterface)->QueryInterface (plugInInterface, CFUUIDGetUUIDBytes (kIOUSBDeviceInterfaceID), (LPVOID *)&dev); (*plugInInterface)->Release (plugInInterface); if (res || !dev) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: couldn't create a device interface (res=0x%08x)\n", (int) res)); IOObjectRelease (ioDevice); continue; } /* make sure this device is not already being handled (this may happen * with some handhelds that reconnect immediately after disconnecting, like the T5) */ if (device_already_in_use(dev)) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: device %p already in use, skipping it\n")); IOObjectRelease (ioDevice); continue; } kr = (*dev)->GetDeviceVendor (dev, &vendor); kr = (*dev)->GetDeviceProduct (dev, &product); if (accepts_device(vendor, product, &accept_flags) == 0) { ULOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: not accepting device (vendor=0x%04x product=0x%04x)\n", vendor, product)); (*dev)->Release(dev); IOObjectRelease (ioDevice); continue; } LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: Accepted USB device, vendor: 0x%04x product: 0x%04x\n", vendor, product)); kr = (*dev)->USBDeviceOpen (dev); if (kr != kIOReturnSuccess) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: unable to open device (kr=0x%08x)\n", kr)); (*dev)->Release(dev); IOObjectRelease (ioDevice); continue; } /* configure the device and query for its preferred I/O pipes */ kr = configure_device (dev, vendor, product, accept_flags, &port_number, &input_pipe_number, &output_pipe_number, &pipe_info_retrieved); if (kr != kIOReturnSuccess) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, (kr == kIOReturnNotReady) ? "darwinusb: device not ready to synchonize\n" : "darwinusb: unable to configure device (kr=0x%08x)\n", kr)); (*dev)->USBDeviceClose (dev); (*dev)->Release (dev); IOObjectRelease (ioDevice); continue; } /* allocate and initialize the USB connection structure */ usb_connection_t *c = malloc(sizeof(usb_connection_t)); if (c == NULL) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "out of memory")); (*dev)->USBDeviceClose (dev); (*dev)->Release (dev); IOObjectRelease (ioDevice); break; } memset(c, 0, sizeof(usb_connection_t)); c->auto_read_size = AUTO_READ_SIZE; c->device = dev; c->ref_count = 1; c->opened = 1; c->device_present = 1; c->vendorID = vendor; c->productID = product; c->dev_flags = accept_flags; /* try to locate the pipes we need to talk to the device */ kr = find_interfaces(c, dev, vendor, product, accept_flags, port_number, input_pipe_number, output_pipe_number, pipe_info_retrieved); if (kr != kIOReturnSuccess) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: unable to find interfaces (kr=0x%08x)\n", kr)); free(c); (*dev)->USBDeviceClose (dev); (*dev)->Release (dev); IOObjectRelease (ioDevice); continue; } /* Just like with service matching notifications, we need to create an event source and add it * to our run loop in order to receive async completion notifications. */ CFRunLoopSourceRef runLoopSource; kr = (*c->interface)->CreateInterfaceAsyncEventSource (c->interface, &runLoopSource); if (kr != kIOReturnSuccess) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: Unable to create async event source (%08x)\n", kr)); free(c); (*dev)->USBDeviceClose (dev); (*dev)->Release (dev); IOObjectRelease (ioDevice); continue; } CFRunLoopAddSource (CFRunLoopGetCurrent(), runLoopSource, kCFRunLoopDefaultMode); LOG((PI_DBG_DEV, PI_DBG_LVL_INFO, "darwinusb: USBConnection %p OPENED c->in_pipe_ref=%d c->out_pipe_ref=%d\n",c,c->in_pipe_ref,c->out_pipe_ref)); /* Register for an interest notification for this device, * so we get notified when it goes away */ LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: registering for disconnect notification\n")); kr = IOServiceAddInterestNotification( usb_notify_port, ioDevice, kIOGeneralInterest, (IOServiceInterestCallback)device_notification, (void *)c, &c->device_notification); IOObjectRelease(ioDevice); /* add the device to our linked list, then only start reading data * (order of operations matters here to avoid race conditions) */ pthread_mutex_init(&c->read_queue_mutex, NULL); pthread_mutex_init(&c->ref_count_mutex, NULL); pthread_cond_init(&c->read_queue_data_avail_cond, NULL); add_connection(c); prime_read(c); } } static IOReturn configure_device(IOUSBDeviceInterface **di, unsigned short vendor, unsigned short product, unsigned short flags, int *port_number, int *input_pipe_number, int *output_pipe_number, int *pipe_info_retrieved) { UInt8 numConf, conf, deviceClass; IOReturn kr; IOUSBConfigurationDescriptorPtr confDesc; /* Get the device class. Most handhelds are registered as composite devices * and therefore already opened & configured by OS X drivers! It seems that * reconfiguring them as we did before is what caused some Sony devices to * refuse talking to us. */ kr = (*di)->GetDeviceClass (di, &deviceClass); if (kr != kIOReturnSuccess) return kr; if (deviceClass != kUSBCompositeClass) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: Not a composite device: performing confiuration\n")); kr = (*di)->GetNumberOfConfigurations (di, &numConf); if (!numConf) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: device has zero configurations!\n")); return -1; } /* try all possible configurations if the first one fails * (shouldn't happen in most cases though) */ for (conf=0; conf < numConf; conf++) { kr = (*di)->GetConfigurationDescriptorPtr(di, 0, &confDesc); if (kr) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: unable to get config descriptor for index %d (err=%08x numConf=%d)\n", 0, kr, (int)numConf)); continue; } kr = (*di)->SetConfiguration(di, confDesc->bConfigurationValue); if (kr == kIOReturnSuccess) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: successfully set configuration %d\n",(int)confDesc->bConfigurationValue)); break; } LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: unable to set configuration to value %d (err=%08x numConf=%d)\n", (int)confDesc->bConfigurationValue, kr, (int)numConf)); } if (conf == numConf) return kr; } if (vendor == VENDOR_PALMONE && product == PRODUCT_PALMCONNECT_USB) { kr = klsi_set_portspeed(di, 9600); *input_pipe_number = 0x01; *output_pipe_number = 0x02; *pipe_info_retrieved = 1; return kr; } /* Try reading pipe information. Most handhelds support a control request that returns info about the ports and * pipes. We first try the generic control code, and if it doesn't work we try the Visor one which seems to be * supported by some devices Also, we can detect that a T5 / LifeDrive is in "wait" mode * (device appears on USB but not synchronizing) and in this case we return a kIOReturnNotReady code. */ kr = read_generic_connection_information (di, port_number, input_pipe_number, output_pipe_number); if (kr != kIOReturnSuccess && kr != kIOReturnNotReady && !(flags & FLAG_ANSWERS_PALM_CONN_INFO)) kr = read_visor_connection_information (di, port_number, input_pipe_number, output_pipe_number); if (kr == kIOReturnNotReady) return kr; /* With some devices (Palm) we need to hardcode the location of the pipes to use * because the Palm engineers had the good idea to mismatch the connection information data * and the actual pipes to use */ if (flags & (FLAG_USE_FIRST_PAIR | FLAG_USE_SECOND_PAIR)) { *pipe_info_retrieved = 1; return kIOReturnSuccess; } /* For device which we know return connection information, we want it to be returned to * consider the device alive */ if (kr != kIOReturnSuccess && (flags & FLAG_ANSWERS_CONN_INFO)) return kIOReturnNotReady; *pipe_info_retrieved = (kr == kIOReturnSuccess); /* query bytes available. Not that we really care, but most devices expect to receive this * before they agree on talking to us. */ if (vendor != VENDOR_TAPWAVE) { unsigned char ba[2]; kr = control_request (di, 0xc2, GENERIC_REQUEST_BYTES_AVAILABLE, 0, 0, &ba[0] , 2); if (kr != kIOReturnSuccess) LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: GENERIC_REQUEST_BYTES_AVAILABLE failed (err=%08x)\n", kr)); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "GENERIC_REQUEST_BYTES_AVAILABLE returns 0x%02x%02x\n", ba[0], ba[1])); } return kIOReturnSuccess; } static IOReturn find_interfaces(usb_connection_t *c, IOUSBDeviceInterface **di, unsigned short vendor, unsigned short product, unsigned short accept_flags, int port_number, int input_pipe_number, int output_pipe_number, int pipe_info_retrieved) { IOReturn kr; io_iterator_t iterator; io_service_t usbInterface; HRESULT res; SInt32 score; UInt8 intfClass, intfSubClass, intfNumEndpoints; int pipeRef, pass; IOUSBFindInterfaceRequest request; IOCFPlugInInterface **plugInInterface = NULL; UInt8 direction, number, transferType, interval; UInt16 maxPacketSize; request.bInterfaceClass = kIOUSBFindInterfaceDontCare; request.bInterfaceSubClass = kIOUSBFindInterfaceDontCare; request.bInterfaceProtocol = kIOUSBFindInterfaceDontCare; request.bAlternateSetting = kIOUSBFindInterfaceDontCare; kr = (*di)->CreateInterfaceIterator (di, &request, &iterator); while ((usbInterface = IOIteratorNext (iterator))) { kr = IOCreatePlugInInterfaceForService (usbInterface, kIOUSBInterfaceUserClientTypeID, kIOCFPlugInInterfaceID, &plugInInterface, &score); kr = IOObjectRelease (usbInterface); // done with the usbInterface object now that I have the plugin if (kr != kIOReturnSuccess || !plugInInterface) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: unable to create a plugin (%08x)\n", kr)); continue; } /* we have the interface plugin: we now need the interface interface */ res = (*plugInInterface)->QueryInterface (plugInInterface, CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID), (LPVOID *) &c->interface); (*plugInInterface)->Release (plugInInterface); /* done with this */ if (res || c->interface == NULL) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: couldn't create an IOUSBInterfaceInterface (%08x)\n", (int) res)); continue; } /* get the interface class and subclass */ kr = (*c->interface)->GetInterfaceClass (c->interface, &intfClass); kr = (*c->interface)->GetInterfaceSubClass (c->interface, &intfSubClass); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: interface class %d, subclass %d\n", intfClass, intfSubClass)); /* Now open the interface. This will cause the pipes to be instantiated that are * associated with the endpoints defined in the interface descriptor. */ kr = (*c->interface)->USBInterfaceOpen (c->interface); if (kr != kIOReturnSuccess) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: unable to open interface (%08x)\n", kr)); (*c->interface)->Release (c->interface); c->interface = NULL; continue; } kr = (*c->interface)->GetNumEndpoints (c->interface, &intfNumEndpoints); if (kr != kIOReturnSuccess) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: unable to get number of endpoints (%08x)\n", kr)); (*c->interface)->USBInterfaceClose (c->interface); (*c->interface)->Release (c->interface); c->interface = NULL; continue; } LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: interface has %d endpoints\n", intfNumEndpoints)); /* If device didn't answer to the connection_information request, * try to read a preamble sent by the device. This is sent by devices which chipsets * don't support the vendor control endpoint requests. Look for the first pipe on * which a preamble is available. */ if (!pipe_info_retrieved) { int reqTimeout; int preambleFound = 0; for (reqTimeout = 100; reqTimeout <= 300 && !preambleFound; reqTimeout += 100) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: checking for pipe_info sent by device with timeout %dms\n",reqTimeout)); for (pipeRef = 1; pipeRef <= intfNumEndpoints; pipeRef++) { kr = (*c->interface)->GetPipeProperties (c->interface, pipeRef, &direction, &number, &transferType, &maxPacketSize, &interval); if (kr != kIOReturnSuccess) continue; if (direction == kUSBIn) { UInt32 size = sizeof(c->read_buffer)-1; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: trying pipe %d type=%d\n", pipeRef, (int)transferType)); if (transferType == kUSBBulk) kr = (*c->interface)->ReadPipeTO (c->interface, pipeRef, &c->read_buffer, &size, reqTimeout, 250); else kr = (*c->interface)->ReadPipe (c->interface, pipeRef, &c->read_buffer, &size); if (kr == kIOReturnSuccess && size >= 8) { /* got something! */ LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: got %d bytes there!\n", (int)size)); CHECK(PI_DBG_DEV, PI_DBG_LVL_DEBUG, pi_dumpdata(c->read_buffer, size)); if (!memcmp(c->read_buffer, "VNDR10", 6)) { /* VNDR version 1.0 */ palm_ext_connection_info ci; memcpy(&ci, &c->read_buffer[6], sizeof(ci)); decode_generic_connection_information(&ci, &port_number, &input_pipe_number, &output_pipe_number); preambleFound = 1; break; } } } } } } /* Locate the pipes we're going to use for reading and writing. * We have four chances to find the right pipes: * 1. If we got a hint from the device with input/output pipes, we try this one first. * 2. If we didn't get both pipes, try using the port number hint. There is at least one recent * device (LifeDrive) on which the port_number hint is actually an endpoint pair index. * The code below tries to cope with that. * 3. If we're still missing one or two pipes, give a second try looking for pipes with a * 64 bytes transfer size * 4. Finally of this failed, forget about the transfer size and take the first ones that * come (i.e. Tungsten W has a 64 bytes IN pipe and a 32 bytes OUT pipe). */ for (pass=1; pass <= 4 && (c->in_pipe_ref==0 || c->out_pipe_ref==0); pass++) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: pass %d looking for pipes, port_number=0x%02x, input_pipe_number=0x%02x, output_pipe_number=0x%02x\n", pass, port_number, input_pipe_number, output_pipe_number)); c->in_pipe_ref = 0; c->out_pipe_ref = 0; int input_pipes_seen = 0; int output_pipes_seen = 0; for (pipeRef = 1; pipeRef <= intfNumEndpoints; pipeRef++) { kr = (*c->interface)->GetPipeProperties (c->interface, pipeRef, &direction, &number, &transferType, &maxPacketSize, &interval); if (kr != kIOReturnSuccess) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: unable to get properties of pipe %d (kr=0x%08x)\n", pipeRef, kr)); } else { int pair_index = (direction == kUSBIn) ? ++input_pipes_seen : ++output_pipes_seen; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: pipe %d: direction=0x%02x, number=0x%02x, transferType=0x%02x, maxPacketSize=%d, interval=0x%02x, pair_index=%d\n", pipeRef,(int)direction,(int)number,(int)transferType,(int)maxPacketSize,(int)interval,pair_index)); if (c->in_pipe_ref == 0 && direction == kUSBIn && transferType == kUSBBulk) { if ((pass == 1 && input_pipe_number != 0xff && number == input_pipe_number) || (pass == 1 && port_number == 0xff && input_pipe_number == 0xff && (accept_flags & FLAG_USE_FIRST_PAIR)) || (pass == 2 && port_number != 0xff && number == port_number) || (pass == 3 && ((port_number != 0xff && pair_index == port_number) || (port_number == 0xff && (maxPacketSize == 64 || maxPacketSize == 512)))) || pass == 4) c->in_pipe_ref = pipeRef; c->in_pipe_bulk_size = maxPacketSize; } else if (c->out_pipe_ref == 0 && direction == kUSBOut && transferType == kUSBBulk) { if ((pass == 1 && output_pipe_number != 0xff && number == output_pipe_number) || (pass == 1 && port_number == 0xff && input_pipe_number == 0xff && (accept_flags & FLAG_USE_FIRST_PAIR)) || (pass == 2 && port_number != 0xff && number == port_number) || (pass == 3 && ((port_number != 0xff && pair_index == port_number) || (port_number == 0xff && (maxPacketSize == 64 || maxPacketSize == 512)))) || pass == 4) { c->out_pipe_ref = pipeRef; c->out_pipe_bulk_size = maxPacketSize; } } } } } if (c->in_pipe_ref && c->out_pipe_ref) return kIOReturnSuccess; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: couldn't find any suitable pipes pair on this interface\n")); (*c->interface)->USBInterfaceClose (c->interface); (*c->interface)->Release (c->interface); c->interface = NULL; c->in_pipe_ref = 0; c->out_pipe_ref = 0; } return c->interface==NULL ? -1 : kIOReturnSuccess; } static IOReturn control_request(IOUSBDeviceInterface **dev, UInt8 requestType, UInt8 request, UInt16 value, UInt16 index, void *pData, UInt16 maxReplyLength) { IOReturn kr; IOUSBDevRequest req; void *pReply = pData; if (!pReply && maxReplyLength) pReply = malloc(maxReplyLength); req.bmRequestType = requestType; /* i.e. 0xc2=kUSBIn, kUSBVendor, kUSBEndpoint */ req.bRequest = request; req.wValue = value; req.wIndex = index; req.wLength = maxReplyLength; req.pData = pReply; req.wLenDone = 0; kr = (*dev)->DeviceRequest (dev, &req); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: control_request(0x%02x) wLenDone=%d kr=0x%08lx\n", (int)request, req.wLenDone, kr)); if (pReply && !pData) free (pReply); return kr; } static IOReturn read_visor_connection_information (IOUSBDeviceInterface **dev, int *port_number, int *input_pipe, int *output_pipe) { int i; kern_return_t kr; visor_connection_info ci; memset(&ci, 0, sizeof(ci)); kr = control_request (dev, 0xc2, VISOR_GET_CONNECTION_INFORMATION, 0, 0, &ci, sizeof(ci)); if (kr != kIOReturnSuccess) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: VISOR_GET_CONNECTION_INFORMATION failed (err=%08x)\n", kr)); } else { CHECK(PI_DBG_DEV, PI_DBG_LVL_DEBUG, pi_dumpdata((const char *)&ci, sizeof(ci))); ci.num_ports = CFSwapInt16LittleToHost(ci.num_ports); /* number of ports is little-endian */ if (ci.num_ports > 8) ci.num_ports = 8; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: VISOR_GET_CONNECTION_INFORMATION, num_ports=%d\n", ci.num_ports)); kr = kIOReturnNotReady; for (i=0; i < ci.num_ports; i++) { char *function_str; switch (ci.connections[i].port_function_id) { case VISOR_FUNCTION_GENERIC: function_str = "GENERIC"; break; case VISOR_FUNCTION_DEBUGGER: function_str = "DEBUGGER"; break; case VISOR_FUNCTION_HOTSYNC: function_str = "HOTSYNC"; if (port_number) *port_number = ci.connections[i].port; kr = kIOReturnSuccess; break; case VISOR_FUNCTION_CONSOLE: function_str = "CONSOLE"; break; case VISOR_FUNCTION_REMOTE_FILE_SYS: function_str = "REMOTE_FILE_SYSTEM"; break; default: function_str = "UNKNOWN"; break; } LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "\t[%d] port_function_id=0x%02x (%s)\n", i, ci.connections[i].port_function_id, function_str)); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "\t[%d] port=%d\n", i, ci.connections[i].port)); } } return kr; } static IOReturn decode_generic_connection_information(palm_ext_connection_info *ci, int *port_number, int *input_pipe, int *output_pipe) { int i; CHECK(PI_DBG_DEV, PI_DBG_LVL_DEBUG, pi_dumpdata((const char *)ci, sizeof(palm_ext_connection_info))); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: decode_generic_connection_information num_ports=%d, endpoint_numbers_different=%d\n", ci->num_ports, ci->endpoint_numbers_different)); for (i=0; i < ci->num_ports; i++) { UInt32 port_function_id = CFSwapInt32LittleToHost(ci->connections[i].port_function_id); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "\t[%d] port_function_id=0x%08lx ('%4.4s')\n", i, port_function_id, (char*)&port_function_id)); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "\t[%d] port=%d\n", i, ci->connections[i].port)); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "\t[%d] endpoint_info=%d (0x%02x)\n", i, ci->connections[i].endpoint_info, (int)ci->connections[i].endpoint_info)); if (port_function_id == 'rfsL') { /* This is a T5 in USB connected but not synchronizing: * don't bother trying to talk to it */ return kIOReturnNotReady; } if (port_function_id == 'sync' || port_function_id == 'ppp_') { /* we found the port/pipes to use for synchronization * If endpoint_numbers_different is != 0, then the number of each * endpoint to use for IN and OUT is stored in endpoint_info. * Otherwise, the port number (same for both endpoints) is in * port. */ if (!ci->endpoint_numbers_different) { if (port_number) *port_number = ci->connections[i].port; } else if (ci->connections[i].endpoint_info) { if (input_pipe) *input_pipe = ci->connections[i].endpoint_info >> 4; if (output_pipe) *output_pipe = ci->connections[i].endpoint_info & 0x0f; } } } return kIOReturnSuccess; } static IOReturn read_generic_connection_information (IOUSBDeviceInterface **dev, int *port_number, int *input_pipe, int *output_pipe) { kern_return_t kr; palm_ext_connection_info ci; memset(&ci, 0, sizeof(ci)); kr = control_request (dev, 0xc2, PALM_GET_EXT_CONNECTION_INFORMATION, 0, 0, &ci, sizeof(ci)); if (kr != kIOReturnSuccess) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: PALM_GET_EXT_CONNECTION_INFORMATION failed (err=%08x)\n", kr)); return kr; } return decode_generic_connection_information(&ci, port_number, input_pipe, output_pipe); } static IOReturn klsi_set_portspeed(IOUSBDeviceInterface **dev, int speed) { /* set the comms speed for a KLSI serial adapter (PalmConnect USB) */ kern_return_t kr; klsi_port_settings settings = {5, KLSI_BAUD_9600, 8, KLSI_PARITY_NONE, KLSI_STOPBITS_0}; switch (speed) { case 230400: settings.BaudRateIndex = KLSI_BAUD_230400; break; case 115200: settings.BaudRateIndex = KLSI_BAUD_115200; break; case 57600: settings.BaudRateIndex = KLSI_BAUD_57600; break; case 38400: settings.BaudRateIndex = KLSI_BAUD_38400; break; case 28800: settings.BaudRateIndex = KLSI_BAUD_28800; break; case 19200: settings.BaudRateIndex = KLSI_BAUD_19200; break; case 14400: settings.BaudRateIndex = KLSI_BAUD_14400; break; case 9600: settings.BaudRateIndex = KLSI_BAUD_9600; break; case 7200: settings.BaudRateIndex = KLSI_BAUD_7200; break; case 4800: settings.BaudRateIndex = KLSI_BAUD_4800; break; case 2400: settings.BaudRateIndex = KLSI_BAUD_2400; break; case 1200: settings.BaudRateIndex = KLSI_BAUD_1200; break; case 600: settings.BaudRateIndex = KLSI_BAUD_600; break; default: break; } kr = control_request(dev, 0x40, KLSI_SET_COMM_DESCRIPTOR, 0, 0, &settings, 5); if (kr == kIOReturnSuccess) { kr = control_request(dev, 0x40, KLSI_SET_COMM_DESCRIPTOR, 0, 0, &settings, 5); if (kr == kIOReturnSuccess) kr = control_request(dev, 0x40, KLSI_SET_FLOWCONTROL, (speed > 9600) ? KLSI_FLOW_USE_RTS : 0, 0, NULL, 0); control_request(dev, 0x40, KLSI_SET_HANDSHAKE_LINES, KLSI_SETHS_DTR | KLSI_SETHS_RTS, 0, NULL, 0); } return kr; } static void device_notification(usb_connection_t *c, io_service_t service, natural_t messageType, void *messageArgument) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: device_notification (c=%p messageType=0x%08lx)\n", c, messageType)); if (messageType == kIOMessageServiceIsTerminated && c != NULL) { c->device_present = 0; c->opened = 0; /* so that stop_listening() does'nt try to send the control_request */ if (change_refcount(c,-1) > 0) { /* In case the reading thread is waiting for data, * we need to raise the usb_data_available cond once. * since darwin_usb_read tests usb.opened, it will * gracefully exit during a data wait. */ ULOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: device_notification signaling c->read_queue_data_avail_cond for c=%p\n",c)); pthread_mutex_lock (&c->read_queue_mutex); pthread_cond_signal (&c->read_queue_data_avail_cond); pthread_mutex_unlock (&c->read_queue_mutex); } } } static void read_completion (usb_connection_t *c, IOReturn result, void *arg0) { size_t bytes_read = (size_t) arg0; ULOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: read_completion(c=%p, result=0x%08lx, bytes_read=%d)\n", c, (long)result, bytes_read)); if (!c->opened) { change_refcount(c, -1); return; } if (result != kIOReturnSuccess) { LOG((PI_DBG_DEV, PI_DBG_LVL_WARN, "darwinusb: async read completion(%p) received error code 0x%08x\n", c, result)); } if (bytes_read) { if (c->vendorID == VENDOR_PALMONE && c->productID == PRODUCT_PALMCONNECT_USB) { /* decode PalmConnect USB frame */ if (bytes_read < 2) bytes_read = 0; else { int data_size = (int)c->read_buffer[0] | ((int)c->read_buffer[1] << 8); if ((data_size + 2) > bytes_read) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: invalid PalmConnect packet (%d bytes, says %d content bytes)\n", bytes_read, data_size)); bytes_read = 0; } else { memmove(&c->read_buffer[0], &c->read_buffer[2], data_size); bytes_read = data_size; } } } if (bytes_read > 0) { pthread_mutex_lock(&c->read_queue_mutex); if (c->read_queue == NULL) { c->read_queue_size = ((bytes_read + 0xfffe) & ~0xffff) - 1; /* 64k chunks */ c->read_queue = (char *) malloc (c->read_queue_size); c->read_queue_used = 0; } else if ((c->read_queue_used + bytes_read) > c->read_queue_size) { c->read_queue_size += ((bytes_read + 0xfffe) & ~0xffff) - 1; c->read_queue = (char *) realloc (c->read_queue, c->read_queue_size); } if (c->read_queue) { memcpy(c->read_queue + c->read_queue_used, c->read_buffer, bytes_read); c->read_queue_used += bytes_read; ULOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: signaling c->read_queue_data_avail_cond for c=%p\n",c)); pthread_cond_signal(&c->read_queue_data_avail_cond); } else { c->read_queue_used = 0; c->read_queue_size = 0; } pthread_mutex_unlock(&c->read_queue_mutex); if (c->total_bytes_read == 0) { /* the connection is now considered live */ pthread_mutex_lock(&usb_connections_mutex); pthread_cond_signal(&usb_connection_added_cond); pthread_mutex_unlock(&usb_connections_mutex); } c->total_bytes_read += (unsigned long)bytes_read; } } if (result != kIOReturnAborted && c->opened && usb_run_loop) { if (result != kIOReturnSuccess) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: clearing input pipe stall\n")); (*c->interface)->ClearPipeStallBothEnds (c->interface, c->in_pipe_ref); } prime_read(c); } change_refcount(c, -1); } static int prime_read(usb_connection_t *c) { /* increment refcount */ if (pthread_mutex_lock(&c->ref_count_mutex) != 0) { /* c became invalid? */ LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: prime_read(%p): can't lock c->ref_count_mutex (structure freed?)\n", c)); return 0; } c->ref_count++; pthread_mutex_unlock(&c->ref_count_mutex); if (c->opened) { /* select a correct read size (always use a multiple of the USB packet size) */ if (c->vendorID == VENDOR_PALMONE && c->productID == PRODUCT_PALMCONNECT_USB) { /* with PalmConnect USB, always use 64 bytes */ c->last_read_ahead_size = 64; } else { c->last_read_ahead_size = c->read_ahead_size & ~(c->in_pipe_bulk_size-1); if (c->last_read_ahead_size <= 0) c->last_read_ahead_size = c->auto_read_size; if (c->last_read_ahead_size > MAX_AUTO_READ_SIZE) c->last_read_ahead_size = MAX_AUTO_READ_SIZE; else if (c->last_read_ahead_size < c->in_pipe_bulk_size) c->last_read_ahead_size = c->in_pipe_bulk_size; // USB packet size } ULOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: prime_read(%p) for %d bytes\n", c, c->last_read_ahead_size)); IOReturn kr = (*c->interface)->ReadPipeAsyncTO (c->interface, c->in_pipe_ref, c->read_buffer, c->last_read_ahead_size, 5000, 5000, (IOAsyncCallback1)&read_completion, (void *)c); if (kr == kIOUSBPipeStalled || kr == kIOUSBTransactionTimeout || kr == kIOUSBDataToggleErr) { // this code may be removed later as we are now using ReadPipeAsyncTO which is not // supposed to return them (it calls the completion callback instead) ULOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: stalled -- clearing stall and re-priming\n")); (*c->interface)->ClearPipeStall (c->interface, c->in_pipe_ref); kr = (*c->interface)->ReadPipeAsyncTO (c->interface, c->in_pipe_ref, c->read_buffer, c->last_read_ahead_size, 5000, 5000, (IOAsyncCallback1)&read_completion, (void *)c); } if (kr == kIOReturnSuccess) { c->read_pending = 1; return 1; } LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: prime_read(%p): ReadPipeAsync returned error 0x%08x\n", c, kr)); } change_refcount(c, -1); return 0; } static int accepts_device(unsigned short vendor, unsigned short product, unsigned short *flags) { int i; for (i=0; i < (int)(sizeof(acceptedDevices) / sizeof(acceptedDevices[0])); i++) { if (vendor == acceptedDevices[i].vendorID) { if (acceptedDevices[i].flags & FLAG_REJECT) return 0; if (acceptedDevices[i].productID == 0xffff || product == acceptedDevices[i].productID) { if (flags) *flags = acceptedDevices[i].flags; return 1; } } } return 0; } /***************************************************************************/ /* */ /* ENTRY POINTS CALLED BY LIBPISOCK */ /* */ /***************************************************************************/ static int u_flush(pi_socket_t *ps, int flags) { usb_connection_t *c = ((pi_usb_data_t *)ps->device->data)->ref; if (change_refcount(c, +1) <= 0) return PI_ERR_SOCK_DISCONNECTED; if (!c->opened) { change_refcount(c, -1); return PI_ERR_SOCK_DISCONNECTED; } if (flags & PI_FLUSH_INPUT) { pthread_mutex_lock(&c->read_queue_mutex); c->read_queue_used = 0; pthread_mutex_unlock(&c->read_queue_mutex); } change_refcount(c, -1); return 0; } static int u_open(struct pi_socket *ps, struct pi_sockaddr *addr, size_t addrlen) { pthread_mutex_lock(&usb_thread_ready_mutex); if (usb_thread == 0) { /* thread doesn't exist yet: create it and wait for * the init phase to be either successful or failed */ pthread_create(&usb_thread, NULL, usb_thread_run, NULL); pthread_cond_wait(&usb_thread_ready_cond, &usb_thread_ready_mutex); pthread_mutex_unlock(&usb_thread_ready_mutex); if (usb_thread != 0) return 1; errno = EINVAL; return pi_set_error(ps->sd, PI_ERR_GENERIC_SYSTEM); } pthread_mutex_unlock(&usb_thread_ready_mutex); return 1; } static int u_close(struct pi_socket *ps) { usb_connection_t *c = ((pi_usb_data_t *)ps->device->data)->ref; ULOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: u_close(ps=%p c=%p\n",ps,c)); if (c && change_refcount(c, 1) > 0) { // @@@ TODO: for KLSI, we should set total_bytes_read to 0 so that next time we receive data, // @@@ a new connection is declared `live' //if (c->vendorID == VENDOR_PALMONE && c->productID == PRODUCT_PALMCONNECT_USB) // control_request(c->device, 0x40, KLSI_SET_HANDSHAKE_LINES, KLSI_SETHS_RTS, 0, NULL, 0); c->opened = 0; /* set opened to 0 so that other threads don't try to acquire this connection, as it is on the way out */ c->total_bytes_read = 0; c->total_bytes_written = 0; c->ps = NULL; change_refcount(c, -2); /* decrement current refcount + disconnect */ } return close(ps->sd); } static int u_wait_for_device(struct pi_socket *ps, int *timeout) { usb_connection_t *c = connection_for_socket(ps); struct timespec to, to_expiration; ULOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: u_wait_for_device(ps=%p c=%p, timeout=%d)\n",ps,c,timeout ? *timeout : 0)); if (timeout && *timeout) { pi_timeout_to_timespec(*timeout, &to_expiration); to.tv_sec = *timeout / 1000; to.tv_nsec = (*timeout % 1000) * 1000 * 1000; } if (c == NULL) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: u_wait_for_device -> waiting for a connection to come up\n")); pthread_mutex_lock(&usb_connections_mutex); if (timeout && *timeout) { if (pthread_cond_timedwait_relative_np(&usb_connection_added_cond, &usb_connections_mutex, &to) == ETIMEDOUT) // if (pthread_cond_timedwait(&usb_connection_added_cond, &usb_connections_mutex, &when) == ETIMEDOUT) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: u_wait_for_device -> connection wait timed out\n")); pthread_mutex_unlock(&usb_connections_mutex); return PI_ERR_SOCK_TIMEOUT; } } else pthread_cond_wait(&usb_connection_added_cond, &usb_connections_mutex); pthread_mutex_unlock(&usb_connections_mutex); c = connection_for_socket(ps); ULOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: u_wait_for_device -> end of wait, c=%p\n",c)); if (c && c->vendorID==VENDOR_PALMONE && c->productID==PRODUCT_PALMCONNECT_USB) { /* when working with a PalmConnect USB, make sure we use the right speed * then let the adapter send us data */ klsi_set_portspeed(c->device, ((pi_usb_data_t *)ps->device->data)->rate); } if (timeout && *timeout) { /* if there was a timeout, compute the remaining timeout time */ *timeout = pi_timespec_to_timeout(&to_expiration); } } return (c != NULL); } static int u_poll(struct pi_socket *ps, int timeout) { usb_connection_t *c = connection_for_socket(ps); if (c == NULL) return PI_ERR_SOCK_DISCONNECTED; struct timespec to; ULOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: u_poll(ps=%p c=%p, timeout=%d)\n",ps,c,timeout)); if (timeout) { to.tv_sec = timeout / 1000; to.tv_nsec = (timeout % 1000) * 1000 * 1000; } pthread_mutex_lock(&c->read_queue_mutex); int available = c->read_queue_used; if (!available) { ULOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: u_poll -> waiting data to be available for c=%p\n",c)); if (timeout) { if (pthread_cond_timedwait_relative_np(&c->read_queue_data_avail_cond, &c->read_queue_mutex, &to) == ETIMEDOUT) { ULOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: u_poll -> data wait timed out\n")); available = PI_ERR_SOCK_TIMEOUT; } else available = c->read_queue_used; } else { /* wait forever for some data to arrive */ pthread_cond_wait(&c->read_queue_data_avail_cond, &c->read_queue_mutex); available = c->read_queue_used; } } pthread_mutex_unlock(&c->read_queue_mutex); change_refcount(c, -1); ULOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: u_poll -> end, c=%p, result=%d\n",c,available)); return available; } static ssize_t u_write(struct pi_socket *ps, const unsigned char *buf, size_t len, int flags) { IOReturn kr; size_t transferred_bytes = 0, data_size; usb_connection_t *c = ((pi_usb_data_t *)ps->device->data)->ref; if (change_refcount(c,+1)<=0 || !c->opened) { /* make sure we report broken connections */ if (ps->state == PI_SOCK_CONN_ACCEPT || ps->state == PI_SOCK_CONN_INIT) ps->state = PI_SOCK_CONN_BREAK; change_refcount(c, -1); return PI_ERR_SOCK_DISCONNECTED; } ULOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: u_write(ps=%p, c=%p, len=%d, flags=%d)\n",ps,c,(int)len,flags)); if (c->vendorID == VENDOR_PALMONE && c->productID == PRODUCT_PALMCONNECT_USB) { /* format packets for the PalmConnect USB adapter */ unsigned char *packet = malloc(c->out_pipe_bulk_size); if (packet == NULL) return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); while (len > 0) { data_size = len; if (data_size > (size_t)(c->out_pipe_bulk_size - 2)) data_size = (size_t)(c->out_pipe_bulk_size - 2); packet[0] = data_size; packet[1] = data_size >> 8; memcpy(&packet[2], &buf[transferred_bytes], data_size); kr = (*c->interface)->WritePipeTO(c->interface, c->out_pipe_ref, packet, c->out_pipe_bulk_size, 5000, 5000); if (kr != kIOReturnSuccess) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: darwin_usb_write(): WritePipe returned kr=0x%08lx\n", kr)); break; } c->total_bytes_written += (unsigned long)data_size; transferred_bytes += data_size; len -= data_size; } free(packet); } else { kr = (*c->interface)->WritePipeTO(c->interface, c->out_pipe_ref, (void *)buf, len, 5000, 5000); if (kr != kIOReturnSuccess) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "darwinusb: darwin_usb_write(): WritePipe returned kr=0x%08lx\n", kr)); } else { c->total_bytes_written += (unsigned long)len; transferred_bytes = len; } } if (change_refcount(c, -1) <= 0) return PI_ERR_SOCK_DISCONNECTED; return transferred_bytes; } static ssize_t u_read(struct pi_socket *ps, pi_buffer_t *buf, size_t len, int flags) { int timeout = ((struct pi_usb_data *)ps->device->data)->timeout; int timed_out = 0; usb_connection_t *c = ((pi_usb_data_t *)ps->device->data)->ref; if (change_refcount(c,+1)<=0 || !c->opened) { /* make sure we report broken connections */ if (ps->state == PI_SOCK_CONN_ACCEPT || ps->state == PI_SOCK_CONN_INIT) ps->state = PI_SOCK_CONN_BREAK; if (c != NULL) change_refcount(c, -1); return PI_ERR_SOCK_DISCONNECTED; } if (pi_buffer_expect (buf, len) == NULL) { errno = ENOMEM; change_refcount(c, -1); return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); } #ifdef DEBUG_USB struct timeval startTime, endTime; gettimeofday(&startTime, NULL); LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: u_read(ps=%p, c=%p, len=%d, timeout=%d, flags=%d)\n", ps, c, (int)len, timeout, flags)); #endif pthread_mutex_lock(&c->read_queue_mutex); if (flags == PI_MSG_PEEK && len > 256) len = 256; if (c->read_queue_used < len) { struct timeval now; struct timespec when; gettimeofday(&now, NULL); when.tv_sec = now.tv_sec + timeout / 1000; when.tv_nsec = now.tv_usec + (timeout % 1000) * 1000 * 1000; if (when.tv_nsec >= 1000000000) { when.tv_nsec -= 1000000000; when.tv_sec++; } do { /* next prime_read() will use a bigger read request */ c->read_ahead_size = len - c->read_queue_used - c->last_read_ahead_size; if (timeout) { if (pthread_cond_timedwait(&c->read_queue_data_avail_cond, &c->read_queue_mutex, &when) == ETIMEDOUT) { timed_out = 1; break; } } else pthread_cond_wait(&c->read_queue_data_avail_cond, &c->read_queue_mutex); } while (c->opened && (c->read_queue_used < len || (flags == PI_MSG_PEEK && c->read_queue_used >= 256))); c->read_ahead_size = 0; } if (!c->opened) { /* make sure we report broken connections */ if (ps->state == PI_SOCK_CONN_ACCEPT || ps->state == PI_SOCK_CONN_INIT) ps->state = PI_SOCK_CONN_BREAK; len = PI_ERR_SOCK_DISCONNECTED; } else { if (c->read_queue_used < len) len = c->read_queue_used; if (len) { pi_buffer_append (buf, c->read_queue, len); if (flags != PI_MSG_PEEK) { c->read_queue_used -= len; if (c->read_queue_used > 0) memmove(c->read_queue, c->read_queue + len, c->read_queue_used); if ((c->read_queue_size - c->read_queue_used) > (16L * 65535L)) { /* if we have more than 1M free in the read queue, we'd better * shrink the buffer */ c->read_queue_size = ((c->read_queue_used + 0xfffe) & ~0xffff) - 1; c->read_queue = (char *) realloc (c->read_queue, c->read_queue_size); } } } else if (timed_out) len = PI_ERR_SOCK_TIMEOUT; } #ifdef DEBUG_USB double a,b; gettimeofday(&endTime, NULL); a = (double)startTime.tv_sec + (double)startTime.tv_usec / (double)1000000; b = (double)endTime.tv_sec + (double)endTime.tv_usec / (double)1000000; if (len >= 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: -> u_read complete (bytes_read=%d, remaining bytes in queue=%d) in %.06fs\n", len, c->read_queue_used,b-a)); } else { LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: -> u_read end with error (err=%d) in %.06fs\n", len,b-a)); } #endif pthread_mutex_unlock(&c->read_queue_mutex); if (change_refcount(c, -1) <= 0) len = PI_ERR_SOCK_DISCONNECTED; return len; } static int u_changebaud(pi_socket_t *ps) { /* Change the baud rate. This is only useful for serial-to-USB adapters, * as these adapters need to know which rate we use to talk to the device. * We currently only support the PalmConnect USB adapter. */ pi_usb_data_t *data = (pi_usb_data_t *)ps->device->data; usb_connection_t *c = data->ref; if (c == NULL) return PI_ERR_SOCK_DISCONNECTED; LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "darwinusb: u_changebaud(ps=%p, c=%p, rate=%d)\n", ps, c, data->rate)); if (c->vendorID == VENDOR_PALMONE && c->productID == PRODUCT_PALMCONNECT_USB) return klsi_set_portspeed(c->device, data->rate); return 0; } void pi_usb_impl_init (struct pi_usb_impl *impl) { impl->open = u_open; impl->close = u_close; impl->write = u_write; impl->read = u_read; impl->flush = u_flush; impl->poll = u_poll; impl->wait_for_device = u_wait_for_device; impl->changebaud = u_changebaud; impl->control_request = NULL; /* that is, until we factor out common code */ } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/palmpix.c0000644000175000017500000021773210513447542020716 0ustar rousseaurousseau/* * $Id: palmpix.c,v 1.17 2006/10/12 14:21:22 desrod Exp $ * * palmpix.c: Translate PalmPix image format * * Copyright 2001 Angus Ainslie * Copyright 2001 John Marshall * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this 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 #include #include #include #if HAVE_STDINT_H # include #else # if HAVE_INTTYPES_H # include # else # ifndef uint8_t # define uint8_t unsigned char # endif # ifndef uint16_t # define uint16_t unsigned short # endif # ifndef uint32_t # define uint32_t unsigned long # endif # ifndef int8_t # define int8_t char # endif # ifndef int16_t # define int16_t short # endif # ifndef int32_t # define int32_t long # endif # endif /* HAVE_INTTYPES_H */ #endif /* HAVE_STDINT_H */ #include "pi-macros.h" #include "pi-palmpix.h" #define max(a,b) (( a > b ) ? a : b ) #define min(a,b) (( a < b ) ? a : b ) int ColourCorrect (const struct PalmPixHeader *picHdr, uint8_t *r, uint8_t *gr, uint8_t *gb, uint8_t *b); int Histogram(const struct PalmPixHeader *picHdr, uint8_t *r, uint8_t *gr, uint8_t *gb, uint8_t *b); void DecodeRow(uint8_t *compData, uint8_t *lastRow, uint8_t *unCompData, uint32_t *offset, int32_t *firstWord, uint16_t *PPLutsW, uint8_t *PPLuts, uint16_t halfWidth); uint8_t huffWidth[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07, 0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07, 0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07, 0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07, 0x0c,0x0c,0x0b,0x0b,0x0a,0x0a,0x0a,0x0a, 0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09, 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, 0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07, 0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07, 0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07, 0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07, 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, 0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09, 0x0a,0x0a,0x0a,0x0a,0x0b,0x0b,0x0c,0x0c }; uint16_t huffTable[] = { 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7, 0xffe8,0xffe8,0xffe8,0xffe8,0xffe8,0xffe8,0xffe8,0xffe8, 0xffe8,0xffe8,0xffe8,0xffe8,0xffe8,0xffe8,0xffe8,0xffe8, 0xffe8,0xffe8,0xffe8,0xffe8,0xffe8,0xffe8,0xffe8,0xffe8, 0xffe8,0xffe8,0xffe8,0xffe8,0xffe8,0xffe8,0xffe8,0xffe8, 0xff60,0xff7b,0xffa5,0xffa5,0xffbd,0xffbd,0xffbd,0xffbd, 0xffd0,0xffd0,0xffd0,0xffd0,0xffd0,0xffd0,0xffd0,0xffd0, 0xffdc,0xffdc,0xffdc,0xffdc,0xffdc,0xffdc,0xffdc,0xffdc, 0xffdc,0xffdc,0xffdc,0xffdc,0xffdc,0xffdc,0xffdc,0xffdc, 0xffef,0xffef,0xffef,0xffef,0xffef,0xffef,0xffef,0xffef, 0xffef,0xffef,0xffef,0xffef,0xffef,0xffef,0xffef,0xffef, 0xffef,0xffef,0xffef,0xffef,0xffef,0xffef,0xffef,0xffef, 0xffef,0xffef,0xffef,0xffef,0xffef,0xffef,0xffef,0xffef, 0xffef,0xffef,0xffef,0xffef,0xffef,0xffef,0xffef,0xffef, 0xffef,0xffef,0xffef,0xffef,0xffef,0xffef,0xffef,0xffef, 0xffef,0xffef,0xffef,0xffef,0xffef,0xffef,0xffef,0xffef, 0xffef,0xffef,0xffef,0xffef,0xffef,0xffef,0xffef,0xffef, 0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3, 0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3, 0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3, 0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3, 0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3, 0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3, 0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3, 0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3, 0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3, 0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3, 0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3, 0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3, 0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3, 0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3, 0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3, 0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009, 0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d, 0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d, 0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d, 0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d, 0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d, 0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d, 0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d, 0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d, 0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d, 0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d, 0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d, 0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d, 0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d, 0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d, 0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d, 0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d, 0x0011,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011, 0x0011,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011, 0x0011,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011, 0x0011,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011, 0x0011,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011, 0x0011,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011, 0x0011,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011, 0x0011,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011, 0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018, 0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018, 0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018, 0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018, 0x0024,0x0024,0x0024,0x0024,0x0024,0x0024,0x0024,0x0024, 0x0024,0x0024,0x0024,0x0024,0x0024,0x0024,0x0024,0x0024, 0x0030,0x0030,0x0030,0x0030,0x0030,0x0030,0x0030,0x0030, 0x0043,0x0043,0x0043,0x0043,0x005b,0x005b,0x0085,0x00a0 }; /**************************************************************** * Bias * * Bias is based on the Fast Alternative to Perlin's Bias algorithm * in Graphics Gems IV by * Christophe Schlick schlick@labri.u-bordeuax.fr *****************************************************************/ static void Bias( double bias, int width, int height, uint8_t *data ) { int i; double num, denom, t; fprintf( stderr, "Bias factor : %lf\n", bias ); for( i=0; iw/2; uint16_t height = picHdr->h/2; int i; uint8_t red[256], greenB[256], greenR[256], blue[256]; memset( red, 0, 256 * sizeof( uint8_t )); memset( greenR, 0, 256 * sizeof( uint8_t )); memset( greenB, 0, 256 * sizeof( uint8_t )); memset( blue, 0, 256 * sizeof( uint8_t )); gbMin = grMin = rMin = bMin = 255; gbMax = grMax = rMax = bMax = 0; for( i=0; iw/2; uint16_t height = picHdr->h/2; int i; float clip; uint8_t red[256], greenB[256], greenR[256], blue[256]; float redCeiling = 254; float greenCeiling = 252; float blueCeiling = 255; memset( red, 0, 256 * sizeof( uint8_t )); memset( greenR, 0, 256 * sizeof( uint8_t )); memset( greenB, 0, 256 * sizeof( uint8_t )); memset( blue, 0, 256 * sizeof( uint8_t )); memset( rC, 0, 256 * sizeof( uint32_t )); memset( grC, 0, 256 * sizeof( uint32_t )); memset( gbC, 0, 256 * sizeof( uint32_t )); memset( bC, 0, 256 * sizeof( uint32_t )); gbMin = grMin = rMin = bMin = 255; gbMax = grMax = rMax = bMax = 0; for( i=0; i clip ) rMin = i; grCum += grC[i]; if( grMin == 255 && grCum > clip ) grMin = i; gbCum += gbC[i]; if( gbMin == 255 && gbCum > clip ) gbMin = i; bCum += bC[i]; if( bMin == 255 && bCum > clip ) bMin = i; if( rMin != 255 && grMin != 255 && gbMin != 255 && bMin != 255 ) break; } rCum = grCum = gbCum = bCum = 0; for( i=255; i > 0; i-- ) { rCum += rC[i]; if( rMax == 0 && rCum > clip ) rMax = i; grCum += grC[i]; if( grMax == 0 && grCum > clip ) grMax = i; gbCum += gbC[i]; if( gbMax == 0 && gbCum > clip ) gbMax = i; bCum += bC[i]; if( bMax == 0 && bCum > clip ) bMax = i; if( rMax != 0 && grMax != 0 && gbMax != 0 && bMax != 0 ) break; } rInc = redCeiling / (rMax-rMin); grInc = greenCeiling / (grMax-grMin); gbInc = greenCeiling / (gbMax-gbMin); bInc = blueCeiling / (bMax-bMin); rCur = 0; grCur = 0; gbCur = 0; bCur = 0; for (i = 0; i<256; i++) { if( i < rMin ) red[i] = 0; else { if( rCur < redCeiling ) red[i] = rCur; else red[i] = greenCeiling; rCur += rInc; } if( i < grMin ) greenR[i] = 0; else { if( grCur < greenCeiling ) greenR[i] = grCur; else greenR[i] = greenCeiling; grCur += grInc; } if( i < gbMin ) greenB[i] = 0; else { if( gbCur < greenCeiling ) greenB[i] = gbCur; else greenB[i] = blueCeiling; gbCur += gbInc; } if( i < bMin ) blue[i] = 0; else { if( bCur < blueCeiling ) blue[i] = bCur; else blue[i] = blueCeiling; bCur += bInc; } } for( i=0; iw/2; for( y=1; yh-1; y++ ) { idx = y/2; offset = idx * rawWidth; ppOff = y * pixHdr->w; if( y%2 == 1 ) { for( x=1; x>2; g = (greenR[offset+x] + greenR[offset+x+rawWidth] + greenB[offset + x - 1] + greenB[offset + x])>>2; b = blue[offset + x]; pp[3 * (ppOff + rowOff) + offset_r] = r; pp[3 * (ppOff + rowOff) + offset_g] = g; pp[3 * (ppOff + rowOff) + offset_b] = b; r = (red[offset + x] + red[offset + rawWidth + x])>>1; g = (( greenB[offset + x] << 2 ) + greenR[offset+x] + greenR[offset+x+1] + greenR[offset+x+rawWidth] + greenR[offset+x+rawWidth+1] )>>3; b = (blue[offset + x] + blue[offset + x + 1])>>1; pp[3 * (ppOff + rowOff + 1) + offset_r] = r; pp[3 * (ppOff + rowOff + 1) + offset_g] = g; pp[3 * (ppOff + rowOff + 1) + offset_b] = b; } } else { for( x=1; x>1; g = (( greenR[offset + x] << 2 ) + greenB[offset-rawWidth+x-1] + greenB[offset-rawWidth+x] + greenB[offset+x-1] + greenB[offset+x] )>>3; b = (blue[offset-rawWidth+x] + blue[offset+x])>>1; pp[3 * (ppOff + rowOff) + offset_r] = r; pp[3 * (ppOff + rowOff) + offset_g] = g; pp[3 * (ppOff + rowOff) + offset_b] = b; r = red[offset+x]; g = (greenR[offset+x] + greenR[offset+x+1] + greenB[offset-rawWidth+x] + greenB[offset + x])>>2; b = (blue[offset+x-rawWidth] + blue[offset+x-rawWidth-1] + blue[offset+x] + blue[offset+x+1])>>2; pp[3 * (ppOff + rowOff + 1) + offset_r] = r; pp[3 * (ppOff + rowOff + 1) + offset_g] = g; pp[3 * (ppOff + rowOff + 1) + offset_b] = b; } } } } void DecodeRow( uint8_t *compData, uint8_t *lastRow, uint8_t *unCompData, uint32_t *offset, int32_t *firstWord, uint16_t *PPLutsW, uint8_t *PPLuts, uint16_t halfWidth ) { uint8_t *saveStartP, shiftOut; int16_t tmpW3, tmpResult, tmpW0, idx, resultW; uint32_t lutIdx, tmpL0, tmpL2, tmpL5; saveStartP = compData; tmpW3 = 32 - *firstWord; tmpResult = 32 - tmpW3; tmpL5 = compData[0]<<24 | compData[1]<<16 | compData[2]<<8 | compData[3] ; tmpL5 = tmpL5<> 24; unCompData[0] = (uint8_t)tmpL0; tmpL5 = tmpL5 << 8; tmpW3 = tmpW3 - 8; idx = 1; while( idx < halfWidth ) { if( tmpW3 < 12 ) { tmpW0 = 16 - tmpW3; tmpL2 = ( compData[0]<<8 | compData[1] ) << tmpW0; tmpL5 = tmpL5 | tmpL2; tmpW3 += 16; compData += 2; } lutIdx = tmpL5 >> 20; shiftOut = PPLuts[lutIdx]; tmpL5 = tmpL5 << shiftOut; tmpW3 = tmpW3 - shiftOut; resultW = ( unCompData[idx-1] + lastRow[idx] ) >> 1; resultW = resultW + PPLutsW[lutIdx]; if( resultW > 255 ) resultW = 255; if( resultW < 0 ) resultW = 0; unCompData[idx++] = (uint8_t)resultW; } while( tmpW3 > 0 ) { compData--; tmpW3 -= 8; } *offset = compData - saveStartP; *firstWord = -tmpW3; } /* A binary PalmPixHeader is a record of length 196 in the following format. Note that multibyte integers are in little endian byte order -- they are NOT in m68k byte order. 0UInt8 numRec; 1UInt8 s0; // Always zero 2UInt8 month; 3UInt8 day; 4UInt8 cent; 5UInt8 year; 6UInt8 hour; 7UInt8 min; 8UInt8 sec; 9UInt8 resolution; // 640x480 = 1, 320x240 = 2, 400x300 = 3, 800x600 = 4 10UInt16 w; 12UInt16 h; 14UInt16 thumbLen; // Size of the thumbnail following the name 16UInt16 GRsize; 18UInt8 sep0; 19UInt16 Rsize; 21UInt8 sep1; 22UInt16 Bsize; 24UInt8 sep2; 25UInt16 GBsize; 27UInt16 pad1; 29UInt16 num; // hires 1200, lowres 300 31UInt8 resA[14]; 45UInt8 zoom; 46UInt8 softMajor; // Always 0x0102 [see below] 47UInt8 softMinor; // Always 0x0102 [see below] 48UInt8 resB[34]; 82UInt16 dir[57]; */ /* The remainder is due to John Marshall. It is pretty trivial compared to the analysis above. */ static int get_le_short (const unsigned char *p) { return p[0] | (p[1] << 8); } int unpack_PalmPixHeader (struct PalmPixHeader *h, const unsigned char *p, int len) { int magic1, magic2; if (len != 196) return 0; magic1 = p[1]; magic2 = get_le_short (&p[46]); /* FIXME For now, don't check the magic. I've seen 0x0002 and 0x0201. I'm not sure that the endianness is right on this one. Possibly it should be interpreted as two bytes instead (major and minor?). */ #if 0 if (magic1 != 0 || (magic2 != 0x0102 && magic2 != 0x0002)) return 0; #endif h->numRec= p[0]; h->month= p[2]; h->day= p[3]; h->year= p[4] * 100 + p[5]; h->hour= p[6]; h->min= p[7]; h->sec= p[8]; h->resolution= p[9]; h->w= get_le_short (&p[10]); h->h= get_le_short (&p[12]); h->thumbLen= get_le_short (&p[14]); h->chansize[pixChannelGR] = get_le_short (&p[16]); h->chansize[pixChannelR] = get_le_short (&p[19]); h->chansize[pixChannelB] = get_le_short (&p[22]); h->chansize[pixChannelGB] = get_le_short (&p[25]); h->num= get_le_short (&p[29]); h->zoom= p[45]; return 196; } int unpack_PalmPix (struct PalmPixState *s, const struct PalmPixHeader *h, int header_recno, int wanted) { int retcode = 1; if (wanted & pixName) { void *buffer; size_t bufsize; if (s->getrecord (s, header_recno + 1, &buffer, &bufsize) == 0 && bufsize == 32) { memcpy (s->pixname, buffer, 32); s->pixname[32] = '\0'; } else retcode = 0; } if (wanted & pixThumbnail) { /* FIXME */ retcode = 0; fprintf (stderr, "palmpix.c: thumbnail reader not implemented\n"); } if (wanted & pixPixmap) { int rawWidth = h->w / 2; int rawHeight = h->h / 2; unsigned char *raw; unsigned char *chan[4]; /* red/greenR/greenB/blue channels */ int chansize_max = 0; int recno = header_recno; int failed = 1; int k; for (k = 0; k < 4; k++) chan[k] = NULL; raw = NULL; s->pixmap = NULL; for (k = 0; k < 4; k++) { chan[k] = malloc ((size_t)(rawWidth * rawHeight)); if (chan[k] == NULL) goto failed; memset (chan[k], 0, (size_t)(rawWidth * rawHeight)); if (chansize_max < h->chansize[k]) chansize_max = h->chansize[k]; } raw = malloc ((size_t)chansize_max); if (raw == NULL) goto failed; s->pixmap = malloc ((size_t)(h->w * h->h * 3)); if (s->pixmap == NULL) goto failed; recno += 4; /* Skip to the first channel record. */ for (k = 0; k < 4; k++) { long num_bytes, offset; int32_t lastWord = 0; int j; for (num_bytes = 0; num_bytes < h->chansize[k]; recno++) { void *buffer; size_t bufsize; if (s->getrecord (s, recno, &buffer, &bufsize) == 0) { if (bufsize > h->chansize[k] - num_bytes) bufsize = h->chansize[k] - num_bytes; memcpy (&raw[num_bytes], buffer, (size_t)bufsize); num_bytes += bufsize; } else goto failed; } offset = 0; memcpy (chan[k], &raw[offset], (size_t)rawWidth); offset += rawWidth; for (j = 1; j < rawHeight; j++) { uint32_t eaten; DecodeRow (&raw[offset], &chan[k][rawWidth * (j - 1)], &chan[k][rawWidth * j], &eaten, &lastWord, huffTable, huffWidth, rawWidth); offset += eaten; } } if( s->flags & PALMPIX_COLOUR_CORRECTION ) ColourCorrect ( h, chan[pixChannelR], chan[pixChannelGR], chan[pixChannelGB], chan[pixChannelB] ); if( s->bias != 50 ) { Bias ( (double)s->bias / 100.0, rawWidth, rawHeight, chan[pixChannelR]); Bias ( (double)s->bias / 100.0, rawWidth, rawHeight, chan[pixChannelGR]); Bias ( (double)s->bias / 100.0, rawWidth, rawHeight, chan[pixChannelGB]); Bias ( (double)s->bias / 100.0, rawWidth, rawHeight, chan[pixChannelB]); } if( s->flags & PALMPIX_HISTOGRAM_STRETCH ) Histogram ( h, chan[pixChannelR], chan[pixChannelGR], chan[pixChannelGB], chan[pixChannelB] ); Interpolate (h, chan[pixChannelR], chan[pixChannelGR], chan[pixChannelGB], chan[pixChannelB], s->pixmap, s->offset_r, s->offset_g, s->offset_b); failed = 0; failed: for (k = 0; k < 4; k++) free (chan[k]); free (raw); if (failed) { free (s->pixmap); retcode = 0; } } s->highest_recno = header_recno + 3 + h->numRec; return retcode; } int free_PalmPix_data (struct PalmPixState *s) { free (s->pixmap); return 1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/memo.c0000644000175000017500000001113410552545410020161 0ustar rousseaurousseau/* * $Id: memo.c,v 1.27 2006/11/22 22:52:25 adridg Exp $ * * memo.c: Translate Pilot memopad data formats * * Copyright (c) 1996, Kenneth Albanowski * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include "pi-macros.h" #include "pi-memo.h" /*********************************************************************** * * Function: free_Memo * * Summary: Frees all record data associated with the Memo database * * Parameters: Memo_t* * * Returns: void * ***********************************************************************/ void free_Memo(Memo_t *memo) { if (memo->text != NULL) { free(memo->text); memo->text = NULL; } } /*********************************************************************** * * Function: unpack_Memo * * Summary: Unpack the memo structure from the buffer * * Parameters: Memo_t*, char* to buffer, length * * Returns: Length in bytes of the buffer allocated * ***********************************************************************/ int unpack_Memo(Memo_t *memo, const pi_buffer_t *record, memoType type) { if (type != memo_v1) /* Don't support anything else yet */ return -1; if (record == NULL || record->data == NULL || record->used < 1) return -1; memo->text = strdup((char *) record->data); return 0; } /*********************************************************************** * * Function: pack_Memo * * Summary: Pack the memo structure into the buffer allocated * * Parameters: Memo_t*, char* to buffer, length of buffer * * Returns: buffer length * ***********************************************************************/ int pack_Memo(const Memo_t *memo, pi_buffer_t *record, memoType type) { size_t destlen = (memo->text ? strlen(memo->text) : 0) + 1; if (type != memo_v1) /* Don't support anything else yet */ return -1; if (record == NULL) return -1; pi_buffer_expect(record, destlen); record->used = destlen; if (memo->text) strcpy((char *) record->data, memo->text); else record->data[0] = 0; return 0; } /*********************************************************************** * * Function: unpack_MemoAppInfo * * Summary: Unpack the memo AppInfo block structure * * Parameters: MemoAppInfo_t*, char* to record, record length * * Returns: effective record length * ***********************************************************************/ int unpack_MemoAppInfo(struct MemoAppInfo *appinfo, const unsigned char *record, size_t len) { int i = unpack_CategoryAppInfo(&appinfo->category, record, len); unsigned char *start = record; appinfo->type = memo_v1; if (!i) return i; record += i; len -= i; if (len >= 4) { record += 2; appinfo->sortByAlpha = get_byte(record); record += 2; } else { appinfo->sortByAlpha = 0; } return (record - start); } /*********************************************************************** * * Function: pack_MemoAppInfo * * Summary: Pack the memo AppInfo block structure * * Parameters: MemoAppInfo_t*, char* to record, record length * * Returns: effective record length * ***********************************************************************/ int pack_MemoAppInfo(const MemoAppInfo_t *appinfo, unsigned char *record, size_t len) { int i; unsigned char *start = record; i = pack_CategoryAppInfo(&appinfo->category, record, len); if (!record) return i + 4; if (i == 0) /* category pack failed */ return 0; record += i; len -= i; if (len < 4) return (record - start); set_short(record, 0); /* gapfill new for 2.0 */ record += 2; set_byte(record, appinfo->sortByAlpha); /* new for 2.0 */ record++; set_byte(record, 0); /* gapfill new for 2.0 */ record++; return (record - start); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/freebsdusb.c0000644000175000017500000003115710513447542021363 0ustar rousseaurousseau/* * $Id: freebsdusb.c,v 1.28 2006/10/12 14:21:22 desrod Exp $ * * freebsdusb.c: device IO for FreeBSD usb devices * * Copyright (c) 1996, 1997, D. Jeff Dionne & Kenneth Albanowski. * 2002, Anish Mistry * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this 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 #include #include #include #include #include "pi-debug.h" #include "pi-source.h" #include "pi-usb.h" #ifdef HAVE_SYS_IOCTL_COMPAT_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #ifndef O_NONBLOCK # define O_NONBLOCK 0 #endif #if defined(__FreeBSD__) /* freebsd usb header */ #include #define MAX_BUF 256 #endif /* Declare prototypes */ static int u_open(pi_socket_t *ps, struct pi_sockaddr *addr, size_t addrlen); static int u_close(pi_socket_t *ps); static ssize_t u_write(pi_socket_t *ps, const unsigned char *buf, size_t len, int flags); static ssize_t u_read(pi_socket_t *ps, pi_buffer_t *buf, size_t len, int flags); static int u_poll(pi_socket_t *ps, int timeout); static int u_flush(pi_socket_t *ps, int flags); void pi_usb_impl_init (struct pi_usb_impl *impl) { impl->open = u_open; impl->close = u_close; impl->write = u_write; impl->read = u_read; impl->flush = u_flush; impl->poll = u_poll; } /*********************************************************************** * * Function: u_open * * Summary: Open the usb port and establish a connection for * communicating over the usb port. * * Parameters: ps is of type pi_socket_t which will given a copy of the * valid file descriptor that is returned by the function. * * addr of type pi_socketaddr contains the member pi_device * which is a character string of the usb device. * * XXX addrlen is of type int contain the size of addr? I'm * not using this, should I? Possible buffer overflow because * I'm not checking something? * * Returns: The file descriptor * ***********************************************************************/ static int u_open(pi_socket_t *ps, struct pi_sockaddr *addr, size_t addrlen) { int fd, i, endpoint_fd; struct usb_device_info udi; /* struct usb_ctl_request ur; */ /* unsigned char usbresponse[50]; */ char *tty = addr->pi_device; char *pEndPoint = NULL; /* open the usb device */ if ((fd = open(tty, O_RDWR, 0)) < 0) { ps->last_error = PI_ERR_GENERIC_SYSTEM; return PI_ERR_GENERIC_SYSTEM; } /* check for a valid file descriptor */ if (fd < 0) { ps->last_error = PI_ERR_GENERIC_SYSTEM; return PI_ERR_GENERIC_SYSTEM; } /* fill the udi structure with information about the handheld, after this is where you will probably want to do device specific stuff */ if (ioctl(fd, USB_GET_DEVICEINFO, &udi)) { close(fd); ps->last_error = PI_ERR_GENERIC_SYSTEM; return PI_ERR_GENERIC_SYSTEM; } LOG((PI_DBG_DEV, PI_DBG_LVL_INFO, "DEV USB_GET_DEVICE_INFO USB FreeBSD fd: %d\n", fd)); /* set the configuration */ i = 1; if (ioctl(fd, USB_SET_CONFIG, &i) < 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "DEV USB_SET_CONFIG USB FreeBSD fd: %d failed\n", fd)); close(fd); ps->last_error = PI_ERR_GENERIC_SYSTEM; return PI_ERR_GENERIC_SYSTEM; } /* close the main communication pipe since we have initilized everything we needed to NOTE: we HAVE to do all this stuff to the main pipe or we will cause a kernel panic when data is sent over the endpoint */ close(fd); /* open endpoint */ /* allocate data for the usb endpoint string */ pEndPoint = malloc(strlen(tty)+20); if(!pEndPoint) return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); /* create device endpoint name string */ sprintf(pEndPoint, "%s.%d", tty, 2); /* open the endpoint with read write access */ endpoint_fd = open(pEndPoint, O_RDWR, 0); if(endpoint_fd < 0) { /* we failed to open the endpoint */ free(pEndPoint); return pi_set_error(ps->sd, PI_ERR_GENERIC_SYSTEM); } if ((i = fcntl(endpoint_fd, F_GETFL, 0)) != -1) { i &= ~O_NONBLOCK; fcntl(endpoint_fd, F_SETFL, i); } /* set short transfer so that we can allow "short" reads since we will don't know exactly what is coming so we can't specify exact byte amounts */ i = 1; if (ioctl(endpoint_fd, USB_SET_SHORT_XFER, &i) < 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_WARN, "DEV USB_SET_SHORT_XFER USB FreeBSD fd: %d failed\n", endpoint_fd)); } /* 0 timeout value will cause us the wait until the device has data available or is disconnected */ i = 0; if (ioctl(endpoint_fd, USB_SET_TIMEOUT, &i) < 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_WARN, "DEV USB_SET_TIMEOUT USB FreeBSD fd: %d failed\n", endpoint_fd)); } /* save our file descriptor in the pi_socket structure */ if ((i = pi_socket_setsd(ps, endpoint_fd)) < 0) { free(pEndPoint); return i; } /* free endpoint string memory */ free(pEndPoint); LOG((PI_DBG_DEV, PI_DBG_LVL_INFO, "DEV OPEN USB FreeBSD fd: %d\n", endpoint_fd)); /* return our endpoint file descriptor since this is where the reading and writing will be done */ return endpoint_fd; } /*********************************************************************** * * Function: u_close * * Summary: Close the open socket/file descriptor * * Parameters: ps is of type pi_socket that contains the member sd which is * the file descriptor that is to be closed. * * Returns: 0 if sucessful or -1 if it failed and errno set to the error * ***********************************************************************/ static int u_close(pi_socket_t *ps) { LOG((PI_DBG_DEV, PI_DBG_LVL_INFO, "DEV CLOSE USB FreeBSD fd: %d\n", ps->sd)); return close(ps->sd); } /*********************************************************************** * * Function: u_poll * * Summary: Poll the open socket/file descriptor * * Parameters: None * * Returns: 1 always since we buffer our own data and you can't poll() * FreeBSD USB devices? * ***********************************************************************/ static int u_poll(pi_socket_t *ps, int timeout) { /* stub this function and log an error that this should never needed to be called */ LOG((PI_DBG_DEV, PI_DBG_LVL_WARN, "DEV POLL USB FreeBSD Timeout: %d\npoll()" " should not be called for FreeBSD USB\n", timeout)); return 1; } /*********************************************************************** * * Function: u_write * * Parameters: ps is of type pi_socket that contains the sd member which is * the file descriptor that the data in buf will be written to. * * buf is a unsigned char pointer that points to the data that * is to be written to ps->sd. * * len is of type int and indicated the number of bytes to * write to ps->sd. * * flags is of type int and contains various write flags. What * flags and should I respect them, since I am currently not * checking this variable? * * Parameters: None * * Returns: The number of bytes written from buf or negative to indicate an * error * ***********************************************************************/ static ssize_t u_write(pi_socket_t *ps, const unsigned char *buf, size_t len, int flags) { int nwrote, total, write_len; fd_set ready; total = len; write_len = len; /* FIXME: there is no timeout handling in the original freebsdusb code! */ while (total > 0) { FD_ZERO(&ready); FD_SET(ps->sd, &ready); if (!FD_ISSET(ps->sd, &ready)) { ps->state = PI_SOCK_CONN_BREAK; return pi_set_error(ps->sd, PI_ERR_SOCK_DISCONNECTED); } nwrote = write(ps->sd, buf, write_len); if (nwrote < 0) { ps->state = PI_SOCK_CONN_BREAK; return pi_set_error(ps->sd, PI_ERR_SOCK_DISCONNECTED); } write_len -= nwrote; buf += nwrote; total -= nwrote; } LOG((PI_DBG_DEV, PI_DBG_LVL_INFO, "DEV TX USB FreeBSD Bytes: %d\n", len)); return len; } /*********************************************************************** * * Function: u_read * * Summary: Read incoming data from the socket/file descriptor and * buffer any extra data that is read in the process of * receiving data from the device. * * Parameters: ps is of type pi_socket that contains the sd member which is * the file descriptor that the data in buf will be read. It * also contains the read buffer. * * buf is a pointer to an unsigned character string that will * receive the data the is read from the device. * * len is of type int that is the the number of bytes to read * from the device/buffer into buf. * * flags is of type in that currently only indicated if you * want to peek data from the device/buffer . * * Returns: The number of bytes that was read from the device or from * the buffer and copied to buf. * ***********************************************************************/ static ssize_t u_read(pi_socket_t *ps, pi_buffer_t *buf, size_t len, int flags) { struct pi_usb_data *data = (struct pi_usb_data *) ps->device->data; ssize_t rlen; int bytes_read = 0; fd_set ready; struct timeval t; if (flags == PI_MSG_PEEK && len > 256) len = 256; if (pi_buffer_expect (buf, len) == NULL) { errno = ENOMEM; return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); } /* first extract anything we had in the "peek" buffer */ if (data->buf_size > 0) { bytes_read = len > data->buf_size ? data->buf_size : len; len -= bytes_read; pi_buffer_append(buf, data->buf, bytes_read); if (flags != PI_MSG_PEEK) { data->buf_size -= bytes_read; if (data->buf_size > 0) memmove(data->buf, data->buf + bytes_read, data->buf_size); } if (!len) return bytes_read; } /* check to see if device is ready for read */ FD_ZERO(&ready); FD_SET(ps->sd, &ready); /* If timeout == 0, wait forever for packet, otherwise wait till timeout milliseconds */ if (data->timeout == 0) select(ps->sd + 1, &ready, 0, 0, 0); else { t.tv_sec = data->timeout / 1000; t.tv_usec = (data->timeout % 1000) * 1000; if (select(ps->sd + 1, &ready, 0, 0, &t) == 0) return pi_set_error(ps->sd, PI_ERR_SOCK_TIMEOUT); } /* If data is available in time, read it */ if (!FD_ISSET(ps->sd, &ready)) { LOG((PI_DBG_DEV, PI_DBG_LVL_WARN, "DEV RX USB FreeBSD timeout\n")); errno = ETIMEDOUT; return pi_set_error(ps->sd, PI_ERR_SOCK_TIMEOUT); } /* read data to pre-sized buffer */ rlen = read(ps->sd, &buf->data[buf->used], len); if (rlen > 0) { if (flags == PI_MSG_PEEK) { memcpy(data->buf, buf->data + buf->used, rlen); data->buf_size = rlen; } buf->used += rlen; bytes_read += rlen; LOG((PI_DBG_DEV, PI_DBG_LVL_INFO, "DEV RX USB FreeBSD Bytes: %d:%d\n", bytes_read, bytes_read + data->buf_size)); } else bytes_read = PI_ERR_SOCK_IO; return bytes_read; } /*********************************************************************** * * Function: u_flush * * Summary: Flush incoming and/or outgoing data from the socket/file * descriptor * * Parameters: ps is of type pi_socket that contains the sd member which is * the file descriptor that the data in buf will be read. It * also contains the read buffer. * * flags is of type int and can be a combination of * PI_FLUSH_INPUT and PI_FLUSH_OUTPUT * * Returns: 0 * ***********************************************************************/ static int u_flush(pi_socket_t *ps, int flags) { char buf[256]; int fl; struct pi_usb_data *data = (struct pi_usb_data *) ps->device->data; if (flags & PI_FLUSH_INPUT) { /* clear internal buffer */ data->buf_size = 0; /* flush pending data */ if ((fl = fcntl(ps->sd, F_GETFL, 0)) != -1) { fcntl(ps->sd, F_SETFL, fl | O_NONBLOCK); while (read(ps->sd, buf, sizeof(buf)) > 0) ; fcntl(ps->sd, F_SETFL, fl); } } return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/address.c0000644000175000017500000001707510552545407020671 0ustar rousseaurousseau/* * $Id: address.c,v 1.30 2006/11/22 22:52:25 adridg Exp $ * * address.c: Translate Pilot address book data formats * (c) 1996, Kenneth Albanowski * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include "pi-macros.h" #include "pi-address.h" #define hi(x) (((x) >> 4) & 0x0f) #define lo(x) ((x) & 0x0f) #define pair(x,y) (((x) << 4) | (y)) /*********************************************************************** * * Function: free_Address * * Summary: Free the members of an address structure * * Parameters: Address_t* * * Returns: void * ***********************************************************************/ void free_Address(Address_t *addr) { int i; for (i = 0; i < 19; i++) if (addr->entry[i]) { free(addr->entry[i]); addr->entry[i] = NULL; } } /*********************************************************************** * * Function: unpack_Address * * Summary: Fill in the address structure based on the raw record * data * * Parameters: Address_t*, pi_buffer_t *buf * * Returns: -1 on error, 0 on success * ***********************************************************************/ int unpack_Address(Address_t *addr, const pi_buffer_t *buf, addressType type) { unsigned long contents, v; size_t ofs; if (type != address_v1) /* Don't support anything else yet */ return -1; if (buf == NULL || buf->data == NULL || buf->used < 9) return -1; /* get_byte(buffer); gapfill */ addr->showPhone = hi(get_byte(buf->data + 1)); addr->phoneLabel[4] = lo(get_byte(buf->data + 1)); addr->phoneLabel[3] = hi(get_byte(buf->data + 2)); addr->phoneLabel[2] = lo(get_byte(buf->data + 2)); addr->phoneLabel[1] = hi(get_byte(buf->data + 3)); addr->phoneLabel[0] = lo(get_byte(buf->data + 3)); contents = get_long(buf->data + 4); /* get_byte(buf->data+8) offset */ ofs = 9; /* if(flag & 0x1) { addr->lastname = strdup((buf->data + ofs); ofs += strlen((buf->data + ofs)) + 1; } else { addr->lastname = 0; } */ for (v = 0; v < 19; v++) { if (contents & (1 << v)) { if ((buf->used - ofs) < 1) return 0; addr->entry[v] = strdup((char *) (buf->data + ofs)); ofs += strlen(addr->entry[v]) + 1; } else { addr->entry[v] = 0; } } return 0; } /*********************************************************************** * * Function: pack_Address * * Summary: Fill in the raw address record data based on the * address structure * * Parameters: Address_t*, pi_buffer_t *buf of record, record type * * Returns: -1 on error, 0 on success. * ***********************************************************************/ int pack_Address(const Address_t *addr, pi_buffer_t *buf, addressType type) { unsigned int l, destlen = 9; unsigned char *buffer; unsigned long contents, v, phoneflag; unsigned char offset; if (addr == NULL || buf == NULL) return -1; if (type != address_v1) /* Don't support anything else yet */ return -1; for (v = 0; v < 19; v++) if (addr->entry[v] && strlen(addr->entry[v])) destlen += strlen(addr->entry[v]) + 1; pi_buffer_expect (buf, destlen); buf->used = destlen; buffer = buf->data + 9; phoneflag = 0; contents = 0; offset = 0; for (v = 0; v < 19; v++) { if (addr->entry[v] && strlen(addr->entry[v])) { if (v == entryCompany) offset = (unsigned char) (buffer - buf->data) - 8; contents |= (1 << v); l = strlen(addr->entry[v]) + 1; memcpy(buffer, addr->entry[v], l); buffer += l; } } phoneflag = ((unsigned long) addr->phoneLabel[0]) << 0; phoneflag |= ((unsigned long) addr->phoneLabel[1]) << 4; phoneflag |= ((unsigned long) addr->phoneLabel[2]) << 8; phoneflag |= ((unsigned long) addr->phoneLabel[3]) << 12; phoneflag |= ((unsigned long) addr->phoneLabel[4]) << 16; phoneflag |= ((unsigned long) addr->showPhone) << 20; set_long(buf->data, phoneflag); set_long(buf->data + 4, contents); set_byte(buf->data + 8, offset); return 0; } /*********************************************************************** * * Function: unpack_AddressAppInfo * * Summary: Fill in the app info structure based on the raw app * info data * * Parameters: AddressAppInfo_t*, char * to record, record length * * Returns: The necessary length of the buffer if record is NULL, * or 0 on error, the length of the data used from the * buffer otherwise * ***********************************************************************/ int unpack_AddressAppInfo(AddressAppInfo_t *ai, const unsigned char *record, size_t len) { size_t i, destlen = 4 + 16 * 22 + 2 + 2; unsigned char *start = record; unsigned long r; ai->type = address_v1; i = unpack_CategoryAppInfo(&ai->category, record, len); if (!record) return i + destlen; if (!i) return i; record += i; len -= i; if (len < destlen) return 0; r = get_long(record); for (i = 0; i < 22; i++) ai->labelRenamed[i] = !!(r & (1 << i)); record += 4; memcpy(ai->labels, record, 16 * 22); record += 16 * 22; ai->country = get_short(record); record += 2; ai->sortByCompany = get_byte(record); record += 2; for (i = 3; i < 8; i++) strcpy(ai->phoneLabels[i - 3], ai->labels[i]); for (i = 19; i < 22; i++) strcpy(ai->phoneLabels[i - 19 + 5], ai->labels[i]); return (record - start); } /*********************************************************************** * * Function: pack_AddressAppInfo * * Summary: Fill in the raw app info record data based on the app * info structure * * Parameters: AddressAppInfo_t*, char * to record, record length * * Returns: The length of the buffer required if record is NULL, * or 0 on error, the length of the data used from the * buffer otherwise * ***********************************************************************/ int pack_AddressAppInfo(const AddressAppInfo_t *ai, unsigned char *record, size_t len) { int i; size_t destlen = 4 + 16 * 22 + 2 + 2; unsigned char *pos = record; unsigned long r; i = pack_CategoryAppInfo(&ai->category, record, len); if (!record) return destlen + i; if (!i) return i; pos += i; len -= i; for (i = 3; i < 8; i++) strcpy(ai->phoneLabels[i - 3], ai->labels[i]); for (i = 19; i < 22; i++) strcpy(ai->phoneLabels[i - 19 + 5], ai->labels[i]); memset(pos, 0, destlen); r = 0; for (i = 0; i < 22; i++) if (ai->labelRenamed[i]) r |= (1 << i); set_long(pos, r); pos += 4; memcpy(pos, ai->labels, 16 * 22); pos += 16 * 22; set_short(pos, ai->country); pos += 2; set_byte(pos, ai->sortByCompany); pos += 2; for (i = 3; i < 8; i++) strcpy(ai->phoneLabels[i - 3], ai->labels[i]); for (i = 19; i < 22; i++) strcpy(ai->phoneLabels[i - 19 + 5], ai->labels[i]); return (pos - record); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/threadsafe.c0000644000175000017500000000323110513447543021336 0ustar rousseaurousseau/* * $Id: threadsafe.c,v 1.5 2006/10/12 14:21:23 desrod Exp $ * * threadsafe.c: utilities for thread-safe behavior * * Copyright (c) 2005, Florent Pillet. * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ #include "pi-threadsafe.h" int pi_mutex_lock(pi_mutex_t *mutex) { #if HAVE_PTHREAD return pthread_mutex_lock(mutex); #else return 0; #endif } int pi_mutex_trylock(pi_mutex_t *mutex) { #if HAVE_PTHREAD return pthread_mutex_trylock(mutex); #else return 0; #endif } int pi_mutex_unlock(pi_mutex_t *mutex) { #if HAVE_PTHREAD return pthread_mutex_unlock(mutex); #else return 0; #endif } unsigned long pi_thread_id() { #if HAVE_PTHREAD return (unsigned long)pthread_self(); #else return 0; #endif } #include "pi-threadsafe.h" /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/socket.c0000644000175000017500000011273510552545410020525 0ustar rousseaurousseau/* * $Id: socket.c,v 1.118 2006/11/07 21:13:24 adridg Exp $ * * socket.c: Berkeley sockets style interface to Pilot * * Copyright (c) 1996, D. Jeff Dionne. * Copyright (c) 1997-1999, Kenneth Albanowski * Copyright (c) 1999, Tilo Christ * Copyright (c) 2000-2001, JP Rosevear * Copyright (c) 2004-2005, Florent Pillet * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include "pi-source.h" #include "pi-serial.h" #ifdef HAVE_USB #include "pi-usb.h" #endif #include "pi-bluetooth.h" #include "pi-inet.h" #include "pi-slp.h" #include "pi-sys.h" #include "pi-padp.h" #include "pi-cmp.h" #include "pi-net.h" #include "pi-dlp.h" #include "pi-syspkt.h" #include "pi-debug.h" #include "pi-error.h" #include "pi-threadsafe.h" /* Declare function prototypes */ static pi_socket_list_t *ps_list_append (pi_socket_list_t *list, pi_socket_t *ps); static pi_socket_t *ps_list_find (pi_socket_list_t *list, int pi_sd); static pi_socket_list_t *ps_list_remove (pi_socket_list_t *list, int pi_sd); static pi_socket_list_t *ps_list_copy (pi_socket_list_t *list); static void ps_list_free (pi_socket_list_t *list); static void protocol_queue_add (pi_socket_t *ps, pi_protocol_t *prot); static void protocol_cmd_queue_add (pi_socket_t *ps, pi_protocol_t *prot); static pi_protocol_t *protocol_queue_find (pi_socket_t *ps, int level); static pi_protocol_t *protocol_queue_find_next (pi_socket_t *ps, int level); int pi_socket_init(pi_socket_t *ps); static int is_connected (pi_socket_t *ps); static int is_listener (pi_socket_t *ps); /* GLOBALS */ static PI_MUTEX_DEFINE(psl_mutex); static pi_socket_list_t *psl = NULL; static PI_MUTEX_DEFINE(watch_list_mutex); static pi_socket_list_t *watch_list = NULL; /* Automated tickling interval */ static unsigned int interval = 0; /* Indicates that the exit function has already been installed. Made non-static * so that library users can choose to not have an exit function installed */ int pi_sock_installedexit = 0; /* Linked List Code */ /*********************************************************************** * * Function: ps_list_dump * * Summary: internal debugging function * * Parameters: pi_socket_list_t * * * Returns: void * ***********************************************************************/ #if 0 static void ps_list_dump (pi_socket_list_t *list) { fprintf(stderr, "* Dumping pi_socket_list @ %p:\n",(void*)list); while (list != NULL) { fprintf(stderr," %p: ps=%p, pi_sd=%d\n", (void*)list, (void*)list->ps, list->ps->sd); list = list->next; } } #endif /*********************************************************************** * * Function: ps_list_append * * Summary: creates and appends a new pi_socket_list element to * the (possibly empty) pi_socket_list and fills in the * pi_socket_t* member to point to the given pi_socket. * * Parameters: pi_socket_list_t*, pi_socket_t* * * Returns: pi_socket_list_t*, or NULL if operation failed * ***********************************************************************/ static pi_socket_list_t * ps_list_append (pi_socket_list_t *list, pi_socket_t *ps) { pi_socket_list_t *elem, *new_elem; ASSERT (ps != NULL); new_elem = (pi_socket_list_t *) malloc (sizeof(pi_socket_list_t)); if (new_elem == NULL) return list; new_elem->ps = ps; new_elem->next = NULL; if (list == NULL) return new_elem; elem = list; while (elem->next != NULL) elem = elem->next; elem->next = new_elem; return list; } /*********************************************************************** * * Function: ps_list_find * * Summary: traverse a (possibly empty) pi_socket_list and find * the first list element whose pi_socket_t* member points * to a pi_socket matching the given socket descriptor * * Parameters: pi_socket_list_t *, socket descriptor * * Returns: pi_socket_t *, or NULL if no match * * NOTE: ps_list_find returns a pointer which points directly to * the socket (pi_socket_t *) whereas ps_find_elem returns a * pointer to the list element (pi_socket_list_t *) which * _contains_ a pointer to the socket * ***********************************************************************/ static pi_socket_t * ps_list_find (pi_socket_list_t *list, int pi_sd) { pi_socket_list_t *elem; for (elem = list; elem != NULL; elem = elem->next) if (elem->ps != NULL && elem->ps->sd == pi_sd) return elem->ps; return NULL; } /*********************************************************************** * * Function: ps_list_remove * * Summary: remove first pi_socket_list element pointing to a pi_socket * member matching socket descriptor * * Parameters: pi_socket_list_t *, socket descriptor * * Returns: the (possibly NULL) head pi_socket_list_t * * * NOTE: only the pi_socket_list element is freed, * _not_ the pi_socket. Consequently, this function * makes the (risky) assumption that the pi_socket will * be freed elsewhere. * ***********************************************************************/ static pi_socket_list_t * ps_list_remove (pi_socket_list_t *list, int pi_sd) { pi_socket_list_t *elem, *new_list = list, *prev_elem = NULL; for (elem = list; elem != NULL; elem = elem->next) { if (elem->ps == NULL) continue; else if (elem->ps->sd == pi_sd) { if (prev_elem == NULL) new_list = elem->next; else prev_elem->next = elem->next; free(elem); break; } prev_elem = elem; } return new_list; } /*********************************************************************** * * Function: ps_list_copy * * Summary: copy pi_socket_list * * Parameters: pi_socket_list_t * * * Returns: pi_socket_list_t* (new list head) * * NOTE: pi_list_copy does _not_ copy the pi_socket member, it * copies only the list elements * ***********************************************************************/ static pi_socket_list_t * ps_list_copy (pi_socket_list_t *list) { pi_socket_list_t *l, *new_list = NULL; for (l = list; l != NULL; l = l->next) new_list = ps_list_append (new_list, l->ps); return new_list; } /*********************************************************************** * * Function: ps_list_free * * Summary: free pi_socket_list elements * * Parameters: pi_socket_list_t * * * Returns: void * * NOTE: only the pi_socket_list elements are freed, * _not_ the pi_sockets. Consequently, this function * makes the (risky) assumption that the pi_sockets will * be freed elsewhere. * ***********************************************************************/ static void ps_list_free (pi_socket_list_t *list) { pi_socket_list_t *l, *next; if (list == NULL) return; l = list; do { next = l->next; free(l); l = next; } while (l != NULL); } /* Protocol Queue */ /*********************************************************************** * * Function: protocol_queue_add * * Summary: adds protocol queue to pi_socket * * Parameters: pi_socket_t*, pi_protocol_t* * * Returns: void * ***********************************************************************/ static void protocol_queue_add (pi_socket_t *ps, pi_protocol_t *prot) { ps->protocol_queue = realloc(ps->protocol_queue, (sizeof(pi_protocol_t *)) * (ps->queue_len + 1)); if (ps->protocol_queue != NULL) { ps->protocol_queue[ps->queue_len] = prot; ps->queue_len++; } else { errno = ENOMEM; ps->queue_len = 0; } } /*********************************************************************** * * Function: cmd_queue_add * * Summary: adds command queue to pi_socket * * Parameters: pi_socket_t*, pi_protocol* * * Returns: void * ***********************************************************************/ static void protocol_cmd_queue_add (pi_socket_t *ps, pi_protocol_t *prot) { ps->cmd_queue = realloc(ps->cmd_queue, (sizeof(pi_protocol_t *)) * (ps->cmd_len + 1)); if (ps->cmd_queue != NULL) { ps->cmd_queue[ps->cmd_len] = prot; ps->cmd_len++; } else { errno = ENOMEM; ps->cmd_len = 0; } } /*********************************************************************** * * Function: protocol_queue_find * * Summary: find queue entry * * Parameters: pi_socket_t*, level * * Returns: pi_protocol*, or NULL if queue entry not found * ***********************************************************************/ static pi_protocol_t* protocol_queue_find (pi_socket_t *ps, int level) { int i; if (ps->command) { for (i = 0; i < ps->cmd_len; i++) { if (ps->cmd_queue[i]->level == level) return ps->cmd_queue[i]; } } else { for (i = 0; i < ps->queue_len; i++) { if (ps->protocol_queue[i]->level == level) return ps->protocol_queue[i]; } } return NULL; } /*********************************************************************** * * Function: protocol_queue_find_next * * Summary: find next queue entry * * Parameters: pi_socket*, level * * Returns: pi_protocol_t* or NULL if next queue entry not found * ***********************************************************************/ static pi_protocol_t* protocol_queue_find_next (pi_socket_t *ps, int level) { int i; if (ps->command && ps->cmd_len == 0) return NULL; if (!ps->command && ps->queue_len == 0) return NULL; if (ps->command && level == 0) return ps->cmd_queue[0]; if (!ps->command && level == 0) return ps->protocol_queue[0]; if (ps->command) { for (i = 0; i < ps->cmd_len - 1; i++) { if (ps->cmd_queue[i]->level == level) return ps->cmd_queue[i + 1]; } } else { for (i = 0; i < ps->queue_len - 1; i++) { if (ps->protocol_queue[i]->level == level) return ps->protocol_queue[i + 1]; } } return NULL; } /*********************************************************************** * * Function: protocol_queue_build * * Summary: build protocol queue * * Parameters: pi_socket_t*, autodetect * * Returns: void * ***********************************************************************/ static void protocol_queue_build (pi_socket_t *ps, int autodetect) { int protocol, result; pi_protocol_t *dev_prot, *dev_cmd_prot; LOG((PI_DBG_SOCK,PI_DBG_LVL_DEBUG, "SOCK fd=%d auto=%d\n",ps->sd,autodetect)); /* The device protocol */ dev_prot = ps->device->protocol (ps->device); dev_cmd_prot = ps->device->protocol (ps->device); /* When opening the device in RAW mode, we stay low-level */ if (ps->type == PI_SOCK_RAW) { LOG((PI_DBG_SOCK,PI_DBG_LVL_DEBUG, "RAW mode, no protocol\n",ps->sd,autodetect)); protocol_queue_add (ps, dev_prot); protocol_cmd_queue_add (ps, dev_cmd_prot); return; } protocol = ps->protocol; LOG((PI_DBG_SOCK,PI_DBG_LVL_DEBUG, "SOCK proto=%s (%d)\n", protocol == PI_PF_DEV ? "DEV" : protocol == PI_PF_SLP ? "SLP" : protocol == PI_PF_SYS ? "SYS" : protocol == PI_PF_PADP? "PADP" : protocol == PI_PF_NET ? "NET" : protocol == PI_PF_DLP ? "DLP" : "unknown", protocol)); if (protocol == PI_PF_DLP && autodetect) { int skipped_bytes = 0, bytes_to_skip; pi_buffer_t *detect_buf = pi_buffer_new(64); for (;;) { /* try to peek a header start from the input sent by the device */ result = dev_prot->read (ps, detect_buf, 10, PI_MSG_PEEK); if (result < 0) break; if (result != 10) { pi_buffer_clear(detect_buf); continue; } bytes_to_skip = 1; /* detect a valid PADP header packet */ if (detect_buf->data[0] == PI_SLP_SIG_BYTE1 && detect_buf->data[1] == PI_SLP_SIG_BYTE2 && detect_buf->data[2] == PI_SLP_SIG_BYTE3) { /* compute the checksum */ int i; unsigned char header_checksum; for (header_checksum = i = 0; i < 9; i++) header_checksum += detect_buf->data[i]; if (header_checksum == detect_buf->data[9]) { /* sum */ if (detect_buf->data[3] == PI_SLP_SOCK_DLP && /* src */ detect_buf->data[4] == PI_SLP_SOCK_DLP && /* dest */ detect_buf->data[5] == PI_SLP_TYPE_PADP && /* type */ detect_buf->data[8] == 0xff) /* txid */ { protocol = PI_PF_PADP; LOG((PI_DBG_SOCK, PI_DBG_LVL_INFO, "\nusing PADP/SLP protocol (skipped %d bytes)\n", skipped_bytes)); break; } else { /* valid but not what we're looking for, skip it altogether */ bytes_to_skip = 10; } } else { /* skip the SLP SIG bytes */ bytes_to_skip = 3; } } /* detect NET header packets */ else if (detect_buf->data[0] == 0x01 && /* NET packet */ detect_buf->data[2] == 0x00 && /* length byte 0 */ detect_buf->data[3] == 0x00 && /* length byte 1 */ detect_buf->data[4] == 0x00 && /* length byte 2 */ detect_buf->data[5] > 0 && /* length byte 3 */ detect_buf->data[6] == 0x90) /* PI_NET_SIG_BYTE1 */ { protocol = PI_PF_NET; LOG((PI_DBG_SOCK, PI_DBG_LVL_INFO, "\nusing NET protocol (skipped %d bytes)\n", skipped_bytes)); break; } /* detect NET packet for cases where we lost the first 6 bytes * (this unfortunately happens on Linux with unixserial, and the * correct way to cope with this is to recognize the second * part of the NET handshake packet) */ else if (detect_buf->data[0] == 0x90 && /* PI_NET_SIG_BYTE1 */ detect_buf->data[1] == 0x01 && detect_buf->data[2] == 0x00 && detect_buf->data[3] == 0x00 && detect_buf->data[4] == 0x00 && detect_buf->data[5] == 0x00 && detect_buf->data[6] == 0x00 && detect_buf->data[7] == 0x00 && detect_buf->data[8] == 0x00 && detect_buf->data[9] == 0x20) { protocol = PI_PF_NET; LOG((PI_DBG_SOCK, PI_DBG_LVL_INFO, "\nusing NET protocol (skipped %d bytes)\n", skipped_bytes)); break; } /* eliminate one byte from the input, trying to frame a proper header */ result = dev_prot->read (ps, detect_buf, bytes_to_skip, 0); if (result < 0) break; skipped_bytes += bytes_to_skip; pi_buffer_clear(detect_buf); } pi_buffer_free(detect_buf); if (result < 0) { /* if there was an error (i.e. disconnect), temporarily fallback * on PADP protocol. In further releases, we should really make * this function return an error if there was a problem. -- fpillet */ LOG((PI_DBG_SOCK, PI_DBG_LVL_DEBUG, "Error: last read returned %d; switching to PADP by default\n", result)); protocol = PI_PF_PADP; } } else if (protocol == PI_PF_DLP) { protocol = PI_PF_PADP; } /* The connected protocol queue */ switch (protocol) { case PI_PF_PADP: protocol_queue_add (ps, padp_protocol ()); case PI_PF_SLP: protocol_queue_add (ps, slp_protocol ()); break; case PI_PF_NET: protocol_queue_add (ps, net_protocol ()); break; case PI_PF_SYS: protocol_queue_add (ps, sys_protocol ()); protocol_queue_add (ps, slp_protocol ()); break; } /* The command protocol queue */ switch (protocol) { case PI_PF_PADP: case PI_PF_SLP: protocol_cmd_queue_add (ps, cmp_protocol ()); protocol_cmd_queue_add (ps, padp_protocol ()); protocol_cmd_queue_add (ps, slp_protocol ()); ps->cmd = PI_CMD_CMP; break; case PI_PF_NET: protocol_cmd_queue_add (ps, net_protocol ()); ps->cmd = PI_CMD_NET; break; case PI_PF_SYS: ps->cmd = PI_CMD_SYS; break; default: LOG((PI_DBG_SOCK, PI_DBG_LVL_ERR, "invalid protocol (%d)", protocol)); break; } protocol_queue_add (ps, dev_prot); protocol_cmd_queue_add (ps, dev_cmd_prot); } /*********************************************************************** * * Function: protocol_queue_destroy * * Summary: destroy protocol queue * * Parameters: pi_socket_t * * * Returns: void * ***********************************************************************/ static void protocol_queue_destroy (pi_socket_t *ps) { int i; for (i = 0; i < ps->queue_len; i++) ps->protocol_queue[i]->free(ps->protocol_queue[i]); for (i = 0; i < ps->cmd_len; i++) ps->cmd_queue[i]->free(ps->cmd_queue[i]); if (ps->queue_len > 0) free(ps->protocol_queue); if (ps->cmd_len > 0) free(ps->cmd_queue); } /*********************************************************************** * * Function: pi_protocol * * Summary: destroy protocol queue * * Parameters: socket descriptor, level * * Returns: pi_protocol_t* * ***********************************************************************/ pi_protocol_t * pi_protocol (int pi_sd, int level) { pi_socket_t *ps; if (!(ps = find_pi_socket(pi_sd))) { errno = ESRCH; return NULL; } return protocol_queue_find(ps, level); } pi_protocol_t * pi_protocol_next (int pi_sd, int level) { pi_socket_t *ps; if (!(ps = find_pi_socket(pi_sd))) { errno = ESRCH; return NULL; } return protocol_queue_find_next(ps, level); } /* Environment Code */ /*********************************************************************** * * Function: env_check * * Summary: configures Pilot-Link debug environment * * Parameters: void * * Returns: void * ***********************************************************************/ static void env_dbgcheck (void) { if (getenv("PILOT_DEBUG")) { int types = 0, done; char *debug, *b, *e; debug = strdup(getenv("PILOT_DEBUG")); b = debug; done = 0; while (!done) { e = strchr(b, ' '); if (e) *e = '\0'; else done = 1; if (!strcmp(b, "SYS")) types |= PI_DBG_SYS; else if (!strcmp(b, "DEV")) types |= PI_DBG_DEV; else if (!strcmp(b, "SLP")) types |= PI_DBG_SLP; else if (!strcmp(b, "PADP")) types |= PI_DBG_PADP; else if (!strcmp(b, "DLP")) types |= PI_DBG_DLP; else if (!strcmp(b, "NET")) types |= PI_DBG_NET; else if (!strcmp(b, "CMP")) types |= PI_DBG_CMP; else if (!strcmp(b, "SOCK")) types |= PI_DBG_SOCK; else if (!strcmp(b, "API")) types |= PI_DBG_API; else if (!strcmp(b, "USER")) types |= PI_DBG_USER; else if (!strcmp(b, "ALL")) types |= PI_DBG_ALL; e++; b = e; } pi_debug_set_types(types); free(debug); } /* PILOT Debug Level */ if (getenv("PILOT_DEBUG_LEVEL")) { int level = 0; const char *debug; debug = getenv("PILOT_DEBUG_LEVEL"); if (!strcmp(debug, "NONE")) level |= PI_DBG_LVL_NONE; else if (!strcmp(debug, "ERR")) level |= PI_DBG_LVL_ERR; else if (!strcmp(debug, "WARN")) level |= PI_DBG_LVL_WARN; else if (!strcmp(debug, "INFO")) level |= PI_DBG_LVL_INFO; else if (!strcmp(debug, "DEBUG")) level |= PI_DBG_LVL_DEBUG; pi_debug_set_level (level); } /* log file name */ if (getenv("PILOT_LOG") && atoi(getenv("PILOT_LOG"))) { const char *logfile; logfile = getenv("PILOT_LOGFILE"); if (logfile == NULL) pi_debug_set_file("pilot-link.debug"); else pi_debug_set_file(logfile); } } /* Util functions */ /*********************************************************************** * * Function: is_connected * * Summary: interrogate socket connection state * * Parameters: pi_socket* * * Returns: 1 if socket is connected, 0 otherwise * ***********************************************************************/ static int is_connected (pi_socket_t *ps) { return (ps->state == PI_SOCK_CONN_INIT || ps->state == PI_SOCK_CONN_ACCEPT) ? 1 : 0; } /*********************************************************************** * * Function: is_listener * * Summary: interrogate socket listener state * * Parameters: pi_socket* * * Returns: 1 if socket is listener, 0 otherwise * ***********************************************************************/ static int is_listener (pi_socket_t *ps) { return (ps->state == PI_SOCK_LISTEN) ? 1 : 0; } /* Alarm Handling Code */ static RETSIGTYPE onalarm(int signo) { pi_socket_list_t *l; signal(signo, onalarm); pi_mutex_lock(&watch_list_mutex); for (l = watch_list; l != NULL; l = l->next) { pi_socket_t *ps = l->ps; if (!is_connected(ps)) continue; if (pi_tickle(ps->sd) < 0) { LOG((PI_DBG_SOCK, PI_DBG_LVL_INFO, "SOCKET Socket %d is busy during tickle\n", ps->sd)); alarm(1); } else { LOG((PI_DBG_SOCK, PI_DBG_LVL_INFO, "SOCKET Tickling socket %d\n", ps->sd)); alarm(interval); } } pi_mutex_unlock(&watch_list_mutex); } /* Exit Handling Code */ /*********************************************************************** * * Function: onexit * * Summary: this function closes and destroys all pi_sockets and * frees the global pi_socket_list * * Parameters: void * * Returns: void * ***********************************************************************/ static void onexit(void) { pi_socket_list_t *l, *list; pi_mutex_lock(&psl_mutex); list = ps_list_copy (psl); pi_mutex_unlock(&psl_mutex); for (l = list; l != NULL; l = l->next) pi_close(l->ps->sd); ps_list_free (list); } /*********************************************************************** * * Function: installexit * * Summary: install exit function using atexit() * * Parameters: void * * Returns: void * ***********************************************************************/ static void installexit(void) { if (!pi_sock_installedexit) { atexit(onexit); pi_sock_installedexit = 1; } } int pi_socket(int domain, int type, int protocol) { pi_socket_t *ps; pi_socket_list_t *list; env_dbgcheck (); if (protocol == 0) { if (type == PI_SOCK_STREAM) protocol = PI_PF_DLP; else if (type == PI_SOCK_RAW) protocol = PI_PF_DEV; } ps = calloc(1, sizeof(pi_socket_t)); if (ps == NULL) { errno = ENOMEM; return -1; } /* Create unique socket descriptor */ if ((ps->sd = open(NULL_DEVICE, O_RDWR)) == -1) { int err = errno; /* Save errno of open */ free(ps); errno = err; return -1; } /* Initialize the rest of the fields (calloc zeroes out all the fields we don't touch) */ ps->type = type; ps->protocol = protocol; ps->state = PI_SOCK_CLOSE; ps->honor_rx_to = 1; ps->command = 1; /* post the new socket to the list */ list = pi_socket_recognize(ps); if (list == NULL) { close (ps->sd); free(ps); errno = ENOMEM; return -1; } installexit(); return ps->sd; } int pi_socket_setsd(pi_socket_t *ps, int pi_sd) { #ifdef HAVE_DUP2 ps->sd = dup2(pi_sd, ps->sd); #else close(ps->sd); #ifdef F_DUPFD ps->sd = fcntl(pi_sd, F_DUPFD, ps->sd); #else ps->sd = dup(pi_sd); #endif #endif if (ps->sd == -1) return pi_set_error(ps->sd, PI_ERR_GENERIC_SYSTEM); if (ps->sd != pi_sd) close(pi_sd); return 0; } /*********************************************************************** * * Function: pi_socket_init * * Summary: inits the pi_socket * * Parameters: pi_socket_t* * * Returns: 0 * ***********************************************************************/ int pi_socket_init(pi_socket_t *ps) { protocol_queue_build (ps, 1); return 0; } /*********************************************************************** * * Function: pi_socket_recognize * * Summary: appends the pi_socket to global list * * Parameters: pi_socket* * * Returns: pi_socket_list_t * * ***********************************************************************/ pi_socket_list_t * pi_socket_recognize(pi_socket_t *ps) { pi_mutex_lock(&psl_mutex); psl = ps_list_append(psl, ps); pi_mutex_unlock(&psl_mutex); return psl; } /*********************************************************************** * * Function: pi_devsocket (static) * * Summary: Looks up a socket and creates a new device * FIXME: Decide whether or not to create the socket here * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static pi_socket_t * pi_devsocket(int pi_sd, const char *port, struct pi_sockaddr *addr) { pi_socket_t *ps; if (!(ps = find_pi_socket(pi_sd))) { errno = ESRCH; return NULL; } if (port == NULL && (port = getenv("PILOTPORT")) == NULL) { errno = ENXIO; return NULL; } /* Create the device and sockaddr */ addr->pi_family = PI_AF_PILOT; if (!strncmp (port, "serial:", 7)) { strncpy(addr->pi_device, port + 7, sizeof(addr->pi_device)); ps->device = pi_serial_device (PI_SERIAL_DEV); #ifdef HAVE_USB } else if (!strncmp (port, "usb:", 4)) { strncpy(addr->pi_device, port + 4, sizeof(addr->pi_device)); ps->device = pi_usb_device (PI_USB_DEV); #endif } else if (!strncmp (port, "net:", 4)) { strncpy(addr->pi_device, port + 4, sizeof(addr->pi_device)); ps->device = pi_inet_device (PI_NET_DEV); #ifdef HAVE_BLUEZ } else if (!strncmp (port, "bluetooth:", 10) || !strncmp (port, "bt:", 3)) { strncpy(addr->pi_device, strchr(port, ':') + 1, sizeof(addr->pi_device)); ps->device = pi_bluetooth_device (PI_BLUETOOTH_DEV); #endif } else { /* No prefix assumed to be serial: (for compatibility) */ strncpy(addr->pi_device, port, sizeof(addr->pi_device)); ps->device = pi_serial_device (PI_SERIAL_DEV); } return ps; } int pi_connect(int pi_sd, const char *port) { pi_socket_t *ps; struct pi_sockaddr addr; int result; ps = pi_devsocket(pi_sd, port, &addr); if (!ps) return PI_ERR_SOCK_INVALID; /* Build the protocol queue */ protocol_queue_build (ps, 0); result = ps->device->connect (ps, (struct sockaddr *)&addr, sizeof(addr)); if (result < 0) pi_close(pi_sd); return result; } int pi_bind(int pi_sd, const char *port) { int bind_return; pi_socket_t *ps; struct pi_sockaddr addr; ps = pi_devsocket(pi_sd, port, &addr); if (!ps) return PI_ERR_SOCK_INVALID; bind_return = ps->device->bind (ps, (struct sockaddr *)&addr, sizeof(addr)); if (bind_return < 0) { ps->device->free (ps->device); ps->device = NULL; } return bind_return; } int pi_listen(int pi_sd, int backlog) { pi_socket_t *ps; if (!(ps = find_pi_socket(pi_sd))) { errno = ESRCH; return PI_ERR_SOCK_INVALID; } return ps->device->listen (ps, backlog); } int pi_accept(int pi_sd, struct sockaddr *addr, size_t *addrlen) { return pi_accept_to(pi_sd, addr, addrlen, 0); } int pi_accept_to(int pi_sd, struct sockaddr *addr, size_t *addrlen, int timeout) { pi_socket_t *ps; int result; if (!(ps = find_pi_socket(pi_sd))) { errno = ESRCH; return PI_ERR_SOCK_INVALID; } if (!is_listener (ps)) return PI_ERR_SOCK_LISTENER; ps->accept_to = timeout; result = ps->device->accept(ps, addr, addrlen); if (result < 0) { LOG((PI_DBG_SOCK, PI_DBG_LVL_DEBUG, "pi_accept_to: ps->device->accept returned %d, calling pi_close()\n", result)); pi_close(pi_sd); } return result; } int pi_getsockopt(int pi_sd, int level, int option_name, void *option_value, size_t *option_len) { pi_socket_t *ps; pi_protocol_t *prot; if (!(ps = find_pi_socket(pi_sd))) { errno = ESRCH; return PI_ERR_SOCK_INVALID; } /* handle getsockopt at socket level */ if (level == PI_LEVEL_SOCK) { switch (option_name) { case PI_SOCK_STATE: if (*option_len != sizeof (ps->state)) goto argerr; memcpy (option_value, &ps->state, sizeof (ps->state)); break; case PI_SOCK_HONOR_RX_TIMEOUT: if (*option_len != sizeof (ps->honor_rx_to)) goto argerr; memcpy (option_value, &ps->honor_rx_to, sizeof (ps->honor_rx_to)); break; default: goto argerr; } return 0; } /* find the protocol at the requested level and forward it the getsockopt request */ prot = protocol_queue_find (ps, level); if (prot == NULL || prot->level != level) { errno = EINVAL; return pi_set_error(pi_sd, PI_ERR_SOCK_INVALID); } return prot->getsockopt (ps, level, option_name, option_value, option_len); argerr: errno = EINVAL; return pi_set_error(pi_sd, PI_ERR_GENERIC_ARGUMENT); } int pi_setsockopt(int pi_sd, int level, int option_name, const void *option_value, size_t *option_len) { pi_socket_t *ps; pi_protocol_t *prot; if (!(ps = find_pi_socket(pi_sd))) { errno = ESRCH; return PI_ERR_SOCK_INVALID; } /* handle setsockopt at socket level */ if (level == PI_LEVEL_SOCK) { switch (option_name) { case PI_SOCK_STATE: if (*option_len != sizeof (ps->state)) goto argerr; memcpy (&ps->state, option_value, sizeof (ps->state)); break; case PI_SOCK_HONOR_RX_TIMEOUT: if (*option_len != sizeof (ps->honor_rx_to)) goto argerr; memcpy (&ps->honor_rx_to, option_value, sizeof (ps->honor_rx_to)); break; default: goto argerr; } return 0; } /* find the protocol at the requested level and forward it the setsockopt request */ prot = protocol_queue_find (ps, level); if (prot == NULL || prot->level != level) { errno = EINVAL; return PI_ERR_SOCK_INVALID; } return prot->setsockopt (ps, level, option_name, option_value, option_len); argerr: errno = EINVAL; return pi_set_error(pi_sd, PI_ERR_GENERIC_ARGUMENT); } /*********************************************************************** * * Function: pi_send * * Summary: Send message on a connected socket * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int pi_send(int pi_sd, const void *msg, size_t len, int flags) { pi_socket_t *ps; if (!(ps = find_pi_socket(pi_sd))) { errno = ESRCH; return PI_ERR_SOCK_INVALID; } if (!is_connected (ps)) return PI_ERR_SOCK_DISCONNECTED; if (interval) alarm(interval); return ps->protocol_queue[0]->write (ps, (void *)msg, len, flags); } /*********************************************************************** * * Function: pi_recv * * Summary: Receive msg on a connected socket * * Parameters: None * * Returns: Nothing * ***********************************************************************/ ssize_t pi_recv(int pi_sd, pi_buffer_t *msg, size_t len, int flags) { pi_socket_t *ps; if (!(ps = find_pi_socket(pi_sd))) { errno = ESRCH; return PI_ERR_SOCK_INVALID; } if (!is_connected (ps)) return PI_ERR_SOCK_DISCONNECTED; return ps->protocol_queue[0]->read (ps, msg, len, flags); } /*********************************************************************** * * Function: pi_read * * Summary: Wrapper for receive * * Parameters: None * * Returns: Nothing * ***********************************************************************/ ssize_t pi_read(int pi_sd, pi_buffer_t *msg, size_t len) { return pi_recv(pi_sd, msg, len, 0); } /*********************************************************************** * * Function: pi_write * * Summary: Wrapper for send * * Parameters: None * * Returns: Nothing * ***********************************************************************/ ssize_t pi_write(int pi_sd, const void *msg, size_t len) { return pi_send(pi_sd, msg, len, 0); } void pi_flush(int pi_sd, int flags) { pi_socket_t *ps; if (!(ps = find_pi_socket(pi_sd))) { errno = ESRCH; return; } if (!is_connected (ps)) return; ps->protocol_queue[0]->flush (ps, flags); } int pi_tickle(int pi_sd) { int result=0, type, oldtype; size_t len = 0, size; unsigned char msg[1]; pi_socket_t *ps; if (!(ps = find_pi_socket(pi_sd))) { errno = ESRCH; return PI_ERR_SOCK_INVALID; } if (!is_connected (ps)) return PI_ERR_SOCK_DISCONNECTED; LOG((PI_DBG_SOCK, PI_DBG_LVL_INFO, "SOCKET Tickling socket %d\n", pi_sd)); switch (ps->cmd) { case PI_CMD_CMP: /* save previous packet type */ size = sizeof(type); pi_getsockopt(ps->sd, PI_LEVEL_PADP, PI_PADP_TYPE, &oldtype, &size); /* set packet type to "tickle" */ type = padTickle; size = sizeof(type); pi_setsockopt(ps->sd, PI_LEVEL_PADP, PI_PADP_TYPE, &type, &size); /* send packet */ result = ps->protocol_queue[0]->write (ps, msg, len, 0); /* restore previous packet type */ size = sizeof(type); pi_setsockopt(ps->sd, PI_LEVEL_PADP, PI_PADP_TYPE, &oldtype, &size); break; case PI_CMD_NET: /* Enter command state */ ps->command = 1; /* Set the type to "tickle" */ type = PI_NET_TYPE_TCKL; size = sizeof(type); pi_setsockopt(ps->sd, PI_LEVEL_NET, PI_NET_TYPE, &type, &size); /* send packet */ result = ps->cmd_queue[0]->write (ps, msg, len, 0); /* Exit command state */ ps->command = 0; break; } return result; } int pi_close(int pi_sd) { int result = 0; pi_socket_t *ps; if (!(ps = find_pi_socket(pi_sd))) { errno = ESRCH; return PI_ERR_SOCK_INVALID; } if (ps->type == PI_SOCK_STREAM && ps->cmd != PI_CMD_SYS) { if (is_connected (ps)) { ps->command = 1; /* then end sync, with clean status */ result = dlp_EndOfSync(ps->sd, 0); ps->command = 0; } } if (result == 0) { /* we need to remove the entry from the list prior to * closing it, because closing it will reset the pi_sd */ pi_mutex_lock(&psl_mutex); psl = ps_list_remove (psl, pi_sd); pi_mutex_unlock(&psl_mutex); pi_mutex_lock(&watch_list_mutex); watch_list = ps_list_remove (watch_list, pi_sd); pi_mutex_unlock(&watch_list_mutex); if (ps->device != NULL) result = ps->device->close (ps); protocol_queue_destroy(ps); if (ps->device != NULL) ps->device->free(ps->device); if (ps->sd > 0) close(ps->sd); free(ps); } return result; } /*********************************************************************** * * Function: pi_getsockname * * Summary: Get the local address for a socket * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int pi_getsockname(int pi_sd, struct sockaddr *addr, size_t *namelen) { pi_socket_t *ps; if (!(ps = find_pi_socket(pi_sd))) { errno = ESRCH; return PI_ERR_SOCK_INVALID; } if (*namelen > ps->laddrlen) *namelen = ps->laddrlen; memcpy(addr, &ps->laddr, *namelen); return 0; } /*********************************************************************** * * Function: pi_getsockpeer * * Summary: Get the remote address for a socket * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int pi_getsockpeer(int pi_sd, struct sockaddr *addr, size_t *namelen) { pi_socket_t *ps; if (!(ps = find_pi_socket(pi_sd))) { errno = ESRCH; return PI_ERR_SOCK_INVALID; } if (*namelen > ps->raddrlen) *namelen = ps->raddrlen; memcpy(addr, &ps->raddr, *namelen); return 0; } int pi_version(int pi_sd) { size_t size; pi_socket_t *ps; if (!(ps = find_pi_socket(pi_sd))) { errno = ESRCH; return PI_ERR_SOCK_INVALID; } if (ps->dlpversion) return ps->dlpversion; if (ps->cmd == PI_CMD_CMP) { /* Enter command state */ ps->command = 1; /* Get the version */ size = sizeof(ps->dlpversion); pi_getsockopt(ps->sd, PI_LEVEL_CMP, PI_CMP_VERS, &ps->dlpversion, &size); ps->maxrecsize = DLP_BUF_SIZE; /* Exit command state */ ps->command = 0; } return ps->dlpversion; } unsigned long pi_maxrecsize(int pi_sd) { pi_socket_t *ps; if (!(ps = find_pi_socket(pi_sd))) { errno = ESRCH; return 0; } /* pi_version will read necessary info from device */ if (pi_version(pi_sd) == 0) return DLP_BUF_SIZE; return ps->maxrecsize; } /*********************************************************************** * * Function: find_pi_socket * * Summary: Thread-safe wrapper for ps_list_find * * Parameters: None * * Returns: Nothing * ***********************************************************************/ pi_socket_t * find_pi_socket(int pi_sd) { pi_socket_t *result; pi_mutex_lock(&psl_mutex); result = ps_list_find (psl, pi_sd); pi_mutex_unlock(&psl_mutex); return result; } int pi_watchdog(int pi_sd, int newinterval) { pi_socket_t *ps; if (!(ps = find_pi_socket(pi_sd))) { errno = ESRCH; return PI_ERR_SOCK_INVALID; } pi_mutex_lock(&watch_list_mutex); watch_list = ps_list_append (watch_list, ps); pi_mutex_unlock(&watch_list_mutex); signal(SIGALRM, onalarm); interval = newinterval; alarm(interval); return 0; } int pi_error(int pi_sd) { pi_socket_t *ps; if ((ps = find_pi_socket(pi_sd)) == NULL) { errno = ESRCH; return PI_ERR_SOCK_INVALID; } return ps->last_error; } int pi_set_error(int pi_sd, int error_code) { pi_socket_t *ps; if ((ps = find_pi_socket(pi_sd))) ps->last_error = error_code; else errno = ESRCH; /* also update errno if makes sense */ if (error_code == PI_ERR_GENERIC_MEMORY) errno = ENOMEM; return error_code; } int pi_palmos_error(int pi_sd) { pi_socket_t *ps; if ((ps = find_pi_socket(pi_sd)) == NULL) { errno = ESRCH; return PI_ERR_SOCK_INVALID; } return ps->palmos_error; } int pi_set_palmos_error(int pi_sd, int error_code) { pi_socket_t *ps; if ((ps = find_pi_socket(pi_sd))) ps->palmos_error = error_code; else errno = ESRCH; return error_code; } void pi_reset_errors(int pi_sd) { pi_socket_t *ps; if ((ps = find_pi_socket(pi_sd))) { ps->last_error = 0; ps->palmos_error = 0; } else errno = ESRCH; } int pi_socket_connected(int pi_sd) { pi_socket_t *ps; if ((ps = find_pi_socket(pi_sd))) return is_connected(ps); errno = ESRCH; return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/appinfo.c0000644000175000017500000000600210552545407020664 0ustar rousseaurousseau/* * $Id: appinfo.c,v 1.19 2006/11/22 22:52:25 adridg Exp $ * * appinfo.c: Translate Pilot category info * * Copyright (c) 1996, 1997, Kenneth Albanowski * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include "pi-macros.h" #include "pi-appinfo.h" /*********************************************************************** * * Function: unpack_CategoryAppInfo * * Summary: Unpack the AppInfo block from record into the structure * * Parameters: CategoryAppInfo_t*, char* to record, record length * * Returns: Nothing * ***********************************************************************/ int unpack_CategoryAppInfo(CategoryAppInfo_t *ai, const unsigned char *record, size_t len) { int i, rec; if (len < 2 + 16 * 16 + 16 + 4) return 0; rec = get_short(record); for (i = 0; i < 16; i++) { if (rec & (1 << i)) ai->renamed[i] = 1; else ai->renamed[i] = 0; } record += 2; for (i = 0; i < 16; i++) { memcpy(ai->name[i], record, 16); record += 16; } memcpy(ai->ID, record, 16); record += 16; ai->lastUniqueID = get_byte(record); record += 4; return 2 + 16 * 16 + 16 + 4; } /*********************************************************************** * * Function: pack_CategoryAppInfo * * Summary: Pack the AppInfo structure * * Parameters: CategoryAppInfo_t*, char* to record, record length * * Returns: Nothing * ***********************************************************************/ int pack_CategoryAppInfo(const CategoryAppInfo_t *ai, unsigned char *record, size_t len) { int i, rec; unsigned char *start = record; if (!record) { return 2 + 16 * 16 + 16 + 4; } if (len < (2 + 16 * 16 + 16 + 4)) return 0; /* not enough room */ rec = 0; for (i = 0; i < 16; i++) { if (ai->renamed[i]) rec |= (1 << i); } set_short(record, rec); record += 2; for (i = 0; i < 16; i++) { memcpy(record, ai->name[i], 16); record += 16; } memcpy(record, ai->ID, 16); record += 16; set_byte(record, ai->lastUniqueID); record++; set_byte(record, 0); /* gapfill */ set_short(record + 1, 0); /* gapfill */ record += 3; return (record - start); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/bluetooth.c0000644000175000017500000005216211007144502021230 0ustar rousseaurousseau/* * bluetooth.c: Interface layer to bluetooth HotSync connections * using the Bluez stack (http://www.bluez.org/) * * Copyright (c) 1996, 1997, D. Jeff Dionne & Kenneth Albanowski * Copyright (c) 1999, Tilo Christ * Copyright (c) 2005, Florent Pillet * Copyright (c) 2004, Paul Evans * Copyright (c) 2005, Bastien Nocera * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include /* Needed for Redhat 6.x machines */ #include #include #include #include #include #include #include "pi-debug.h" #include "pi-source.h" #include "pi-socket.h" #include "pi-bluetooth.h" #include "pi-cmp.h" #include "pi-net.h" #include "pi-error.h" #include "pi-serial.h" #include "pi-util.h" #ifdef OS2 #include #endif /* Declare prototypes */ static int pi_bluetooth_open(struct pi_socket *ps, struct pi_sockaddr *addr, int addrlen); static int pi_bluetooth_connect(pi_socket_t *ps, struct sockaddr *addr, size_t addrlen); static int pi_bluetooth_bind(pi_socket_t *ps, struct sockaddr *addr, size_t addrlen); static int pi_bluetooth_listen(pi_socket_t *ps, int backlog); static int pi_bluetooth_accept(pi_socket_t *ps, struct sockaddr *addr, size_t *addrlen); static int pi_bluetooth_getsockopt(pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len); static int pi_bluetooth_setsockopt(pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len); static int pi_bluetooth_close(pi_socket_t *ps); static int pi_bluetooth_flush(pi_socket_t *ps, int flags); static ssize_t pi_bluetooth_write(struct pi_socket *ps, const unsigned char *buf, size_t len, int flags); static ssize_t pi_bluetooth_read(struct pi_socket *ps, pi_buffer_t *buf, size_t len, int flags); extern int pi_socket_init(pi_socket_t *ps); /* SDP Helper functions */ /* * Copyright (C) 2004 Edd Dumbill * Copyright (C) 2005 Bastien Nocera * Mostly borrowed from BlueZ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky * Copyright (C) 2002-2005 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * Copyright (C) 2002-2003 Jean Tourrilhes * */ #include #include typedef struct { char *name; char *provider; char *desc; unsigned int class; unsigned int profile; unsigned int channel; } svc_info_t; #define HOTSYNC_CHANNEL 22 static unsigned char hotsync_uuid[] = { 0xD8, 0x0C, 0xF9, 0xEA, 0x13, 0x4C, 0x11, 0xD5, 0x83, 0xCE, 0x00, 0x30, 0x65, 0x7C, 0x54, 0x3C }; static int add_hotsync(sdp_session_t *session, sdp_record_t *rec, bdaddr_t *interface, svc_info_t *si, uint32_t *handle, int *channel_ret) { sdp_record_t record; sdp_list_t *root, *svclass, *proto; uuid_t root_uuid, svclass_uuid, l2cap_uuid, rfcomm_uuid; uint8_t channel = HOTSYNC_CHANNEL; memset(&record, 0, sizeof(record)); record.handle = 0xffffffff; sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP); root = sdp_list_append(NULL, &root_uuid); sdp_set_browse_groups(&record, root); sdp_uuid16_create(&l2cap_uuid, L2CAP_UUID); proto = sdp_list_append(NULL, sdp_list_append(NULL, &l2cap_uuid)); sdp_uuid16_create(&rfcomm_uuid, RFCOMM_UUID); proto = sdp_list_append(proto, sdp_list_append( sdp_list_append(NULL, &rfcomm_uuid), sdp_data_alloc(SDP_UINT8, &channel))); sdp_set_access_protos(&record, sdp_list_append(NULL, proto)); sdp_uuid128_create(&svclass_uuid, (void *) hotsync_uuid); svclass = sdp_list_append(NULL, &svclass_uuid); sdp_set_service_classes(&record, svclass); sdp_set_info_attr(&record, "PalmOS HotSync", NULL, NULL); if (sdp_device_record_register(session, interface, &record, 0) < 0) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "bluetooth: service record registration failed\n")); return -1; } *handle = record.handle; *channel_ret = HOTSYNC_CHANNEL; return 0; } static int register_sdp (uint32_t *handle, int *channel, sdp_session_t **sess) { svc_info_t si; bdaddr_t interface; bacpy (&interface, BDADDR_ANY); *sess = sdp_connect (&interface, BDADDR_LOCAL, 0); if (*sess == NULL) return -1; memset (&si, 0, sizeof(si)); si.name = "HOTSYNC"; return add_hotsync (*sess, 0, &interface, &si, handle, channel); } static int deregister_sdp(uint32_t handle, sdp_session_t *sess) { uint32_t range = 0x0000ffff; sdp_list_t *attr; sdp_record_t *rec; bdaddr_t interface; if (!sess) return 0; bacpy(&interface, BDADDR_ANY); attr = sdp_list_append(0, &range); rec = sdp_service_attr_req(sess, handle, SDP_ATTR_REQ_RANGE, attr); sdp_list_free(attr, 0); if (!rec) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "bluetooth: service record not found\n")); sdp_close(sess); return -1; } if (sdp_record_unregister(sess, rec)) { LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "bluetooth: failed to unregister service record: %s\n", strerror(errno))); sdp_close(sess); return -1; } LOG((PI_DBG_DEV, PI_DBG_LVL_INFO, "bluetooth: service record deleted\n")); sdp_close(sess); return 0; } /* Protocol Functions */ /*********************************************************************** * * Function: pi_bluetooth_protocol_dup * * Summary: clones an existing pi_protocol struct * * Parameters: pi_protocol* * * Returns: pi_protocol_t* or NULL if operation failed * ***********************************************************************/ static pi_protocol_t* pi_bluetooth_protocol_dup (pi_protocol_t *prot) { pi_protocol_t *new_prot; ASSERT (prot != NULL); new_prot = (pi_protocol_t *) malloc(sizeof (pi_protocol_t)); if (new_prot != NULL) { new_prot->level = prot->level; new_prot->dup = prot->dup; new_prot->free = prot->free; new_prot->read = prot->read; new_prot->write = prot->write; new_prot->flush = prot->flush; new_prot->getsockopt = prot->getsockopt; new_prot->setsockopt = prot->setsockopt; new_prot->data = NULL; } return new_prot; } /*********************************************************************** * * Function: pi_bluetooth_protocol_free * * Summary: frees an existing pi_protocol struct * * Parameters: pi_protocol* * * Returns: void * ***********************************************************************/ static void pi_bluetooth_protocol_free (pi_protocol_t *prot) { ASSERT (prot != NULL); if (prot != NULL) free(prot); } /*********************************************************************** * * Function: pi_bluetooth_protocol * * Summary: creates and inits pi_protocol struct instance * * Parameters: pi_device_t* * * Returns: pi_protocol_t* or NULL if operation failed * ***********************************************************************/ static pi_protocol_t* pi_bluetooth_protocol (pi_device_t *dev) { pi_protocol_t *prot; struct pi_bluetooth_data *data; ASSERT (dev != NULL); prot = (pi_protocol_t *) malloc(sizeof (pi_protocol_t)); data = (struct pi_bluetooth_data *)(dev->data); if (prot != NULL) { prot->level = PI_LEVEL_DEV; prot->dup = pi_bluetooth_protocol_dup; prot->free = pi_bluetooth_protocol_free; prot->read = pi_bluetooth_read; prot->write = pi_bluetooth_write; prot->flush = pi_bluetooth_flush; prot->getsockopt = pi_bluetooth_getsockopt; prot->setsockopt = pi_bluetooth_setsockopt; prot->data = NULL; } return prot; } /* Device Functions */ /*********************************************************************** * * Function: pi_bluetooth_register_hotsync_sdp * * Summary: Gets on which channel the HOTSYNC service is, and * registers it if necessary * * Parameters: None * * Returns: Nothing * **********************************************************************/ static void pi_bluetooth_register_hotsync_sdp (struct pi_bluetooth_data *data) { if (register_sdp (&data->handle, &data->channel, &data->sess) < 0) { data->channel = -1; data->handle = 0; data->sess = NULL; } } /*********************************************************************** * * Function: pi_bluetooth_unregister_hotsync_sdp * * Summary: Removes the HOTSYNC service * * Parameters: None * * Returns: Nothing * **********************************************************************/ static void pi_bluetooth_unregister_hotsync_sdp (struct pi_bluetooth_data *data) { if (data->handle != 0) deregister_sdp (data->handle, data->sess); } /*********************************************************************** * * Function: pi_bluetooth_device_free * * Summary: frees an existing pi_device struct * * Parameters: pi_device_t* * * Returns: void * ***********************************************************************/ static void pi_bluetooth_device_free (pi_device_t *dev) { struct pi_bluetooth_data *data; ASSERT (dev != NULL); if (dev->data) { data = dev->data; pi_bluetooth_unregister_hotsync_sdp (data); if (data->device) free (data->device); free(dev->data); } free(dev); } /*********************************************************************** * * Function: pi_bluetooth_open * * Summary: Open a new BlueTooth RFCOMM socket * * Parameters: None * * Returns: A negative number on error, 0 otherwise * **********************************************************************/ static int pi_bluetooth_open(struct pi_socket *ps, struct pi_sockaddr *addr, int addrlen) { int fd, flags; struct pi_bluetooth_data *data = ps->device->data; pi_bluetooth_register_hotsync_sdp (data); /* If we didn't manage to create an SDP record, force channel 22 and try * again */ if (data->channel < 0) { fprintf (stderr, "didn't manage to get a channel\n"); data->channel = 22; } if ((fd = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)) < 0) return -1; if ((flags = fcntl(fd, F_GETFL, 0)) != -1) { flags &= ~O_NONBLOCK; fcntl(fd, F_SETFL, flags); } if (pi_socket_setsd(ps, fd) < 0) return -1; return 0; } /*********************************************************************** * * Function: pi_bluetooth_device * * Summary: creates and inits pi_device struct instance * * Parameters: device type * * Returns: pi_device_t* or NULL if operation failed * ***********************************************************************/ pi_device_t* pi_bluetooth_device (int type) { pi_device_t *dev; struct pi_bluetooth_data *data; dev = (pi_device_t *) malloc(sizeof (pi_device_t)); if (dev == NULL) return NULL; data = (struct pi_bluetooth_data *) malloc(sizeof (struct pi_bluetooth_data)); if (data == NULL) { free(dev); return NULL; } dev->free = pi_bluetooth_device_free; dev->protocol = pi_bluetooth_protocol; dev->bind = pi_bluetooth_bind; dev->listen = pi_bluetooth_listen; dev->accept = pi_bluetooth_accept; dev->connect = pi_bluetooth_connect; dev->close = pi_bluetooth_close; data->timeout = 0; dev->data = data; return dev; } /*********************************************************************** * * Function: pi_bluetooth_connect * * Summary: Connect socket to a given address * * Parameters: pi_socket*, sockaddr*, size_t * * Returns: A negative number on error, 0 otherwise * ***********************************************************************/ static int pi_bluetooth_connect(pi_socket_t *ps, struct sockaddr *addr, size_t addrlen) { ps->raddr = malloc(addrlen); memcpy(ps->raddr, addr, addrlen); ps->raddrlen = addrlen; ps->laddr = malloc(addrlen); memcpy(ps->laddr, addr, addrlen); ps->laddrlen = addrlen; if (( ps->type == PI_SOCK_STREAM && ps->cmd == PI_CMD_CMP) && cmp_tx_handshake(ps) < 0) { pi_close(ps->sd); return -1; } ps->state = PI_SOCK_CONN_INIT; ps->command = 0; return 0; } /*********************************************************************** * * Function: pi_bluetooth_bind * * Summary: Bind address to a local socket * * Parameters: pi_socket*, sockaddr*, size_t * * Returns: A negative number on error, 0 otherwise * ***********************************************************************/ static int pi_bluetooth_bind(pi_socket_t *ps, struct sockaddr *addr, size_t addrlen) { struct pi_sockaddr *pa = (struct pi_sockaddr *) addr; struct pi_bluetooth_data *data = (struct pi_bluetooth_data *)ps->device->data; char *device = pa->pi_device; struct sockaddr_rc bindaddr; if (pi_bluetooth_open(ps, pa, addrlen) == -1) return -1; /* errno already set */ data->device = strdup (device); bindaddr.rc_family = AF_BLUETOOTH; bacpy(&bindaddr.rc_bdaddr, BDADDR_ANY); bindaddr.rc_channel = data->channel; if (bind(ps->sd, (struct sockaddr *)&bindaddr, sizeof(bindaddr)) < 0) { pi_set_error(ps->sd, PI_ERR_GENERIC_SYSTEM); return -1; } ps->laddr = malloc(addrlen); memcpy(ps->laddr, addr, addrlen); ps->laddrlen = addrlen; return 0; } /*********************************************************************** * * Function: pi_bluetooth_listen * * Summary: Prepare for incoming connections * * Parameters: pi_socket*, backlog * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int pi_bluetooth_listen(pi_socket_t *ps, int backlog) { // FIXME: no result is actually being taken into account listen(ps->sd, 10); ps->state = PI_SOCK_LISTEN; return 0; } /*********************************************************************** * * Function: pi_bluetooth_accept_rfcomm * * Summary: Accept an incoming connection and associate it with an * RFCOMM serial device * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int pi_bluetooth_accept_rfcomm(struct pi_socket *ps, const char *device, struct sockaddr_rc *peeraddr, unsigned int *peeraddrlen) { int rfcommfd; rfcommfd = accept(ps->sd, (struct sockaddr *)peeraddr, peeraddrlen); if (rfcommfd < 0) { pi_set_error(ps->sd, PI_ERR_GENERIC_SYSTEM); return -1; } /* Check whether we need to really accept this connection */ if (device[0] != '\0' && strcmp (device, "any") != 0) { bdaddr_t tmp; if (str2ba (device, &tmp) < 0) { close (rfcommfd); return -1; } if (bacmp (&tmp, &(peeraddr->rc_bdaddr)) != 0) { close (rfcommfd); return -1; } } return rfcommfd; } /*********************************************************************** * * Function: pi_bluetooth_accept * * Summary: Accept an incoming connection * * Parameters: pi_socket*, sockaddr* * * Returns: Nothing * ***********************************************************************/ static int pi_bluetooth_accept(pi_socket_t *ps, struct sockaddr *addr, size_t *addrlen) { struct pi_bluetooth_data *data = (struct pi_bluetooth_data *)ps->device->data; struct sockaddr_rc peeraddr; unsigned int peeraddrlen = sizeof(peeraddr); int sd; /* Wait for data */ sd = pi_bluetooth_accept_rfcomm(ps, data->device, &peeraddr, &peeraddrlen); if (sd < 0) { pi_set_error(ps->sd, PI_ERR_GENERIC_SYSTEM); return -1; } if (pi_socket_setsd(ps, sd) < 0) return -1; pi_socket_init(ps); if (ps->type == PI_SOCK_STREAM) { switch (ps->cmd) { case PI_CMD_CMP: if (cmp_rx_handshake(ps, 0, 0) < 0) return -1; break; case PI_CMD_NET: if (net_rx_handshake(ps) < 0) return -1; break; } ps->dlprecord = 0; } data->timeout = 0; ps->command = 0; ps->state = PI_SOCK_CONN_ACCEPT; return ps->sd; } static int pi_bluetooth_flush(pi_socket_t *ps, int flags) { char buf[256]; int fl; if (flags & PI_FLUSH_INPUT) { if ((fl = fcntl(ps->sd, F_GETFL, 0)) != -1) { fcntl(ps->sd, F_SETFL, fl | O_NONBLOCK); while (read(ps->sd, buf, sizeof(buf)) > 0) ; fcntl(ps->sd, F_SETFL, fl); } } return 0; } static ssize_t pi_bluetooth_read(struct pi_socket *ps, pi_buffer_t *buf, size_t len, int flags) { int rbuf; struct pi_bluetooth_data *data = (struct pi_bluetooth_data *)ps->device->data; struct timeval t; fd_set ready; if (pi_buffer_expect (buf, len) == NULL) return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); FD_ZERO(&ready); FD_SET(ps->sd, &ready); /* If timeout == 0, wait forever for packet, otherwise wait till timeout milliseconds */ if (data->timeout == 0) select(ps->sd + 1, &ready, 0, 0, 0); else { t.tv_sec = data->timeout / 1000; t.tv_usec = (data->timeout % 1000) * 1000; select(ps->sd + 1, &ready, 0, 0, &t); } /* If data is available in time, read it */ if (FD_ISSET(ps->sd, &ready)) { if (flags == PI_MSG_PEEK && len > 256) len = 256; rbuf = read(ps->sd, buf->data + buf->used, len); } else { LOG((PI_DBG_DEV, PI_DBG_LVL_WARN, "DEV RX BlueTooth timeout\n")); pi_set_error(ps->sd, PI_ERR_SOCK_TIMEOUT); return -1; } buf->used += rbuf; LOG((PI_DBG_DEV, PI_DBG_LVL_INFO, "DEV RX bluetooth %d bytes\n", rbuf)); return rbuf; } static ssize_t pi_bluetooth_write(struct pi_socket *ps, const unsigned char *buf, size_t len, int flags) { int total, nwrote; struct pi_bluetooth_data *data = (struct pi_bluetooth_data *)ps->device->data; struct timeval t; fd_set ready; FD_ZERO(&ready); FD_SET(ps->sd, &ready); total = len; while (total > 0) { if (data->timeout == 0) select(ps->sd + 1, 0, &ready, 0, 0); else { t.tv_sec = data->timeout / 1000; t.tv_usec = (data->timeout % 1000) * 1000; select(ps->sd + 1, 0, &ready, 0, &t); } if (!FD_ISSET(ps->sd, &ready)) { pi_set_error(ps->sd, PI_ERR_SOCK_IO); return -1; } nwrote = write(ps->sd, buf, len); if (nwrote < 0) { pi_set_error(ps->sd, PI_ERR_SOCK_IO); return -1; } total -= nwrote; } LOG((PI_DBG_DEV, PI_DBG_LVL_INFO, "DEV TX bluetooth %d bytes\n", len)); return len; } /*********************************************************************** * * Function: pi_bluetooth_getsockopt * * Summary: get options on socket * * Parameters: pi_socket*, level, option name, option value, option length * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int pi_bluetooth_getsockopt(pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len) { struct pi_bluetooth_data *data = (struct pi_bluetooth_data *)ps->device->data; if (option_name == PI_DEV_TIMEOUT) { if (*option_len < sizeof (data->timeout)) { pi_set_error(ps->sd, PI_ERR_GENERIC_ARGUMENT); return -1; } memcpy (option_value, &data->timeout, sizeof (data->timeout)); *option_len = sizeof (data->timeout); } return 0; } /*********************************************************************** * * Function: pi_bluetooth_setsockopt * * Summary: set options on socket * * Parameters: pi_socket*, level, option name, option value, option length * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int pi_bluetooth_setsockopt(pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len) { struct pi_bluetooth_data *data = (struct pi_bluetooth_data *)ps->device->data; if (option_name == PI_DEV_TIMEOUT) { if (*option_len != sizeof (data->timeout)) { pi_set_error(ps->sd, PI_ERR_GENERIC_ARGUMENT); return -1; } memcpy (&data->timeout, option_value, sizeof (data->timeout)); } return 0; } /*********************************************************************** * * Function: pi_bluetooth_close * * Summary: Close a connection, destroy the socket * * Parameters: pi_socket* * * Returns: always 0 for success * ***********************************************************************/ static int pi_bluetooth_close(pi_socket_t *ps) { if (ps->laddr) { free(ps->laddr); ps->laddr = NULL; } if (ps->raddr) { free(ps->raddr); ps->raddr = NULL; } return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/expense.c0000644000175000017500000002520110552545410020673 0ustar rousseaurousseau/* * $Id: expense.c,v 1.29 2006/11/07 21:13:24 adridg Exp $ * * expense.c: Translate Pilot expense tracker data formats * * Copyright (c) 1997, Kenneth Albanowski * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #include "pi-macros.h" #include "pi-expense.h" char *ExpenseSortNames[] = { "Date", "Type", NULL }; char *ExpenseDistanceNames[] = { "Miles", "Kilometers", NULL }; char *ExpensePaymentNames[] = { "AmEx", "Cash", "Check", "CreditCard", "MasterCard", "Prepaid", "VISA", "Unfiled" }; char *ExpenseTypeNames[] = { "Airfare", "Breakfast", "Bus", "Business Meals", "Car Rental", "Dinner", "Entertainment", "Fax", "Gas", "Gifts", "Hotel", "Incidentals", "Laundry", "Limo", "Lodging", "Lunch", "Mileage", "Other", "Parking", "Postage", "Snack", "Subway", "Supplies", "Taxi", "Telephone", "Tips", "Tolls", "Train" }; /*********************************************************************** * * Function: free_Expense * * Summary: frees members of the Expense structure * * Parameters: Expense_t* * * Returns: void * ***********************************************************************/ void free_Expense(Expense_t *expense) { if (expense->note != NULL) { free(expense->note); expense->note = NULL; } if (expense->amount != NULL) { free(expense->amount); expense->amount = NULL; } if (expense->city != NULL) { free(expense->city); expense->city = NULL; } if (expense->vendor != NULL) { free(expense->vendor); expense->vendor = NULL; } if (expense->attendees != NULL) { free(expense->attendees); expense->attendees = NULL; } } /*********************************************************************** * * Function: unpack_Expense * * Summary: unpack Expense records * * Parameters: Expense_t*, char* to buffer, length of buffer * * Returns: effective buffer length * ***********************************************************************/ int unpack_Expense(Expense_t *expense, unsigned char *buffer, int len) { unsigned long d; unsigned char *start = buffer; if (len < 6) return 0; d = (unsigned short int) get_short(buffer); expense->date.tm_year = (d >> 9) + 4; expense->date.tm_mon = ((d >> 5) & 15) - 1; expense->date.tm_mday = d & 31; expense->date.tm_hour = 0; expense->date.tm_min = 0; expense->date.tm_sec = 0; expense->date.tm_isdst = -1; mktime(&expense->date); expense->type = (enum ExpenseType) get_byte(buffer + 2); expense->payment = (enum ExpensePayment) get_byte(buffer + 3); expense->currency = get_byte(buffer + 4); buffer += 6; len -= 6; if (len < 1) return 0; if (*buffer) { expense->amount = strdup((char *)buffer); buffer += strlen(expense->amount); len -= strlen(expense->amount); } else { expense->amount = 0; } buffer++; len--; if (len < 1) return 0; if (*buffer) { expense->vendor = strdup((char *)buffer); buffer += strlen(expense->vendor); len -= strlen(expense->vendor); } else { expense->vendor = 0; } buffer++; len--; if (len < 1) return 0; if (*buffer) { expense->city = strdup((char *)buffer); buffer += strlen(expense->city); len -= strlen(expense->city); } else { expense->city = 0; } buffer++; len--; if (len < 1) return 0; if (*buffer) { expense->attendees = strdup((char *)buffer); buffer += strlen(expense->attendees); len -= strlen(expense->attendees); } else { expense->attendees = 0; } buffer++; len--; if (len < 1) return 0; if (*buffer) { expense->note = strdup((char *)buffer); buffer += strlen(expense->note); len -= strlen(expense->note); } else { expense->note = 0; } buffer++; len--; return (buffer - start); } /*********************************************************************** * * Function: pack_Expense * * Summary: pack Expense records * * Parameters: Expense_t*, char* to buffer, buffer length * * Returns: effective buffer length * ***********************************************************************/ int pack_Expense(Expense_t *expense, unsigned char *record, int len) { int destlen = 6 + 1 + 1 + 1 + 1 + 1; unsigned char *buf = record; if (expense->amount) destlen += strlen(expense->amount); if (expense->vendor) destlen += strlen(expense->vendor); if (expense->city) destlen += strlen(expense->city); if (expense->attendees) destlen += strlen(expense->attendees); if (expense->note) destlen += strlen(expense->note); if (!record) return destlen; if (len < destlen) return 0; set_short(buf, ((expense->date.tm_year - 4) << 9) | ((expense->date.tm_mon + 1) << 5) | expense->date. tm_mday); buf += 2; set_byte(buf, expense->type); set_byte(buf + 1, expense->payment); set_byte(buf + 2, expense->currency); set_byte(buf + 3, 0); /* gapfill */ buf += 4; if (expense->amount) { strcpy((char *)buf, expense->amount); buf += strlen((char *)buf); } else { set_byte(buf, 0); } buf++; if (expense->vendor) { strcpy((char *)buf, expense->vendor); buf += strlen((char *)buf); } else { set_byte(buf, 0); } buf++; if (expense->city) { strcpy((char *)buf, expense->city); buf += strlen((char *)buf); } else { set_byte(buf, 0); } buf++; if (expense->attendees) { strcpy((char *)buf, expense->attendees); buf += strlen((char *)buf); } else { set_byte(buf, 0); } buf++; if (expense->note) { strcpy((char *)buf, expense->note); buf += strlen((char *)buf); } else { set_byte(buf, 0); } buf++; return (buf - record); } /*********************************************************************** * * Function: unpack_ExpenseAppInfo * * Summary: unpacks ExpenseAppInfo record * * Parameters: ExpenseAppInfo_t*, char* to record, record length * * Returns: effective record length * ***********************************************************************/ int unpack_ExpenseAppInfo(ExpenseAppInfo_t *appinfo, unsigned char *record, size_t len) { int i; unsigned char *start = record; i = unpack_CategoryAppInfo(&appinfo->category, record, len); if (!i) return 0; record += i; len -= i; appinfo->sortOrder = (enum ExpenseSort) get_byte(record); record += 2; for (i = 0; i < 4; i++) { memcpy(appinfo->currencies[i].name, record, 16); record += 16; memcpy(appinfo->currencies[i].symbol, record, 4); record += 4; memcpy(appinfo->currencies[i].rate, record, 8); record += 8; } return (record - start); } /*********************************************************************** * * Function: pack_ExpenseAppInfo * * Summary: packs ExpenseAppInfo record * * Parameters: ExpenseAppInfo_t*, char* to record, record length * * Returns: effective record length * ***********************************************************************/ int pack_ExpenseAppInfo(ExpenseAppInfo_t *appinfo, unsigned char *record, size_t len) { int i, destlen = 2 + (16 + 4 + 8) * 4; unsigned char *start = record; i = pack_CategoryAppInfo(&appinfo->category, record, len); if (!record) return i + destlen; if (!i) return i; record += i; len -= i; if (len < destlen) return 0; set_byte(record, appinfo->sortOrder); set_byte(record + 1, 0); /* gapfill */ record += 2; for (i = 0; i < 4; i++) { memcpy(record, appinfo->currencies[i].name, 16); record += 16; memcpy(record, appinfo->currencies[i].symbol, 4); record += 4; memcpy(record, appinfo->currencies[i].rate, 8); record += 8; } return (record - start); } /*********************************************************************** * * Function: unpack_ExpensePref * * Summary: unpacks ExpensePref record * * Parameters: ExpensePref_t*, char* to record, record length * * Returns: effective record length * ***********************************************************************/ int unpack_ExpensePref(ExpensePref_t *pref, unsigned char *record, int len) { int i; unsigned char *start = record; (void) len; pref->currentCategory = get_short(record); record += 2; pref->defaultCurrency = get_short(record); record += 2; pref->attendeeFont = get_byte(record); record++; pref->showAllCategories = get_byte(record); record++; pref->showCurrency = get_byte(record); record++; pref->saveBackup = get_byte(record); record++; pref->allowQuickFill = get_byte(record); record++; pref->unitOfDistance = (enum ExpenseDistance) get_byte(record); record++; for (i = 0; i < 5; i++) { pref->currencies[i] = get_byte(record); record++; } for (i = 0; i < 2; i++) { pref->unknown[i] = get_byte(record); record++; } pref->noteFont = get_byte(record); record++; return (record - start); } /*********************************************************************** * * Function: pack_ExpensePref * * Summary: packs ExpensePref record * * Parameters: ExpensePref_t*, char* to record, record length * * Returns: Nothing * ***********************************************************************/ int pack_ExpensePref(ExpensePref_t *p, unsigned char *record, int len) { int i; unsigned char *start = record; (void) len; set_short(record, p->currentCategory); record += 2; set_short(record, p->defaultCurrency); record += 2; set_byte(record, p->attendeeFont); record++; set_byte(record, p->showAllCategories); record++; set_byte(record, p->showCurrency); record++; set_byte(record, p->saveBackup); record++; set_byte(record, p->allowQuickFill); record++; set_byte(record, p->unitOfDistance); record++; for (i = 0; i < 5; i++) { set_byte(record, p->currencies[i]); record++; } /* Unknown values */ set_byte(record, 0xff); record++; set_byte(record, 0xff); record++; set_byte(record, p->noteFont); record++; return record - start; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/debug.c0000644000175000017500000001252210513447542020320 0ustar rousseaurousseau/* * $Id: debug.c,v 1.16 2006/10/12 14:21:22 desrod Exp $ * * debug.c: Pilot-Link debug configuration and debug logging * * Copyright (c) 1996, Anonymous * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include "pi-debug.h" #include "pi-threadsafe.h" static int debug_types = PI_DBG_NONE; static int debug_level = PI_DBG_LVL_NONE; static FILE *debug_file = NULL; static PI_MUTEX_DEFINE(logfile_mutex); /*********************************************************************** * * Function: pi_debug_get_types * * Summary: fetches the current debug types configuration * * Parameters: void * * Returns: debug_types * ***********************************************************************/ int pi_debug_get_types (void) { return debug_types; } /*********************************************************************** * * Function: pi_debug_set_types * * Summary: sets the debug_types configuration * * Parameters: types * * Returns: void * ***********************************************************************/ void pi_debug_set_types (int types) { debug_types = types; } /*********************************************************************** * * Function: pi_debug_get_types * * Summary: fetches the current debug level configuration * * Parameters: void * * Returns: debug_level * ***********************************************************************/ int pi_debug_get_level (void) { return debug_level; } /*********************************************************************** * * Function: pi_debug_set_level * * Summary: sets the debug_level configuration * * Parameters: level * * Returns: void * ***********************************************************************/ void pi_debug_set_level (int level) { pi_mutex_lock(&logfile_mutex); debug_level = level; pi_mutex_unlock(&logfile_mutex); } /*********************************************************************** * * Function: pi_debug_set_file * * Summary: sets the debug log file configuration * * Parameters: char* to logfile name * * Returns: void * ***********************************************************************/ void pi_debug_set_file (const char *path) { pi_mutex_lock(&logfile_mutex); if (debug_file != NULL && debug_file != stderr) fclose (debug_file); debug_file = fopen (path, "a"); if (debug_file == NULL) debug_file = stderr; pi_mutex_unlock(&logfile_mutex); } /*********************************************************************** * * Function: pi_log * * Summary: logs a debug message * * Parameters: type, level, format, ... * * Returns: void * ***********************************************************************/ void pi_log (int type, int level, const char *format, ...) { va_list ap; if (!(debug_types & type) && type != PI_DBG_ALL) return; if (debug_level < level) return; pi_mutex_lock(&logfile_mutex); if (debug_file == NULL) debug_file = stderr; #if HAVE_PTHREAD fprintf(debug_file, "[thread 0x%08lx] ", pi_thread_id()); #endif va_start(ap, format); vfprintf(debug_file, format, ap); va_end(ap); fflush(debug_file); pi_mutex_unlock(&logfile_mutex); } void pi_dumpline(const char *buf, size_t len, unsigned int addr) { unsigned int i; int offset; char line[256]; offset = sprintf(line, " %.4x ", addr); for (i = 0; i < 16; i++) { if (i < len) offset += sprintf(line+offset, "%.2x ", 0xff & (unsigned int) buf[i]); else { strcpy(line+offset, " "); offset += 3; } } strcpy(line+offset, " "); offset += 2; for (i = 0; i < len; i++) { if (buf[i] == '%') { /* since we're going through pi_log, we need to * properly escape % characters */ line[offset++] = '%'; line[offset++] = '%'; } else if (isprint(buf[i]) && buf[i] >= 32 && buf[i] <= 126) line[offset++] = buf[i]; else line[offset++] = '.'; } strcpy(line+offset,"\n"); LOG((PI_DBG_ALL, PI_DBG_LVL_NONE, line)); } void dumpline(const char *buf, size_t len, unsigned int addr) { /* this function will be removed in 0.13. Use pi_dumpline() instead. */ pi_dumpline(buf, len, addr); } void pi_dumpdata(const char *buf, size_t len) { unsigned int i; for (i = 0; i < len; i += 16) pi_dumpline(buf + i, ((len - i) > 16) ? 16 : len - i, i); } void dumpdata(const char *buf, size_t len) { /* this function will be removed in 0.13. Use pi_dumpdata() instead */ pi_dumpdata(buf, len); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/pi-buffer.c0000644000175000017500000000535410513447542021116 0ustar rousseaurousseau/* * $Id: pi-buffer.c,v 1.10 2006/10/12 14:21:22 desrod Exp $ * * pi-buffer.c: simple data block management for variable data storage * * Copyright (c) 2004-2005, Florent Pillet. * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ #include #include #include #include "pi-buffer.h" pi_buffer_t* pi_buffer_new (size_t capacity) { pi_buffer_t* buf; buf = (struct pi_buffer_t *) malloc (sizeof (struct pi_buffer_t)); if (buf == NULL) return NULL; if (capacity <= 0) capacity = 16; /* allocating 0 byte is illegal - use a small value instead */ buf->data = (unsigned char *) malloc (capacity); if (buf->data == NULL) { free (buf); return NULL; } buf->allocated = capacity; buf->used = 0; return buf; } pi_buffer_t* pi_buffer_expect (pi_buffer_t *buf, size_t expect) { if ((buf->allocated - buf->used) >= expect) return buf; if (buf->data) buf->data = (unsigned char *) realloc (buf->data, buf->used + expect); else buf->data = (unsigned char *) malloc (expect); if (buf->data == NULL) { buf->allocated = 0; buf->used = 0; return NULL; } buf->allocated = buf->used + expect; return buf; } pi_buffer_t* pi_buffer_append (pi_buffer_t *buf, const void *data, size_t len) { if (pi_buffer_expect (buf, len) == NULL) return NULL; memcpy (buf->data + buf->used, data, len); buf->used += len; return buf; } pi_buffer_t * pi_buffer_append_buffer (pi_buffer_t *dest, const pi_buffer_t *src) { return pi_buffer_append (dest, src->data, src->used); } void pi_buffer_clear (pi_buffer_t *buf) { buf->used = 0; if (buf->allocated > (size_t)65535) { buf->data = (unsigned char *) realloc (buf->data, 65535); buf->allocated = (buf->data == NULL) ? 0 : 65535; } } void pi_buffer_free (pi_buffer_t* buf) { if (buf) { if (buf->data) free (buf->data); free (buf); } } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/slp.c0000644000175000017500000004214210515154171020024 0ustar rousseaurousseau/* * $Id: slp.c,v 1.56 2006/10/13 09:52:13 fpillet Exp $ * * slp.c: Pilot SLP protocol * * (c) 1996, D. Jeff Dionne. * Much of this code adapted from Brian J. Swetland * Additional work Copyright (c) 2005, Florent Pillet * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include "pi-debug.h" #include "pi-source.h" #include "pi-serial.h" #include "pi-slp.h" #include "pi-error.h" /* Declare function prototypes */ static int slp_flush(pi_socket_t *ps, int flags); static int slp_getsockopt(pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len); static int slp_setsockopt(pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len); /*********************************************************************** * * Function: slp_protocol_dup * * Summary: clones an existing pi_protocol struct * * Parameters: pi_protocol_t* * * Returns: pi_protocol_t* or NULL if operation failed * ***********************************************************************/ static pi_protocol_t* slp_protocol_dup (pi_protocol_t *prot) { pi_protocol_t *new_prot; struct pi_slp_data *data, *new_data; new_prot = (pi_protocol_t *)malloc (sizeof (pi_protocol_t)); new_data = (struct pi_slp_data *)malloc (sizeof (struct pi_slp_data)); if (new_prot != NULL && new_data != NULL) { new_prot->level = prot->level; new_prot->dup = prot->dup; new_prot->free = prot->free; new_prot->read = prot->read; new_prot->write = prot->write; new_prot->flush = prot->flush; new_prot->getsockopt = prot->getsockopt; new_prot->setsockopt = prot->setsockopt; data = (struct pi_slp_data *)prot->data; new_data->dest = data->dest; new_data->last_dest = data->last_dest; new_data->src = data->src; new_data->last_src = data->last_src; new_data->type = data->type; new_data->last_type = data->last_type; new_data->txid = data->txid; new_data->last_txid = data->last_txid; new_prot->data = new_data; } else if (new_prot != NULL) { free(new_prot); new_prot = NULL; } else if (new_data != NULL) { free(new_data); new_data = NULL; } return new_prot; } /*********************************************************************** * * Function: slp_protocol_free * * Summary: frees an existing pi_protocol struct * * Parameters: pi_protocol_t* * * Returns: void * ***********************************************************************/ static void slp_protocol_free (pi_protocol_t *prot) { if (prot != NULL) { if (prot->data != NULL) free(prot->data); free(prot); } } /*********************************************************************** * * Function: slp_protocol * * Summary: creates a pi_protocol struct instance * * Parameters: pi_protocol_t* * * Returns: pi_protocol_t* or NULL if operation failed * ***********************************************************************/ pi_protocol_t* slp_protocol (void) { pi_protocol_t *prot; struct pi_slp_data *data; prot = (pi_protocol_t *)malloc (sizeof (pi_protocol_t)); data = (struct pi_slp_data *)malloc (sizeof (struct pi_slp_data)); if (prot != NULL && data != NULL) { prot->level = PI_LEVEL_SLP; prot->dup = slp_protocol_dup; prot->free = slp_protocol_free; prot->read = slp_rx; prot->write = slp_tx; prot->flush = slp_flush; prot->getsockopt = slp_getsockopt; prot->setsockopt = slp_setsockopt; data->dest = PI_SLP_SOCK_DLP; data->last_dest = -1; data->src = PI_SLP_SOCK_DLP; data->last_src = -1; data->type = PI_SLP_TYPE_PADP; data->last_type = -1; data->txid = 0xfe; data->last_txid = 0xff; prot->data = data; } else if (prot != NULL) { free(prot); prot = NULL; } else if (data != NULL) { free(data); data = NULL; } return prot; } /*********************************************************************** * * Function: slp_tx * * Summary: Build and queue up an SLP packet to be transmitted * * Parameters: None * * Returns: A negative number on error, 0 otherwise * ***********************************************************************/ ssize_t slp_tx(pi_socket_t *ps, const unsigned char *buf, size_t len, int flags) { int bytes; pi_protocol_t *prot, *next; struct pi_slp_data *data; struct slp *slp; unsigned char *slp_buf; unsigned int i, n; prot = pi_protocol(ps->sd, PI_LEVEL_SLP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (struct pi_slp_data *)prot->data; next = pi_protocol_next(ps->sd, PI_LEVEL_SLP); if (next == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); slp_buf = (unsigned char *) malloc (PI_SLP_HEADER_LEN + PI_SLP_MTU + PI_SLP_FOOTER_LEN); if (slp_buf == NULL) return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); slp = (struct slp *) slp_buf; /* Header values */ slp->_be = 0xbe; slp->_ef = 0xef; slp->_ed = 0xed; slp->dest = data->dest; slp->src = data->src; slp->type = data->type; set_short(&slp->dlen, len); slp->id_ = data->txid; for (n = i = 0; i < 9; i++) n += slp_buf[i]; slp->csum = 0xff & n; /* Copy in the packet data */ memcpy (slp_buf + PI_SLP_HEADER_LEN, buf, len); /* CRC value */ set_short(&slp_buf[PI_SLP_HEADER_LEN + len], crc16(slp_buf, (int)(PI_SLP_HEADER_LEN + len))); /* Write out the data */ bytes = next->write(ps, slp_buf, PI_SLP_HEADER_LEN + len + PI_SLP_FOOTER_LEN, flags); if (bytes >= 0) { CHECK(PI_DBG_SLP, PI_DBG_LVL_INFO, slp_dump_header(slp_buf, 1)); CHECK(PI_DBG_SLP, PI_DBG_LVL_DEBUG, slp_dump(slp_buf)); } free (slp_buf); return bytes; } /* Sigh. SLP is a really broken protocol. It has no proper framing, so it makes a proper "device driver" layer impossible. There ought to be a layer below SLP that reads frames off the wire and passes them up. Instead, all we can do is have the device driver give us bytes and SLP has to keep a pile of status info while it builds frames for itself. So here's the code that does that. */ /*********************************************************************** * * Function: slp_rx * * Summary: Accept SLP packets on the wire * * Parameters: None * * Returns: packet length or negative on error * ***********************************************************************/ ssize_t slp_rx(pi_socket_t *ps, pi_buffer_t *buf, size_t len, int flags) { int i, computed_crc, received_crc, b1, b2, b3, state, expect = 0, packet_len, bytes; unsigned char header_checksum; pi_protocol_t *prot, *next; pi_buffer_t *slp_buf; struct pi_slp_data *data; LOG((PI_DBG_SLP, PI_DBG_LVL_DEBUG, "SLP RX len=%d flags=0x%04x\n", len, flags)); prot = pi_protocol(ps->sd, PI_LEVEL_SLP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (struct pi_slp_data *)prot->data; next = pi_protocol_next(ps->sd, PI_LEVEL_SLP); if (next == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); slp_buf = pi_buffer_new (PI_SLP_HEADER_LEN + PI_SLP_MTU + PI_SLP_FOOTER_LEN); if (slp_buf == NULL) { errno = ENOMEM; return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); } state = 0; packet_len = 0; for (;;) { switch (state) { case 0: expect = 3; state++; break; case 1: b1 = slp_buf->data[PI_SLP_OFFSET_SIG1]; b2 = slp_buf->data[PI_SLP_OFFSET_SIG2]; b3 = slp_buf->data[PI_SLP_OFFSET_SIG3]; if (b1 == PI_SLP_SIG_BYTE1 && b2 == PI_SLP_SIG_BYTE2 && b3 == PI_SLP_SIG_BYTE3) { state++; expect = PI_SLP_HEADER_LEN - 3; } else { slp_buf->data[PI_SLP_OFFSET_SIG1] = slp_buf->data[PI_SLP_OFFSET_SIG2]; slp_buf->data[PI_SLP_OFFSET_SIG2] = slp_buf->data[PI_SLP_OFFSET_SIG3]; expect = 1; slp_buf->used = 2; LOG((PI_DBG_SLP, PI_DBG_LVL_WARN, "SLP RX Unexpected signature" " 0x%.2x 0x%.2x 0x%.2x\n", b1, b2, b3)); } break; case 2: /* Addition check sum for header */ for (header_checksum = i = 0; i < 9; i++) header_checksum += slp_buf->data[i]; /* read in the whole SLP header. */ if (header_checksum == slp_buf->data[PI_SLP_OFFSET_SUM]) { state++; packet_len = get_short(&slp_buf->data[PI_SLP_OFFSET_SIZE]); if (packet_len > (int)len) { LOG((PI_DBG_SLP, PI_DBG_LVL_ERR, "SLP RX Packet size exceed buffer\n")); pi_buffer_free (slp_buf); return pi_set_error(ps->sd, PI_ERR_PROT_BADPACKET); } expect = packet_len; } else { LOG((PI_DBG_SLP, PI_DBG_LVL_WARN, "SLP RX Header checksum failed for header:\n")); pi_dumpdata((const char *)slp_buf->data, PI_SLP_HEADER_LEN); pi_buffer_free (slp_buf); return 0; } break; case 3: state++; expect = PI_SLP_FOOTER_LEN; break; case 4: /* that should be the whole packet. */ computed_crc = crc16(slp_buf->data, PI_SLP_HEADER_LEN + packet_len); received_crc = get_short(&slp_buf->data[PI_SLP_HEADER_LEN + packet_len]); if (get_byte(&slp_buf->data[PI_SLP_OFFSET_TYPE]) == PI_SLP_TYPE_LOOP) { /* Adjust because every tenth loopback * packet has a bogus check sum */ if (computed_crc != received_crc) computed_crc |= 0x00e0; } if (computed_crc != received_crc) { LOG((PI_DBG_SLP, PI_DBG_LVL_ERR, "SLP RX packet crc failed: " "computed=0x%.4x received=0x%.4x\n", computed_crc, received_crc)); pi_buffer_free (slp_buf); return 0; } /* Track the info so getsockopt will work */ data->last_dest = get_byte(&slp_buf->data[PI_SLP_OFFSET_DEST]); data->last_src = get_byte(&slp_buf->data[PI_SLP_OFFSET_SRC]); data->last_type = get_byte(&slp_buf->data[PI_SLP_OFFSET_TYPE]); data->last_txid = get_byte(&slp_buf->data[PI_SLP_OFFSET_TXID]); CHECK(PI_DBG_SLP, PI_DBG_LVL_INFO, slp_dump_header(slp_buf->data, 0)); CHECK(PI_DBG_SLP, PI_DBG_LVL_DEBUG, slp_dump(slp_buf->data)); if (pi_buffer_append (buf, &slp_buf->data[PI_SLP_HEADER_LEN], packet_len) == NULL) { errno = ENOMEM; return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); } pi_buffer_free (slp_buf); return packet_len; default: break; } do { bytes = next->read(ps, slp_buf, (size_t)expect, flags); if (bytes < 0) { LOG((PI_DBG_SLP, PI_DBG_LVL_ERR, "SLP RX Read Error %d\n", bytes)); pi_buffer_free (slp_buf); return bytes; } expect -= bytes; } while (expect > 0); } } /*********************************************************************** * * Function: slp_flush * * Summary: Flush input and output buffers * * Parameters: pi_socket_t*, flags * * Returns: A negative number on error, 0 otherwise * ***********************************************************************/ static int slp_flush(pi_socket_t *ps, int flags) { pi_protocol_t *prot, *next; prot = pi_protocol(ps->sd, PI_LEVEL_SLP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); next = pi_protocol_next(ps->sd, PI_LEVEL_SLP); if (next == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); return next->flush(ps, flags); } /*********************************************************************** * * Function: slp_getsockopt * * Summary: get options on socket * * Parameters: pi_socket*, level, option name, option value, option length * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int slp_getsockopt(pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len) { pi_protocol_t *prot; struct pi_slp_data *data; prot = pi_protocol(ps->sd, PI_LEVEL_SLP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (struct pi_slp_data *)prot->data; switch (option_name) { case PI_SLP_DEST: if (*option_len < sizeof (data->dest)) goto error; memcpy (option_value, &data->dest, sizeof (data->dest)); *option_len = sizeof (data->dest); break; case PI_SLP_LASTDEST: if (*option_len < sizeof (data->dest)) goto error; memcpy (option_value, &data->last_dest, sizeof (data->last_dest)); *option_len = sizeof (data->last_dest); break; case PI_SLP_SRC: if (*option_len < sizeof (data->src)) goto error; memcpy (option_value, &data->src, sizeof (data->src)); *option_len = sizeof (data->src); break; case PI_SLP_LASTSRC: if (*option_len < sizeof (data->last_src)) goto error; memcpy (option_value, &data->last_src, sizeof (data->last_src)); *option_len = sizeof (data->last_src); break; case PI_SLP_TYPE: if (*option_len < sizeof (data->type)) goto error; memcpy (option_value, &data->type, sizeof (data->type)); *option_len = sizeof (data->type); break; case PI_SLP_LASTTYPE: if (*option_len < sizeof (data->last_type)) goto error; memcpy (option_value, &data->last_type, sizeof (data->last_type)); *option_len = sizeof (data->last_type); break; case PI_SLP_TXID: if (*option_len < sizeof (data->txid)) goto error; memcpy (option_value, &data->txid, sizeof (data->txid)); *option_len = sizeof (data->txid); break; case PI_SLP_LASTTXID: if (*option_len < sizeof (data->last_txid)) goto error; memcpy (option_value, &data->last_txid, sizeof (data->last_txid)); *option_len = sizeof (data->last_txid); break; } return 0; error: errno = EINVAL; return pi_set_error(ps->sd, PI_ERR_GENERIC_ARGUMENT); } /*********************************************************************** * * Function: slp_setsockopt * * Summary: set options on socket * * Parameters: pi_socket*, level, option name, option value, option length * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int slp_setsockopt(pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len) { pi_protocol_t *prot; struct pi_slp_data *data; prot = pi_protocol(ps->sd, PI_LEVEL_SLP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (struct pi_slp_data *)prot->data; switch (option_name) { case PI_SLP_DEST: if (*option_len != sizeof (data->dest)) goto error; memcpy (&data->dest, option_value, sizeof (data->dest)); *option_len = sizeof (data->dest); break; case PI_SLP_SRC: if (*option_len != sizeof (data->src)) goto error; memcpy (&data->src, option_value, sizeof (data->src)); *option_len = sizeof (data->src); break; case PI_SLP_TYPE: if (*option_len != sizeof (data->type)) goto error; memcpy (&data->type, option_value, sizeof (data->type)); *option_len = sizeof (data->type); break; case PI_SLP_TXID: if (*option_len != sizeof (data->txid)) goto error; memcpy (&data->txid, option_value, sizeof (data->txid)); *option_len = sizeof (data->txid); break; } return 0; error: errno = EINVAL; return pi_set_error(ps->sd, PI_ERR_GENERIC_ARGUMENT); } /*********************************************************************** * * Function: slp_dump_header * * Summary: Dump the contents of the SPL frame header * * Parameters: char* to data buffer, RXTX flag * * Returns: void * ***********************************************************************/ void slp_dump_header(const unsigned char *data, int rxtx) { LOG((PI_DBG_SLP, PI_DBG_LVL_NONE, "SLP %s %d->%d type=%d txid=0x%.2x len=0x%.4x checksum=0x%.2x\n", rxtx ? "TX" : "RX", get_byte(&data[PI_SLP_OFFSET_DEST]), get_byte(&data[PI_SLP_OFFSET_SRC]), get_byte(&data[PI_SLP_OFFSET_TYPE]), get_byte(&data[PI_SLP_OFFSET_TXID]), get_short(&data[PI_SLP_OFFSET_SIZE]), get_byte(&data[PI_SLP_OFFSET_SUM]))); } /*********************************************************************** * * Function: slp_dump * * Summary: Dump the contents of the SPL frame * * Parameters: char* to data buffer * * Returns: void * ***********************************************************************/ void slp_dump(const unsigned char *data) { pi_dumpdata((char *)&data[PI_SLP_HEADER_LEN], get_short(&data[PI_SLP_OFFSET_SIZE])); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/versamail.c0000644000175000017500000002573110513447543021224 0ustar rousseaurousseau/* * $Id: versamail.c,v 1.11 2006/10/12 14:21:23 desrod Exp $ * * versamail.c: Translate VersaMail data formats * * Copyright (c) 2004, Nick Piper * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #include "pi-macros.h" #include "pi-versamail.h" /* Todo: What is unknown1 and 2? What is reserved 1 and 2? What is download ? (It's non zero, when there is more to d/l, and appears to be an ID, allocated by VersaMail. Maybe an index into another db?) How do we do attachments ? They are not kept in-line, but in another db. Attachments are related to unknown3. Why is mark = 2, when there is no mark set, and 3 when it is? */ void free_VersaMail(struct VersaMail *a) { if (a->messageUID) free(a->messageUID); if (a->to) free(a->to); if (a->from) free(a->from); if (a->cc) free(a->cc); if (a->bcc) free(a->bcc); if (a->subject) free(a->subject); if (a->dateString) free(a->dateString); if (a->body) free(a->body); if (a->replyTo) free(a->replyTo); if (a->unknown3) free(a->unknown3); } #define SHUFFLE_BUFFER(shuffle_distance) { \ len -= shuffle_distance; \ buffer += shuffle_distance; \ } #define GET_BYTE_INTO(attrib) { \ attrib = get_byte(buffer); \ SHUFFLE_BUFFER(1); \ } #define GET_SHORT_INTO(attrib) { \ attrib = (unsigned int) get_short(buffer); \ SHUFFLE_BUFFER(2); \ } #define GET_STR_INTO(attrib) { \ if (get_byte(buffer)) { \ attrib = strdup(buffer); \ SHUFFLE_BUFFER(strlen(buffer)); \ } else { \ attrib = NULL; \ }; \ buffer++; \ len--; \ } #define PUT_STR_FROM(attrib) { \ if (attrib) { \ strcpy(buffer, attrib); \ SHUFFLE_BUFFER(strlen(buffer)); \ } else \ set_byte(buffer, 0); \ buffer++; \ len--; \ } #define ADD_LENGTH(str, destlen) { \ if (str) { \ destlen += 1+strlen(str); \ } else { \ destlen++; \ }; \ } \ #define CONVERT_TIME_T_PALM_TO_UNIX(t) (t=t-2082844800) #define CONVERT_TIME_T_UNIX_TO_PALM(t) (t=t+2082844800) int unpack_VersaMail(struct VersaMail *a, char *buffer, size_t len) { time_t date_t; struct tm *date_tm; char *start = buffer; /* 000000 - 000003 */ a->imapuid = (unsigned long) get_long(buffer); SHUFFLE_BUFFER(4); /* This is different to the other databases, because Palm didn't write VersaMail :-) */ /* 000004 - 000007 */ date_t = (time_t) get_long(buffer); CONVERT_TIME_T_PALM_TO_UNIX(date_t); date_tm = localtime(&date_t); memcpy(&(a->date), date_tm, sizeof(struct tm)); SHUFFLE_BUFFER(4); /* 000008 - 000009 */ GET_SHORT_INTO(a->category); /* 00000A - 00000B */ GET_SHORT_INTO(a->accountNo); /* 00000C - 00000D */ GET_SHORT_INTO(a->unknown1); /* 00000E - 00000E */ GET_BYTE_INTO(a->download); /* 00000F - 00000F */ GET_BYTE_INTO(a->mark); /* of the above, bit 0 is mark, apparently bit 4 is header-only flag, and it looks like bit 1 is always set, which gives a normal value of 2 */ /* 000010 - 000011 */ GET_SHORT_INTO(a->unknown2); /* 000012 - 000013 */ a->reserved1 = (get_byte(buffer)); a->reserved2 = (get_byte(buffer + 1) >> 1); a->read = (get_byte(buffer + 1) && 1); SHUFFLE_BUFFER(2); /* This is the size, as provided by the imap server: * 1 FETCH (UID 12779 BODY[] {3377} .... ) Size==3377 I guess VersaMail uses it to determine how much more there might be to download. I don't think it uses it to know there IS more to download though, because the palm doesn't track most of the headers, so it'll never be able to calculate if there is more or not, exactly. */ /* 000014 - 000017 */ a->msgSize = get_long(buffer); SHUFFLE_BUFFER(4); GET_STR_INTO(a->messageUID); GET_STR_INTO(a->to); GET_STR_INTO(a->from); GET_STR_INTO(a->cc); GET_STR_INTO(a->bcc); GET_STR_INTO(a->subject); GET_STR_INTO(a->dateString); GET_STR_INTO(a->body); GET_STR_INTO(a->replyTo); a->unknown3length = 0; a->unknown3 = NULL; a->attachmentCount = 0; if (len > 0) { a->unknown3 = (void *) malloc(len); /* printf("Msg has extra %d bytes. That's 4*%d + %d\n", len, len / 4, len % 4); */ /* Example: Byte 0: 0x 43 | C | 67 / Variable amount of 'rubbish' Byte 1: 0x 50 | P | 80 \ NOT neccessary !NULL Byte 2: 0x 0 | . | 0 / Byte 3: 0x 68 | h | 104 | Each attachment adds four bytes, Byte 4: 0x ffffffc0 | . | -64 | NULL, an int, then two signed ints Byte 5: 0x ffffff90 | . | -112 \ Byte 6: 0x 0 | . | 0 / Byte 7: 0x 68 | h | 104 | Byte 8: 0x ffffffc0 | . | -64 | Byte 9: 0x ffffff92 | . | -110 \ Byte 10: 0x 0 | . | 0 / Byte 11: 0x 68 | h | 104 | Byte 12: 0x ffffffc0 | . | -64 | Byte 13: 0x ffffff94 | . | -108 \ Byte 14: 0x 0 | . | 0 / Byte 15: 0x 0 | . | 0 | Then we end with a block of Byte 16: 0x 0 | . | 0 | four NULLs Byte 17: 0x 0 | . | 0 \ The 'rubbish' doesn't seem to be for alignment within the pdb, AFAIKS. */ a->attachmentCount = (len / 4) - 1; if (a->unknown3) { a->unknown3length = len; memcpy(a->unknown3, buffer, len); SHUFFLE_BUFFER(len); } } return (buffer - start); } int pack_VersaMail(struct VersaMail *a, char *buffer, size_t len) { time_t date_t; unsigned int destlen; char *start = buffer; destlen = 4 + 4 + 2 + 2 + 2 + 2 + 2 + 2 + 4 + a->unknown3length; ADD_LENGTH(a->messageUID, destlen); ADD_LENGTH(a->to, destlen); ADD_LENGTH(a->from, destlen); ADD_LENGTH(a->cc, destlen); ADD_LENGTH(a->bcc, destlen); ADD_LENGTH(a->subject, destlen); ADD_LENGTH(a->dateString, destlen); ADD_LENGTH(a->body, destlen); ADD_LENGTH(a->replyTo, destlen); if (!buffer) return destlen; if (len < destlen) return 0; set_long(buffer, a->imapuid); SHUFFLE_BUFFER(4); date_t = mktime(&(a->date)); CONVERT_TIME_T_UNIX_TO_PALM(date_t); set_long(buffer, (unsigned long) date_t); SHUFFLE_BUFFER(4); set_short(buffer, a->category); SHUFFLE_BUFFER(2); set_short(buffer, a->accountNo); SHUFFLE_BUFFER(2); set_short(buffer, a->unknown1); SHUFFLE_BUFFER(2); set_byte(buffer, a->download); SHUFFLE_BUFFER(1); set_byte(buffer, a->mark); SHUFFLE_BUFFER(1); set_short(buffer, a->unknown2); SHUFFLE_BUFFER(2); set_byte(buffer, a->reserved1); set_byte(buffer + 1, ((a->reserved2 << 1) || a->read)); SHUFFLE_BUFFER(2); set_long(buffer, a->msgSize); SHUFFLE_BUFFER(4); PUT_STR_FROM(a->messageUID); PUT_STR_FROM(a->to); PUT_STR_FROM(a->from); PUT_STR_FROM(a->cc); PUT_STR_FROM(a->bcc); PUT_STR_FROM(a->subject); PUT_STR_FROM(a->dateString); PUT_STR_FROM(a->body); PUT_STR_FROM(a->replyTo); if (a->unknown3length > 0) { memcpy(buffer, a->unknown3, a->unknown3length); } return (buffer - start); } int unpack_VersaMailAppInfo(struct VersaMailAppInfo *ai, unsigned char *record, size_t len) { int i; unsigned char *start = record; i = unpack_CategoryAppInfo(&ai->category, record, len); if (!i) return i; record += i; len -= i; return (record - start); } /* Message provided to the maintainer of pilot-mailsync: (the above implementation does not fully agree, BTW) -------- Original Message -------- Subject: Re: QueueSync2.0 Date: Sat, 31 Jan 2004 03:19:28 +0900 From: Masaru matsumoto To: Jochen Garcke References: <401A7AE7.5090109@garcke.de> Hi, The definition of the database is to refer to the following. But, because I analyzed it, it has the possibility to be wrong. Write only information on VersaMail. Because there are many problems in ClieMail. typedef struct { UInt16 mu_reserved1 : 8; UInt16 mu_reserved2 : 7; UInt16 mu_read : 1; } mu_MailFlagsType; typedef struct { UInt32 mu_version; UInt32 mu_datetime; UInt16 mu_category; UInt16 mu_account_no; UInt16 mu_rfu1; UInt16 mu_mark; UInt16 mu_rfu2; mu_MailFlagsType mu_flags; UInt32 mu_msgSize; char mu_firstField; } mu_MailPackedDBRecordType; typedef mu_MailPackedDBRecordType * mu_MailPackedDBRecordPtr; mu_msgSize = strlen(subject)+strlen(contents)+strlen(dateString)+strlen(replyto)+4; Field sequence : messageUID to from cc bcc subject dateString body replayTo */ /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/blob.c0000644000175000017500000001063311150204034020132 0ustar rousseaurousseau/* * $Id: blob.c,v 1.1 2009/02/22 08:09:00 nicholas Exp $ * * pi-blob.h - Support for blobs that appear in some palm databases. * * (c) 2008, Jon Schewe & Judd Montgomery * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #include "pi-macros.h" #include "pi-blob.h" /*********************************************************************** * * Function: free_Blob * * Summary: Frees members of the blob structure * * Parameters: Blob_t* * * Returns: void * ***********************************************************************/ void free_Blob(Blob_t *blob) { if(NULL != blob->data) { free(blob->data); blob->data = NULL; } } /*********************************************************************** * * Function: dup_Blob * * Summary: Allocate memory for a new blob that is a duplicate of this one and copy the data into it * * Parameters: Blob_t* * * Returns: Blob_t* or NULL if there isn't enough memory and errno is set to ENOMEM * ***********************************************************************/ Blob_t* dup_Blob(const Blob_t *blob) { if(NULL == blob) { return NULL; } Blob_t *retval = (Blob_t*)malloc(sizeof(Blob_t)); if(NULL == retval) { errno = ENOMEM; return NULL; } memcpy(retval->type, blob->type, 4); retval->length = blob->length; if(blob->length > 0) { retval->data = (uint8_t *)malloc(blob->length); if(NULL == retval->data) { errno = ENOMEM; return NULL; } else { memcpy(retval->data, blob->data, blob->length); } } else { retval->data = NULL; } return retval; } /*********************************************************************** * * Function: unpack_Blob * * Summary: Unpack a blob starting at position in data * * Parameters: Blob_t*, unsigned char*, size_t * * Returns: the number of bytes read or -1 on error * ***********************************************************************/ int unpack_Blob_p(Blob_t *blob, const unsigned char *data, const size_t position) { size_t localPosition = position; memcpy(blob->type, (char *)data+localPosition, 4); localPosition += 4; //printf("blob->type = %c %c %c %c\n", blob->type[0], blob->type[1], blob->type[2], blob->type[3]); blob->length = get_short(data+localPosition); localPosition += 2; if(blob->length > 0) { //printf("blob->length = %d\n", blob->length); blob->data = (uint8_t *)malloc(blob->length); if(NULL == blob->data) { printf("Malloc failed!\n"); return -1; } else { memcpy(blob->data, data+localPosition, blob->length); } localPosition += blob->length; } return localPosition - position; } /*********************************************************************** * * Function: pack_Blob * * Summary: Pack a blob into the specified buffer * * Parameters: Blob_t*, pi_buffer_t* * * Returns: 0 on success, -1 on failure * ***********************************************************************/ int pack_Blob(const Blob_t *blob, pi_buffer_t *buf) { size_t offset; offset = buf->used; pi_buffer_expect(buf, buf->used + 6 + blob->length); buf->used = buf->used + 6 + blob->length; memcpy(buf->data+offset, blob->type, 4); offset += 4; set_short(buf->data+offset, blob->length); offset += 2; memcpy(buf->data+offset, blob->data, blob->length); offset += blob->length; return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/mail.c0000644000175000017500000003556710513447542020172 0ustar rousseaurousseau/* * $Id: mail.c,v 1.25 2006/10/12 14:21:22 desrod Exp $ * * mail.c: Translate Pilot mail data formats * * Copyright (c) 1997, Kenneth Albanowski * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #include "pi-macros.h" #include "pi-mail.h" char *MailSortTypeNames[] = { "Date", "Type", NULL }; char *MailSyncTypeNames[] = { "All", "Send", "Filter", NULL }; /*********************************************************************** * * Function: free_Mail * * Summary: frees all the Mail_t structure members * * Parameters: Mail_t* * * Returns: void * ***********************************************************************/ void free_Mail(Mail_t *mail) { if (mail->from != NULL) { free(mail->from); mail->from = NULL; } if (mail->to != NULL) { free(mail->to); mail->to = NULL; } if (mail->subject != NULL) { free(mail->subject); mail->to = NULL; } if (mail->cc != NULL) { free(mail->cc); mail->cc = NULL; } if (mail->bcc != NULL) { free(mail->bcc); mail->bcc = NULL; } if (mail->replyTo) { free(mail->replyTo); mail->replyTo = NULL; } if (mail->sentTo) { free(mail->sentTo); mail->sentTo = NULL; } if (mail->body != NULL) { free(mail->body); mail->body = NULL; } } /*********************************************************************** * * Function: free_MailAppInfo * * Summary: frees all MailAppInfo_t structure members * * Parameters: MailAppInfo_t* * * Returns: void * ***********************************************************************/ void free_MailAppInfo(MailAppInfo_t *appinfo) { /* if (appinfo->signature) free(appinfo->signature); */ } /*********************************************************************** * * Function: free_MailSyncPref * * Summary: frees all MailSyncPref_t structure members * * Parameters: MailSyncPref_t* * * Returns: void * ***********************************************************************/ void free_MailSyncPref(MailSyncPref_t *pref) { if (pref->filterTo != NULL) { free(pref->filterTo); pref->filterTo = NULL; } if (pref->filterFrom != NULL) { free(pref->filterFrom); pref->filterFrom = NULL; } if (pref->filterSubject != NULL) { free(pref->filterSubject); pref->filterSubject = NULL; } } /*********************************************************************** * * Function: free_MailSignaturePref * * Summary: frees all MailSignaturePref_t structure members * * Parameters: MailSignaturePref_t* * * Returns: void * ***********************************************************************/ void free_MailSignaturePref(MailSignaturePref_t *pref) { if (pref->signature != NULL) { free(pref->signature); pref->signature = NULL; } } /*********************************************************************** * * Function: unpack_Mail * * Summary: unpacks Mail * * Parameters: Mail_t*, char* to buffer, buffer length * * Returns: effective buffer length * ***********************************************************************/ int unpack_Mail(Mail_t *mail, unsigned char *buffer, size_t len) { int flags; unsigned long d; unsigned char *start = buffer; if (len < 6) return 0; d = (unsigned short int) get_short(buffer); mail->date.tm_year = (d >> 9) + 4; mail->date.tm_mon = ((d >> 5) & 15) - 1; mail->date.tm_mday = d & 31; mail->date.tm_hour = get_byte(buffer + 2); mail->date.tm_min = get_byte(buffer + 3); mail->date.tm_sec = 0; mail->date.tm_isdst = -1; mktime(&mail->date); if (d) mail->dated = 1; else mail->dated = 0; flags = get_byte(buffer + 4); mail->read = (flags & (1 << 7)) ? 1 : 0; mail->signature = (flags & (1 << 6)) ? 1 : 0; mail->confirmRead = (flags & (1 << 5)) ? 1 : 0; mail->confirmDelivery = (flags & (1 << 4)) ? 1 : 0; mail->priority = (flags & (3 << 2)) >> 2; mail->addressing = (flags & 3); buffer += 6; len -= 6; if (len < 1) return 0; if (get_byte(buffer)) { mail->subject = strdup((char *)buffer); buffer += strlen((char *)buffer); len -= strlen((char *)buffer); } else mail->subject = 0; buffer++; len--; if (len < 1) return 0; if (get_byte(buffer)) { mail->from = strdup((char *)buffer); buffer += strlen((char *)buffer); len -= strlen((char *)buffer); } else mail->from = 0; buffer++; len--; if (len < 1) return 0; if (get_byte(buffer)) { mail->to = strdup((char *)buffer); buffer += strlen((char *)buffer); len -= strlen((char *)buffer); } else mail->to = 0; buffer++; len--; if (len < 1) return 0; if (get_byte(buffer)) { mail->cc = strdup((char *)buffer); buffer += strlen((char *)buffer); len -= strlen((char *)buffer); } else mail->cc = 0; buffer++; len--; if (len < 1) return 0; if (get_byte(buffer)) { mail->bcc = strdup((char *)buffer); buffer += strlen((char *)buffer); len -= strlen((char *)buffer); } else mail->bcc = 0; buffer++; len--; if (len < 1) return 0; if (get_byte(buffer)) { mail->replyTo = strdup((char *)buffer); buffer += strlen((char *)buffer); len -= strlen((char *)buffer); } else mail->replyTo = 0; buffer++; len--; if (len < 1) return 0; if (get_byte(buffer)) { mail->sentTo = strdup((char *)buffer); buffer += strlen((char *)buffer); len -= strlen((char *)buffer); } else mail->sentTo = 0; buffer++; len--; if (len < 1) return 0; if (get_byte(buffer)) { mail->body = strdup((char *)buffer); buffer += strlen((char *)buffer); len -= strlen((char *)buffer); } else mail->body = 0; buffer++; len--; return (buffer - start); } /*********************************************************************** * * Function: pack_Mail * * Summary: packs Mail * * Parameters: Mail_t*, char* to buffer, buffer length * * Returns: effective buffer length * ***********************************************************************/ int pack_Mail(struct Mail *mail, unsigned char *buffer, size_t len) { size_t destlen = 6 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1; unsigned char *start = buffer; if (mail->subject) destlen += strlen(mail->subject); if (mail->from) destlen += strlen(mail->from); if (mail->to) destlen += strlen(mail->to); if (mail->cc) destlen += strlen(mail->cc); if (mail->bcc) destlen += strlen(mail->bcc); if (mail->replyTo) destlen += strlen(mail->replyTo); if (mail->sentTo) destlen += strlen(mail->sentTo); if (mail->body) destlen += strlen(mail->body); if (!buffer) return destlen; if (len < destlen) return 0; set_short(buffer, ((mail->date.tm_year - 4) << 9) | ((mail->date.tm_mon + 1) << 5) | mail->date. tm_mday); set_byte(buffer + 2, mail->date.tm_hour); set_byte(buffer + 3, mail->date.tm_min); if (!mail->dated) set_long(buffer, 0); set_byte(buffer + 4, (mail->read ? (1 << 7) : 0) | (mail->signature ? (1 << 6) : 0) | (mail-> confirmRead ? (1 << 5) : 0) | (mail-> confirmDelivery ? (1 << 4) : 0) | ((mail->priority & 3) << 2) | (mail->addressing & 3)); set_byte(buffer + 5, 0); buffer += 6; if (mail->subject) { strcpy((char *)buffer, mail->subject); buffer += strlen((char *)buffer); } else set_byte(buffer, 0); buffer++; if (mail->from) { strcpy((char *)buffer, mail->from); buffer += strlen((char *)buffer); } else set_byte(buffer, 0); buffer++; if (mail->to) { strcpy((char *)buffer, mail->to); buffer += strlen((char *)buffer); } else set_byte(buffer, 0); buffer++; if (mail->cc) { strcpy((char *)buffer, mail->cc); buffer += strlen((char *)buffer); } else set_byte(buffer, 0); buffer++; if (mail->bcc) { strcpy((char *)buffer, mail->bcc); buffer += strlen((char *)buffer); } else set_byte(buffer, 0); buffer++; if (mail->replyTo) { strcpy((char *)buffer, mail->replyTo); buffer += strlen((char *)buffer); } else set_byte(buffer, 0); buffer++; if (mail->sentTo) { strcpy((char *)buffer, mail->sentTo); buffer += strlen((char *)buffer); } else set_byte(buffer, 0); buffer++; if (mail->body) { strcpy((char *)buffer, mail->body); buffer += strlen((char *)buffer); } else set_byte(buffer, 0); buffer++; return (buffer - start); } /*********************************************************************** * * Function: unpack_MailAppInfo * * Summary: unpacks MailAppInfo * * Parameters: MailAppInfo_t*, char* to buffer, buffer length * * Returns: effective buffer length * ***********************************************************************/ int unpack_MailAppInfo(MailAppInfo_t *appinfo, unsigned char *record, size_t len) { int i; unsigned char *start = record; i = unpack_CategoryAppInfo(&appinfo->category, record, len); if (!i) return i; record += i; len -= i; if (len < 11) return 0; appinfo->dirty = get_short(record); record += 2; appinfo->sortOrder = get_byte(record); record += 2; appinfo->unsentMessage = get_long(record); record += 4; /* ai->signature = 0; */ /* strdup(start + get_short(record)); */ record += 3; return (record - start); } /*********************************************************************** * * Function: pack_MailAppInfo * * Summary: packs MailAppInfo * * Parameters: MailAppInfo_t*, char* to buffer, buffer length * * Returns: effective buffer length * ***********************************************************************/ int pack_MailAppInfo(struct MailAppInfo *appinfo, unsigned char *record, size_t len) { int i; unsigned char *start = record; i = pack_CategoryAppInfo(&appinfo->category, record, len); if (!record) return i + 11; if (!i) return i; record += i; len -= i; if (len < 8) return 0; set_short(record, appinfo->dirty); record += 2; set_short(record, 0); /* gapfill */ set_byte(record, appinfo->sortOrder); record += 2; set_long(record, appinfo->unsentMessage); record += 4; set_short(record, (record - start + 2)); record += 2; /* if (appinfo->signature) strcpy(record, appinfo->signature); else set_byte(record, 0); record += strlen(record); */ set_byte(record, 0); record++; return (record - start); } /*********************************************************************** * * Function: unpack_MailSyncPref * * Summary: unpacks Mail * * Parameters: MailSyncPref_t*, char* to buffer, buffer length * * Returns: effective buffer length * ***********************************************************************/ int unpack_MailSyncPref(MailSyncPref_t *pref, unsigned char *record, size_t len) { unsigned char *start = record; pref->syncType = get_byte(record); record += 1; pref->getHigh = get_byte(record); record += 1; pref->getContaining = get_byte(record); record += 2; pref->truncate = get_short(record); record += 2; if (get_byte(record)) { pref->filterTo = strdup((char *)record); record += strlen((char *)record); } else pref->filterTo = 0; record++; if (get_byte(record)) { pref->filterFrom = strdup((char *)record); record += strlen((char *)record); } else pref->filterFrom = 0; record++; if (get_byte(record)) { pref->filterSubject = strdup((char *)record); record += strlen((char *)record); } else pref->filterSubject = 0; record++; return (record - start); } /*********************************************************************** * * Function: pack_MailSyncPref * * Summary: packs Mail * * Parameters: MailSyncPref_t*, char* to buffer, buffer length * * Returns: effective buffer length * ***********************************************************************/ int pack_MailSyncPref(MailSyncPref_t *pref, unsigned char *record, size_t len) { size_t destlen = 6 + 1 + 1 + 1; unsigned char *start = record; if (pref->filterTo) destlen += strlen(pref->filterTo); if (pref->filterSubject) destlen += strlen(pref->filterSubject); if (pref->filterFrom) destlen += strlen(pref->filterFrom); if (!record) return destlen; if (len < destlen) return 0; set_byte(record, pref->syncType); record++; set_byte(record, pref->getHigh); record++; set_byte(record, pref->getContaining); record++; set_byte(record, 0); record++; /* gapfill */ set_short(record, pref->truncate); record += 2; if (pref->filterTo) { strcpy((char *)record, pref->filterTo); record += strlen(pref->filterTo); } *record++ = 0; if (pref->filterFrom) { strcpy((char *)record, pref->filterFrom); record += strlen(pref->filterFrom); } *record++ = 0; if (pref->filterSubject) { strcpy((char *)record, pref->filterSubject); record += strlen(pref->filterSubject); } *record++ = 0; return (record - start); } /*********************************************************************** * * Function: unpack_MailSignaturePref * * Summary: unpacks MailSignaturePref * * Parameters: MailSignaturePref_t*, char* to buffer, buffer length * * Returns: effective buffer length * ***********************************************************************/ int unpack_MailSignaturePref(MailSignaturePref_t *pref, unsigned char *record, size_t len) { unsigned char *start = record; if (len < 1) return 0; pref->signature = strdup((char *)record); record += strlen(pref->signature) + 1; return (record - start); } /*********************************************************************** * * Function: pack_MailSignaturePref * * Summary: packs MailSignaturePref * * Parameters: MailSignaturePref_t*, char* to buffer, buffer length * * Returns: effective buffer length * ***********************************************************************/ int pack_MailSignaturePref(struct MailSignaturePref *pref, unsigned char *record, size_t len) { size_t destlen = 1; unsigned char *start = record; if (pref->signature) destlen += strlen(pref->signature); if (!record) return destlen; if (len < destlen) return 0; if (pref->signature) { strcpy((char *)record, pref->signature); record += strlen(pref->signature); } *record = 0; record++; return (record - start); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/location.c0000644000175000017500000004460411150204035021032 0ustar rousseaurousseau/* * $Id: location.c,v 1.1 2009/02/22 08:09:01 nicholas Exp $ * * location.c: Translate Pilot location data formats * (c) 2008, Jon Schewe * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include "pi-macros.h" #include "pi-location.h" /*********************************************************************** * * Function: new_Timezone * * Summary: Create empty timzone * * Parameters: Timezone_t* * * Returns: void * ***********************************************************************/ void new_Timezone(Timezone_t *a) { a->offset = 0; a->t2 = 0; a->dstStart.dayOfWeek = 0; a->dstStart.weekOfMonth = 0; a->dstStart.month = 0; a->dstStart.unknown = 0; a->dstEnd.dayOfWeek = 0; a->dstEnd.weekOfMonth = 0; a->dstEnd.month = 0; a->dstEnd.unknown = 0; a->dstObserved = 0; a->t4 = 0; a->unknown = 0; a->name = NULL; } /*********************************************************************** * * Function: new_Locatio * * Summary: Create empty location * * Parameters: Location_t* * * Returns: void * ***********************************************************************/ void new_Location(Location_t *a) { new_Timezone(&(a->tz)); a->unknownExists = 0; a->unknown = 0; a->latitude.degrees = 0; a->latitude.minutes = 0; a->latitude.direction = 0; a->longitude.degrees = 0; a->longitude.minutes = 0; a->longitude.direction = 0; a->note = NULL; } /*********************************************************************** * * Function: copy_Timezone * * Summary: Copy the data from one timezone to another. The destination * timezone event must already be cleared, either by creating new or by * calling free_Timezone on it first. * * Parameters: Timezone_t*, Timezone_t* * * Returns: int -1 on failure (errno will be set), 0 on success * ***********************************************************************/ int copy_Timezone(const Timezone_t *source, Timezone_t *dest) { dest->offset = source->offset; dest->t2 = source->t2; dest->dstStart.dayOfWeek = source->dstStart.dayOfWeek; dest->dstStart.weekOfMonth = source->dstStart.weekOfMonth; dest->dstStart.month = source->dstStart.month; dest->dstStart.unknown = source->dstStart.unknown; dest->dstEnd.dayOfWeek = source->dstEnd.dayOfWeek; dest->dstEnd.weekOfMonth = source->dstEnd.weekOfMonth; dest->dstEnd.month = source->dstEnd.month; dest->dstEnd.unknown = source->dstEnd.unknown; dest->dstObserved = source->dstObserved; dest->t4 = source->t4; dest->unknown = source->unknown; if(NULL != source->name) { dest->name = strdup(source->name); } else { dest->name = NULL; } return 0; } /*********************************************************************** * * Function: copy_Location * * Summary: Copy the data from one location to another. The destination * location event must already be cleared, either by creating new or by * calling free_Location on it first. * * Parameters: Location_t*, Location_t* * * Returns: int -1 on failure (errno will be set), 0 on success * ***********************************************************************/ int copy_Location(const Location_t *source, Location_t *dest) { int retval; retval = copy_Timezone(&(source->tz), &(dest->tz)); if(0 != retval) { return retval; } dest->unknownExists = source->unknownExists; dest->unknown = source->unknown; dest->latitude.degrees = source->latitude.degrees; dest->latitude.minutes = source->latitude.minutes; dest->latitude.direction = source->latitude.direction; dest->longitude.degrees = source->longitude.degrees; dest->longitude.minutes = source->longitude.minutes; dest->longitude.direction = source->longitude.direction; if(NULL != source->note) { dest->note = strdup(source->note); } else { dest->note = NULL; } return 0; } /*********************************************************************** * * Function: free_Location * * Summary: Free the members of a location structure * * Parameters: Location_t* * * Returns: void * ***********************************************************************/ void free_Location(Location_t *loc) { free_Timezone(&(loc->tz)); if(loc->note != NULL) { free(loc->note); loc->note = NULL; } } /*********************************************************************** * * Function: dup_Timezone * * Summary: Allocate memory for a new timezone that is a duplicate of this one and copy the data into it * * Parameters: Timezone_t* * * Returns: Timezone_t* or NULL if there isn't enough memory and errno is set to ENOMEM * ***********************************************************************/ Timezone_t* dup_Timezone(const Timezone_t *tz) { Timezone_t *retval = (Timezone_t*)malloc(sizeof(Timezone_t)); if(NULL == retval) { errno = ENOMEM; return NULL; } retval->offset = tz->offset; retval->t2 = tz->t2; memcpy(&(retval->dstStart), &(tz->dstStart), sizeof(DST_t)); memcpy(&(retval->dstEnd), &(tz->dstEnd), sizeof(DST_t)); retval->dstObserved = tz->dstObserved; retval->t4 = tz->t4; retval->unknown = tz->unknown; if(NULL != tz->name) { retval->name = strdup(tz->name); } else { retval->name = NULL; } return retval; } /*********************************************************************** * * Function: free_Timezone * * Summary: Free the members of a timezone structure * * Parameters: Timezone_t* * * Returns: void * ***********************************************************************/ void free_Timezone(Timezone_t *tz) { if(tz->name != NULL) { free(tz->name); tz->name = NULL; } } /*********************************************************************** * * Function: unpack_DST * * Summary: Fill in the daylight savings time structure based on the raw record * data * * Parameters: DST_t*, pi_buffer_t *buf * * Returns: -1 on error, 0 on success * ***********************************************************************/ int unpack_DST(DST_t *dst, const pi_buffer_t *buf) { return unpack_DST_p(dst, buf->data, 0); } /** Does the work for unpack_DST given a position in buf */ int unpack_DST_p(DST_t *dst, const unsigned char *data, const size_t position) { uint8_t byte; byte = get_byte(data+position); switch(byte) { case 0x00: dst->dayOfWeek = sunday; break; case 0x01: dst->dayOfWeek = monday; break; case 0x02: dst->dayOfWeek = tuesday; break; case 0x03: dst->dayOfWeek = wednesday; break; case 0x04: dst->dayOfWeek = thursday; break; case 0x05: dst->dayOfWeek = friday; break; case 0x06: dst->dayOfWeek = saturday; break; default: printf("Illegal value found in day of week: 0x%02X\n", byte); return -1; } byte = get_byte(data+position+1); switch(byte) { case 0x00: dst->weekOfMonth = first; break; case 0x01: dst->weekOfMonth = second; break; case 0x02: dst->weekOfMonth = third; break; case 0x03: dst->weekOfMonth = fourth; break; case 0x04: dst->weekOfMonth = last; break; default: printf("Illegal value found in week: 0x%02Xd\n", byte); return -1; } byte = get_byte(data+position+2); switch(byte) { case 0x00: dst->month = none; break; case 0x01: dst->month = january; break; case 0x02: dst->month = february; break; case 0x03: dst->month = march; break; case 0x04: dst->month = april; break; case 0x05: dst->month = may; break; case 0x06: dst->month = june; break; case 0x07: dst->month = july; break; case 0x08: dst->month = august; break; case 0x09: dst->month = september; break; case 0x0a: dst->month = october; break; case 0x0b: dst->month = november; break; case 0x0c: dst->month = december; break; default: printf("Illegal value found in month: 0x%02Xd\n", byte); return -1; } dst->unknown = get_byte(data+position+3); switch(dst->unknown) { case 0x00: case 0x01: case 0x02: case 0x03: /*case 0x04:*/ break; default: printf("Bad value for DST.unknown: 0x%02x\n", dst->unknown); return -1; } return 0; } /*********************************************************************** * * Function: unpack_timezone * * Summary: Fill in the timezone structure based on the raw record * data * * Parameters: Timezone_t*, pi_buffer_t *buf, optional position in buf * * Returns: -1 on error, number of bytes read on success * ***********************************************************************/ int unpack_Timezone(Timezone_t *tz, const pi_buffer_t *buf) { return unpack_Timezone_p(tz, buf->data, 0); } /** * Does the work of unpack_Timezone given a position in buf. * * Returns: -1 on error, number of bytes read on success */ int unpack_Timezone_p(Timezone_t *tz, const unsigned char *data, const size_t position) { uint8_t byte; size_t localPosition = position; tz->offset = get_short(data+localPosition); localPosition += 2; /*printf("Offset is %d\n", tz->offset);*/ tz->t2 = get_byte(data + localPosition); ++localPosition; switch(tz->t2) { case 0x00: break; case 0x01: break; case 0x02: break; case 0x03: break; default: /*printf("Bad value for t2 0x%02X\n", tz->t2);*/ return -1; } if(unpack_DST_p(&(tz->dstStart), data, localPosition) != 0) { return -1; } localPosition += 4; if(unpack_DST_p(&(tz->dstEnd), data, localPosition) != 0) { return -1; } localPosition += 4; byte = get_byte(data+localPosition); ++localPosition; switch(byte) { case 0x3c: /* dst observed */ tz->dstObserved = 1; break; case 0x00: /* dst not observed */ tz->dstObserved = 0; break; default: printf("Illegal value in dst_observed 0x%02X\n", byte); return -1; } tz->t4 = get_byte(data+localPosition); ++localPosition; tz->unknown = get_byte(data+localPosition); ++localPosition; switch(tz->unknown) { case 0x80: case 0x00: break; default: printf("Bad value for unknown 0x%02X\n", tz->unknown); return -1; } if(0x00 == data+localPosition) { tz->name = NULL; ++localPosition; } else { tz->name = strdup((char *)(data+localPosition)); localPosition += strlen(tz->name) + 1; } return localPosition; } /*********************************************************************** * * Function: unpack_Location * * Summary: Fill in the location structure based on the raw record * data * * Parameters: Location_t*, pi_buffer_t *buf * * Returns: -1 on error, 0 on success * ***********************************************************************/ int unpack_Location(Location_t *loc, const pi_buffer_t *buf) { size_t localPosition = 0; localPosition = unpack_Timezone_p(&(loc->tz), buf->data, localPosition); if(localPosition < 0) { return -1; } loc->unknownExists = 0; /* unpack latitude */ loc->latitude.degrees = get_short(buf->data+localPosition); loc->latitude.minutes = get_short(buf->data+localPosition+2); if(loc->latitude.degrees > 90 || loc->latitude.degrees < -90 || loc->latitude.minutes > 60 || loc->latitude.minutes < -60) { /* printf("latitude degrees out of range: %d or\n", loc->latitude.degrees); printf("latitude minutes out of range: %d\n", loc->latitude.minutes); */ loc->unknownExists = 1; loc->unknown = get_byte(buf->data+localPosition); ++localPosition; /*printf("Found unknown: 0x%02X\n", loc->unknown); */ loc->latitude.degrees = get_short(buf->data+localPosition); localPosition += 2; loc->latitude.minutes = get_short(buf->data+localPosition); localPosition += 2; } else { localPosition += 4; } loc->longitude.degrees = get_short(buf->data+localPosition); localPosition += 2; loc->longitude.minutes = get_short(buf->data+localPosition); localPosition += 2; /* now make latitude and longitude easy to read */ loc->latitude.direction = south; loc->longitude.direction = west; if(loc->latitude.minutes < 0) { loc->latitude.direction = north; loc->latitude.minutes = -1 * loc->latitude.minutes; } if(loc->latitude.degrees < 0) { loc->latitude.direction = north; loc->latitude.degrees = -1 * loc->latitude.degrees; } if(loc->longitude.minutes < 0) { loc->longitude.direction = east; loc->longitude.minutes = -1 * loc->longitude.minutes; } if(loc->longitude.degrees < 0) { loc->longitude.direction = east; loc->longitude.degrees = -1 * loc->longitude.degrees; } if(0x00 == buf->data[localPosition]) { loc->note = NULL; ++localPosition; } else { loc->note = strdup((char *)(buf->data+localPosition)); localPosition += strlen(loc->note) + 1; } return 0; } /*********************************************************************** * * Function: pack_DST * * Summary: append raw DST record data to buf based on the * DST structure * * Parameters: DST_t*, pi_buffer_t *buf of record, record type * * Returns: -1 on error, 0 on success. * ***********************************************************************/ int pack_DST(const DST_t *dst, pi_buffer_t *buf) { size_t offset; if (dst == NULL || buf == NULL) return -1; offset = buf->used; pi_buffer_expect(buf, buf->used + 4); buf->used = buf->used + 4; switch(dst->dayOfWeek) { case sunday: set_byte(buf->data+offset, 0x00); break; case monday: set_byte(buf->data+offset, 0x01); break; case tuesday: set_byte(buf->data+offset, 0x02); break; case wednesday: set_byte(buf->data+offset, 0x03); break; case thursday: set_byte(buf->data+offset, 0x04); break; case friday: set_byte(buf->data+offset, 0x05); break; case saturday: set_byte(buf->data+offset, 0x06); break; default: return -1; } switch(dst->weekOfMonth) { case first: set_byte(buf->data+offset+1, 0x00); break; case second: set_byte(buf->data+offset+1, 0x01); break; case third: set_byte(buf->data+offset+1, 0x02); break; case fourth: set_byte(buf->data+offset+1, 0x03); break; case last: set_byte(buf->data+offset+1, 0x04); break; default: return -1; } switch(dst->month) { case none: set_byte(buf->data+offset+2, 0x00); break; case january: set_byte(buf->data+offset+2, 0x01); break; case february: set_byte(buf->data+offset+2, 0x02); break; case march: set_byte(buf->data+offset+2, 0x03); break; case april: set_byte(buf->data+offset+2, 0x04); break; case may: set_byte(buf->data+offset+2, 0x05); break; case june: set_byte(buf->data+offset+2, 0x06); break; case july: set_byte(buf->data+offset+2, 0x07); break; case august: set_byte(buf->data+offset+2, 0x08); break; case september: set_byte(buf->data+offset+2, 0x09); break; case october: set_byte(buf->data+offset+2, 0x0a); break; case november: set_byte(buf->data+offset+2, 0x0b); break; case december: set_byte(buf->data+offset+2, 0x0c); break; default: return -1; } set_byte(buf->data+offset+3, dst->unknown); return 0; } /*********************************************************************** * * Function: pack_Timezone * * Summary: Append the raw Timezone record to buf based on the * Timezone structure * * Parameters: Timezone_t*, pi_buffer_t *buf of record, record type * * Returns: -1 on error, 0 on success. * ***********************************************************************/ int pack_Timezone(const Timezone_t *tz, pi_buffer_t *buf) { size_t offset; if (tz == NULL || buf == NULL) return -1; offset = buf->used; pi_buffer_expect(buf, buf->used + 3); buf->used = buf->used + 3; set_short(buf->data+offset, tz->offset); set_byte(buf->data+offset+2, tz->t2); pack_DST(&(tz->dstStart), buf); pack_DST(&(tz->dstEnd), buf); offset = buf->used; pi_buffer_expect(buf, buf->used + 3); buf->used = buf->used + 3; if(tz->dstObserved) { set_byte(buf->data+offset, 0x3c); } else { set_byte(buf->data+offset, 0x00); } set_byte(buf->data+offset, tz->t4); if(NULL != tz->name) { offset = buf->used; pi_buffer_expect(buf, buf->used + strlen(tz->name)+1); buf->used = buf->used + strlen(tz->name)+1; strcpy((char *)(buf->data+offset), tz->name); } return 0; } /*********************************************************************** * * Function: pack_Location * * Summary: Append the raw Location record to buf based on the * Location structure * * Parameters: Location_t*, pi_buffer_t *buf of record, record type * * Returns: -1 on error, 0 on success. * ***********************************************************************/ int pack_Location(const Location_t *loc, pi_buffer_t *buf) { size_t offset; if (loc == NULL || buf == NULL) return -1; pack_Timezone(&(loc->tz), buf); if(loc->unknownExists) { offset = buf->used; pi_buffer_expect(buf, buf->used + 1); buf->used = buf->used+1; set_byte(buf->data+offset, loc->unknown); } offset = buf->used; pi_buffer_expect(buf, buf->used+8); buf->used = buf->used+8; if(loc->latitude.direction == north) { set_short(buf->data+offset, -1 * loc->latitude.degrees); set_short(buf->data+offset+2, -1 * loc->latitude.minutes); } else { set_short(buf->data+offset, loc->latitude.degrees); set_short(buf->data+offset+2, loc->latitude.minutes); } if(loc->longitude.direction == east) { set_short(buf->data+offset+4, -1 * loc->longitude.degrees); set_short(buf->data+offset+6, -1 * loc->longitude.minutes); } else { set_short(buf->data+offset+4, loc->longitude.degrees); set_short(buf->data+offset+6, loc->longitude.minutes); } if(NULL != loc->note) { offset = buf->used; pi_buffer_expect(buf, buf->used + strlen(loc->note)+1); buf->used = buf->used + strlen(loc->note)+1; strcpy((char *)(buf->data+offset), loc->note); } else { offset = buf->used; pi_buffer_expect(buf, buf->used + 1); set_byte(buf->data+offset, 0); buf->used = buf->used + 1; } return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/padp.c0000644000175000017500000006527210565355407020175 0ustar rousseaurousseau/* * $Id: padp.c,v 1.59 2006/10/13 09:52:13 fpillet Exp $ * * padp.c: Pilot PADP protocol * * (c) 1996, D. Jeff Dionne. * Much of this code adapted from Brian J. Swetland * Mostly rewritten by Kenneth Albanowski. Adjusted timeout values and * better error handling by Tilo Christ. * (c) 2005, Florent Pillet * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this 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 #include #include "pi-debug.h" #include "pi-source.h" #include "pi-padp.h" #include "pi-slp.h" #include "pi-error.h" #define PI_PADP_TX_TIMEOUT 2*1000 #define PI_PADP_TX_RETRIES 10 #define PI_PADP_RX_BLOCK_TO 30*1000 #define PI_PADP_RX_SEGMENT_TO 30*1000 /* Declare function prototypes */ static int padp_flush(pi_socket_t *ps, int flags); static int padp_getsockopt(pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len); static int padp_setsockopt(pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len); static int padp_sendack(struct pi_socket *ps, struct pi_padp_data *data, unsigned char txid, struct padp *padp, int flags); /*********************************************************************** * * Function: padp_protocol_dup * * Summary: clones an existing pi_protocol struct * * Parameters: pi_protocol* * * Returns: pi_protocol_t* or NULL if operation failed * ***********************************************************************/ static pi_protocol_t* padp_protocol_dup (pi_protocol_t *prot) { pi_protocol_t *new_prot = NULL; pi_padp_data_t *data = NULL, *new_data = NULL; new_prot = (pi_protocol_t *)malloc (sizeof (pi_protocol_t)); if (new_prot != NULL) { new_data = (pi_padp_data_t *)malloc (sizeof (pi_padp_data_t)); if (new_data == NULL) { free(new_prot); new_prot = NULL; } else { new_prot->level = prot->level; new_prot->dup = prot->dup; new_prot->free = prot->free; new_prot->read = prot->read; new_prot->write = prot->write; new_prot->flush = prot->flush; new_prot->getsockopt = prot->getsockopt; new_prot->setsockopt = prot->setsockopt; data = (pi_padp_data_t *)prot->data; memcpy(new_data, data, sizeof(pi_padp_data_t)); new_prot->data = new_data; } } return new_prot; } /*********************************************************************** * * Function: padp_protocol_free * * Summary: frees an existing pi_protocol struct * * Parameters: pi_protocol* * * Returns: void * ***********************************************************************/ static void padp_protocol_free (pi_protocol_t *prot) { ASSERT (prot != NULL); if (prot != NULL) { if (prot->data != NULL) free(prot->data); free(prot); } } /*********************************************************************** * * Function: padp_protocol * * Summary: creates and inits pi_protocol struct instance * * Parameters: void * * Returns: pi_protocol_t* or NULL if operation failed * ***********************************************************************/ pi_protocol_t *padp_protocol (void) { pi_protocol_t *prot = NULL; pi_padp_data_t *data = NULL; prot = (pi_protocol_t *) malloc (sizeof (pi_protocol_t)); if (prot != NULL) { data = (pi_padp_data_t *) malloc (sizeof (pi_padp_data_t)); if (data == NULL) { free(prot); prot = NULL; } else { prot->level = PI_LEVEL_PADP; prot->dup = padp_protocol_dup; prot->free = padp_protocol_free; prot->read = padp_rx; prot->write = padp_tx; prot->flush = padp_flush; prot->getsockopt = padp_getsockopt; prot->setsockopt = padp_setsockopt; data->type = padData; data->last_type = -1; data->txid = 0xff; data->next_txid = 0xff; data->freeze_txid = 0; data->use_long_format = 0; prot->data = data; } } return prot; } /*********************************************************************** * * Function: padp_tx * * Summary: Transmit PADP packets * * Parameters: pi_socket_t*, char* to buffer, buffer length, flags * * Returns: Number of packets transmitted * ***********************************************************************/ ssize_t padp_tx(pi_socket_t *ps, const unsigned char *buf, size_t len, int flags) { int fl = PADP_FL_FIRST, count = 0, retries, result, type, socket, timeout, header_size; size_t size, tlen; unsigned char txid; pi_protocol_t *prot, *next; pi_padp_data_t *data; pi_buffer_t *padp_buf; struct padp padp; prot = pi_protocol(ps->sd, PI_LEVEL_PADP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (pi_padp_data_t *)prot->data; next = pi_protocol_next(ps->sd, PI_LEVEL_PADP); if (next == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); if (data->type == padWake) data->txid = 0xff; if (!data->freeze_txid) { if (data->txid == 0) data->txid = 0x10; /* some random # */ else if (data->txid >= 0xfe) data->next_txid = 1; /* wrap */ else data->next_txid = data->txid + 1; } if (data->type != padAck && ps->state == PI_SOCK_CONN_ACCEPT) data->txid = data->next_txid; padp_buf = pi_buffer_new (PI_PADP_HEADER_LEN + 2 + PI_PADP_MTU); if (padp_buf == NULL) return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); pi_flush(ps->sd, PI_FLUSH_INPUT); do { retries = PI_PADP_TX_RETRIES; do { padp_buf->used = 0; type = PI_SLP_TYPE_PADP; socket = PI_SLP_SOCK_DLP; timeout = PI_PADP_TX_TIMEOUT; size = sizeof(type); pi_setsockopt(ps->sd, PI_LEVEL_SLP, PI_SLP_TYPE, &type, &size); pi_setsockopt(ps->sd, PI_LEVEL_SLP, PI_SLP_DEST, &socket, &size); pi_setsockopt(ps->sd, PI_LEVEL_SLP, PI_SLP_SRC, &socket, &size); size = sizeof(timeout); pi_setsockopt(ps->sd, PI_LEVEL_DEV, PI_DEV_TIMEOUT, &timeout, &size); size = sizeof(data->txid); pi_setsockopt(ps->sd, PI_LEVEL_SLP, PI_SLP_TXID, &data->txid, &size); tlen = (len > PI_PADP_MTU) ? PI_PADP_MTU : len; header_size = data->use_long_format ? PI_PADP_HEADER_LEN+2 : PI_PADP_HEADER_LEN; /* build the packet */ set_byte(&padp_buf->data[PI_PADP_OFFSET_TYPE], data->type); set_byte(&padp_buf->data[PI_PADP_OFFSET_FLGS], fl | (len == tlen ? PADP_FL_LAST : 0) | (data->use_long_format ? PADP_FL_LONG : 0)); if (data->use_long_format) set_long(&padp_buf->data[PI_PADP_OFFSET_SIZE], (fl ? len : (size_t)count)); else set_short(&padp_buf->data[PI_PADP_OFFSET_SIZE], (fl ? len : (size_t)count)); memcpy(padp_buf->data + header_size, buf, tlen); CHECK(PI_DBG_PADP, PI_DBG_LVL_INFO, padp_dump_header(padp_buf->data, 1)); CHECK(PI_DBG_PADP, PI_DBG_LVL_DEBUG, padp_dump(padp_buf->data)); /* send the packet, check for disconnection (i.e. when running over USB) */ result = next->write(ps, padp_buf->data, header_size + tlen, flags); if (result < 0) { if (result == PI_ERR_SOCK_DISCONNECTED) goto disconnected; } /* Tickles don't get acks */ if (data->type == padTickle) break; keepwaiting: LOG((PI_DBG_PADP, PI_DBG_LVL_DEBUG, "PADP TX waiting for ACK\n")); result = next->read(ps, padp_buf, PI_PADP_HEADER_LEN + 2 + PI_PADP_MTU, flags); if (result > 0) { padp.type = get_byte(&padp_buf->data[PI_PADP_OFFSET_TYPE]); padp.flags = get_byte(&padp_buf->data[PI_PADP_OFFSET_FLGS]); if (padp.flags & PADP_FL_LONG) { header_size = PI_PADP_HEADER_LEN + 2; padp.size = get_long(&padp_buf->data[PI_PADP_OFFSET_SIZE]); } else { header_size = PI_PADP_HEADER_LEN; padp.size = get_short(&padp_buf->data[PI_PADP_OFFSET_SIZE]); } CHECK(PI_DBG_PADP, PI_DBG_LVL_INFO, padp_dump_header(padp_buf->data, 0)); CHECK(PI_DBG_PADP, PI_DBG_LVL_DEBUG, padp_dump(padp_buf->data)); size = sizeof(type); pi_getsockopt(ps->sd, PI_LEVEL_SLP, PI_SLP_LASTTYPE, &type, &size); size = sizeof(txid); pi_getsockopt(ps->sd, PI_LEVEL_SLP, PI_SLP_LASTTXID, &txid, &size); if (type == PI_SLP_TYPE_PADP && padp.type == (unsigned char)padData && txid == data->txid && len == tlen) { /* We didn't receive the ack for the last packet, but the incomding data is the response to this transmission. The ack was lost. */ LOG((PI_DBG_PADP, PI_DBG_LVL_WARN, "PADP TX Missing Ack\n")); count += tlen; goto done; } else if (padp.type == (unsigned char)padTickle) { /* Tickle to avoid timeout */ goto keepwaiting; } else if (type == PI_SLP_TYPE_PADP && padp.type == (unsigned char)padAck && txid == data->txid) { if (padp.flags & PADP_FL_MEMERROR) { /* OS 2.x enjoys sending erroneous memory errors */ LOG((PI_DBG_PADP, PI_DBG_LVL_WARN, "PADP TX Memory Error\n")); /* Mimimum failure: transmission failed due to * lack of memory in reciever link layer, but * connection is still active. This transmission * was lost, but other transmissions will be * received. */ errno = EMSGSIZE; count = -1; goto done; } /* Successful Ack */ buf = buf + tlen; len -= tlen; count += tlen; fl = 0; LOG((PI_DBG_PADP, PI_DBG_LVL_DEBUG, "PADP TX got ACK\n")); break; } else if (type == PI_SLP_TYPE_PADP && padp.type == data->last_ack_padp.type && padp.flags == data->last_ack_padp.flags && padp.size == data->last_ack_padp.size && txid == data->last_ack_txid) { /* A repeat of a packet we already received. The ack got lost, so resend it. */ LOG((PI_DBG_PADP, PI_DBG_LVL_WARN, "PADP TX resending lost ACK\n")); padp_sendack(ps, data, txid, &padp, flags); continue; } else { LOG((PI_DBG_PADP, PI_DBG_LVL_ERR, "PADP TX Unexpected packet " "(possible port speed problem? " "out of sync packet?)\n")); padp_dump_header (buf, 1); /* Got unknown packet */ errno = EIO; count = -1; goto done; } } else if (result == PI_ERR_SOCK_DISCONNECTED) goto disconnected; } while (--retries > 0); if (retries == 0) { /* Maximum failure: transmission failed, and the connection must be presumed dead */ LOG((PI_DBG_PADP, PI_DBG_LVL_ERR, "PADP TX too many retries")); errno = ETIMEDOUT; pi_buffer_free (padp_buf); ps->state = PI_SOCK_CONN_BREAK; return pi_set_error(ps->sd, PI_ERR_SOCK_DISCONNECTED); } } while (len); done: if (data->type != padAck && ps->state == PI_SOCK_CONN_INIT) data->txid = data->next_txid; pi_buffer_free (padp_buf); return count; disconnected: LOG((PI_DBG_PADP, PI_DBG_LVL_ERR, "PADP TX disconnected")); pi_buffer_free(padp_buf); ps->state = PI_SOCK_CONN_BREAK; return pi_set_error(ps->sd, PI_ERR_SOCK_DISCONNECTED); } /*********************************************************************** * * Function: padp_rx * * Summary: Receive PADP packets * * Parameters: pi_socket_t*, char* to buffer, expected length, flags * * Returns: number of bytes received or negative on error * ***********************************************************************/ ssize_t padp_rx(pi_socket_t *ps, pi_buffer_t *buf, size_t expect, int flags) { int bytes, offset = 0, ouroffset = 0, honor_rx_timeout, type, timeout, header_size; unsigned char txid; size_t total_bytes, size; pi_protocol_t *next, *prot; pi_padp_data_t *data; struct padp padp; pi_buffer_t *padp_buf; time_t endtime; LOG((PI_DBG_PADP, PI_DBG_LVL_DEBUG, "PADP RX expect=%d flags=0x%04x\n", expect, flags)); prot = pi_protocol(ps->sd, PI_LEVEL_PADP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (pi_padp_data_t *)prot->data; next = pi_protocol_next(ps->sd, PI_LEVEL_PADP); if (next == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); size = sizeof(honor_rx_timeout); pi_getsockopt(ps->sd, PI_LEVEL_SOCK, PI_SOCK_HONOR_RX_TIMEOUT, &honor_rx_timeout, &size); padp_buf = pi_buffer_new (PI_PADP_HEADER_LEN + PI_PADP_MTU); if (padp_buf == NULL) { errno = ENOMEM; return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); } /* the txid may be "frozen" if we're in the process of doing a large read * over VFS. In this case, all packets have the same txid */ if (!data->freeze_txid) { if (ps->state == PI_SOCK_CONN_ACCEPT) { if (data->txid >= 0xfe) data->next_txid = 1; /* wrap */ else data->next_txid = data->txid + 1; } else data->next_txid = data->txid; } endtime = time(NULL) + PI_PADP_RX_BLOCK_TO / 1000; for (;;) { if (honor_rx_timeout && time(NULL) > endtime) { LOG((PI_DBG_PADP, PI_DBG_LVL_ERR, "PADP RX Timed out")); /* Bad timeout breaks connection */ errno = ETIMEDOUT; ps->state = PI_SOCK_CONN_BREAK; pi_buffer_free (padp_buf); return pi_set_error(ps->sd, PI_ERR_SOCK_DISCONNECTED); } timeout = honor_rx_timeout ? PI_PADP_RX_BLOCK_TO + 2000 : 0; size = sizeof(timeout); pi_setsockopt(ps->sd, PI_LEVEL_DEV, PI_DEV_TIMEOUT, &timeout, &size); total_bytes = 0; padp_buf->used = 0; header_size = PI_PADP_HEADER_LEN; while (total_bytes < header_size) { bytes = next->read(ps, padp_buf, (size_t)header_size + PI_PADP_MTU - total_bytes, flags); if (bytes < 0) { LOG((PI_DBG_PADP, PI_DBG_LVL_ERR, "PADP RX Read Error\n")); pi_buffer_free (padp_buf); return bytes; } total_bytes += bytes; /* check for the long packet format flag and adjust header size */ if (header_size==PI_PADP_HEADER_LEN && total_bytes >= PI_PADP_HEADER_LEN && (padp_buf->data[PI_PADP_OFFSET_FLGS] & PADP_FL_LONG)) { header_size += 2; } } padp.type = padp_buf->data[PI_PADP_OFFSET_TYPE]; padp.flags = padp_buf->data[PI_PADP_OFFSET_FLGS]; if (padp.flags & PADP_FL_LONG) padp.size = get_long(&padp_buf->data[PI_PADP_OFFSET_SIZE]); else padp.size = get_short(&padp_buf->data[PI_PADP_OFFSET_SIZE]); size = sizeof(type); pi_getsockopt(ps->sd, PI_LEVEL_SLP, PI_SLP_LASTTYPE, &type, &size); size = sizeof(txid); pi_getsockopt(ps->sd, PI_LEVEL_SLP, PI_SLP_LASTTXID, &txid, &size); if (padp.flags & PADP_FL_MEMERROR) { if (txid == data->txid) { LOG((PI_DBG_PADP, PI_DBG_LVL_WARN, "PADP RX Memory Error\n")); errno = EMSGSIZE; ouroffset = -1; goto done; /* Mimimum failure: transmission failed due to lack of memory in reciever link layer, but connection is still active. This transmission was lost, but other transmissions will be received. */ } continue; } else if (padp.type == padTickle) { /* Tickle to avoid timeout */ LOG((PI_DBG_PADP, PI_DBG_LVL_WARN, "PADP RX Got Tickled\n")); endtime = time(NULL) + PI_PADP_RX_BLOCK_TO / 1000; continue; } else if (type != PI_SLP_TYPE_PADP || padp.type != padData || txid != data->txid || !(padp.flags & PADP_FL_FIRST)) { LOG((PI_DBG_PADP, PI_DBG_LVL_ERR, "PADP RX Wrong packet type on queue" "(possible port speed problem? (loc1))\n")); continue; } break; } /* OK, we got the expected begin-of-data packet */ endtime = time(NULL) + PI_PADP_RX_SEGMENT_TO / 1000; for (;;) { CHECK(PI_DBG_PADP, PI_DBG_LVL_INFO, padp_dump_header(padp_buf->data, 0)); CHECK(PI_DBG_PADP, PI_DBG_LVL_DEBUG, padp_dump(padp_buf->data)); /* Ack the packet */ padp_sendack(ps, data, data->txid, &padp, flags); /* calculate length and offset - remove */ offset = ((padp.flags & PADP_FL_FIRST) ? 0 : padp.size); total_bytes -= PI_PADP_HEADER_LEN; /* If packet was out of order, ignore it */ if (offset == ouroffset) { if (pi_buffer_append (buf, &padp_buf->data[header_size], total_bytes) == NULL) { errno = ENOMEM; return pi_set_error(ps->sd, PI_ERR_GENERIC_MEMORY); } ouroffset += total_bytes; } if (padp.flags & PADP_FL_LAST) break; endtime = time(NULL) + PI_PADP_RX_SEGMENT_TO / 1000; for (;;) { if (honor_rx_timeout && time(NULL) > endtime) { LOG((PI_DBG_PADP, PI_DBG_LVL_ERR, "PADP RX Segment Timeout")); /* Segment timeout, return error */ errno = ETIMEDOUT; ouroffset = -1; /* Bad timeout breaks connection */ ps->state = PI_SOCK_CONN_BREAK; pi_buffer_free (padp_buf); return pi_set_error(ps->sd, PI_ERR_SOCK_DISCONNECTED); } timeout = honor_rx_timeout ? (PI_PADP_RX_SEGMENT_TO + 2000) : 0; size = sizeof(timeout); pi_setsockopt(ps->sd, PI_LEVEL_DEV, PI_DEV_TIMEOUT, &timeout, &size); total_bytes = 0; padp_buf->used = 0; header_size = PI_PADP_HEADER_LEN; while (total_bytes < header_size) { bytes = next->read(ps, padp_buf, header_size + PI_PADP_MTU - total_bytes, flags); if (bytes < 0) { LOG((PI_DBG_PADP, PI_DBG_LVL_ERR, "PADP RX Read Error")); pi_buffer_free (padp_buf); return pi_set_error(ps->sd, bytes); } total_bytes += bytes; /* check for the long packet format flag and adjust header size */ if (header_size==PI_PADP_HEADER_LEN && total_bytes >= PI_PADP_HEADER_LEN && (padp_buf->data[PI_PADP_OFFSET_FLGS] & PADP_FL_LONG)) { header_size += 2; } } padp.type = padp_buf->data[PI_PADP_OFFSET_TYPE]; padp.flags = padp_buf->data[PI_PADP_OFFSET_FLGS]; if (padp.flags & PADP_FL_LONG) padp.size = get_long(&padp_buf->data[PI_PADP_OFFSET_SIZE]); else padp.size = get_short(&padp_buf->data[PI_PADP_OFFSET_SIZE]); CHECK(PI_DBG_PADP, PI_DBG_LVL_INFO, padp_dump_header(padp_buf->data, 0)); CHECK(PI_DBG_PADP, PI_DBG_LVL_DEBUG, padp_dump(padp_buf->data)); size = sizeof(type); pi_getsockopt(ps->sd, PI_LEVEL_SLP, PI_SLP_LASTTYPE, &type, &size); size = sizeof(txid); pi_getsockopt(ps->sd, PI_LEVEL_SLP, PI_SLP_LASTTXID, &txid, &size); if (padp.flags & PADP_FL_MEMERROR) { if (txid == data->txid) { /* Mimimum failure: transmission failed due to lack of memory in receiver link layer, but connection is still active. This transmission was lost, but other transmissions will be received. */ LOG((PI_DBG_PADP, PI_DBG_LVL_WARN, "PADP RX Memory Error")); errno = EMSGSIZE; ouroffset = -1; goto done; } continue; } if (padp.type == (unsigned char) 4) { /* Tickle to avoid timeout */ endtime = time(NULL) + PI_PADP_RX_BLOCK_TO / 1000; LOG((PI_DBG_PADP, PI_DBG_LVL_WARN, "PADP RX Got Tickled")); continue; } if (type != PI_SLP_TYPE_PADP || padp.type != padData || txid != data->txid || (padp.flags & PADP_FL_FIRST)) { LOG((PI_DBG_PADP, PI_DBG_LVL_ERR, "PADP RX Wrong packet type on queue" "(possible port speed problem? (loc2))\n")); continue; } break; } } done: data->txid = data->next_txid; pi_buffer_free (padp_buf); return ouroffset; } /*********************************************************************** * * Function: padp_flush * * Summary: Flush input and output buffers * * Parameters: pi_socket_t*, flags * * Returns: A negative number on error, 0 otherwise * ***********************************************************************/ static int padp_flush(pi_socket_t *ps, int flags) { pi_protocol_t *prot, *next; prot = pi_protocol(ps->sd, PI_LEVEL_PADP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); next = pi_protocol_next(ps->sd, PI_LEVEL_PADP); if (next == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); return next->flush(ps, flags); } /*********************************************************************** * * Function: padp_getsockopt * * Summary: get options on socket * * Parameters: pi_socket*, level, option name, option value, option length * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int padp_getsockopt(pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len) { pi_protocol_t *prot; pi_padp_data_t *data; prot = pi_protocol(ps->sd, PI_LEVEL_PADP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (pi_padp_data_t *)prot->data; switch (option_name) { case PI_PADP_TYPE: if (*option_len != sizeof (data->type)) goto error; memcpy (option_value, &data->type, sizeof (data->type)); break; case PI_PADP_LASTTYPE: if (*option_len != sizeof (data->last_type)) goto error; memcpy (option_value, &data->last_type, sizeof (data->last_type)); break; case PI_PADP_FREEZE_TXID: if (*option_len != sizeof (data->freeze_txid)) goto error; memcpy (option_value, &data->freeze_txid, sizeof(data->freeze_txid)); break; case PI_PADP_USE_LONG_FORMAT: if (*option_len != sizeof (data->use_long_format)) goto error; memcpy (option_value, &data->use_long_format, sizeof(data->use_long_format)); break; } return 0; error: errno = EINVAL; return pi_set_error(ps->sd, PI_ERR_GENERIC_ARGUMENT); } /*********************************************************************** * * Function: padp_setsockopt * * Summary: get options on socket * * Parameters: pi_socket*, level, option name, option value, option length * * Returns: 0 for success, negative otherwise * ***********************************************************************/ static int padp_setsockopt(pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len) { pi_protocol_t *prot; pi_padp_data_t *data; int was_frozen; prot = pi_protocol(ps->sd, PI_LEVEL_PADP); if (prot == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); data = (pi_padp_data_t *)prot->data; switch (option_name) { case PI_PADP_TYPE: if (*option_len != sizeof (data->type)) goto error; memcpy (&data->type, option_value, sizeof (data->type)); break; case PI_PADP_FREEZE_TXID: if (*option_len != sizeof (data->freeze_txid)) goto error; was_frozen = data->freeze_txid; memcpy (&data->freeze_txid, option_value, sizeof (data->freeze_txid)); if (was_frozen && !data->freeze_txid) { data->next_txid++; if (data->next_txid >= 0xfe) data->next_txid = 1; } break; case PI_PADP_USE_LONG_FORMAT: if (*option_len != sizeof (data->use_long_format)) goto error; memcpy (&data->use_long_format, option_value, sizeof(data->use_long_format)); break; } return 0; error: errno = EINVAL; return pi_set_error(ps->sd, PI_ERR_GENERIC_ARGUMENT); } /*********************************************************************** * * Function: padp_sendack * * Summary: Acknowledge receipt of a packet * * Parameters: * * Returns: * ***********************************************************************/ static int padp_sendack(struct pi_socket *ps, struct pi_padp_data *data, /* padp state, will be modified */ unsigned char txid, /* txid of the packet being acked */ struct padp *padp, /* padp header of the packet being acked */ int flags) { int type, socket, result, header_size; size_t size; unsigned char npadp_buf[PI_PADP_HEADER_LEN+2]; struct pi_protocol *next; next = pi_protocol_next(ps->sd, PI_LEVEL_PADP); if (next == NULL) return pi_set_error(ps->sd, PI_ERR_SOCK_INVALID); type = 2; socket = PI_SLP_SOCK_DLP; size = sizeof(type); pi_setsockopt(ps->sd, PI_LEVEL_SLP, PI_SLP_TYPE, &type, &size); pi_setsockopt(ps->sd, PI_LEVEL_SLP, PI_SLP_DEST, &socket, &size); pi_setsockopt(ps->sd, PI_LEVEL_SLP, PI_SLP_SRC, &socket, &size); size = sizeof(txid); pi_setsockopt(ps->sd, PI_LEVEL_SLP, PI_SLP_TXID, &txid, &size); header_size = PI_PADP_HEADER_LEN; set_byte(&npadp_buf[PI_PADP_OFFSET_TYPE], padAck); set_byte(&npadp_buf[PI_PADP_OFFSET_FLGS], padp->flags); if (padp->flags & PADP_FL_LONG) { header_size += 2; set_long(&npadp_buf[PI_PADP_OFFSET_SIZE], padp->size); } else { set_short(&npadp_buf[PI_PADP_OFFSET_SIZE], padp->size); } CHECK(PI_DBG_PADP, PI_DBG_LVL_INFO, padp_dump_header(npadp_buf, 1)); CHECK(PI_DBG_PADP, PI_DBG_LVL_DEBUG, padp_dump(npadp_buf)); result = next->write(ps, npadp_buf, header_size, flags); if (result >= 0) { data->last_ack_txid = txid; data->last_ack_padp.type = padp->type; data->last_ack_padp.flags = padp->flags; data->last_ack_padp.size = padp->size; } return result; } /*********************************************************************** * * Function: padp_dump_header * * Summary: Dump PADP packet header * * Parameters: char* to data, RXTX boolean * * Returns: void * ***********************************************************************/ void padp_dump_header(const unsigned char *data, int rxtx) { long s; char *stype; unsigned char type, flags; type = get_byte (&data[PI_PADP_OFFSET_TYPE]); switch (type) { case padData: stype = "DATA"; break; case padAck: stype = "ACK"; break; case padTickle: stype = "TICKLE"; break; case padAbort: stype = "ABORT"; break; default: stype = "UNK"; break; } flags = get_byte(&data[PI_PADP_OFFSET_FLGS]); if (flags & PADP_FL_LONG) s = get_long(&data[PI_PADP_OFFSET_SIZE]); else s = get_short(&data[PI_PADP_OFFSET_SIZE]); LOG((PI_DBG_PADP, PI_DBG_LVL_NONE, "PADP %s %c%c%c type=%s len=%ld\n", rxtx ? "TX" : "RX", (flags & PADP_FL_FIRST) ? 'F' : ' ', (flags & PADP_FL_LAST) ? 'L' : ' ', (flags & PADP_FL_MEMERROR) ? 'M' : ' ', stype, s)); } /*********************************************************************** * * Function: padp_dump * * Summary: Dump PADP packets * * Parameters: char* to data * * Returns: void * ***********************************************************************/ void padp_dump(const unsigned char *data) { size_t size; unsigned char type, flags; int header_size = PI_PADP_HEADER_LEN; type = get_byte (&data[PI_PADP_OFFSET_TYPE]); flags = get_byte (&data[PI_PADP_OFFSET_FLGS]); if (flags & PADP_FL_LONG) { header_size += 2; size = get_long(&data[PI_PADP_OFFSET_SIZE]); } else size = get_short(&data[PI_PADP_OFFSET_SIZE]); if (size > PI_PADP_MTU) size = PI_PADP_MTU; if (type != padAck) pi_dumpdata((char *)&data[header_size], size); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisock/veo.c0000644000175000017500000001032610513447543020024 0ustar rousseaurousseau/* * $Id: veo.c,v 1.7 2006/10/12 14:21:23 desrod Exp $ * * veo.c: Translate veo traveler data formats * * Copyright (c) 2002, Angus Ainslie * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include "pi-macros.h" #include "pi-veo.h" /*********************************************************************** * * Function: free_Veo * * Summary: Free the memory and filehandle from the record alloc. * ***********************************************************************/ void free_Veo( Veo_t *veo ) { } /*********************************************************************** * * Function: unpack_Veo * * Summary: Unpack the Veo structure into records we can chew on * ***********************************************************************/ int unpack_Veo(Veo_t *veo, unsigned char *buffer, size_t len) { unsigned char *start = buffer; /* consume unknown */ buffer += 1; veo->quality = (unsigned char) get_byte(buffer); buffer += 1; veo->resolution = (unsigned char) get_byte(buffer); buffer += 1; /* consume 12 more unknowns */ buffer += 12; veo->picnum = (unsigned long int) get_long(buffer); buffer += 4; veo->day = (unsigned short int) get_short(buffer); buffer += 2; veo->month = (unsigned short int) get_short(buffer); buffer += 2; veo->year = (unsigned short int) get_short(buffer); buffer += 2; if( veo->resolution == 0 ) { veo->width = 640; veo->height = 480; } else if( veo->resolution == 1 ) { veo->width = 320; veo->height = 240; } else fprintf( stderr, "unknown resolution\n" ); return ( buffer - start ); /* FIXME: return real length */ } /*********************************************************************** * * Function: pack_Veo * * Summary: Pack the Veo records into a structure * ***********************************************************************/ int pack_Veo(Veo_t *veo, unsigned char *buf, size_t len) { return( 0 ); } /*********************************************************************** * * Function: unpack_VeoAppInfo * * Summary: Unpack the Veo AppInfo block from the structure * ***********************************************************************/ int unpack_VeoAppInfo(struct VeoAppInfo *appinfo, unsigned char *record, size_t len) { int i; unsigned char *start = record; i = unpack_CategoryAppInfo( &appinfo->category, record, len ); if (!i) return 0; record += i; len -= i; if (len < 4) return 0; appinfo->dirty = get_short(record); record += 2; appinfo->sortByPriority = get_byte(record); record += 2; return (record - start); } /*********************************************************************** * * Function: pack_VeoAppInfo * * Summary: Pack the AppInfo block/record back into the structure * ***********************************************************************/ int pack_VeoAppInfo(struct VeoAppInfo *appinfo, unsigned char *record, size_t len) { int i; unsigned char *start = record; i = pack_CategoryAppInfo(&appinfo->category, record, len); if (!record) return i + 4; if (!i) return 0; record += i; len -= i; if (len < 4) return 0; set_short(record, appinfo->dirty); set_byte(record + 2, appinfo->sortByPriority); set_byte(record + 3, 0); /* gapfill */ record += 4; return (record - start); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/configure0000755000175000017500000220604011333433245017014 0ustar rousseaurousseau#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.65. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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=: # Pre-4.2 versions of Zsh do 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_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } 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.) 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do 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_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_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 || $as_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" || as_fn_error "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error ERROR [LINENO LOG_FD] # --------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with status $?, using 1 if that was 0. as_fn_error () { as_status=$?; test $as_status -eq 0 && as_status=1 if test "$3"; then as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 fi $as_echo "$as_me: error: $1" >&2 as_fn_exit $as_status } # as_fn_error 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # 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" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac 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 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then 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 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='mkdir -p "$as_dir"' 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'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac ECHO=${lt_ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF $* _LT_EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi test -n "$DJDIR" || 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= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="include/pi-version.h.in" ac_default_prefix=/usr/local # 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" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS CAT_ENTRY_END CAT_ENTRY_START DOCBOOK_ROOT XSLTPROC_FLAGS XML_CATALOG ENABLE_XSLTPROC_FALSE ENABLE_XSLTPROC_TRUE XSLTPROC BUILD_XML_FALSE BUILD_XML_TRUE WITH_PYTHON_FALSE WITH_PYTHON_TRUE PYTHON_H PYTHON_VERSION PYTHON_CFLAGS PYTHON_LIBS PYTHON WITH_TCL_FALSE WITH_TCL_TRUE WISH_PROG TCLSH_PROG TCL_INCLUDES TCL_SHLIB_LD_LIBS TCL_LD_FLAGS TCL_EXTRA_CFLAGS TCL_DEFS TCL_LIBS TCL_STUB_LIB_SPEC TCL_STUB_LIB_FLAG TCL_STUB_LIB_FILE TCL_LIB_SPEC TCL_LIB_FLAG TCL_LIB_FILE TCL_SRC_DIR TCL_BIN_DIR TCL_VERSION JAVA_VERSION JAVABASE WITH_JAVA_FALSE WITH_JAVA_TRUE JAR JAVA JAVAC WITH_PERL_FALSE WITH_PERL_TRUE PERL RL_LIBS ICONV_LIBS ICONV_CFLAGS POPT_INCLUDES POPT_LIBS INCLUDED_POPT_FALSE INCLUDED_POPT_TRUE WITH_BLUEZ_FALSE WITH_BLUEZ_TRUE BLUEZ_LIBS BLUEZ_CFLAGS PKG_CONFIG usb_libs WITH_DARWINUSB_FALSE WITH_DARWINUSB_TRUE WITH_FREEBSDUSB_FALSE WITH_FREEBSDUSB_TRUE WITH_LINUXUSB_FALSE WITH_LINUXUSB_TRUE WITH_LIBUSB_FALSE WITH_LIBUSB_TRUE WITH_USB_FALSE WITH_USB_TRUE PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CC acx_pthread_config PNG_LIBS PNG_CFLAGS ENABLE_CONDUITS_FALSE ENABLE_CONDUITS_TRUE CVS_BUILD_FALSE CVS_BUILD_TRUE PIC_LIBS YFLAGS YACC CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL lt_ECHO RANLIB AR OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED LIBTOOL ac_ct_F77 FFLAGS F77 am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build PISYNC_AGE PISYNC_REVISION PISYNC_CURRENT PISOCK_AGE PISOCK_REVISION PISOCK_CURRENT PILOT_LINK_PATCH PILOT_LINK_MINOR PILOT_LINK_MAJOR PILOT_LINK_VERS MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_gnu_ld enable_libtool_lock enable_conduits with_libpng enable_threads enable_libusb with_bluez with_included_popt with_libiconv with_readline with_perl with_java with_tcl with_tclinclude with_python with_efence enable_debug enable_profile enable_xsltproc enable_compile_warnings enable_compile_werror ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS F77 FFLAGS CPP YACC YFLAGS PKG_CONFIG BLUEZ_CFLAGS BLUEZ_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # 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}' 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_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=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_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error "unrecognized option: \`$ac_option' Try \`$0 --help' for more information." ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_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'` as_fn_error "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. 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 # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" 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 $as_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 .` || as_fn_error "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error "pwd does not report name of working directory" # 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 -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | 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 .." as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" 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 this package 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/PACKAGE] --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] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --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-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-conduits Build the userland conduits --enable-threads Add this to have built-in thread safety --enable-libusb Enable usage of libusb --disable-debug Shunt runtime debugging --enable-profile use gprof profiling [default=no] --enable-xsltproc Use xsltproc to build documentation [default=no] --enable-compile-warnings Enable verbose compiler warnings --enable-compile-werror Causes warnings to be treated as errors in GCC Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-libpng Prefix where libpng is installed --with-bluez Enable use of BlueZ --with-included-popt use bundled popt library, not from system --with-libiconv Prefix where libiconv is installed --without-readline Disable readline [default=no] --with-perl=perlexec use Perl [default=no] --with-java=jdkbase use Java [default=no] --with-tcl=tclconfig use Tcl, [default=no] --with-tclinclude public Tcl header dir --with-python=pybase use Python, [default=no] --with-python Compile with Python bindings --with-efence use ElectricFence, [default=no] 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 (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags CPP C preprocessor YACC The `Yet Another C Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. PKG_CONFIG path to pkg-config utility BLUEZ_CFLAGS C compiler flags for BLUEZ, overriding pkg-config BLUEZ_LIBS linker flags for BLUEZ, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _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" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && 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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_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 $as_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 configure generated by GNU Autoconf 2.65 Copyright (C) 2009 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 ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_f77_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_f77_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_f77_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* 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 $2 (); /* 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_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_func # ac_fn_f77_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_f77_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_f77_try_link # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_mongrel 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 $as_me, which was generated by GNU Autoconf 2.65. 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=. $as_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append 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 as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset 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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; 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=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_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=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_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 && $as_echo "$as_me: caught signal $ac_signal" $as_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'; as_fn_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 $as_echo "/* confdefs.h */" > 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 cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_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. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # 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,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_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 # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_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. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$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 ac_config_headers="$ac_config_headers config.h" ac_config_headers="$ac_config_headers include/pi-md5.h" PILOT_LINK_VERS=0 PILOT_LINK_MAJOR=12 PILOT_LINK_MINOR=5 PILOT_LINK_PATCH= VERSION="$PILOT_LINK_VERS.$PILOT_LINK_MAJOR.$PILOT_LINK_MINOR$PILOT_LINK_PATCH" PISOCK_CURRENT=9 PISOCK_REVISION=2 PISOCK_AGE=0 PISYNC_CURRENT=1 PISYNC_REVISION=3 PISYNC_AGE=0 enable_werror=no save_CFLAGS="$CFLAGS" CFLAGS=`echo $save_CFLAGS | sed -e s/-Werror//g` CXXFLAGS=`echo $save_CXXFLAGS | sed -e s/-Werror//g` if test "x$CFLAGS" != "x$save_CFLAGS"; then enable_werror="yes" fi ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do for ac_t in install-sh install.sh shtool; do if test -f "$ac_dir/$ac_t"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/$ac_t -c" break 2 fi done done if test -z "$ac_aux_dir"; then as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 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. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then : $as_echo_n "(cached) " >&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 && as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error "invalid value of canonical build" "$LINENO" 5;; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then : $as_echo_n "(cached) " >&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` || as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error "invalid value of canonical host" "$LINENO" 5;; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if test "${ac_cv_target+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || as_fn_error "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error "invalid value of canonical target" "$LINENO" 5;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- cat >>confdefs.h <<_ACEOF #define HOST_OS "$host" _ACEOF am__api_version='1.11' # 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. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&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 rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$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' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # 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". as_fn_error "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "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 $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&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" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&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" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P 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. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then : $as_echo_n "(cached) " >&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" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_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 : $as_echo_n "(cached) " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi 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=pilot-link VERSION=$VERSION 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"} # 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_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&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" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&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" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&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" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&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" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&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" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&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" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "no acceptable C compiler found in \$PATH See \`config.log' for more details." "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 | *.dSYM | *.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 if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { as_fn_set_status 77 as_fn_error "C compiler cannot create executables See \`config.log' for more details." "$LINENO" 5; }; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "cannot compute suffix of object files: cannot compile See \`config.log' for more details." "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg 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) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 g77-3.2 g77-3.3 fl32 f77 fort77 xlf f90 xlf90 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_F77+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # 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_F77="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $F77" >&5 $as_echo "$F77" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 g77-3.2 g77-3.3 fl32 f77 fort77 xlf f90 xlf90 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_F77+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # 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_F77="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_F77" >&5 $as_echo "$ac_ct_F77" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_F77" && break done if test "x$ac_ct_F77" = x; then F77="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac F77=$ac_ct_F77 fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran 77 compiler" >&5 $as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; } if test "${ac_cv_f77_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_compiler_gnu" >&5 $as_echo "$ac_cv_f77_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -g" >&5 $as_echo_n "checking whether $F77 accepts -g... " >&6; } if test "${ac_cv_prog_f77_g+set}" = set; then : $as_echo_n "(cached) " >&6 else FFLAGS=-g cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : ac_cv_prog_f77_g=yes else ac_cv_prog_f77_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_g" >&5 $as_echo "$ac_cv_prog_f77_g" >&6; } if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi if test $ac_compiler_gnu = yes; then G77=yes else G77= 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 case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.2.6b' macro_revision='1.3017' ltmain="$ac_aux_dir/ltmain.sh" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if test "${ac_cv_path_SED+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_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 do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_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_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_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 as_fn_arith $ac_count + 1 && ac_count=$as_val 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 if test -z "$ac_cv_path_GREP"; then as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_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 as_fn_arith $ac_count + 1 && ac_count=$as_val 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 if test -z "$ac_cv_path_EGREP"; then as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if test "${ac_cv_path_FGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_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 fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_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_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # 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 ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&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. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test "${lt_cv_path_NM+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$ac_tool_prefix"; then for ac_prog in "dumpbin -symbols" "link -dump -symbols" 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DUMPBIN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # 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_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if test "${lt_cv_nm_interface+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:5036: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:5039: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:5042: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # 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_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&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" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&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" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&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" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&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" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 6248 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then : $as_echo_n "(cached) " >&6 else 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_NMEDIT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # 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_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_LIPO+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # 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_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # 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_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL64+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # 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_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if test "${lt_cv_apple_cc_single_mod+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&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 : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # 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 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." "$LINENO" 5; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h 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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " eval as_val=\$$as_ac_Header if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_F77+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # 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_F77="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $F77" >&5 $as_echo "$F77" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_F77+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # 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_F77="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_F77" >&5 $as_echo "$ac_ct_F77" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_F77" && break done if test "x$ac_ct_F77" = x; then F77="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac F77=$ac_ct_F77 fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran 77 compiler" >&5 $as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; } if test "${ac_cv_f77_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_compiler_gnu" >&5 $as_echo "$ac_cv_f77_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -g" >&5 $as_echo_n "checking whether $F77 accepts -g... " >&6; } if test "${ac_cv_prog_f77_g+set}" = set; then : $as_echo_n "(cached) " >&6 else FFLAGS=-g cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : ac_cv_prog_f77_g=yes else ac_cv_prog_f77_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_g" >&5 $as_echo "$ac_cv_prog_f77_g" >&6; } if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi if test $ac_compiler_gnu = yes; then G77=yes else G77= 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 -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if test "${lt_cv_objdir+set}" = set; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7997: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:8001: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 $as_echo "$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8336: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:8340: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test "${lt_cv_prog_compiler_static_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8441: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8445: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8496: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8500: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # 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 ;; linux* | k*bsd*-gnu) link_all_deplibs=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # 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. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' 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 cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) 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 exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi 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].*|aix[5-9]*) 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 exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # 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=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi 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 export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # 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 "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi 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_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # 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*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo(void) {} _ACEOF if ac_fn_c_try_link "$LINENO"; then : archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 $as_echo "$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line 10880 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line 10976 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } 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 CC="$lt_save_CC" ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_direct_absolute_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no inherit_rpath_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${F77-"f77"} compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` GCC=$G77 if test -n "$compiler"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } GCC_F77="$G77" LD_F77="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_F77='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_F77='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fPIC' lt_prog_compiler_static_F77='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='--shared' lt_prog_compiler_static_F77='--static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-qpic' lt_prog_compiler_static_F77='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_F77='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; rdos*) lt_prog_compiler_static_F77='-non_shared' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_F77" >&5 $as_echo "$lt_prog_compiler_pic_F77" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... " >&6; } if test "${lt_cv_prog_compiler_pic_works_F77+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11631: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:11635: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_F77=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_F77" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_F77" >&6; } if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test "${lt_cv_prog_compiler_static_works_F77+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_F77=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_F77=yes fi else lt_cv_prog_compiler_static_works_F77=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_F77" >&5 $as_echo "$lt_cv_prog_compiler_static_works_F77" >&6; } if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then : else lt_prog_compiler_static_F77= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_F77=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11730: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:11734: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_F77" >&5 $as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_F77=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11782: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:11786: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_F77" >&5 $as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag_F77= always_export_symbols_F77=no archive_cmds_F77= archive_expsym_cmds_F77= compiler_needs_object_F77=no enable_shared_with_static_runtimes_F77=no export_dynamic_flag_spec_F77= export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic_F77=no hardcode_direct_F77=no hardcode_direct_absolute_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported inherit_rpath_F77=no link_all_deplibs_F77=unknown module_cmds_F77= module_expsym_cmds_F77= old_archive_from_new_cmds_F77= old_archive_from_expsyms_cmds_F77= thread_safe_flag_spec_F77= whole_archive_flag_spec_F77= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # 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 ;; linux* | k*bsd*-gnu) link_all_deplibs_F77=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # 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. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='' ;; m68k) archive_cmds_F77='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_F77=no fi ;; interix[3-9]*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec_F77= tmp_sharedflag='--shared' ;; xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_F77=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_F77='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec_F77='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' archive_cmds_F77='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_F77='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs_F77=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix[4-9]*) 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 exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi 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].*|aix[5-9]*) 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 exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_direct_absolute_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes file_list_spec_F77='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs_F77=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec_F77='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an # empty executable. cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='' ;; m68k) archive_cmds_F77='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # 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_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' link_all_deplibs_F77=yes allow_undefined_flag_F77="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_F77="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_F77="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs_F77=no fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes hardcode_direct_absolute_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: case $host_cpu in hppa*64*|ia64*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; *) hardcode_direct_F77=yes hardcode_direct_absolute_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat > conftest.$ac_ext <<_ACEOF int foo(void) {} _ACEOF if ac_fn_f77_try_link "$LINENO"; then : archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc_F77='no' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: inherit_rpath_F77=yes link_all_deplibs_F77=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no hardcode_direct_absolute_F77=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs_F77=no fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc_F77='no' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi archive_cmds_need_lc_F77='no' hardcode_libdir_separator_F77=: ;; solaris*) no_undefined_flag_F77=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds_F77='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_F77='${wl}-z,text' allow_undefined_flag_F77='${wl}-z,nodefs' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-R,$libdir' hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec_F77='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_F77" >&5 $as_echo "$ld_shlibs_F77" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no with_gnu_ld_F77=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 pic_flag=$lt_prog_compiler_pic_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_F77 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_F77 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_F77" >&5 $as_echo "$archive_cmds_need_lc_F77" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_F77\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_F77\"" cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || test -n "$runpath_var_F77" || test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_F77" >&5 $as_echo "$hardcode_action_F77" >&6; } if test "$hardcode_action_F77" = relink || test "$inherit_rpath_F77" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_F77" != yes 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_config_commands="$ac_config_commands libtool" # Only expand once: for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_YACC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # 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_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" if test "x$GCC" = "xyes"; then CFLAGS=${CFLAGS:-"-g2 -Wall"} fi PIC_LIBS="" null_device="/dev/null" case "$host" in *darwin*) CPPFLAGS="$CPPFLAGS -DMACOSX" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fink support" >&5 $as_echo_n "checking for fink support... " >&6; } if test -d "/sw/lib" -a -d "/sw/include"; then CPPFLAGS="$CPPFLAGS -I/sw/include" LDFLAGS="$LDFLAGS -L/sw/lib" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; amd64*freebsd*) PIC_LIBS="-fPIC" ;; *solaris*) ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton" if test "x$ac_cv_func_inet_pton" = x""yes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton in -lresolv" >&5 $as_echo_n "checking for inet_pton in -lresolv... " >&6; } if test "${ac_cv_lib_resolv_inet_pton+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 inet_pton (); int main () { return inet_pton (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_resolv_inet_pton=yes else ac_cv_lib_resolv_inet_pton=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_inet_pton" >&5 $as_echo "$ac_cv_lib_resolv_inet_pton" >&6; } if test "x$ac_cv_lib_resolv_inet_pton" = x""yes; then : LIBS="-lresolv $LIBS" fi fi ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" if test "x$ac_cv_func_pow" = x""yes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 $as_echo_n "checking for pow in -lm... " >&6; } if test "${ac_cv_lib_m_pow+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 pow (); int main () { return pow (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_pow=yes else ac_cv_lib_m_pow=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 $as_echo "$ac_cv_lib_m_pow" >&6; } if test "x$ac_cv_lib_m_pow" = x""yes; then : LIBS="-lm $LIBS" fi fi ;; *) ;; esac cat >>confdefs.h <<_ACEOF #define NULL_DEVICE "$null_device" _ACEOF if test -d "${srcdir}/CVS" ; then PL_FROM_CVS=yes fi if test -d "${srcdir}/CVS"; then CVS_BUILD_TRUE= CVS_BUILD_FALSE='#' else CVS_BUILD_TRUE='#' CVS_BUILD_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if test "${ac_cv_header_time+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if test "${ac_cv_struct_tm+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } if test "${ac_cv_prog_gcc_traditional+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 $as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if test "${ac_cv_type_signal+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF for ac_header in dirent.h errno.h fcntl.h inttypes.h memory.h netdb.h \ netinet/in.h regex.h stdint.h stdlib.h string.h strings.h \ sys/ioctl_compat.h sys/ioctl.h sys/malloc.h sys/select.h \ sys/sockio.h sys/time.h sys/utsname.h unistd.h IOKit/IOBSD.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" eval as_val=\$$as_ac_Header if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in ifaddrs.h inttypes.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" eval as_val=\$$as_ac_Header if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in atexit cfmakeraw cfsetispeed cfsetospeed cfsetspeed dup2 \ gethostname inet_aton malloc memcpy memmove putenv sigaction \ snprintf strchr strdup strtok strtoul strerror uname do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" eval as_val=\$$as_ac_var if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done tcl_checkBoth=0 ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = x""yes; then : tcl_checkSocket=0 else tcl_checkSocket=1 fi if test "$tcl_checkSocket" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lsocket" >&5 $as_echo_n "checking for main in -lsocket... " >&6; } if test "${ac_cv_lib_socket_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_main=yes else ac_cv_lib_socket_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_main" >&5 $as_echo "$ac_cv_lib_socket_main" >&6; } if test "x$ac_cv_lib_socket_main" = x""yes; then : LIBS="$LIBS -lsocket" else tcl_checkBoth=1 fi fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" ac_fn_c_check_func "$LINENO" "accept" "ac_cv_func_accept" if test "x$ac_cv_func_accept" = x""yes; then : tcl_checkNsl=0 else LIBS=$tk_oldLibs fi fi ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = x""yes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lnsl" >&5 $as_echo_n "checking for main in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_main=yes else ac_cv_lib_nsl_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_main" >&5 $as_echo "$ac_cv_lib_nsl_main" >&6; } if test "x$ac_cv_lib_nsl_main" = x""yes; then : LIBS="$LIBS -lnsl" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -linet" >&5 $as_echo_n "checking for main in -linet... " >&6; } if test "${ac_cv_lib_inet_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_inet_main=yes else ac_cv_lib_inet_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_main" >&5 $as_echo "$ac_cv_lib_inet_main" >&6; } if test "x$ac_cv_lib_inet_main" = x""yes; then : LIBS="$LIBS -linet" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cispeed and cospeed members of struct termios" >&5 $as_echo_n "checking for cispeed and cospeed members of struct termios... " >&6; } if test "${ac_cv_termios_cspeed+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int main(void) { struct termios t;t.c_ispeed=t.c_ospeed=0;} ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_termios_cspeed=yes else ac_cv_termios_cspeed=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_termios_cspeed" >&5 $as_echo "$ac_cv_termios_cspeed" >&6; } if test $ac_cv_termios_cspeed = yes; then $as_echo "#define TERMIOS_CSPEED 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5 $as_echo_n "checking for socklen_t... " >&6; } if test "${kde_cv_socklen_t+set}" = set; then : $as_echo_n "(cached) " >&6 else kde_cv_socklen_t=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { socklen_t len; getpeername(0,0,&len); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : kde_cv_socklen_t=yes kde_cv_socklen_t_equiv=socklen_t fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kde_cv_socklen_t" >&5 $as_echo "$kde_cv_socklen_t" >&6; } if test $kde_cv_socklen_t = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent for socket functions" >&5 $as_echo_n "checking for socklen_t equivalent for socket functions... " >&6; } if test "${kde_cv_socklen_t_equiv+set}" = set; then : $as_echo_n "(cached) " >&6 else kde_cv_socklen_t_equiv=int for t in int size_t unsigned long "unsigned long"; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { $t len; getpeername(0,0,&len); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : kde_cv_socklen_t_equiv="$t" break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kde_cv_socklen_t_equiv" >&5 $as_echo "$kde_cv_socklen_t_equiv" >&6; } fi cat >>confdefs.h <<_ACEOF #define pl_socklen_t $kde_cv_socklen_t_equiv _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable userland conduits" >&5 $as_echo_n "checking whether to enable userland conduits... " >&6; } # Check whether --enable-conduits was given. if test "${enable_conduits+set}" = set; then : enableval=$enable_conduits; enable_conduits="yes" else enable_conduits="no" fi if test "x$enable_conduits" != "xno"; then ENABLE_CONDUITS_TRUE= ENABLE_CONDUITS_FALSE='#' else ENABLE_CONDUITS_TRUE='#' ENABLE_CONDUITS_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_conduits" >&5 $as_echo "$enable_conduits" >&6; } msg_png=no if test "x$enable_conduits" != "xno"; then have_png=no # Check whether --with-libpng was given. if test "${with_libpng+set}" = set; then : withval=$with_libpng; fi case $with_libpng in /*) PNG_CFLAGS="-I$withval/include" PNG_LIBS="-L$withval/lib" ;; esac save_CFLAGS="$CFLAGS" save_CPPFLAGS="$CPPFLAGS" save_LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS $PNG_CFLAGS" CPPFLAGS="$CPPFLAGS $PNG_CFLAGS" LDFLAGS="$LDFLAGS $PNG_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpng" >&5 $as_echo_n "checking for main in -lpng... " >&6; } if test "${ac_cv_lib_png_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpng -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_png_main=yes else ac_cv_lib_png_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_main" >&5 $as_echo "$ac_cv_lib_png_main" >&6; } if test "x$ac_cv_lib_png_main" = x""yes; then : have_png=yes; PNG_LIBS="$PNG_LIBS -lpng" else have_png=no fi if test "$have_png" = yes; then ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" if test "x$ac_cv_header_png_h" = x""yes; then : else have_png=no fi if test "$have_png" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png setjmp support" >&5 $as_echo_n "checking for png setjmp support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef PNG_SETJMP_SUPPORTED yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : else have_png=no fi rm -f conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_png" >&5 $as_echo "$have_png" >&6; } if test "$have_png" = yes; then $as_echo "#define HAVE_PNG 1" >>confdefs.h have_png=yes msg_png=yes fi fi fi CFLAGS="$save_CFLAGS" CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" else have_png="none" PNG_CFLAGS= PNG_LIBS= fi msg_threads=no use_threads=false # Check whether --enable-threads was given. if test "${enable_threads+set}" = set; then : enableval=$enable_threads; use_threads=true fi if $use_threads; then 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 acx_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 $as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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_join (); int main () { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : acx_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 $as_echo "$acx_pthread_ok" >&6; } if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthread or # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do case $flag in none) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 $as_echo_n "checking whether pthreads work without any flags... " >&6; } ;; -*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 $as_echo_n "checking whether pthreads work with $flag... " >&6; } PTHREAD_CFLAGS="$flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_acx_pthread_config+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$acx_pthread_config"; then ac_cv_prog_acx_pthread_config="$acx_pthread_config" # 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_acx_pthread_config="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no" fi fi acx_pthread_config=$ac_cv_prog_acx_pthread_config if test -n "$acx_pthread_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_config" >&5 $as_echo "$acx_pthread_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$acx_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 $as_echo_n "checking for the pthreads library -l$flag... " >&6; } PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : acx_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 $as_echo "$acx_pthread_ok" >&6; } if test "x$acx_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$acx_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 $as_echo_n "checking for joinable pthread attribute... " >&6; } attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int attr=$attr; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : attr_name=$attr; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 $as_echo "$attr_name" >&6; } if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then cat >>confdefs.h <<_ACEOF #define PTHREAD_CREATE_JOINABLE $attr_name _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 $as_echo_n "checking if more special flags are required for pthreads... " >&6; } flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 $as_echo "${flag}" >&6; } if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with cc_r # Extract the first word of "cc_r", so it can be a program name with args. set dummy cc_r; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_PTHREAD_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_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_PTHREAD_CC="cc_r" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_PTHREAD_CC" && ac_cv_prog_PTHREAD_CC="${CC}" fi fi PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 $as_echo "$PTHREAD_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else PTHREAD_CC="$CC" fi # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h : else acx_pthread_ok=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 if test x"$acx_pthread_ok" = xno; then use_threads=false fi else $as_echo "#define HAVE_PTHREADS 0" >>confdefs.h use_threads=false fi if $use_threads; then msg_threads=yes fi have_libusb=no use_libusb=no usb_type= usb_libs= # Check whether --enable-libusb was given. if test "${enable_libusb+set}" = set; then : enableval=$enable_libusb; if test "x$enableval" != "xno" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usb_open in -lusb" >&5 $as_echo_n "checking for usb_open in -lusb... " >&6; } if test "${ac_cv_lib_usb_usb_open+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lusb $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 usb_open (); int main () { return usb_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_usb_usb_open=yes else ac_cv_lib_usb_usb_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usb_usb_open" >&5 $as_echo "$ac_cv_lib_usb_usb_open" >&6; } if test "x$ac_cv_lib_usb_usb_open" = x""yes; then : have_libusb=yes; else have_libusb=no fi fi fi if test "$have_libusb" = yes; then $as_echo "#define HAVE_USB 1" >>confdefs.h usb_type=libusb msg_usb="yes, libusb" case "$host" in *darwin*) usb_libs="-lusb -Wl,-framework,IOKit,-framework,CoreFoundation" ;; *) if test "$msg_threads" = "no"; then usb_libs="-lusb -lpthread" else usb_libs="-lusb" fi ;; esac else case "$host" in *linux*) $as_echo "#define HAVE_USB 1" >>confdefs.h usb_type=linux msg_usb="yes, Linux" ;; *freebsd*) $as_echo "#define HAVE_USB 1" >>confdefs.h usb_type=freebsd msg_usb="yes, FreeBSD" ;; *darwin*) $as_echo "#define HAVE_USB 1" >>confdefs.h usb_type=darwin msg_usb="yes, Darwin" usb_libs="-Wl,-framework,IOKit,-framework,CoreFoundation" ;; esac fi if test x$usb_type; then WITH_USB_TRUE= WITH_USB_FALSE='#' else WITH_USB_TRUE='#' WITH_USB_FALSE= fi if test x$usb_type = xlibusb; then WITH_LIBUSB_TRUE= WITH_LIBUSB_FALSE='#' else WITH_LIBUSB_TRUE='#' WITH_LIBUSB_FALSE= fi if test x$usb_type = xlinux; then WITH_LINUXUSB_TRUE= WITH_LINUXUSB_FALSE='#' else WITH_LINUXUSB_TRUE='#' WITH_LINUXUSB_FALSE= fi if test x$usb_type = xfreebsd; then WITH_FREEBSDUSB_TRUE= WITH_FREEBSDUSB_FALSE='#' else WITH_FREEBSDUSB_TRUE='#' WITH_FREEBSDUSB_FALSE= fi if test x$usb_type = xdarwin; then WITH_DARWINUSB_TRUE= WITH_DARWINUSB_FALSE='#' else WITH_DARWINUSB_TRUE='#' WITH_DARWINUSB_FALSE= fi have_bluez=no use_bluez=auto # Check whether --with-bluez was given. if test "${with_bluez+set}" = set; then : withval=$with_bluez; use_bluez="$withval" fi if test "$use_bluez" != "no" ; then 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&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" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&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" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BLUEZ" >&5 $as_echo_n "checking for BLUEZ... " >&6; } if test -n "$PKG_CONFIG"; then if test -n "$BLUEZ_CFLAGS"; then pkg_cv_BLUEZ_CFLAGS="$BLUEZ_CFLAGS" else if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bluez\""; } >&5 ($PKG_CONFIG --exists --print-errors "bluez") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_BLUEZ_CFLAGS=`$PKG_CONFIG --cflags "bluez" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$BLUEZ_LIBS"; then pkg_cv_BLUEZ_LIBS="$BLUEZ_LIBS" else if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bluez\""; } >&5 ($PKG_CONFIG --exists --print-errors "bluez") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_BLUEZ_LIBS=`$PKG_CONFIG --libs "bluez" 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 BLUEZ_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "bluez"` else BLUEZ_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "bluez"` fi # Put the nasty error message in config.log where it belongs echo "$BLUEZ_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no pkgconfig package" >&5 $as_echo "no pkgconfig package" >&6; } bluez_prefix="$prefix" test "$prefix" = "NONE" && bluez_prefix="$ac_default_prefix" test "${use_bluez#/}" != "$use_bluez" && bluez_prefix="$use_bluez" BLUEZ_CFLAGS="" BLUEZ_LIBS="" ac_save_CPPFLAGS="$CPPFLAGS" for bluid in {"${bluez_prefix}",/usr,/usr/local}/include ; do CPPFLAGS="$ac_save_CPPFLAGS -I${bluid}" ac_fn_c_check_header_mongrel "$LINENO" "bluetooth/bluetooth.h" "ac_cv_header_bluetooth_bluetooth_h" "$ac_includes_default" if test "x$ac_cv_header_bluetooth_bluetooth_h" = x""yes; then : BLUEZ_CFLAGS="-I$bluid" fi test -z "$BLUEZ_CFLAGS" || break done CPPFLAGS="$ac_save_CPPFLAGS" if test -n "$BLUEZ_CFLAGS" ; then ac_save_LDFLAGS="$LDFLAGS" for bluld in {"${bluez_prefix}",usr,/usr/local}/{lib,lib64} ; do LDFLAGS="$ac_saveLDFLAGS -L${bluld}" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hci_open_dev in -lbluetooth" >&5 $as_echo_n "checking for hci_open_dev in -lbluetooth... " >&6; } if test "${ac_cv_lib_bluetooth_hci_open_dev+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbluetooth $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 hci_open_dev (); int main () { return hci_open_dev (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bluetooth_hci_open_dev=yes else ac_cv_lib_bluetooth_hci_open_dev=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bluetooth_hci_open_dev" >&5 $as_echo "$ac_cv_lib_bluetooth_hci_open_dev" >&6; } if test "x$ac_cv_lib_bluetooth_hci_open_dev" = x""yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sdp_connect in -lbluetooth" >&5 $as_echo_n "checking for sdp_connect in -lbluetooth... " >&6; } if test "${ac_cv_lib_bluetooth_sdp_connect+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbluetooth $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 sdp_connect (); int main () { return sdp_connect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bluetooth_sdp_connect=yes else ac_cv_lib_bluetooth_sdp_connect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bluetooth_sdp_connect" >&5 $as_echo "$ac_cv_lib_bluetooth_sdp_connect" >&6; } if test "x$ac_cv_lib_bluetooth_sdp_connect" = x""yes; then : BLUEZ_LIBS="-L${bluld} -lbluetooth" fi fi test -z "${BLUEZ_LIBS}" || break done LDFLAGS="$ac_save_LDFLAGS" fi if test -z "${BLUEZ_CFLAGS}" -o -z "${BLUEZ_LIBS}" ; then test "$use_bluez" != "no" -a "$use_bluez" != "auto" \ && as_fn_error "BlueZ explicitly requested, but no library found" "$LINENO" 5 use_bluez=no have_bluez=no else have_bluez=yes use_bluez=yes fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no pkgconfig package" >&5 $as_echo "no pkgconfig package" >&6; } bluez_prefix="$prefix" test "$prefix" = "NONE" && bluez_prefix="$ac_default_prefix" test "${use_bluez#/}" != "$use_bluez" && bluez_prefix="$use_bluez" BLUEZ_CFLAGS="" BLUEZ_LIBS="" ac_save_CPPFLAGS="$CPPFLAGS" for bluid in {"${bluez_prefix}",/usr,/usr/local}/include ; do CPPFLAGS="$ac_save_CPPFLAGS -I${bluid}" ac_fn_c_check_header_mongrel "$LINENO" "bluetooth/bluetooth.h" "ac_cv_header_bluetooth_bluetooth_h" "$ac_includes_default" if test "x$ac_cv_header_bluetooth_bluetooth_h" = x""yes; then : BLUEZ_CFLAGS="-I$bluid" fi test -z "$BLUEZ_CFLAGS" || break done CPPFLAGS="$ac_save_CPPFLAGS" if test -n "$BLUEZ_CFLAGS" ; then ac_save_LDFLAGS="$LDFLAGS" for bluld in {"${bluez_prefix}",usr,/usr/local}/{lib,lib64} ; do LDFLAGS="$ac_saveLDFLAGS -L${bluld}" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hci_open_dev in -lbluetooth" >&5 $as_echo_n "checking for hci_open_dev in -lbluetooth... " >&6; } if test "${ac_cv_lib_bluetooth_hci_open_dev+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbluetooth $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 hci_open_dev (); int main () { return hci_open_dev (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bluetooth_hci_open_dev=yes else ac_cv_lib_bluetooth_hci_open_dev=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bluetooth_hci_open_dev" >&5 $as_echo "$ac_cv_lib_bluetooth_hci_open_dev" >&6; } if test "x$ac_cv_lib_bluetooth_hci_open_dev" = x""yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sdp_connect in -lbluetooth" >&5 $as_echo_n "checking for sdp_connect in -lbluetooth... " >&6; } if test "${ac_cv_lib_bluetooth_sdp_connect+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbluetooth $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 sdp_connect (); int main () { return sdp_connect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bluetooth_sdp_connect=yes else ac_cv_lib_bluetooth_sdp_connect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bluetooth_sdp_connect" >&5 $as_echo "$ac_cv_lib_bluetooth_sdp_connect" >&6; } if test "x$ac_cv_lib_bluetooth_sdp_connect" = x""yes; then : BLUEZ_LIBS="-L${bluld} -lbluetooth" fi fi test -z "${BLUEZ_LIBS}" || break done LDFLAGS="$ac_save_LDFLAGS" fi if test -z "${BLUEZ_CFLAGS}" -o -z "${BLUEZ_LIBS}" ; then test "$use_bluez" != "no" -a "$use_bluez" != "auto" \ && as_fn_error "BlueZ explicitly requested, but no library found" "$LINENO" 5 use_bluez=no have_bluez=no else have_bluez=yes use_bluez=yes fi else BLUEZ_CFLAGS=$pkg_cv_BLUEZ_CFLAGS BLUEZ_LIBS=$pkg_cv_BLUEZ_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_bluez=yes use_bluez=yes fi fi if test "$use_bluez" = "yes" ; then $as_echo "#define HAVE_BLUEZ 1" >>confdefs.h fi if test "$use_bluez" = "yes"; then WITH_BLUEZ_TRUE= WITH_BLUEZ_FALSE='#' else WITH_BLUEZ_TRUE='#' WITH_BLUEZ_FALSE= fi # Check whether --with-included-popt was given. if test "${with_included_popt+set}" = set; then : withval=$with_included_popt; else with_included_popt="auto" fi if test "x$enable_conduits" != "xno"; then if test "x$with_included_popt" != "xyes"; then save_LIBS="$LIBS" ac_fn_c_check_header_mongrel "$LINENO" "popt.h" "ac_cv_header_popt_h" "$ac_includes_default" if test "x$ac_cv_header_popt_h" = x""yes; then : # ac_fn_c_check_decl LINENO SYMBOL VAR # ------------------------------------ # Tests whether SYMBOL is declared, setting cache variable VAR accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5 $as_echo_n "checking whether $2 is declared... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $2 (void) $2; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_decl ac_fn_c_check_decl "$LINENO" "POPT_BIT_SET" "ac_cv_have_decl_POPT_BIT_SET" "#include " if test "x$ac_cv_have_decl_POPT_BIT_SET" = x""yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for poptStrippedArgv in -lpopt" >&5 $as_echo_n "checking for poptStrippedArgv in -lpopt... " >&6; } if test "${ac_cv_lib_popt_poptStrippedArgv+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpopt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 poptStrippedArgv (); int main () { return poptStrippedArgv (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_popt_poptStrippedArgv=yes else ac_cv_lib_popt_poptStrippedArgv=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_popt_poptStrippedArgv" >&5 $as_echo "$ac_cv_lib_popt_poptStrippedArgv" >&6; } if test "x$ac_cv_lib_popt_poptStrippedArgv" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPOPT 1 _ACEOF LIBS="-lpopt $LIBS" else with_included_popt="yes" fi else with_included_popt="yes" fi else with_included_popt="yes" fi LIBS="$save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use included popt" >&5 $as_echo_n "checking whether to use included popt... " >&6; } if test "x$with_included_popt" = "xyes"; then msg_popt="yes (internal)" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } POPT_LIBS='$(top_builddir)/popt/libpopt.la' POPT_INCLUDES='-I$(top_srcdir)/popt' else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } msg_popt="yes (system)" POPT_LIBS="-lpopt" fi else with_included_popt="no" msg_popt="none" POPT_LIBS= POPT_INCLUDES= fi if test "x$with_included_popt" = "xyes"; then INCLUDED_POPT_TRUE= INCLUDED_POPT_FALSE='#' else INCLUDED_POPT_TRUE='#' INCLUDED_POPT_FALSE= fi have_iconv=no # Check whether --with-libiconv was given. if test "${with_libiconv+set}" = set; then : withval=$with_libiconv; fi case $withval in /*) ICONV_CFLAGS="-I$withval/include" ICONV_LIBS="-L$withval/lib" ;; esac save_CFLAGS="$CFLAGS" save_LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS $ICONV_CFLAGS" LDFLAGS="$LDFLAGS $ICONV_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv in -liconv" >&5 $as_echo_n "checking for libiconv in -liconv... " >&6; } if test "${ac_cv_lib_iconv_libiconv+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 libiconv (); int main () { return libiconv (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_iconv_libiconv=yes else ac_cv_lib_iconv_libiconv=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv" >&5 $as_echo "$ac_cv_lib_iconv_libiconv" >&6; } if test "x$ac_cv_lib_iconv_libiconv" = x""yes; then : have_iconv=yes; ICONV_LIBS="$ICONV_LIBS -liconv" else ac_fn_c_check_func "$LINENO" "iconv" "ac_cv_func_iconv" if test "x$ac_cv_func_iconv" = x""yes; then : for ac_func in gnu_get_libc_version do : ac_fn_c_check_func "$LINENO" "gnu_get_libc_version" "ac_cv_func_gnu_get_libc_version" if test "x$ac_cv_func_gnu_get_libc_version" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GNU_GET_LIBC_VERSION 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking if system iconv handles CP1252" >&5 $as_echo_n "checking if system iconv handles CP1252... " >&6; } if test "$cross_compiling" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: not cross compiling" >&5 $as_echo "not cross compiling" >&6; }; else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #ifdef HAVE_GNU_GET_LIBC_VERSION #include #endif int main (int argc, char **argv) { const char *pc = "\x66\x66\x66\x66\x66\x66\x66\xA9"; const char *utf8 = "\x66\x66\x66\x66\x66\x66\x66\xC2\xA9"; char transbuf[10], *trans = transbuf; iconv_t cd; size_t pc_len = strlen (pc), utf8_len = 10; size_t utf8_real_len = strlen (utf8); cd = iconv_open ("UTF-8", "CP1252"); if (!cd) exit (1); if (iconv (cd, &pc, &pc_len, &trans, &utf8_len) == -1 || pc_len != 0) exit (1); if (memcmp (utf8, transbuf, utf8_real_len) != 0) exit (1); exit (0); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; have_iconv=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi CFLAGS="$save_CFLAGS" LDFLAGS="$save_LDFLAGS" if test "$have_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h msg_iconv=yes else msg_iconv=no fi if test "x$enable_conduits" != "xno"; then msg_readline="no" RL_LIBS="" # Check whether --with-readline was given. if test "${with_readline+set}" = set; then : withval=$with_readline; else with_readline="yes" fi if test "x$with_readline" != "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a readline compatible library" >&5 $as_echo_n "checking for a readline compatible library... " >&6; } if test "${vl_cv_lib_readline+set}" = set; then : $as_echo_n "(cached) " >&6 else ORIG_LIBS="$LIBS" for readline_lib in readline edit editline; do for termcap_lib in "" termcap curses ncurses; do if test -z "$termcap_lib"; then TRY_LIB="-l$readline_lib" else TRY_LIB="-l$readline_lib -l$termcap_lib" fi LIBS="$ORIG_LIBS $TRY_LIB" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 readline (); int main () { return readline (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : vl_cv_lib_readline="$TRY_LIB" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -n "$vl_cv_lib_readline"; then break fi done if test -n "$vl_cv_lib_readline"; then break fi done if test -z "$vl_cv_lib_readline"; then vl_cv_lib_readline="no" fi LIBS="$ORIG_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vl_cv_lib_readline" >&5 $as_echo "$vl_cv_lib_readline" >&6; } fi if test "$vl_cv_lib_readline" != "no"; then msg_readline="yes" RL_LIBS="$vl_cv_lib_readline" $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h for ac_header in readline.h readline/readline.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" eval as_val=\$$as_ac_Header if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readline supports history" >&5 $as_echo_n "checking whether readline supports history... " >&6; } if test "${vl_cv_lib_readline_history+set}" = set; then : $as_echo_n "(cached) " >&6 else vl_cv_lib_readline_history="no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 add_history (); int main () { return add_history (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : vl_cv_lib_readline_history="yes" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vl_cv_lib_readline_history" >&5 $as_echo "$vl_cv_lib_readline_history" >&6; } if test "$vl_cv_lib_readline_history" = "yes"; then $as_echo "#define HAVE_READLINE_HISTORY 1" >>confdefs.h for ac_header in history.h readline/history.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" eval as_val=\$$as_ac_Header if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done fi fi else msg_readline="none" fi use_perl=false #msg_perl=no # Check whether --with-perl was given. if test "${with_perl+set}" = set; then : withval=$with_perl; else with_perl=no fi if test "x$with_perl" = "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if perl was enabled" >&5 $as_echo_n "checking if perl was enabled... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PERL='' else if test "x$with_perl" != "xyes" && test "x$with_perl" != "x"; then PERL="$with_perl" else # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_PERL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$PERL"; then ac_cv_prog_PERL="$PERL" # 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_PERL="perl" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PERL=$ac_cv_prog_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi PERL_MINVERSION="5.000_00" if test "x$PERL" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl version greater than or equal to $PERL_MINVERSION" >&5 $as_echo_n "checking for perl version greater than or equal to $PERL_MINVERSION... " >&6; } $PERL -e "exit ! eval 'use $PERL_MINVERSION; 1'" if test $? -ne 0; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; use_perl=false else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; PERL_VERSION=`$PERL -e 'print $]'` use_perl=true fi fi if $use_perl; then WITH_PERL_TRUE= WITH_PERL_FALSE='#' else WITH_PERL_TRUE='#' WITH_PERL_FALSE= fi #if $use_perl; then # msg_perl=yes #fi use_java=false # msg_java=no # Check whether --with-java was given. if test "${with_java+set}" = set; then : withval=$with_java; else with_java=no fi if test "x$with_java" != "xno"; then # Extract the first word of "javac", so it can be a program name with args. set dummy javac; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_JAVAC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JAVAC in [\\/]* | ?:[\\/]*) ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$with_java/bin:$PATH" for as_dir in $as_dummy 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_JAVAC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi JAVAC=$ac_cv_path_JAVAC if test -n "$JAVAC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 $as_echo "$JAVAC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "java", so it can be a program name with args. set dummy java; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_JAVA+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JAVA in [\\/]* | ?:[\\/]*) ac_cv_path_JAVA="$JAVA" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$with_java/bin:$PATH" for as_dir in $as_dummy 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_JAVA="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi JAVA=$ac_cv_path_JAVA if test -n "$JAVA"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA" >&5 $as_echo "$JAVA" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "jar", so it can be a program name with args. set dummy jar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_JAR+set}" = set; then : $as_echo_n "(cached) " >&6 else case $JAR in [\\/]* | ?:[\\/]*) ac_cv_path_JAR="$JAR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$with_java/bin:$PATH" for as_dir in $as_dummy 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_JAR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi JAR=$ac_cv_path_JAR if test -n "$JAR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAR" >&5 $as_echo "$JAR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$JAVA" != "x" && test "x$JAVAC" != "x" && test "x$JAR" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Java Development Kit" >&5 $as_echo_n "checking for Java Development Kit... " >&6; } JAVABASE=`echo "$JAVAC" | sed -e "s/\/bin\/javac//"` if test -f "$JAVABASE/include/jni.h"; then use_java=true { $as_echo "$as_me:${as_lineno-$LINENO}: result: looks good" >&5 $as_echo "looks good" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 $as_echo "not usable" >&6; } fi fi if $use_java; then WITH_JAVA_TRUE= WITH_JAVA_FALSE='#' else WITH_JAVA_TRUE='#' WITH_JAVA_FALSE= fi if $use_java; then # msg_java=yes JAVA_VERSION=`java -version 2>&1 | grep '^java version' | awk -F\" '{print $2}'` # " This is here to stop the errors from mismatched quotes. fi # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # use_tcl=false # Check whether --with-tcl was given. if test "${with_tcl+set}" = set; then : withval=$with_tcl; with_tclconfig=${withval} else with_tclconfig=no fi if test x"${with_tclconfig}" != xno ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl configuration" >&5 $as_echo_n "checking for Tcl configuration... " >&6; } if test "${ac_cv_c_tclconfig+set}" = set; then : $as_echo_n "(cached) " >&6 else # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else as_fn_error "${with_tclconfig}, but directory doesn't contain tclConfig.sh" "$LINENO" 5 fi fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi fi if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Cannot find Tcl configuration definitions\"" >&5 $as_echo "$as_me: WARNING: \"Cannot find Tcl configuration definitions\"" >&2;} exit 0 else use_tcl=true TCL_BIN_DIR=${ac_cv_c_tclconfig} { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $TCL_BIN_DIR/tclConfig.sh" >&5 $as_echo "found $TCL_BIN_DIR/tclConfig.sh" >&6; } fi fi if $use_tcl; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 $as_echo_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh... " >&6; } if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5 $as_echo "loading" >&6; } . $TCL_BIN_DIR/tclConfig.sh else { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 $as_echo "file not found" >&6; } fi # # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TCL_BIN_DIR/Makefile ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} fi # # eval is required to do the TCL_DBGX substitution # eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" #AC_SUBST(TCL_DBGX) #AC_SUBST(TCL_BUILD_LIB_SPEC) #AC_SUBST(TCL_BUILD_STUB_LIB_SPEC) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl public headers" >&5 $as_echo_n "checking for Tcl public headers... " >&6; } # Check whether --with-tclinclude was given. if test "${with_tclinclude+set}" = set; then : withval=$with_tclinclude; with_tclinclude=${withval} fi if test "${ac_cv_c_tclh+set}" = set; then : $as_echo_n "(cached) " >&6 else # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else as_fn_error "${with_tclinclude} directory does not contain tcl.h" "$LINENO" 5 fi else # Check order: pkg --prefix location, Tcl's --prefix location, # directory of tclConfig.sh, and Tcl source directory. # Looking in the source dir is not ideal, but OK. eval "temp_includedir=${includedir}" list="`ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TCL_PREFIX} 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${PILOT_LINK_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="/usr/local/include /usr/include $list" fi for i in $list ; do if test -f "$i/tcl.h" ; then ac_cv_c_tclh=$i break fi done fi fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then as_fn_error "tcl.h not found. Please specify its location with --with-tclinclude= Where is the directory containing tcl.h for your tcl version, such as --with-tclinclude=/usr/include/tcl/ " "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_c_tclh}" >&5 $as_echo "${ac_cv_c_tclh}" >&6; } fi TCL_INCLUDES=-I${ac_cv_c_tclh} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclsh" >&5 $as_echo_n "checking for tclsh... " >&6; } if test "${ac_cv_path_tclsh+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x${CELIB_DIR}" != "x" ; then # If CELIB_DIR is defined, assume Windows/CE target is requested # which means target tclsh cannot be run (cross-compile) search_path=`echo ${PATH} | sed -e 's/:/ /g'` else search_path=`echo ${TCL_BIN_DIR}:${TCL_BIN_DIR}/../bin:${exec_prefix}/bin:${prefix}/bin:${PATH} | sed -e 's/:/ /g'` fi for dir in $search_path ; do for j in `ls -r $dir/tclsh[8-9]*${EXEEXT} 2> /dev/null` \ `ls -r $dir/tclsh*${EXEEXT} 2> /dev/null` ; do if test x"$ac_cv_path_tclsh" = x ; then if test -f "$j" ; then ac_cv_path_tclsh=$j break fi fi done done fi if test -f "$ac_cv_path_tclsh" ; then TCLSH_PROG=$ac_cv_path_tclsh { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCLSH_PROG" >&5 $as_echo "$TCLSH_PROG" >&6; } else as_fn_error "No tclsh found in PATH: $search_path" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wish" >&5 $as_echo_n "checking for wish... " >&6; } if test "${ac_cv_path_wish+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x${CELIB_DIR}" != "x" ; then # If CELIB_DIR is defined, assume Windows/CE target is requested # which means target wish cannot be run (cross-compile) search_path=`echo ${PATH} | sed -e 's/:/ /g'` else search_path=`echo ${TK_BIN_DIR}:${TK_BIN_DIR}/../bin:${TCL_BIN_DIR}:${TCL_BIN_DIR}/../bin:${exec_prefix}/bin:${prefix}/bin:${PATH} | sed -e 's/:/ /g'` fi for dir in $search_path ; do for j in `ls -r $dir/wish[8-9]*${EXEEXT} 2> /dev/null` \ `ls -r $dir/wish*${EXEEXT} 2> /dev/null` ; do if test x"$ac_cv_path_wish" = x ; then if test -f "$j" ; then ac_cv_path_wish=$j break fi fi done done fi if test -f "$ac_cv_path_wish" ; then WISH_PROG=$ac_cv_path_wish { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WISH_PROG" >&5 $as_echo "$WISH_PROG" >&6; } else as_fn_error "No wish found in PATH: $search_path" "$LINENO" 5 fi fi #AC_SUBST(TCL_INCLUDES) #AC_SUBST(TCL_LIB_FILE) #AC_SUBST(TCL_LIB_FLAG) #AC_SUBST(TCL_LIB_SPEC) #AC_SUBST(TCL_LIBS) #AC_SUBST(TCL_VERSION) #AC_SUBST(TCLSH_PROG) #AC_SUBST(WISH_PROG) if $use_tcl; then WITH_TCL_TRUE= WITH_TCL_FALSE='#' else WITH_TCL_TRUE='#' WITH_TCL_FALSE= fi use_python=false # Check whether --with-python was given. if test "${with_python+set}" = set; then : withval=$with_python; else with_python=no fi if test "x$with_python" != "xno"; then for ac_prog in python do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PYTHON+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PYTHON in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHON="$PYTHON" # 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_PYTHON="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PYTHON" && break done if test "x$PYTHON" != "x"; then # Check whether --with-python was given. if test "${with_python+set}" = set; then : withval=$with_python; if test "x$withval" != "xno" -a "x$withval" != "xyes"; then ith_arg="$withval/include:-L$withval/lib $withval/include/python:-L$withval/lib" fi fi if test "x$with_python" != "xno"; then # Extract the first word of "python", so it can be a program name with args. set dummy python; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PYTHON+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PYTHON in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHON="$PYTHON" # 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_PYTHON="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$PYTHON" != ""; then PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[0:3]"` PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python.h" >&5 $as_echo_n "checking for Python.h... " >&6; } PYTHON_EXEC_PREFIX=`$PYTHON -c "import sys; print sys.exec_prefix"` if test "$PYTHON_VERSION" != ""; then if test -f $PYTHON_PREFIX/include/python$PYTHON_VERSION/Python.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_PREFIX/include/python$PYTHON_VERSION/Python.h" >&5 $as_echo "$PYTHON_PREFIX/include/python$PYTHON_VERSION/Python.h" >&6; } PYTHON_LIB_LOC="-L$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/config" PYTHON_CFLAGS="-I$PYTHON_PREFIX/include/python$PYTHON_VERSION" PYTHON_MAKEFILE="$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile" PYTHON_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE` PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE` PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE` PYTHON_OTHER_LIBM=`sed -n -e 's/^LIBC=\(.*\)/\1/p' $PYTHON_MAKEFILE` PYTHON_OTHER_LIBC=`sed -n -e 's/^LIBM=\(.*\)/\1/p' $PYTHON_MAKEFILE` PYTHON_LIBS="$PYTHON_LOCALMODLIBS $PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS $PYTHON_OTHER_LIBC $PYTHON_OTHER_LIBM" PYTHON_LIBS="-L$PYTHON_EXEC_PREFIX/lib $PYTHON_LIB_LOC -lpython$PYTHON_VERSION $PYTHON_LIBS" PYTHON_CFLAGS="$PYTHON_CFLAGS" PYTHON_H=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found or unusable" >&5 $as_echo "not found or unusable" >&6; } PYTHON_H=no fi fi fi fi if test "x$PYTHON_H" = "xyes"; then use_python=true else PYTHON_VERSION='' fi fi if $use_python; then WITH_PYTHON_TRUE= WITH_PYTHON_FALSE='#' else WITH_PYTHON_TRUE='#' WITH_PYTHON_FALSE= fi if $use_python; then msg_python=yes fi msg_efence=no # Check whether --with-efence was given. if test "${with_efence+set}" = set; then : withval=$with_efence; else with_efence=no fi if test "x$with_efence" != "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for malloc in -lefence" >&5 $as_echo_n "checking for malloc in -lefence... " >&6; } if test "${ac_cv_lib_efence_malloc+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lefence $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 malloc (); int main () { return malloc (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_efence_malloc=yes else ac_cv_lib_efence_malloc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_efence_malloc" >&5 $as_echo "$ac_cv_lib_efence_malloc" >&6; } if test "x$ac_cv_lib_efence_malloc" = x""yes; then : LIBS="$LIBS -lefence" fi if test "$ac_cv_lib_efence_malloc" = yes; then msg_efence=true else echo "Unable to locate ElectricFence malloc() debugging library!" echo "Please download from ftp://ftp.perens.com/pub/ElectricFence/" echo "You may also try omitting --with-efence when running configure." echo "" exit 1; fi fi set_debug=yes # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; set_debug=no fi if test "${enable_debug+set}" = set; then if test "$enable_debug" = yes; then CFLAGS="-g $CFLAGS" set_debug=yes fi fi echo -n "Runtime debugging is " if test "$set_debug" = "yes"; then echo "enabled" $as_echo "#define PI_DEBUG 1" >>confdefs.h else echo "disabled" CFLAGS=`echo "$CFLAGS" | sed -e "s/-g //"` fi # Check whether --enable-profile was given. if test "${enable_profile+set}" = set; then : enableval=$enable_profile; CFLAGS="-pg $CFLAGS" fi if test ! -d "{$srcdir}/CVS"; then BUILD_XML_TRUE= BUILD_XML_FALSE='#' else BUILD_XML_TRUE='#' BUILD_XML_FALSE= fi # if test -d "${srcdir}/CVS" ; then # Check whether --enable-xsltproc was given. if test "${enable_xsltproc+set}" = set; then : enableval=$enable_xsltproc; enable_xsltproc="$enableval" else enable_xsltproc=no fi if test x"$enable_xsltproc" = x"yes"; then # Extract the first word of "xsltproc", so it can be a program name with args. set dummy xsltproc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_XSLTPROC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $XSLTPROC in [\\/]* | ?:[\\/]*) ac_cv_path_XSLTPROC="$XSLTPROC" # 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_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_XSLTPROC" && ac_cv_path_XSLTPROC="no" ;; esac fi XSLTPROC=$ac_cv_path_XSLTPROC if test -n "$XSLTPROC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 $as_echo "$XSLTPROC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$XSLTPROC" = x"no"; then enable_xsltproc=no fi fi if test x"$enable_xsltproc" = x"yes"; then ENABLE_XSLTPROC_TRUE= ENABLE_XSLTPROC_FALSE='#' else ENABLE_XSLTPROC_TRUE='#' ENABLE_XSLTPROC_FALSE= fi # fi # now let's test to see if we can find the docbook-xsl stuff XSLTPROC_FLAGS="--nonet" set_compile_warnings=no # Check whether --enable-compile-warnings was given. if test "${enable_compile_warnings+set}" = set; then : enableval=$enable_compile_warnings; set_compile_warnings=yes fi if test "$GCC" = "yes" -a "$set_compile_warnings" != "no"; then CFLAGS="$CFLAGS \ -std=gnu99 -g -Wshadow -Wall -W -Waggregate-return -Wcast-align \ -Wcast-qual -Wnested-externs -Wpointer-arith -Wundef -Winline \ -Wbad-function-cast -pedantic -O0" fi case "$host" in *bsd*) $as_echo "#define TTYPrompt \"/dev/cua<0..n>\"" >>confdefs.h ;; *) $as_echo "#define TTYPrompt \"/dev/tty<0..n>\"" >>confdefs.h ;; esac # Check whether --enable-compile-werror was given. if test "${enable_compile_werror+set}" = set; then : enableval=$enable_compile_werror; enable_werror=yes fi if test "x$GCC" = "xyes" -a "x$enable_werror" = "xyes"; then CFLAGS="$CFLAGS -Werror" fi ac_config_files="$ac_config_files Makefile pilot-link.m4 pilot-link.pc pilot-link-pp.pc libpisock/Makefile libpisync/Makefile include/Makefile include/pi-version.h popt/Makefile src/Makefile src/prc/Makefile src/pix/Makefile bindings/Makefile bindings/Perl/Makefile.PL bindings/Python/setup.py bindings/Python/setup-standalone.py bindings/Java/Makefile bindings/Tcl/Makefile doc/Makefile doc/doxygen.cfg doc/xml/Makefile doc/xml/catalog.xml doc/xml/docbook.xsl doc/man/Makefile tests/Makefile darwin/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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; 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" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_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=`$as_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. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append 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 as_fn_error "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CVS_BUILD_TRUE}" && test -z "${CVS_BUILD_FALSE}"; then as_fn_error "conditional \"CVS_BUILD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_CONDUITS_TRUE}" && test -z "${ENABLE_CONDUITS_FALSE}"; then as_fn_error "conditional \"ENABLE_CONDUITS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_USB_TRUE}" && test -z "${WITH_USB_FALSE}"; then as_fn_error "conditional \"WITH_USB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_LIBUSB_TRUE}" && test -z "${WITH_LIBUSB_FALSE}"; then as_fn_error "conditional \"WITH_LIBUSB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_LINUXUSB_TRUE}" && test -z "${WITH_LINUXUSB_FALSE}"; then as_fn_error "conditional \"WITH_LINUXUSB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_FREEBSDUSB_TRUE}" && test -z "${WITH_FREEBSDUSB_FALSE}"; then as_fn_error "conditional \"WITH_FREEBSDUSB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_DARWINUSB_TRUE}" && test -z "${WITH_DARWINUSB_FALSE}"; then as_fn_error "conditional \"WITH_DARWINUSB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_BLUEZ_TRUE}" && test -z "${WITH_BLUEZ_FALSE}"; then as_fn_error "conditional \"WITH_BLUEZ\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INCLUDED_POPT_TRUE}" && test -z "${INCLUDED_POPT_FALSE}"; then as_fn_error "conditional \"INCLUDED_POPT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_PERL_TRUE}" && test -z "${WITH_PERL_FALSE}"; then as_fn_error "conditional \"WITH_PERL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_JAVA_TRUE}" && test -z "${WITH_JAVA_FALSE}"; then as_fn_error "conditional \"WITH_JAVA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_TCL_TRUE}" && test -z "${WITH_TCL_FALSE}"; then as_fn_error "conditional \"WITH_TCL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_PYTHON_TRUE}" && test -z "${WITH_PYTHON_FALSE}"; then as_fn_error "conditional \"WITH_PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_XML_TRUE}" && test -z "${BUILD_XML_FALSE}"; then as_fn_error "conditional \"BUILD_XML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_XSLTPROC_TRUE}" && test -z "${ENABLE_XSLTPROC_FALSE}"; then as_fn_error "conditional \"ENABLE_XSLTPROC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $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} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## 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=: # Pre-4.2 versions of Zsh do 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_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } 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.) 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error ERROR [LINENO LOG_FD] # --------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with status $?, using 1 if that was 0. as_fn_error () { as_status=$?; test $as_status -eq 0 && as_status=1 if test "$3"; then as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 fi $as_echo "$as_me: error: $1" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac 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 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then 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 else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_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 || $as_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" || as_fn_error "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' 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 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=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 $as_me, which was generated by GNU Autoconf 2.65. 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 case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # 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_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent 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 the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" Copyright (C) 2009 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' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. 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 ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_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. -*) as_fn_error "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append 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 || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' LD_F77='`$ECHO "X$LD_F77" | $Xsed -e "$delay_single_quote_subst"`' old_archive_cmds_F77='`$ECHO "X$old_archive_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`' compiler_F77='`$ECHO "X$compiler_F77" | $Xsed -e "$delay_single_quote_subst"`' GCC_F77='`$ECHO "X$GCC_F77" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_F77='`$ECHO "X$lt_prog_compiler_no_builtin_flag_F77" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_wl_F77='`$ECHO "X$lt_prog_compiler_wl_F77" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_pic_F77='`$ECHO "X$lt_prog_compiler_pic_F77" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_static_F77='`$ECHO "X$lt_prog_compiler_static_F77" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_F77='`$ECHO "X$lt_cv_prog_compiler_c_o_F77" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_need_lc_F77='`$ECHO "X$archive_cmds_need_lc_F77" | $Xsed -e "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_F77='`$ECHO "X$enable_shared_with_static_runtimes_F77" | $Xsed -e "$delay_single_quote_subst"`' export_dynamic_flag_spec_F77='`$ECHO "X$export_dynamic_flag_spec_F77" | $Xsed -e "$delay_single_quote_subst"`' whole_archive_flag_spec_F77='`$ECHO "X$whole_archive_flag_spec_F77" | $Xsed -e "$delay_single_quote_subst"`' compiler_needs_object_F77='`$ECHO "X$compiler_needs_object_F77" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_new_cmds_F77='`$ECHO "X$old_archive_from_new_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_F77='`$ECHO "X$old_archive_from_expsyms_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_F77='`$ECHO "X$archive_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`' archive_expsym_cmds_F77='`$ECHO "X$archive_expsym_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`' module_cmds_F77='`$ECHO "X$module_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`' module_expsym_cmds_F77='`$ECHO "X$module_expsym_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`' with_gnu_ld_F77='`$ECHO "X$with_gnu_ld_F77" | $Xsed -e "$delay_single_quote_subst"`' allow_undefined_flag_F77='`$ECHO "X$allow_undefined_flag_F77" | $Xsed -e "$delay_single_quote_subst"`' no_undefined_flag_F77='`$ECHO "X$no_undefined_flag_F77" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_F77='`$ECHO "X$hardcode_libdir_flag_spec_F77" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld_F77='`$ECHO "X$hardcode_libdir_flag_spec_ld_F77" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_separator_F77='`$ECHO "X$hardcode_libdir_separator_F77" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_F77='`$ECHO "X$hardcode_direct_F77" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_absolute_F77='`$ECHO "X$hardcode_direct_absolute_F77" | $Xsed -e "$delay_single_quote_subst"`' hardcode_minus_L_F77='`$ECHO "X$hardcode_minus_L_F77" | $Xsed -e "$delay_single_quote_subst"`' hardcode_shlibpath_var_F77='`$ECHO "X$hardcode_shlibpath_var_F77" | $Xsed -e "$delay_single_quote_subst"`' hardcode_automatic_F77='`$ECHO "X$hardcode_automatic_F77" | $Xsed -e "$delay_single_quote_subst"`' inherit_rpath_F77='`$ECHO "X$inherit_rpath_F77" | $Xsed -e "$delay_single_quote_subst"`' link_all_deplibs_F77='`$ECHO "X$link_all_deplibs_F77" | $Xsed -e "$delay_single_quote_subst"`' fix_srcfile_path_F77='`$ECHO "X$fix_srcfile_path_F77" | $Xsed -e "$delay_single_quote_subst"`' always_export_symbols_F77='`$ECHO "X$always_export_symbols_F77" | $Xsed -e "$delay_single_quote_subst"`' export_symbols_cmds_F77='`$ECHO "X$export_symbols_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`' exclude_expsyms_F77='`$ECHO "X$exclude_expsyms_F77" | $Xsed -e "$delay_single_quote_subst"`' include_expsyms_F77='`$ECHO "X$include_expsyms_F77" | $Xsed -e "$delay_single_quote_subst"`' prelink_cmds_F77='`$ECHO "X$prelink_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`' file_list_spec_F77='`$ECHO "X$file_list_spec_F77" | $Xsed -e "$delay_single_quote_subst"`' hardcode_action_F77='`$ECHO "X$hardcode_action_F77" | $Xsed -e "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ AR \ AR_FLAGS \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ SHELL \ ECHO \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ finish_eval \ old_striplib \ striplib \ LD_F77 \ compiler_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_cv_prog_compiler_c_o_F77 \ export_dynamic_flag_spec_F77 \ whole_archive_flag_spec_F77 \ compiler_needs_object_F77 \ with_gnu_ld_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ fix_srcfile_path_F77 \ exclude_expsyms_F77 \ include_expsyms_F77 \ file_list_spec_F77; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ export_symbols_cmds_F77 \ prelink_cmds_F77; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` ;; esac ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # 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" ;; "include/pi-md5.h") CONFIG_HEADERS="$CONFIG_HEADERS include/pi-md5.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "pilot-link.m4") CONFIG_FILES="$CONFIG_FILES pilot-link.m4" ;; "pilot-link.pc") CONFIG_FILES="$CONFIG_FILES pilot-link.pc" ;; "pilot-link-pp.pc") CONFIG_FILES="$CONFIG_FILES pilot-link-pp.pc" ;; "libpisock/Makefile") CONFIG_FILES="$CONFIG_FILES libpisock/Makefile" ;; "libpisync/Makefile") CONFIG_FILES="$CONFIG_FILES libpisync/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "include/pi-version.h") CONFIG_FILES="$CONFIG_FILES include/pi-version.h" ;; "popt/Makefile") CONFIG_FILES="$CONFIG_FILES popt/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/prc/Makefile") CONFIG_FILES="$CONFIG_FILES src/prc/Makefile" ;; "src/pix/Makefile") CONFIG_FILES="$CONFIG_FILES src/pix/Makefile" ;; "bindings/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/Makefile" ;; "bindings/Perl/Makefile.PL") CONFIG_FILES="$CONFIG_FILES bindings/Perl/Makefile.PL" ;; "bindings/Python/setup.py") CONFIG_FILES="$CONFIG_FILES bindings/Python/setup.py" ;; "bindings/Python/setup-standalone.py") CONFIG_FILES="$CONFIG_FILES bindings/Python/setup-standalone.py" ;; "bindings/Java/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/Java/Makefile" ;; "bindings/Tcl/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/Tcl/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/doxygen.cfg") CONFIG_FILES="$CONFIG_FILES doc/doxygen.cfg" ;; "doc/xml/Makefile") CONFIG_FILES="$CONFIG_FILES doc/xml/Makefile" ;; "doc/xml/catalog.xml") CONFIG_FILES="$CONFIG_FILES doc/xml/catalog.xml" ;; "doc/xml/docbook.xsl") CONFIG_FILES="$CONFIG_FILES doc/xml/docbook.xsl" ;; "doc/man/Makefile") CONFIG_FILES="$CONFIG_FILES doc/man/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "darwin/Makefile") CONFIG_FILES="$CONFIG_FILES darwin/Makefile" ;; *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 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 'as_fn_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") } || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || as_fn_error "could not setup config files machinery" "$LINENO" 5 _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 || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # 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. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; :[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 || as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append 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 '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; 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 || $as_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"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_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 ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # 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= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 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 || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;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 s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || as_fn_error "could not create $ac_file" "$LINENO" 5 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"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_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 \ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || as_fn_error "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || as_fn_error "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | 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) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="F77 " # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == "file_magic". file_magic_cmd=$lt_file_magic_cmd # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name of the directory that contains temporary libtool files. objdir=$objdir # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that does not interpret backslashes. ECHO=$lt_ECHO # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $* )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[^=]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$@"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1+=\$2" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1=\$$1\$2" } _LT_EOF ;; esac sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: F77 # The linker used to build libraries. LD=$lt_LD_F77 # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_F77 # A language specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU compiler? with_gcc=$GCC_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_F77 # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_F77 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_F77 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_F77 # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_F77 # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path_F77 # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_F77 # Specify filename containing input files. file_list_spec=$lt_file_list_spec_F77 # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # ### END LIBTOOL TAG CONFIG: F77 _LT_EOF ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 # 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 || as_fn_exit $? fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: Options detected/selected -------------------------. pilot-link version...... : $VERSION libpisock version....... : $PISOCK_CURRENT.$PISOCK_AGE.$PISOCK_REVISION libpisync version....... : $PISYNC_CURRENT.$PISYNC_AGE.$PISYNC_REVISION Build for host.......... : $host Extra Warnings.......... : $set_compile_warnings Direct USB support...... : $msg_usb BlueZ support........... : $use_bluez Thread-safe libpisock... : $msg_threads ElectricFence checks.... : $msg_efence CPPFLAGS................ : $CPPFLAGS CFLAGS.................. : $CFLAGS Userland Tools -------------------------. Build userland tools.... : $enable_conduits Support for popt........ : $msg_popt Readline support........ : $msg_readline PNG support............. : $msg_png Internal Language Support -------------------------. Iconv support........... : $msg_iconv External Language Support -------------------------. TCL support............. : $use_tcl $TCL_VERSION Java support............ : $use_java $JAVA_VERSION Python support.......... : $use_python $PYTHON_VERSION Perl support............ : $use_perl $PERL_VERSION " >&5 $as_echo " Options detected/selected -------------------------. pilot-link version...... : $VERSION libpisock version....... : $PISOCK_CURRENT.$PISOCK_AGE.$PISOCK_REVISION libpisync version....... : $PISYNC_CURRENT.$PISYNC_AGE.$PISYNC_REVISION Build for host.......... : $host Extra Warnings.......... : $set_compile_warnings Direct USB support...... : $msg_usb BlueZ support........... : $use_bluez Thread-safe libpisock... : $msg_threads ElectricFence checks.... : $msg_efence CPPFLAGS................ : $CPPFLAGS CFLAGS.................. : $CFLAGS Userland Tools -------------------------. Build userland tools.... : $enable_conduits Support for popt........ : $msg_popt Readline support........ : $msg_readline PNG support............. : $msg_png Internal Language Support -------------------------. Iconv support........... : $msg_iconv External Language Support -------------------------. TCL support............. : $use_tcl $TCL_VERSION Java support............ : $use_java $JAVA_VERSION Python support.......... : $use_python $PYTHON_VERSION Perl support............ : $use_perl $PERL_VERSION " >&6; } if [ x"$PL_FROM_CVS" = xyes ]; then echo " .----- NOTICE ------------------------------------------------." echo " | You are using pilot-link from CVS source. |" echo " | |" echo " | This is likely to be unstable, or contain some incomplete |" echo " | features, or just plain not work at all. Use it at your own |" echo " | risk. Please help us to fix any bugs you find, by reporting |" echo " | them back to us via email or at http://bugs.pilot-link.org/ |" echo " \`-------------------------------------------------------------'" echo "" fi pilot-link-0.12.5-dfsg/m4/0000755000175000017500000000000011333433323015416 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/m4/ltsugar.m40000644000175000017500000001042411333433237017346 0ustar rousseaurousseau# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # 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 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) pilot-link-0.12.5-dfsg/m4/threads.m40000644000175000017500000001606310211440001017301 0ustar rousseaurousseau# threads.m4 -- # # This file provides a set of autoconf macros to help # pilot-link find threads support # AC_DEFUN([PILOT_LINK_THREADS_SUPPORT], [ use_threads=false AC_ARG_ENABLE(threads,[ --enable-threads Add this to have built-in thread safety],use_threads=true) if $use_threads; then ACX_PTHREAD if test x"$acx_pthread_ok" = xno; then use_threads=false fi else AC_DEFINE(HAVE_PTHREADS, 0, [Define if we have pthreads]) use_threads=false fi ]) # ------------------------------------------------ # ACX_PTHREAD # Steven G. Johnson # http://autoconf-archive.cryp.to/acx_pthread.html # ------------------------------------------------ AC_DEFUN([ACX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_SAVE AC_LANG_C acx_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) AC_MSG_RESULT($acx_pthread_ok) if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthread or # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do case $flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; -*) AC_MSG_CHECKING([whether pthreads work with $flag]) PTHREAD_CFLAGS="$flag" ;; pthread-config) AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) if test x"$acx_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) AC_MSG_CHECKING([for the pthreads library -l$flag]) PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_TRY_LINK([#include ], [pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], [acx_pthread_ok=yes]) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" AC_MSG_RESULT($acx_pthread_ok) if test "x$acx_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$acx_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. AC_MSG_CHECKING([for joinable pthread attribute]) attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do AC_TRY_LINK([#include ], [int attr=$attr;], [attr_name=$attr; break]) done AC_MSG_RESULT($attr_name) if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, [Define to necessary symbol if this constant uses a non-standard name on your system.]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with cc_r AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC}) else PTHREAD_CC="$CC" fi AC_SUBST(PTHREAD_LIBS) AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_CC) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) : else acx_pthread_ok=no $2 fi AC_LANG_RESTORE ])dnl ACX_PTHREAD pilot-link-0.12.5-dfsg/m4/socklen.m40000644000175000017500000000435510437354634017340 0ustar rousseaurousseaudnl This file is part of pilot-link. dnl Copied from the KDE libraries admin/acinclude.m4.in dnl dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu) dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org) dnl dnl This file is free software; you can redistribute it and/or dnl modify it under the terms of the GNU Library General Public dnl License as published by the Free Software Foundation; either dnl version 2 of the License, or (at your option) any later version. dnl dnl This library is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl Library General Public License for more details. dnl dnl You should have received a copy of the GNU Library General Public License dnl along with this library; see the file COPYING.LIB. If not, write to dnl the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, dnl Boston, MA 02110-1301, USA. dnl Check for the type of the third argument of getsockname AC_DEFUN([AC_CHECK_SOCKLEN_T], [ AC_MSG_CHECKING(for socklen_t) AC_CACHE_VAL(kde_cv_socklen_t, [ kde_cv_socklen_t=no AC_TRY_COMPILE([ #include #include ], [ socklen_t len; getpeername(0,0,&len); ], [ kde_cv_socklen_t=yes kde_cv_socklen_t_equiv=socklen_t ]) ]) AC_MSG_RESULT($kde_cv_socklen_t) if test $kde_cv_socklen_t = no; then AC_MSG_CHECKING([for socklen_t equivalent for socket functions]) AC_CACHE_VAL(kde_cv_socklen_t_equiv, [ kde_cv_socklen_t_equiv=int for t in int size_t unsigned long "unsigned long"; do AC_TRY_COMPILE([ #include #include ], [ $t len; getpeername(0,0,&len); ], [ kde_cv_socklen_t_equiv="$t" break ]) done ]) AC_MSG_RESULT($kde_cv_socklen_t_equiv) fi AC_DEFINE_UNQUOTED(pl_socklen_t, $kde_cv_socklen_t_equiv, [type to use in place of socklen_t if not defined]) ]) pilot-link-0.12.5-dfsg/m4/ltversion.m40000644000175000017500000000127711333433237017720 0ustar rousseaurousseau# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # 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. # Generated from ltversion.in. # serial 3017 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.2.6b]) m4_define([LT_PACKAGE_REVISION], [1.3017]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.2.6b' macro_revision='1.3017' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) pilot-link-0.12.5-dfsg/m4/tcl.m40000644000175000017500000005101410250122237016437 0ustar rousseaurousseau# tcl.m4 -- # # This file provides a set of autoconf macros to help # pilot-link find Tcl support (borrowed from PILOT_LINK) # # Copyright (c) 1999-2000 Ajuba Solutions. # Copyright (c) 2002-2003 ActiveState Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. #------------------------------------------------------------------------ # PILOT_LINK_PATH_TCLCONFIG -- # # Locate the tclConfig.sh file and perform a sanity check on # the Tcl compile flags # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tcl=... # # Defines the following vars: # TCL_BIN_DIR Full path to the directory containing # the tclConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([PILOT_LINK_PATH_TCLCONFIG], [ # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # use_tcl=false AC_ARG_WITH(tcl,[ --with-tcl=tclconfig use Tcl, [[default=no]]], with_tclconfig=${withval}, with_tclconfig=no) if test x"${with_tclconfig}" != xno ; then AC_MSG_CHECKING([for Tcl configuration]) AC_CACHE_VAL(ac_cv_c_tclconfig,[ # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else AC_MSG_ERROR([${with_tclconfig}, but directory doesn't contain tclConfig.sh]) fi fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi ]) if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" AC_MSG_WARN("Cannot find Tcl configuration definitions") exit 0 else use_tcl=true TCL_BIN_DIR=${ac_cv_c_tclconfig} AC_MSG_RESULT([found $TCL_BIN_DIR/tclConfig.sh]) fi fi ]) #------------------------------------------------------------------------ # PILOT_LINK_LOAD_TCLCONFIG -- # # Load the tclConfig.sh file # # Arguments: # # Requires the following vars to be set: # TCL_BIN_DIR # # Results: # # Subst the following vars: # TCL_BIN_DIR # TCL_SRC_DIR # TCL_LIB_FILE # #------------------------------------------------------------------------ AC_DEFUN([PILOT_LINK_LOAD_TCLCONFIG], [ AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh]) if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then AC_MSG_RESULT([loading]) . $TCL_BIN_DIR/tclConfig.sh else AC_MSG_RESULT([file not found]) fi # # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TCL_BIN_DIR/Makefile ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} fi # # eval is required to do the TCL_DBGX substitution # eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" AC_SUBST(TCL_VERSION) AC_SUBST(TCL_BIN_DIR) AC_SUBST(TCL_SRC_DIR) AC_SUBST(TCL_LIB_FILE) AC_SUBST(TCL_LIB_FLAG) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_STUB_LIB_FILE) AC_SUBST(TCL_STUB_LIB_FLAG) AC_SUBST(TCL_STUB_LIB_SPEC) #AC_SUBST(TCL_DBGX) AC_SUBST(TCL_LIBS) AC_SUBST(TCL_DEFS) AC_SUBST(TCL_EXTRA_CFLAGS) AC_SUBST(TCL_LD_FLAGS) AC_SUBST(TCL_SHLIB_LD_LIBS) #AC_SUBST(TCL_BUILD_LIB_SPEC) #AC_SUBST(TCL_BUILD_STUB_LIB_SPEC) ]) #-------------------------------------------------------------------- # PILOT_LINK_TCL_LINK_LIBS # # Search for the libraries needed to link the Tcl shell. # Things like the math library (-lm) and socket stuff (-lsocket vs. # -lnsl) are dealt with here. # # Arguments: # Requires the following vars to be set in the Makefile: # DL_LIBS # LIBS # MATH_LIBS # # Results: # # Subst's the following var: # TCL_LIBS # MATH_LIBS # # Might append to the following vars: # LIBS # # Might define the following vars: # HAVE_NET_ERRNO_H # #-------------------------------------------------------------------- AC_DEFUN([PILOT_LINK_TCL_LINK_LIBS], [ #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. # Also, Linux requires the "ieee" library for math to work # right (and it must appear before "-lm"). #-------------------------------------------------------------------- AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) AC_CHECK_HEADER(net/errno.h, AC_DEFINE(HAVE_NET_ERRNO_H)) #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right # order in the command line generated by make. Here are some # special considerations: # 1. Use "connect" and "accept" to check for -lsocket, and # "gethostbyname" to check for -lnsl. # 2. Use each function name only once: can't redo a check because # autoconf caches the results of the last check and won't redo it. # 3. Use -lnsl and -lsocket only if they supply procedures that # aren't already present in the normal libraries. This is because # IRIX 5.2 has libraries, but they aren't needed and they're # bogus: they goof up name resolution if used. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. # To get around this problem, check for both libraries together # if -lsocket doesn't work by itself. #-------------------------------------------------------------------- tcl_checkBoth=0 AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) if test "$tcl_checkSocket" = 1; then AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) fi AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, [LIBS="$LIBS -lnsl"])]) # Don't perform the eval of the libraries here because DL_LIBS # won't be set until we call PILOT_LINK_CONFIG_CFLAGS TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' AC_SUBST(TCL_LIBS) AC_SUBST(MATH_LIBS) ]) #-------------------------------------------------------------------- # PILOT_LINK_TCL_EARLY_FLAGS # # Check for what flags are needed to be passed so the correct OS # features are available. # # Arguments: # None # # Results: # # Might define the following vars: # _ISOC99_SOURCE # _LARGEFILE64_SOURCE # #-------------------------------------------------------------------- AC_DEFUN([PILOT_LINK_TCL_EARLY_FLAG],[ AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no, AC_TRY_COMPILE([[#define ]$1[ 1 ]$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no))) if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then AC_DEFINE($1) tcl_flags="$tcl_flags $1" fi ]) AC_DEFUN([PILOT_LINK_TCL_EARLY_FLAGS],[ AC_MSG_CHECKING([for required early compiler flags]) tcl_flags="" PILOT_LINK_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], [char *p = (char *)strtoll; char *q = (char *)strtoull;]) PILOT_LINK_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], [struct stat64 buf; int i = stat64("/", &buf);]) if test "x${tcl_flags}" = "x" ; then AC_MSG_RESULT([none]) else AC_MSG_RESULT([${tcl_flags}]) fi ]) #-------------------------------------------------------------------- # PILOT_LINK_TCL_64BIT_FLAGS # # Check for what is defined in the way of 64-bit features. # # Arguments: # None # # Results: # # Might define the following vars: # TCL_WIDE_INT_IS_LONG # TCL_WIDE_INT_TYPE # HAVE_STRUCT_DIRENT64 # HAVE_STRUCT_STAT64 # HAVE_TYPE_OFF64_T # #-------------------------------------------------------------------- AC_DEFUN([PILOT_LINK_TCL_64BIT_FLAGS], [ AC_MSG_CHECKING([for 64-bit integer type]) AC_CACHE_VAL(tcl_cv_type_64bit,[ AC_TRY_COMPILE(,[__int64 value = (__int64) 0;], tcl_cv_type_64bit=__int64,tcl_cv_type_64bit=none AC_TRY_RUN([#include int main() {exit(!(sizeof(long long) > sizeof(long)));} ], tcl_cv_type_64bit="long long"))]) if test "${tcl_cv_type_64bit}" = none ; then AC_MSG_RESULT([using long]) else AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}) AC_MSG_RESULT([${tcl_cv_type_64bit}]) # Now check for auxiliary declarations AC_MSG_CHECKING([for struct dirent64]) AC_CACHE_VAL(tcl_cv_struct_dirent64,[ AC_TRY_COMPILE([#include #include ],[struct dirent64 p;], tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)]) if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_DIRENT64) fi AC_MSG_RESULT([${tcl_cv_struct_dirent64}]) AC_MSG_CHECKING([for struct stat64]) AC_CACHE_VAL(tcl_cv_struct_stat64,[ AC_TRY_COMPILE([#include ],[struct stat64 p; ], tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)]) if test "x${tcl_cv_struct_stat64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_STAT64) fi AC_MSG_RESULT([${tcl_cv_struct_stat64}]) AC_MSG_CHECKING([for off64_t]) AC_CACHE_VAL(tcl_cv_type_off64_t,[ AC_TRY_COMPILE([#include ],[off64_t offset; ], tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)]) if test "x${tcl_cv_type_off64_t}" = "xyes" ; then AC_DEFINE(HAVE_TYPE_OFF64_T) fi AC_MSG_RESULT([${tcl_cv_type_off64_t}]) fi ]) ## ## Here ends the standard Tcl configuration bits and starts the ## PILOT_LINK specific functions ## #------------------------------------------------------------------------ # PILOT_LINK_PUBLIC_TCL_HEADERS -- # # Locate the installed public Tcl header files # # Arguments: # None. # # Results: # # Adds a --with-tclinclude switch to configure. # Result is cached. # # Substs the following vars: # TCL_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([PILOT_LINK_PUBLIC_TCL_HEADERS], [ AC_MSG_CHECKING([for Tcl public headers]) AC_ARG_WITH(tclinclude, [ --with-tclinclude public Tcl header dir], with_tclinclude=${withval}) AC_CACHE_VAL(ac_cv_c_tclh, [ # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h]) fi else # Check order: pkg --prefix location, Tcl's --prefix location, # directory of tclConfig.sh, and Tcl source directory. # Looking in the source dir is not ideal, but OK. eval "temp_includedir=${includedir}" list="`ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TCL_PREFIX} 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${PILOT_LINK_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="/usr/local/include /usr/include $list" fi for i in $list ; do if test -f "$i/tcl.h" ; then ac_cv_c_tclh=$i break fi done fi ]) # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude= Where is the directory containing tcl.h for your tcl version, such as --with-tclinclude=/usr/include/tcl/ ]) else AC_MSG_RESULT([${ac_cv_c_tclh}]) fi TCL_INCLUDES=-I${ac_cv_c_tclh} AC_SUBST(TCL_INCLUDES) ]) #------------------------------------------------------------------------ # PILOT_LINK_PROG_TCLSH # Locate a tclsh shell in the following directories: # ${TCL_BIN_DIR} ${TCL_BIN_DIR}/../bin # ${exec_prefix}/bin ${prefix}/bin # ${PATH} # # Arguments # none # # Results # Subst's the following values: # TCLSH_PROG #------------------------------------------------------------------------ AC_DEFUN([PILOT_LINK_PROG_TCLSH], [ AC_MSG_CHECKING([for tclsh]) AC_CACHE_VAL(ac_cv_path_tclsh, [ if test "x${CELIB_DIR}" != "x" ; then # If CELIB_DIR is defined, assume Windows/CE target is requested # which means target tclsh cannot be run (cross-compile) search_path=`echo ${PATH} | sed -e 's/:/ /g'` else search_path=`echo ${TCL_BIN_DIR}:${TCL_BIN_DIR}/../bin:${exec_prefix}/bin:${prefix}/bin:${PATH} | sed -e 's/:/ /g'` fi for dir in $search_path ; do for j in `ls -r $dir/tclsh[[8-9]]*${EXEEXT} 2> /dev/null` \ `ls -r $dir/tclsh*${EXEEXT} 2> /dev/null` ; do if test x"$ac_cv_path_tclsh" = x ; then if test -f "$j" ; then ac_cv_path_tclsh=$j break fi fi done done ]) if test -f "$ac_cv_path_tclsh" ; then TCLSH_PROG=$ac_cv_path_tclsh AC_MSG_RESULT([$TCLSH_PROG]) else AC_MSG_ERROR([No tclsh found in PATH: $search_path]) fi AC_SUBST(TCLSH_PROG) ]) #------------------------------------------------------------------------ # PILOT_LINK_PROG_WISH # Locate a wish shell in the following directories: # ${TK_BIN_DIR} ${TK_BIN_DIR}/../bin # ${TCL_BIN_DIR} ${TCL_BIN_DIR}/../bin # ${exec_prefix}/bin ${prefix}/bin # ${PATH} # # Arguments # none # # Results # Subst's the following values: # WISH_PROG #------------------------------------------------------------------------ AC_DEFUN([PILOT_LINK_PROG_WISH], [ AC_MSG_CHECKING([for wish]) AC_CACHE_VAL(ac_cv_path_wish, [ if test "x${CELIB_DIR}" != "x" ; then # If CELIB_DIR is defined, assume Windows/CE target is requested # which means target wish cannot be run (cross-compile) search_path=`echo ${PATH} | sed -e 's/:/ /g'` else search_path=`echo ${TK_BIN_DIR}:${TK_BIN_DIR}/../bin:${TCL_BIN_DIR}:${TCL_BIN_DIR}/../bin:${exec_prefix}/bin:${prefix}/bin:${PATH} | sed -e 's/:/ /g'` fi for dir in $search_path ; do for j in `ls -r $dir/wish[[8-9]]*${EXEEXT} 2> /dev/null` \ `ls -r $dir/wish*${EXEEXT} 2> /dev/null` ; do if test x"$ac_cv_path_wish" = x ; then if test -f "$j" ; then ac_cv_path_wish=$j break fi fi done done ]) if test -f "$ac_cv_path_wish" ; then WISH_PROG=$ac_cv_path_wish AC_MSG_RESULT([$WISH_PROG]) else AC_MSG_ERROR([No wish found in PATH: $search_path]) fi AC_SUBST(WISH_PROG) ]) #------------------------------------------------------------------------ # PILOT_LINK_PATH_CONFIG -- # # Locate the ${1}Config.sh file and perform a sanity check on # the ${1} compile flags. These are used by packages like # [incr Tk] that load *Config.sh files from more than Tcl and Tk. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-$1=... # # Defines the following vars: # $1_BIN_DIR Full path to the directory containing # the $1Config.sh file #------------------------------------------------------------------------ AC_DEFUN([PILOT_LINK_PATH_CONFIG], [ # # Ok, lets find the $1 configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-$1 # if test x"${no_$1}" = x ; then # we reset no_$1 in case something fails here no_$1=true AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval}) AC_MSG_CHECKING([for $1 configuration]) AC_CACHE_VAL(ac_cv_c_$1config,[ # First check to see if --with-$1 was specified. if test x"${with_$1config}" != x ; then if test -f "${with_$1config}/$1Config.sh" ; then ac_cv_c_$1config=`(cd ${with_$1config}; pwd)` else AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh]) fi fi # then check for a private $1 installation if test x"${ac_cv_c_$1config}" = x ; then for i in \ ../$1 \ `ls -dr ../$1[[8-9]].[[0-9]]* 2>/dev/null` \ ../../$1 \ `ls -dr ../../$1[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../$1 \ `ls -dr ../../../$1[[8-9]].[[0-9]]* 2>/dev/null` \ ${srcdir}/../$1 \ `ls -dr ${srcdir}/../$1[[8-9]].[[0-9]]* 2>/dev/null` \ ; do if test -f "$i/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i; pwd)` break fi if test -f "$i/unix/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_$1config}" = x ; then for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i; pwd)` break fi done fi ]) if test x"${ac_cv_c_$1config}" = x ; then $1_BIN_DIR="# no $1 configs found" AC_MSG_WARN("Cannot find $1 configuration definitions") exit 0 else no_$1= $1_BIN_DIR=${ac_cv_c_$1config} AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh]) fi fi ]) #------------------------------------------------------------------------ # PILOT_LINK_LOAD_CONFIG -- # # Load the $1Config.sh file # # Arguments: # # Requires the following vars to be set: # $1_BIN_DIR # # Results: # # Subst the following vars: # $1_SRC_DIR # $1_LIB_FILE # $1_LIB_SPEC # #------------------------------------------------------------------------ AC_DEFUN([PILOT_LINK_LOAD_CONFIG], [ AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh]) if test -f "${$1_BIN_DIR}/$1Config.sh" ; then AC_MSG_RESULT([loading]) . ${$1_BIN_DIR}/$1Config.sh else AC_MSG_RESULT([file not found]) fi # # If the $1_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable $1_LIB_SPEC will be set to the value # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC # instead of $1_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f ${$1_BIN_DIR}/Makefile ; then AC_MSG_WARN([Found Makefile - using build library specs for $1]) $1_LIB_SPEC=${$1_BUILD_LIB_SPEC} $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC} $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH} fi AC_SUBST($1_VERSION) AC_SUBST($1_SRC_DIR) AC_SUBST($1_LIB_FILE) AC_SUBST($1_LIB_SPEC) AC_SUBST($1_STUB_LIB_FILE) AC_SUBST($1_STUB_LIB_SPEC) AC_SUBST($1_STUB_LIB_PATH) ]) pilot-link-0.12.5-dfsg/m4/ltoptions.m40000644000175000017500000002724211333433237017726 0ustar rousseaurousseau# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # 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 6 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [0], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) pilot-link-0.12.5-dfsg/m4/python.m40000644000175000017500000000472010411050151017172 0ustar rousseaurousseauPYTHON= PYTHON_VERSION= PYTHON_CFLAGS= PYTHON_LIBS= AC_DEFUN([AM_CHECK_PYTHON], [ AC_SUBST(PYTHON_LIBS) AC_SUBST(PYTHON_CFLAGS) AC_ARG_WITH(python, AC_HELP_STRING([--with-python],[Compile with Python bindings]), if test "x$withval" != "xno" -a "x$withval" != "xyes"; then ith_arg="$withval/include:-L$withval/lib $withval/include/python:-L$withval/lib" fi ) if test "x$with_python" != "xno"; then AC_PATH_PROG(PYTHON, python) if test "$PYTHON" != ""; then PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"` PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"` fi AC_MSG_CHECKING(for Python.h) PYTHON_EXEC_PREFIX=`$PYTHON -c "import sys; print sys.exec_prefix"` if test "$PYTHON_VERSION" != ""; then if test -f $PYTHON_PREFIX/include/python$PYTHON_VERSION/Python.h; then AC_MSG_RESULT($PYTHON_PREFIX/include/python$PYTHON_VERSION/Python.h) PYTHON_LIB_LOC="-L$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/config" PYTHON_CFLAGS="-I$PYTHON_PREFIX/include/python$PYTHON_VERSION" PYTHON_MAKEFILE="$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile" PYTHON_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE` PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE` PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE` PYTHON_OTHER_LIBM=`sed -n -e 's/^LIBC=\(.*\)/\1/p' $PYTHON_MAKEFILE` PYTHON_OTHER_LIBC=`sed -n -e 's/^LIBM=\(.*\)/\1/p' $PYTHON_MAKEFILE` PYTHON_LIBS="$PYTHON_LOCALMODLIBS $PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS $PYTHON_OTHER_LIBC $PYTHON_OTHER_LIBM" PYTHON_LIBS="-L$PYTHON_EXEC_PREFIX/lib $PYTHON_LIB_LOC -lpython$PYTHON_VERSION $PYTHON_LIBS" PYTHON_CFLAGS="$PYTHON_CFLAGS" PYTHON_H=yes else AC_MSG_RESULT(not found or unusable) PYTHON_H=no fi fi fi ]) pilot-link-0.12.5-dfsg/m4/lt~obsolete.m40000644000175000017500000001311311333433237020235 0ustar rousseaurousseau# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # 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 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) pilot-link-0.12.5-dfsg/m4/libtool.m40000644000175000017500000077464711333433237017361 0ustar rousseaurousseau# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written 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. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 56 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl _LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\[$]0 --fallback-echo"')dnl " lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` ;; esac _LT_OUTPUT_LIBTOOL_INIT ]) # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) cat >"$CONFIG_LT" <<_LTEOF #! $SHELL # Generated by $as_me. # Run this file to recreate a libtool stub with the current configuration. lt_cl_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2008 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. if test "$no_create" != yes; then lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) fi ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_XSI_SHELLFNS sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES # -------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(whole_archive_flag_spec, $1)='' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX # ----------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. m4_defun([_LT_PROG_ECHO_BACKSLASH], [_LT_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac ECHO=${lt_ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF [$]* _LT_EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(lt_ECHO) ]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that does not interpret backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [AC_CHECK_TOOL(AR, ar, false) test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1]) AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[[3-9]]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl 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 $CC]) 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. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname 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(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method == "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC*) # IBM XL 8.0 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # 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 ;; linux* | k*bsd*-gnu) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # 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. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) 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 exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi 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]].*|aix[[5-9]]*) 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 exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # 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. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE(int foo(void) {}, _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ) LDFLAGS="$save_LDFLAGS" else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then _LT_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], [[If ld is used when linking, flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [fix_srcfile_path], [1], [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_PROG_CXX # ------------ # Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ # compiler, we have our own version here. m4_defun([_LT_PROG_CXX], [ pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) AC_PROG_CXX if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_CXX dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_CXX], []) # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [AC_REQUIRE([_LT_PROG_CXX])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) 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 exp_sym_flag='-Bexport' no_entry_flag="" 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]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 will use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; xl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=echo else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ]) dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_PROG_F77 # ------------ # Since AC_PROG_F77 is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_F77], [ pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) AC_PROG_F77 if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_F77 dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_F77], []) # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_REQUIRE([_LT_PROG_F77])dnl AC_LANG_PUSH(Fortran 77) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${F77-"f77"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_PROG_FC # ----------- # Since AC_PROG_FC is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_FC], [ pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) AC_PROG_FC if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_FC dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_FC], []) # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_REQUIRE([_LT_PROG_FC])dnl AC_LANG_PUSH(Fortran) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${FC-"f95"} compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC="$lt_save_CC" ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC= CC=${RC-"windres"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC="$lt_save_CC" ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_XSI_SHELLFNS # --------------------- # Bourne and XSI compatible variants of some useful shell functions. m4_defun([_LT_PROG_XSI_SHELLFNS], [case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $[*] )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } dnl func_dirname_and_basename dnl A portable version of this function is already defined in general.m4sh dnl so there is no need for it here. # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[[^=]]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$[@]"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]+=\$[2]" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]=\$$[1]\$[2]" } _LT_EOF ;; esac ]) pilot-link-0.12.5-dfsg/m4/vl_lib_readline.m40000644000175000017500000000767410250122237021004 0ustar rousseaurousseaudnl @synopsis VL_LIB_READLINE dnl dnl Searches for a readline compatible library. If found, defines dnl `HAVE_LIBREADLINE'. If the found library has the `add_history' dnl function, sets also `HAVE_READLINE_HISTORY'. Also checks for the dnl locations of the necessary include files and sets `HAVE_READLINE_H' dnl or `HAVE_READLINE_READLINE_H' and `HAVE_READLINE_HISTORY_H' or dnl 'HAVE_HISTORY_H' if the corresponding include files exists. dnl dnl The libraries that may be readline compatible are `libedit', dnl `libeditline' and `libreadline'. Sometimes we need to link a termcap dnl library for readline to work, this macro tests these cases too by dnl trying to link with `libtermcap', `libcurses' or `libncurses' before dnl giving up. dnl dnl Here is an example of how to use the information provided by this dnl macro to perform the necessary includes or declarations in a C file: dnl dnl #ifdef HAVE_LIBREADLINE dnl # if defined(HAVE_READLINE_READLINE_H) dnl # include dnl # elif defined(HAVE_READLINE_H) dnl # include dnl # else /* !defined(HAVE_READLINE_H) */ dnl extern char *readline (); dnl # endif /* !defined(HAVE_READLINE_H) */ dnl char *cmdline = NULL; dnl #else /* !defined(HAVE_READLINE_READLINE_H) */ dnl /* no readline */ dnl #endif /* HAVE_LIBREADLINE */ dnl dnl #ifdef HAVE_READLINE_HISTORY dnl # if defined(HAVE_READLINE_HISTORY_H) dnl # include dnl # elif defined(HAVE_HISTORY_H) dnl # include dnl # else /* !defined(HAVE_HISTORY_H) */ dnl extern void add_history (); dnl extern int write_history (); dnl extern int read_history (); dnl # endif /* defined(HAVE_READLINE_HISTORY_H) */ dnl /* no history */ dnl #endif /* HAVE_READLINE_HISTORY */ dnl dnl dnl @version 1.1 dnl @author Ville Laurikari dnl dnl Modifications by T. Joseph Carter for pilot-link: dnl - Don't put -lreadline in LIBS dnl - Add --without-readline to disable use of it dnl - Set msg_readline and RL_LIBS appropriately dnl dnl TODO: dnl - Add --with-readline-includes and -headers dnl - Make the above default to $with_readline/{include,lib} if set to dnl something other than "yes" or "no". dnl AC_DEFUN([VL_LIB_READLINE], [ msg_readline="no" RL_LIBS="" AC_ARG_WITH(readline, [ --without-readline Disable readline [[default=no]]],, with_readline="yes") if test "x$with_readline" != "xno"; then AC_CACHE_CHECK([for a readline compatible library], vl_cv_lib_readline, [ ORIG_LIBS="$LIBS" for readline_lib in readline edit editline; do for termcap_lib in "" termcap curses ncurses; do if test -z "$termcap_lib"; then TRY_LIB="-l$readline_lib" else TRY_LIB="-l$readline_lib -l$termcap_lib" fi LIBS="$ORIG_LIBS $TRY_LIB" AC_TRY_LINK_FUNC(readline, vl_cv_lib_readline="$TRY_LIB") if test -n "$vl_cv_lib_readline"; then break fi done if test -n "$vl_cv_lib_readline"; then break fi done if test -z "$vl_cv_lib_readline"; then vl_cv_lib_readline="no" fi LIBS="$ORIG_LIBS" ]) fi if test "$vl_cv_lib_readline" != "no"; then msg_readline="yes" RL_LIBS="$vl_cv_lib_readline" AC_DEFINE(HAVE_LIBREADLINE, 1, [Define if you have a readline compatible library]) AC_CHECK_HEADERS(readline.h readline/readline.h) AC_CACHE_CHECK([whether readline supports history], vl_cv_lib_readline_history, [ vl_cv_lib_readline_history="no" AC_TRY_LINK_FUNC(add_history, vl_cv_lib_readline_history="yes") ]) if test "$vl_cv_lib_readline_history" = "yes"; then AC_DEFINE(HAVE_READLINE_HISTORY, 1, [Define if your readline library has \`add_history']) AC_CHECK_HEADERS(history.h readline/history.h) fi fi AC_SUBST(RL_LIBS) ])dnl pilot-link-0.12.5-dfsg/m4/bluez.m40000644000175000017500000000211410715070045017000 0ustar rousseaurousseaudnl AC_BLUEZ([action-if-found],[action-if-not-found]) dnl Input: use_bluez may contain prefix AC_DEFUN([AC_BLUEZ], [ bluez_prefix="$prefix" test "$prefix" = "NONE" && bluez_prefix="$ac_default_prefix" test "${use_bluez#/}" != "$use_bluez" && bluez_prefix="$use_bluez" BLUEZ_CFLAGS="" BLUEZ_LIBS="" ac_save_CPPFLAGS="$CPPFLAGS" for bluid in {"${bluez_prefix}",/usr,/usr/local}/include ; do CPPFLAGS="$ac_save_CPPFLAGS -I${bluid}" AC_CHECK_HEADER([bluetooth/bluetooth.h],[ BLUEZ_CFLAGS="-I$bluid" ]) test -z "$BLUEZ_CFLAGS" || break done CPPFLAGS="$ac_save_CPPFLAGS" if test -n "$BLUEZ_CFLAGS" ; then ac_save_LDFLAGS="$LDFLAGS" for bluld in {"${bluez_prefix}",usr,/usr/local}/{lib,lib64} ; do LDFLAGS="$ac_saveLDFLAGS -L${bluld}" AC_CHECK_LIB([bluetooth],[hci_open_dev],[ AC_CHECK_LIB([bluetooth],[sdp_connect],[ BLUEZ_LIBS="-L${bluld} -lbluetooth" ]) ]) test -z "${BLUEZ_LIBS}" || break done LDFLAGS="$ac_save_LDFLAGS" fi if test -z "${BLUEZ_CFLAGS}" -o -z "${BLUEZ_LIBS}" ; then ifelse([$2], , :, [$2]) else ifelse([$1], , :, [$1]) fi ]) pilot-link-0.12.5-dfsg/pilot-link.pc.in0000644000175000017500000000042007702404366020117 0ustar rousseaurousseauprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: Pilot Link Description: Suite of tools to communicate with a Palm handheld over various interfaces Version: @VERSION@ Requires: Libs: -L${libdir} -lpisock Cflags: -g -I${includedir} pilot-link-0.12.5-dfsg/darwin/0000755000175000017500000000000011333433324016363 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/darwin/Makefile.in0000644000175000017500000002665511333433243020446 0ustar rousseaurousseau# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ target_triplet = @target@ subdir = darwin DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/bluez.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/tcl.m4 \ $(top_srcdir)/m4/threads.m4 \ $(top_srcdir)/m4/vl_lib_readline.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/include/pi-md5.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLUEZ_CFLAGS = @BLUEZ_CFLAGS@ BLUEZ_LIBS = @BLUEZ_LIBS@ CAT_ENTRY_END = @CAT_ENTRY_END@ CAT_ENTRY_START = @CAT_ENTRY_START@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOCBOOK_ROOT = @DOCBOOK_ROOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVA = @JAVA@ JAVABASE = @JAVABASE@ JAVAC = @JAVAC@ JAVA_VERSION = @JAVA_VERSION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PIC_LIBS = @PIC_LIBS@ PILOT_LINK_MAJOR = @PILOT_LINK_MAJOR@ PILOT_LINK_MINOR = @PILOT_LINK_MINOR@ PILOT_LINK_PATCH = @PILOT_LINK_PATCH@ PILOT_LINK_VERS = @PILOT_LINK_VERS@ PISOCK_AGE = @PISOCK_AGE@ PISOCK_CURRENT = @PISOCK_CURRENT@ PISOCK_REVISION = @PISOCK_REVISION@ PISYNC_AGE = @PISYNC_AGE@ PISYNC_CURRENT = @PISYNC_CURRENT@ PISYNC_REVISION = @PISYNC_REVISION@ PKG_CONFIG = @PKG_CONFIG@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ POPT_INCLUDES = @POPT_INCLUDES@ POPT_LIBS = @POPT_LIBS@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_H = @PYTHON_H@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RL_LIBS = @RL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ XML_CATALOG = @XML_CATALOG@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ builddir = @builddir@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ usb_libs = @usb_libs@ EXTRA_DIST = \ build_framework.sh all: all-am .SUFFIXES: $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu darwin/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu darwin/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: pilot-link-0.12.5-dfsg/darwin/build_framework.sh0000755000175000017500000000225110474150513022077 0ustar rousseaurousseau#!/bin/sh # # Build a libpisock.framework embeddable in an application # # Usage examples: # # sh build_framework.sh # builds the framework without prebinding # # sh build_framework.sh 0x12345678 # builds the framework prebound at address 0x12345678, suited for # building frameworks that are going to be linked to prebound # executables # # Copyright (c) 2004, Florent Pillet # what=libpisock libs=../libpisock/.libs/libpisock.a linkflags="-framework Carbon -framework System -framework IOKit" gcc_version=`gcc --version | sed -e '2,$ d s/.*) \([[:digit:]+]\).[[:digit:]+].[[:digit:]+].*/\1/g'` if [ $gcc_version != 4 ]; then linkflags="$linkflags -lgcc"; fi incs=../include rm -Rf $what.framework mkdir -p $what.framework/Versions/A/Headers if [ $1 ]; then export LD_PREBIND=1 linkflags="$linkflags -seg1addr $1"; fi /usr/bin/libtool -v -dynamic -arch_only ppc \ -o $what.framework/Versions/A/$what \ -install_name @executable_path/../Frameworks/$what.framework/Versions/A/$what \ $libs $linkflags cp $incs/*.h $what.framework/Versions/A/Headers/ cd $what.framework/Versions ln -sf A Current cd .. ln -sf Versions/Current/Headers Headers ln -sf Versions/Current/$what $what cd .. pilot-link-0.12.5-dfsg/darwin/Makefile.am0000644000175000017500000000004410055467710020423 0ustar rousseaurousseauEXTRA_DIST = \ build_framework.sh pilot-link-0.12.5-dfsg/src/0000755000175000017500000000000011333433323015665 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/src/pilot-read-palmpix.c0000644000175000017500000003443511211745573021562 0ustar rousseaurousseau/* * $Id: pilot-read-palmpix.c,v 1.36 2007/02/04 23:06:03 desrod Exp $ * * pilot-read-palmpix.c: PalmPix image convertor * * Copyright 2001 John Marshall * Copyright 2002-2004 Angus Ainslie * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "pi-file.h" #include "pi-socket.h" #include "pi-header.h" #include "pi-palmpix.h" #include "pi-userland.h" #ifdef HAVE_PNG #include "png.h" #if (PNG_LIBPNG_VER < 10201) #define png_voidp_NULL (png_voidp)NULL #define png_error_ptr_NULL (png_error_ptr)NULL #endif #endif const char *progname; /*********************************************************************** * * Function: PalmPixState_pi_file * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ struct PalmPixState_pi_file { struct PalmPixState state; struct pi_file *f; }; /*********************************************************************** * * Function: getrecord_pi_file * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int getrecord_pi_file (struct PalmPixState *vstate, int recno, void **buf, size_t *bufsize) { struct PalmPixState_pi_file *state = (struct PalmPixState_pi_file *) vstate; return pi_file_read_record (state->f, recno, buf, bufsize, NULL, NULL, NULL) < 0 ? -1 : 0; } /*********************************************************************** * * Function: PalmPixState_pi_socket * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ struct PalmPixState_pi_socket { struct PalmPixState state; int sd, db; }; /*********************************************************************** * * Function: getrecord_pi_socket * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int getrecord_pi_socket (struct PalmPixState *vstate, int recno, void **buf, size_t *bufsize) { static char buffer[65536]; static pi_buffer_t fakebuf; struct PalmPixState_pi_socket *state = (struct PalmPixState_pi_socket *) vstate; *buf = buffer; fakebuf.data = buffer; fakebuf.allocated = 0; fakebuf.used = 0; return dlp_ReadRecordByIndex (state->sd, state->db, recno, &fakebuf, NULL, NULL, NULL) < 0 ? 1 : 0; } /*********************************************************************** * * Function: fmt_date * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static const char *fmt_date (const struct PalmPixHeader *h) { static char buf[24]; sprintf (buf, "%d-%02d-%02d %02d:%02d:%02d", h->year, h->month, h->day, h->hour, h->min, h->sec); return buf; } /*********************************************************************** * * Function: init_for_ppm * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ void init_for_ppm (struct PalmPixState *state) { state->offset_r = 0; state->offset_g = 1; state->offset_b = 2; } /*********************************************************************** * * Function: write_ppm * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ void write_ppm (FILE *f, const struct PalmPixState *state, const struct PalmPixHeader *header) { fprintf (f, "P6\n# %s (taken at %s)\n%d %d\n255\n", state->pixname, fmt_date (header), header->w, header->h); fwrite (state->pixmap, header->w * header->h * 3, 1, f); } /*********************************************************************** * * Function: write_png * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ #ifdef HAVE_PNG void write_png( FILE *f, const struct PalmPixState *state, const struct PalmPixHeader *header) { int i; png_structp png_ptr; png_infop info_ptr; png_ptr = png_create_write_struct ( PNG_LIBPNG_VER_STRING, png_voidp_NULL, png_error_ptr_NULL, png_error_ptr_NULL); if(!png_ptr) return; info_ptr = png_create_info_struct(png_ptr); if(!info_ptr) { png_destroy_write_struct(&png_ptr, (png_infopp)NULL); return; } if( setjmp( png_jmpbuf(png_ptr))) { png_destroy_write_struct(&png_ptr, &info_ptr); fclose(f); return; } png_init_io(png_ptr, f); png_set_IHDR(png_ptr, info_ptr, header->w, header->h, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); png_write_info( png_ptr, info_ptr ); for(i=0; ih; i++) { png_write_row(png_ptr, &state->pixmap[i*header->w*3]); png_write_flush(png_ptr); } png_write_end(png_ptr, info_ptr); png_destroy_write_struct(&png_ptr, &info_ptr); } #endif /*********************************************************************** * * Function: write_one * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int write_one (const struct PalmPixHeader *header, struct PalmPixState *state, int recno, const char *pixname) { if (unpack_PalmPix (state, header, recno, pixName) != 0) { init_for_ppm (state); if (strcmp (state->pixname, pixname) == 0 && unpack_PalmPix (state, header, recno, pixName | pixPixmap) != 0) { #ifdef HAVE_PNG if( state->output_type == PALMPIX_OUT_PPM ) write_ppm( stdout, state, header); else if( state->output_type == PALMPIX_OUT_PNG ) write_png( stdout, state, header); #else write_ppm (stdout, state, header); #endif free_PalmPix_data (state); } recno = state->highest_recno; } return recno; } /*********************************************************************** * * Function: write_all * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int write_all (const struct PalmPixHeader *header, struct PalmPixState *state, int recno, const char *ignored) { char fname[FILENAME_MAX], ext[10]; FILE *f; init_for_ppm (state); if (!unpack_PalmPix (state, header, recno, pixName | pixPixmap)) { /* bail */ return recno; } sprintf( fname, "%s", state->pixname ); if( state->output_type == PALMPIX_OUT_PPM ) sprintf( ext, "_pp.ppm" ); else if( state->output_type == PALMPIX_OUT_PNG ) sprintf( ext, "_pp.png" ); if (plu_protect_files( fname, ext, sizeof(fname) ) < 1) { return recno; } printf ("Generating %s...\n", fname); f = fopen (fname, "wb"); if (f) { struct utimbuf timep ; struct tm timeptr ; #ifdef HAVE_PNG if( state->output_type == PALMPIX_OUT_PPM ) write_ppm(f, state, header); else if( state->output_type == PALMPIX_OUT_PNG ) write_png(f, state, header); #else write_ppm (f, state, header); #endif fclose (f); /* Keep file date the same date as the photo */ timeptr.tm_year = header->year - 1900; timeptr.tm_mon = header->month -1; timeptr.tm_mday = header->day; timeptr.tm_hour = header->hour; timeptr.tm_min = header->min; timeptr.tm_sec = header->sec; timep.actime = timep.modtime = mktime(&timeptr); utime (fname,&timep); } else { fprintf (stderr, "%s: can't write to %s\n", progname, fname); } free_PalmPix_data (state); recno = state->highest_recno; return recno; } /*********************************************************************** * * Function: list * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int list (const struct PalmPixHeader *h, struct PalmPixState *state, int recno, const char *ignored) { if (unpack_PalmPix (state, h, recno, pixName) != 0) { printf ("%d x %d\t%d\t%s\t%s\n", h->w, h->h, h->num, fmt_date (h), state->pixname); recno = state->highest_recno; } return recno; } /*********************************************************************** * * Function: read_db * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ void read_db (struct PalmPixState *state, int n, int (*action) (const struct PalmPixHeader *, struct PalmPixState *, int, const char *), const char *action_arg) { int i; for (i = 0; i < n; i++) { void *buffer; size_t bufsize; struct PalmPixHeader header; if (state->getrecord (state, i, &buffer, &bufsize) == 0 && unpack_PalmPixHeader (&header, buffer, bufsize) != 0) i = action (&header, state, i, action_arg); } } static int fail (const char *func) { perror (func); return -1; } int main (int argc, const char **argv) { int c, /* switch */ sd = -1, output_type = PALMPIX_OUT_PPM, bias = 50, flags = 0; int (*action) (const struct PalmPixHeader *, struct PalmPixState *, int, const char *) = write_all; const char *pixname = NULL; const char *file_arg = NULL, *type_str = NULL; struct PilotUser User; poptContext pc; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"stretch", 's', POPT_ARG_VAL | POPT_ARGFLAG_OR, &flags, PALMPIX_HISTOGRAM_STRETCH, "Do a histogram stretch on the colour planes", NULL}, {"colour", 'c', POPT_ARG_VAL | POPT_ARGFLAG_OR, &flags, PALMPIX_COLOUR_CORRECTION, "Do a simple colour correction", NULL}, {"type", 't', POPT_ARG_STRING, &type_str, 't', "Specify picture output type (ppm or png)", "[ppm|png]"}, {"bias", 'b', POPT_ARG_INT, &bias, 0 , "lighten or darken the image (0..49 darken, 51..100 lighten)", "bias"}, {"list", 'l', POPT_ARG_NONE, NULL, 'l', "List picture information instead of converting", NULL}, {"name", 'n', POPT_ARG_STRING, &pixname, 'n', "Convert only , and output to STDOUT as type", "name"}, POPT_TABLEEND }; pc = poptGetContext("read-palmpix", argc, argv, options, 0); poptSetOtherOptionHelp(pc,"[file] ...\n\n" " Convert all pictures in the files given, or found via connecting to a\n" " Palm handheld if no files are given, writing each to .ppm\n\n"); if (argc < 2) { poptPrintUsage(pc,stderr,0); return 1; } while ((c = poptGetNextOpt(pc)) >= 0) { switch (c) { /* Normally, l would be handled by popt magic, but since action is a _function_pointer_, not an enum or something, it needs special treatment. */ case 'l': action = list; case 'n': action = write_one; break; case 't': if( !strncmp( "png", type_str, 3 )) { #ifdef HAVE_PNG output_type = PALMPIX_OUT_PNG; #else fprintf( stderr, " ERROR: read-palmpix was built without png support\n" ); #endif } else if( !strncmp( "ppm", type_str, 3 )) { output_type = PALMPIX_OUT_PPM; } else { fprintf( stderr, " ERROR: Unknown output type defaulting to ppm\n" ); output_type = PALMPIX_OUT_PPM; } break; default: fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } } if (c < -1) { plu_badoption(pc,c); } if( bias < 0 || bias > 100 ) { fprintf( stderr, " ERROR: Bad bias valud %d, defaulting to 50.\n", bias ); bias=50; } if(poptPeekArg(pc) != NULL) { int i = 0; while((file_arg = poptGetArg(pc)) != NULL) { struct pi_file *f = pi_file_open (file_arg); i++; if (f) { struct DBInfo info; if ((poptPeekArg(pc) != NULL || i > 1) && action != write_one) printf ("%s:\n", file_arg); pi_file_get_info (f, &info); if (info.flags & dlpDBFlagResource) { struct PalmPixState_pi_file s; int n = 0; s.state.output_type = output_type; pi_file_get_entries (f, &n); s.state.getrecord = getrecord_pi_file; s.f = f; read_db (&s.state, n, action, pixname); } else { fprintf (stderr, " ERROR: %s is not a valid record database\n", file_arg); } pi_file_close (f); } else { fprintf (stderr, " ERROR: can't open %s\n", file_arg); } } } else { int db; sd = plu_connect(); if (sd < 0) return fail ("pi_socket"); if (dlp_ReadUserInfo(sd, &User) < 0) return fail( "Read user info" ); dlp_OpenConduit (sd); dlp_ReadUserInfo (sd, &User); if (dlp_OpenDB (sd, 0, dlpOpenRead, PalmPix_DB, &db) >= 0) { struct PalmPixState_pi_socket s; int n = 0; s.state.output_type = output_type; s.state.bias = bias; s.state.flags = flags; dlp_ReadOpenDBInfo (sd, db, &n); s.state.getrecord = getrecord_pi_socket; s.sd = sd; s.db = db; read_db (&s.state, n, action, pixname); dlp_CloseDB (sd, db); dlp_AddSyncLogEntry (sd, "Read PalmPix images from Palm.\n"); User.lastSyncPC = 0x00010000; User.lastSyncDate = User.successfulSyncDate = time (NULL); dlp_WriteUserInfo (sd, &User); } else { fprintf (stderr, " ERROR: can't open database %s\n", PalmPix_DB); } dlp_EndOfSync (sd, dlpEndCodeNormal); pi_close (sd); } return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/Makefile.in0000644000175000017500000020276711333433244017752 0ustar rousseaurousseau# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ target_triplet = @target@ @ENABLE_CONDUITS_TRUE@bin_PROGRAMS = pilot-addresses$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-clip$(EXEEXT) pilot-csd$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-debugsh$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-dedupe$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-dlpsh$(EXEEXT) pilot-file$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-foto$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-getram$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-getrom$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-getromtoken$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-hinotes$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-install-datebook$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-install-expenses$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-install-hinote$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-install-memo$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-install-netsync$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-install-todo$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-install-todos$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-install-user$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-memos$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-nredir$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-read-expenses$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-read-ical$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-read-notepad$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-read-palmpix$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-read-screenshot$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-read-todos$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-read-veo$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-reminders$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-schlep$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-foto-treo600$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-foto-treo650$(EXEEXT) \ @ENABLE_CONDUITS_TRUE@ pilot-wav$(EXEEXT) pilot-xfer$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in parsedate.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/bluez.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/tcl.m4 \ $(top_srcdir)/m4/threads.m4 \ $(top_srcdir)/m4/vl_lib_readline.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/include/pi-md5.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libpiuserland_la_LIBADD = am__libpiuserland_la_SOURCES_DIST = plu_args.c userland.c @ENABLE_CONDUITS_TRUE@am_libpiuserland_la_OBJECTS = plu_args.lo \ @ENABLE_CONDUITS_TRUE@ userland.lo libpiuserland_la_OBJECTS = $(am_libpiuserland_la_OBJECTS) libpiuserland_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libpiuserland_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_CONDUITS_TRUE@am_libpiuserland_la_rpath = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__pilot_addresses_SOURCES_DIST = pilot-addresses.c @ENABLE_CONDUITS_TRUE@am_pilot_addresses_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-addresses.$(OBJEXT) pilot_addresses_OBJECTS = $(am_pilot_addresses_OBJECTS) am__DEPENDENCIES_1 = @ENABLE_CONDUITS_TRUE@pilot_addresses_DEPENDENCIES = libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_clip_SOURCES_DIST = pilot-clip.c @ENABLE_CONDUITS_TRUE@am_pilot_clip_OBJECTS = pilot-clip.$(OBJEXT) pilot_clip_OBJECTS = $(am_pilot_clip_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_clip_DEPENDENCIES = libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_csd_SOURCES_DIST = pilot-csd.c @ENABLE_CONDUITS_TRUE@am_pilot_csd_OBJECTS = pilot-csd.$(OBJEXT) pilot_csd_OBJECTS = $(am_pilot_csd_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_csd_DEPENDENCIES = libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_debugsh_SOURCES_DIST = pilot-debugsh.c @ENABLE_CONDUITS_TRUE@am_pilot_debugsh_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-debugsh.$(OBJEXT) pilot_debugsh_OBJECTS = $(am_pilot_debugsh_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_debugsh_DEPENDENCIES = \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_dedupe_SOURCES_DIST = pilot-dedupe.c @ENABLE_CONDUITS_TRUE@am_pilot_dedupe_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-dedupe.$(OBJEXT) pilot_dedupe_OBJECTS = $(am_pilot_dedupe_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_dedupe_DEPENDENCIES = libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_dlpsh_SOURCES_DIST = pilot-dlpsh.c @ENABLE_CONDUITS_TRUE@am_pilot_dlpsh_OBJECTS = pilot-dlpsh.$(OBJEXT) pilot_dlpsh_OBJECTS = $(am_pilot_dlpsh_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_dlpsh_DEPENDENCIES = libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_file_SOURCES_DIST = pilot-file.c @ENABLE_CONDUITS_TRUE@am_pilot_file_OBJECTS = pilot-file.$(OBJEXT) pilot_file_OBJECTS = $(am_pilot_file_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_file_DEPENDENCIES = libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_foto_SOURCES_DIST = pilot-foto.c @ENABLE_CONDUITS_TRUE@am_pilot_foto_OBJECTS = pilot-foto.$(OBJEXT) pilot_foto_OBJECTS = $(am_pilot_foto_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_foto_DEPENDENCIES = libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_foto_treo600_SOURCES_DIST = pilot-foto-treo600.c @ENABLE_CONDUITS_TRUE@am_pilot_foto_treo600_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-foto-treo600.$(OBJEXT) pilot_foto_treo600_OBJECTS = $(am_pilot_foto_treo600_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_foto_treo600_DEPENDENCIES = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_foto_treo650_SOURCES_DIST = pilot-foto-treo650.c @ENABLE_CONDUITS_TRUE@am_pilot_foto_treo650_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-foto-treo650.$(OBJEXT) pilot_foto_treo650_OBJECTS = $(am_pilot_foto_treo650_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_foto_treo650_DEPENDENCIES = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_getram_SOURCES_DIST = pilot-getram.c @ENABLE_CONDUITS_TRUE@am_pilot_getram_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-getram.$(OBJEXT) pilot_getram_OBJECTS = $(am_pilot_getram_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_getram_DEPENDENCIES = libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_getrom_SOURCES_DIST = pilot-getrom.c @ENABLE_CONDUITS_TRUE@am_pilot_getrom_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-getrom.$(OBJEXT) pilot_getrom_OBJECTS = $(am_pilot_getrom_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_getrom_DEPENDENCIES = libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_getromtoken_SOURCES_DIST = pilot-getromtoken.c @ENABLE_CONDUITS_TRUE@am_pilot_getromtoken_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-getromtoken.$(OBJEXT) pilot_getromtoken_OBJECTS = $(am_pilot_getromtoken_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_getromtoken_DEPENDENCIES = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_hinotes_SOURCES_DIST = pilot-hinotes.c @ENABLE_CONDUITS_TRUE@am_pilot_hinotes_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-hinotes.$(OBJEXT) pilot_hinotes_OBJECTS = $(am_pilot_hinotes_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_hinotes_DEPENDENCIES = libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_install_datebook_SOURCES_DIST = pilot-install-datebook.c \ parsedate.y @ENABLE_CONDUITS_TRUE@am_pilot_install_datebook_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-install-datebook.$(OBJEXT) \ @ENABLE_CONDUITS_TRUE@ parsedate.$(OBJEXT) pilot_install_datebook_OBJECTS = $(am_pilot_install_datebook_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_install_datebook_DEPENDENCIES = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_install_expenses_SOURCES_DIST = pilot-install-expenses.c @ENABLE_CONDUITS_TRUE@am_pilot_install_expenses_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-install-expenses.$(OBJEXT) pilot_install_expenses_OBJECTS = $(am_pilot_install_expenses_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_install_expenses_DEPENDENCIES = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_install_hinote_SOURCES_DIST = pilot-install-hinote.c @ENABLE_CONDUITS_TRUE@am_pilot_install_hinote_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-install-hinote.$(OBJEXT) pilot_install_hinote_OBJECTS = $(am_pilot_install_hinote_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_install_hinote_DEPENDENCIES = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_install_memo_SOURCES_DIST = pilot-install-memo.c @ENABLE_CONDUITS_TRUE@am_pilot_install_memo_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-install-memo.$(OBJEXT) pilot_install_memo_OBJECTS = $(am_pilot_install_memo_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_install_memo_DEPENDENCIES = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_install_netsync_SOURCES_DIST = pilot-install-netsync.c @ENABLE_CONDUITS_TRUE@am_pilot_install_netsync_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-install-netsync.$(OBJEXT) pilot_install_netsync_OBJECTS = $(am_pilot_install_netsync_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_install_netsync_DEPENDENCIES = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_install_todo_SOURCES_DIST = pilot-install-todo.c @ENABLE_CONDUITS_TRUE@am_pilot_install_todo_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-install-todo.$(OBJEXT) pilot_install_todo_OBJECTS = $(am_pilot_install_todo_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_install_todo_DEPENDENCIES = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_install_todos_SOURCES_DIST = pilot-install-todos.c @ENABLE_CONDUITS_TRUE@am_pilot_install_todos_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-install-todos.$(OBJEXT) pilot_install_todos_OBJECTS = $(am_pilot_install_todos_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_install_todos_DEPENDENCIES = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_install_user_SOURCES_DIST = pilot-install-user.c @ENABLE_CONDUITS_TRUE@am_pilot_install_user_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-install-user.$(OBJEXT) pilot_install_user_OBJECTS = $(am_pilot_install_user_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_install_user_DEPENDENCIES = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_memos_SOURCES_DIST = pilot-memos.c @ENABLE_CONDUITS_TRUE@am_pilot_memos_OBJECTS = pilot-memos.$(OBJEXT) pilot_memos_OBJECTS = $(am_pilot_memos_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_memos_DEPENDENCIES = libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_nredir_SOURCES_DIST = pilot-nredir.c @ENABLE_CONDUITS_TRUE@am_pilot_nredir_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-nredir.$(OBJEXT) pilot_nredir_OBJECTS = $(am_pilot_nredir_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_nredir_DEPENDENCIES = libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_read_expenses_SOURCES_DIST = pilot-read-expenses.c @ENABLE_CONDUITS_TRUE@am_pilot_read_expenses_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-read-expenses.$(OBJEXT) pilot_read_expenses_OBJECTS = $(am_pilot_read_expenses_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_read_expenses_DEPENDENCIES = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_read_ical_SOURCES_DIST = pilot-read-ical.c @ENABLE_CONDUITS_TRUE@am_pilot_read_ical_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-read-ical.$(OBJEXT) pilot_read_ical_OBJECTS = $(am_pilot_read_ical_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_read_ical_DEPENDENCIES = libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_read_notepad_SOURCES_DIST = pilot-read-notepad.c @ENABLE_CONDUITS_TRUE@am_pilot_read_notepad_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-read-notepad.$(OBJEXT) pilot_read_notepad_OBJECTS = $(am_pilot_read_notepad_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_read_notepad_DEPENDENCIES = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_read_palmpix_SOURCES_DIST = pilot-read-palmpix.c @ENABLE_CONDUITS_TRUE@am_pilot_read_palmpix_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-read-palmpix.$(OBJEXT) pilot_read_palmpix_OBJECTS = $(am_pilot_read_palmpix_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_read_palmpix_DEPENDENCIES = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_read_screenshot_SOURCES_DIST = pilot-read-screenshot.c @ENABLE_CONDUITS_TRUE@am_pilot_read_screenshot_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-read-screenshot.$(OBJEXT) pilot_read_screenshot_OBJECTS = $(am_pilot_read_screenshot_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_read_screenshot_DEPENDENCIES = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_read_todos_SOURCES_DIST = pilot-read-todos.c @ENABLE_CONDUITS_TRUE@am_pilot_read_todos_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-read-todos.$(OBJEXT) pilot_read_todos_OBJECTS = $(am_pilot_read_todos_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_read_todos_DEPENDENCIES = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_read_veo_SOURCES_DIST = pilot-read-veo.c @ENABLE_CONDUITS_TRUE@am_pilot_read_veo_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-read-veo.$(OBJEXT) pilot_read_veo_OBJECTS = $(am_pilot_read_veo_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_read_veo_DEPENDENCIES = libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_reminders_SOURCES_DIST = pilot-reminders.c @ENABLE_CONDUITS_TRUE@am_pilot_reminders_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-reminders.$(OBJEXT) pilot_reminders_OBJECTS = $(am_pilot_reminders_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_reminders_DEPENDENCIES = libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_schlep_SOURCES_DIST = pilot-schlep.c @ENABLE_CONDUITS_TRUE@am_pilot_schlep_OBJECTS = \ @ENABLE_CONDUITS_TRUE@ pilot-schlep.$(OBJEXT) pilot_schlep_OBJECTS = $(am_pilot_schlep_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_schlep_DEPENDENCIES = libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_wav_SOURCES_DIST = pilot-wav.c @ENABLE_CONDUITS_TRUE@am_pilot_wav_OBJECTS = pilot-wav.$(OBJEXT) pilot_wav_OBJECTS = $(am_pilot_wav_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_wav_DEPENDENCIES = libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la am__pilot_xfer_SOURCES_DIST = pilot-xfer.c @ENABLE_CONDUITS_TRUE@am_pilot_xfer_OBJECTS = pilot-xfer.$(OBJEXT) pilot_xfer_OBJECTS = $(am_pilot_xfer_OBJECTS) @ENABLE_CONDUITS_TRUE@pilot_xfer_DEPENDENCIES = libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' SCRIPTS = $(bin_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ @MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ || YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) LTYACCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS) YLWRAP = $(top_srcdir)/ylwrap SOURCES = $(libpiuserland_la_SOURCES) $(pilot_addresses_SOURCES) \ $(pilot_clip_SOURCES) $(pilot_csd_SOURCES) \ $(pilot_debugsh_SOURCES) $(pilot_dedupe_SOURCES) \ $(pilot_dlpsh_SOURCES) $(pilot_file_SOURCES) \ $(pilot_foto_SOURCES) $(pilot_foto_treo600_SOURCES) \ $(pilot_foto_treo650_SOURCES) $(pilot_getram_SOURCES) \ $(pilot_getrom_SOURCES) $(pilot_getromtoken_SOURCES) \ $(pilot_hinotes_SOURCES) $(pilot_install_datebook_SOURCES) \ $(pilot_install_expenses_SOURCES) \ $(pilot_install_hinote_SOURCES) $(pilot_install_memo_SOURCES) \ $(pilot_install_netsync_SOURCES) $(pilot_install_todo_SOURCES) \ $(pilot_install_todos_SOURCES) $(pilot_install_user_SOURCES) \ $(pilot_memos_SOURCES) $(pilot_nredir_SOURCES) \ $(pilot_read_expenses_SOURCES) $(pilot_read_ical_SOURCES) \ $(pilot_read_notepad_SOURCES) $(pilot_read_palmpix_SOURCES) \ $(pilot_read_screenshot_SOURCES) $(pilot_read_todos_SOURCES) \ $(pilot_read_veo_SOURCES) $(pilot_reminders_SOURCES) \ $(pilot_schlep_SOURCES) $(pilot_wav_SOURCES) \ $(pilot_xfer_SOURCES) DIST_SOURCES = $(am__libpiuserland_la_SOURCES_DIST) \ $(am__pilot_addresses_SOURCES_DIST) \ $(am__pilot_clip_SOURCES_DIST) $(am__pilot_csd_SOURCES_DIST) \ $(am__pilot_debugsh_SOURCES_DIST) \ $(am__pilot_dedupe_SOURCES_DIST) \ $(am__pilot_dlpsh_SOURCES_DIST) $(am__pilot_file_SOURCES_DIST) \ $(am__pilot_foto_SOURCES_DIST) \ $(am__pilot_foto_treo600_SOURCES_DIST) \ $(am__pilot_foto_treo650_SOURCES_DIST) \ $(am__pilot_getram_SOURCES_DIST) \ $(am__pilot_getrom_SOURCES_DIST) \ $(am__pilot_getromtoken_SOURCES_DIST) \ $(am__pilot_hinotes_SOURCES_DIST) \ $(am__pilot_install_datebook_SOURCES_DIST) \ $(am__pilot_install_expenses_SOURCES_DIST) \ $(am__pilot_install_hinote_SOURCES_DIST) \ $(am__pilot_install_memo_SOURCES_DIST) \ $(am__pilot_install_netsync_SOURCES_DIST) \ $(am__pilot_install_todo_SOURCES_DIST) \ $(am__pilot_install_todos_SOURCES_DIST) \ $(am__pilot_install_user_SOURCES_DIST) \ $(am__pilot_memos_SOURCES_DIST) \ $(am__pilot_nredir_SOURCES_DIST) \ $(am__pilot_read_expenses_SOURCES_DIST) \ $(am__pilot_read_ical_SOURCES_DIST) \ $(am__pilot_read_notepad_SOURCES_DIST) \ $(am__pilot_read_palmpix_SOURCES_DIST) \ $(am__pilot_read_screenshot_SOURCES_DIST) \ $(am__pilot_read_todos_SOURCES_DIST) \ $(am__pilot_read_veo_SOURCES_DIST) \ $(am__pilot_reminders_SOURCES_DIST) \ $(am__pilot_schlep_SOURCES_DIST) $(am__pilot_wav_SOURCES_DIST) \ $(am__pilot_xfer_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLUEZ_CFLAGS = @BLUEZ_CFLAGS@ BLUEZ_LIBS = @BLUEZ_LIBS@ CAT_ENTRY_END = @CAT_ENTRY_END@ CAT_ENTRY_START = @CAT_ENTRY_START@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOCBOOK_ROOT = @DOCBOOK_ROOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVA = @JAVA@ JAVABASE = @JAVABASE@ JAVAC = @JAVAC@ JAVA_VERSION = @JAVA_VERSION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PIC_LIBS = @PIC_LIBS@ PILOT_LINK_MAJOR = @PILOT_LINK_MAJOR@ PILOT_LINK_MINOR = @PILOT_LINK_MINOR@ PILOT_LINK_PATCH = @PILOT_LINK_PATCH@ PILOT_LINK_VERS = @PILOT_LINK_VERS@ PISOCK_AGE = @PISOCK_AGE@ PISOCK_CURRENT = @PISOCK_CURRENT@ PISOCK_REVISION = @PISOCK_REVISION@ PISYNC_AGE = @PISYNC_AGE@ PISYNC_CURRENT = @PISYNC_CURRENT@ PISYNC_REVISION = @PISYNC_REVISION@ PKG_CONFIG = @PKG_CONFIG@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ POPT_INCLUDES = @POPT_INCLUDES@ POPT_LIBS = @POPT_LIBS@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_H = @PYTHON_H@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RL_LIBS = @RL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ XML_CATALOG = @XML_CATALOG@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ builddir = @builddir@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ usb_libs = @usb_libs@ SUBDIRS = prc pix @ENABLE_CONDUITS_TRUE@INCLUDES = \ @ENABLE_CONDUITS_TRUE@ -I/usr/include \ @ENABLE_CONDUITS_TRUE@ -I$(top_srcdir)/include \ @ENABLE_CONDUITS_TRUE@ $(POPT_INCLUDES) \ @ENABLE_CONDUITS_TRUE@ $(PNG_CFLAGS) \ @ENABLE_CONDUITS_TRUE@ $(TCL_INCLUDES) \ @ENABLE_CONDUITS_TRUE@ $(RL_CFLAGS) @ENABLE_CONDUITS_TRUE@noinst_LTLIBRARIES = libpiuserland.la @ENABLE_CONDUITS_TRUE@@WITH_PERL_FALSE@PERLSCRIPTS = @ENABLE_CONDUITS_TRUE@@WITH_PERL_TRUE@PERLSCRIPTS = \ @ENABLE_CONDUITS_TRUE@@WITH_PERL_TRUE@ pilot-ietf2datebook \ @ENABLE_CONDUITS_TRUE@@WITH_PERL_TRUE@ pilot-undelete \ @ENABLE_CONDUITS_TRUE@@WITH_PERL_TRUE@ pilot-sync-plan @ENABLE_CONDUITS_TRUE@bin_SCRIPTS = \ @ENABLE_CONDUITS_TRUE@ $(PERLSCRIPTS) #ccexample_SOURCES = \ # ccexample.cc #ccexample_LDADD = \ # $(top_builddir)/libpisock++/libpisock++.la \ # $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@libpiuserland_la_SOURCES = \ @ENABLE_CONDUITS_TRUE@ plu_args.c \ @ENABLE_CONDUITS_TRUE@ userland.c @ENABLE_CONDUITS_TRUE@libpiuserland_la_LDFLAGS = \ @ENABLE_CONDUITS_TRUE@ -static #getrom_SOURCES = \ # getrom.c #getrom_LDADD = \ # $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_install_datebook_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-install-datebook.c \ @ENABLE_CONDUITS_TRUE@ parsedate.y @ENABLE_CONDUITS_TRUE@pilot_install_datebook_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_install_hinote_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-install-hinote.c @ENABLE_CONDUITS_TRUE@pilot_install_hinote_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_install_memo_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-install-memo.c @ENABLE_CONDUITS_TRUE@pilot_install_memo_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_install_todos_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-install-todos.c @ENABLE_CONDUITS_TRUE@pilot_install_todos_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_install_todo_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-install-todo.c @ENABLE_CONDUITS_TRUE@pilot_install_todo_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_install_user_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-install-user.c @ENABLE_CONDUITS_TRUE@pilot_install_user_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_memos_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-memos.c @ENABLE_CONDUITS_TRUE@pilot_memos_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_csd_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-csd.c @ENABLE_CONDUITS_TRUE@pilot_csd_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_debugsh_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-debugsh.c @ENABLE_CONDUITS_TRUE@pilot_debugsh_LDADD = \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_dlpsh_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-dlpsh.c @ENABLE_CONDUITS_TRUE@pilot_dlpsh_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(RL_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_getram_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-getram.c @ENABLE_CONDUITS_TRUE@pilot_getram_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_getrom_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-getrom.c @ENABLE_CONDUITS_TRUE@pilot_getrom_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_getromtoken_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-getromtoken.c @ENABLE_CONDUITS_TRUE@pilot_getromtoken_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_hinotes_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-hinotes.c @ENABLE_CONDUITS_TRUE@pilot_hinotes_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_install_expenses_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-install-expenses.c @ENABLE_CONDUITS_TRUE@pilot_install_expenses_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_install_netsync_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-install-netsync.c @ENABLE_CONDUITS_TRUE@pilot_install_netsync_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_nredir_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-nredir.c @ENABLE_CONDUITS_TRUE@pilot_nredir_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_addresses_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-addresses.c @ENABLE_CONDUITS_TRUE@pilot_addresses_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_clip_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-clip.c @ENABLE_CONDUITS_TRUE@pilot_clip_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_dedupe_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-dedupe.c @ENABLE_CONDUITS_TRUE@pilot_dedupe_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_file_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-file.c @ENABLE_CONDUITS_TRUE@pilot_file_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_foto_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-foto.c @ENABLE_CONDUITS_TRUE@pilot_foto_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_read_screenshot_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-read-screenshot.c @ENABLE_CONDUITS_TRUE@pilot_read_screenshot_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(PNG_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_reminders_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-reminders.c @ENABLE_CONDUITS_TRUE@pilot_reminders_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_schlep_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-schlep.c @ENABLE_CONDUITS_TRUE@pilot_schlep_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_foto_treo600_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-foto-treo600.c @ENABLE_CONDUITS_TRUE@pilot_foto_treo600_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_foto_treo650_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-foto-treo650.c @ENABLE_CONDUITS_TRUE@pilot_foto_treo650_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_wav_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-wav.c @ENABLE_CONDUITS_TRUE@pilot_wav_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_xfer_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-xfer.c @ENABLE_CONDUITS_TRUE@pilot_xfer_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_read_expenses_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-read-expenses.c @ENABLE_CONDUITS_TRUE@pilot_read_expenses_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_read_ical_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-read-ical.c @ENABLE_CONDUITS_TRUE@pilot_read_ical_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_read_notepad_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-read-notepad.c @ENABLE_CONDUITS_TRUE@pilot_read_notepad_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(PNG_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_read_palmpix_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-read-palmpix.c @ENABLE_CONDUITS_TRUE@pilot_read_palmpix_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(PNG_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_read_todos_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-read-todos.c @ENABLE_CONDUITS_TRUE@pilot_read_todos_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@pilot_read_veo_SOURCES = \ @ENABLE_CONDUITS_TRUE@ pilot-read-veo.c @ENABLE_CONDUITS_TRUE@pilot_read_veo_LDADD = \ @ENABLE_CONDUITS_TRUE@ libpiuserland.la \ @ENABLE_CONDUITS_TRUE@ $(POPT_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(PNG_LIBS) \ @ENABLE_CONDUITS_TRUE@ $(top_builddir)/libpisock/libpisock.la @ENABLE_CONDUITS_TRUE@CLEANFILES = $(PERLSCRIPTS) EXTRA_DIST = \ ccexample.cc \ pilot-ietf2datebook.pl \ kittykiller.c \ parsedate.y \ pd-tty.c \ pilot-addresses.c \ pilot-clip.c \ pilot-csd.c \ pilot-debug.c \ pilot-debugsh.c \ pilot-dedupe.c \ pilot-dlpsh.c \ pilot-file.c \ pilot-foto.c \ pilot-getram.c \ pilot-getrom.c \ pilot-getromtoken.c \ pilot-hinotes.c \ pilot-install-datebook.c \ pilot-install-expenses \ pilot-install-hinote.c \ pilot-install-memo.c \ pilot-install-netsync.c \ pilot-install-todo.c \ pilot-install-todos.c \ pilot-install-user.c \ pilot-memos.c \ pilot-nredir.c \ pilot-port.c \ pilot-read-expenses.c \ pilot-read-ical.c \ pilot-read-notepad.c \ pilot-read-palmpix.c \ pilot-read-screenshot.c \ pilot-read-todos.c \ pilot-read-veo.c \ pilot-reminders.c \ pilot-schlep.c \ pilot-foto-treo600.c \ pilot-foto-treo650.c \ pilot-undelete.pl \ pilot-wav.c \ pilot-xfer.c \ pilot-sync-plan.pl \ validate.cc all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj .y .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 $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libpiuserland.la: $(libpiuserland_la_OBJECTS) $(libpiuserland_la_DEPENDENCIES) $(libpiuserland_la_LINK) $(am_libpiuserland_la_rpath) $(libpiuserland_la_OBJECTS) $(libpiuserland_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list pilot-addresses$(EXEEXT): $(pilot_addresses_OBJECTS) $(pilot_addresses_DEPENDENCIES) @rm -f pilot-addresses$(EXEEXT) $(LINK) $(pilot_addresses_OBJECTS) $(pilot_addresses_LDADD) $(LIBS) pilot-clip$(EXEEXT): $(pilot_clip_OBJECTS) $(pilot_clip_DEPENDENCIES) @rm -f pilot-clip$(EXEEXT) $(LINK) $(pilot_clip_OBJECTS) $(pilot_clip_LDADD) $(LIBS) pilot-csd$(EXEEXT): $(pilot_csd_OBJECTS) $(pilot_csd_DEPENDENCIES) @rm -f pilot-csd$(EXEEXT) $(LINK) $(pilot_csd_OBJECTS) $(pilot_csd_LDADD) $(LIBS) pilot-debugsh$(EXEEXT): $(pilot_debugsh_OBJECTS) $(pilot_debugsh_DEPENDENCIES) @rm -f pilot-debugsh$(EXEEXT) $(LINK) $(pilot_debugsh_OBJECTS) $(pilot_debugsh_LDADD) $(LIBS) pilot-dedupe$(EXEEXT): $(pilot_dedupe_OBJECTS) $(pilot_dedupe_DEPENDENCIES) @rm -f pilot-dedupe$(EXEEXT) $(LINK) $(pilot_dedupe_OBJECTS) $(pilot_dedupe_LDADD) $(LIBS) pilot-dlpsh$(EXEEXT): $(pilot_dlpsh_OBJECTS) $(pilot_dlpsh_DEPENDENCIES) @rm -f pilot-dlpsh$(EXEEXT) $(LINK) $(pilot_dlpsh_OBJECTS) $(pilot_dlpsh_LDADD) $(LIBS) pilot-file$(EXEEXT): $(pilot_file_OBJECTS) $(pilot_file_DEPENDENCIES) @rm -f pilot-file$(EXEEXT) $(LINK) $(pilot_file_OBJECTS) $(pilot_file_LDADD) $(LIBS) pilot-foto$(EXEEXT): $(pilot_foto_OBJECTS) $(pilot_foto_DEPENDENCIES) @rm -f pilot-foto$(EXEEXT) $(LINK) $(pilot_foto_OBJECTS) $(pilot_foto_LDADD) $(LIBS) pilot-foto-treo600$(EXEEXT): $(pilot_foto_treo600_OBJECTS) $(pilot_foto_treo600_DEPENDENCIES) @rm -f pilot-foto-treo600$(EXEEXT) $(LINK) $(pilot_foto_treo600_OBJECTS) $(pilot_foto_treo600_LDADD) $(LIBS) pilot-foto-treo650$(EXEEXT): $(pilot_foto_treo650_OBJECTS) $(pilot_foto_treo650_DEPENDENCIES) @rm -f pilot-foto-treo650$(EXEEXT) $(LINK) $(pilot_foto_treo650_OBJECTS) $(pilot_foto_treo650_LDADD) $(LIBS) pilot-getram$(EXEEXT): $(pilot_getram_OBJECTS) $(pilot_getram_DEPENDENCIES) @rm -f pilot-getram$(EXEEXT) $(LINK) $(pilot_getram_OBJECTS) $(pilot_getram_LDADD) $(LIBS) pilot-getrom$(EXEEXT): $(pilot_getrom_OBJECTS) $(pilot_getrom_DEPENDENCIES) @rm -f pilot-getrom$(EXEEXT) $(LINK) $(pilot_getrom_OBJECTS) $(pilot_getrom_LDADD) $(LIBS) pilot-getromtoken$(EXEEXT): $(pilot_getromtoken_OBJECTS) $(pilot_getromtoken_DEPENDENCIES) @rm -f pilot-getromtoken$(EXEEXT) $(LINK) $(pilot_getromtoken_OBJECTS) $(pilot_getromtoken_LDADD) $(LIBS) pilot-hinotes$(EXEEXT): $(pilot_hinotes_OBJECTS) $(pilot_hinotes_DEPENDENCIES) @rm -f pilot-hinotes$(EXEEXT) $(LINK) $(pilot_hinotes_OBJECTS) $(pilot_hinotes_LDADD) $(LIBS) pilot-install-datebook$(EXEEXT): $(pilot_install_datebook_OBJECTS) $(pilot_install_datebook_DEPENDENCIES) @rm -f pilot-install-datebook$(EXEEXT) $(LINK) $(pilot_install_datebook_OBJECTS) $(pilot_install_datebook_LDADD) $(LIBS) pilot-install-expenses$(EXEEXT): $(pilot_install_expenses_OBJECTS) $(pilot_install_expenses_DEPENDENCIES) @rm -f pilot-install-expenses$(EXEEXT) $(LINK) $(pilot_install_expenses_OBJECTS) $(pilot_install_expenses_LDADD) $(LIBS) pilot-install-hinote$(EXEEXT): $(pilot_install_hinote_OBJECTS) $(pilot_install_hinote_DEPENDENCIES) @rm -f pilot-install-hinote$(EXEEXT) $(LINK) $(pilot_install_hinote_OBJECTS) $(pilot_install_hinote_LDADD) $(LIBS) pilot-install-memo$(EXEEXT): $(pilot_install_memo_OBJECTS) $(pilot_install_memo_DEPENDENCIES) @rm -f pilot-install-memo$(EXEEXT) $(LINK) $(pilot_install_memo_OBJECTS) $(pilot_install_memo_LDADD) $(LIBS) pilot-install-netsync$(EXEEXT): $(pilot_install_netsync_OBJECTS) $(pilot_install_netsync_DEPENDENCIES) @rm -f pilot-install-netsync$(EXEEXT) $(LINK) $(pilot_install_netsync_OBJECTS) $(pilot_install_netsync_LDADD) $(LIBS) pilot-install-todo$(EXEEXT): $(pilot_install_todo_OBJECTS) $(pilot_install_todo_DEPENDENCIES) @rm -f pilot-install-todo$(EXEEXT) $(LINK) $(pilot_install_todo_OBJECTS) $(pilot_install_todo_LDADD) $(LIBS) pilot-install-todos$(EXEEXT): $(pilot_install_todos_OBJECTS) $(pilot_install_todos_DEPENDENCIES) @rm -f pilot-install-todos$(EXEEXT) $(LINK) $(pilot_install_todos_OBJECTS) $(pilot_install_todos_LDADD) $(LIBS) pilot-install-user$(EXEEXT): $(pilot_install_user_OBJECTS) $(pilot_install_user_DEPENDENCIES) @rm -f pilot-install-user$(EXEEXT) $(LINK) $(pilot_install_user_OBJECTS) $(pilot_install_user_LDADD) $(LIBS) pilot-memos$(EXEEXT): $(pilot_memos_OBJECTS) $(pilot_memos_DEPENDENCIES) @rm -f pilot-memos$(EXEEXT) $(LINK) $(pilot_memos_OBJECTS) $(pilot_memos_LDADD) $(LIBS) pilot-nredir$(EXEEXT): $(pilot_nredir_OBJECTS) $(pilot_nredir_DEPENDENCIES) @rm -f pilot-nredir$(EXEEXT) $(LINK) $(pilot_nredir_OBJECTS) $(pilot_nredir_LDADD) $(LIBS) pilot-read-expenses$(EXEEXT): $(pilot_read_expenses_OBJECTS) $(pilot_read_expenses_DEPENDENCIES) @rm -f pilot-read-expenses$(EXEEXT) $(LINK) $(pilot_read_expenses_OBJECTS) $(pilot_read_expenses_LDADD) $(LIBS) pilot-read-ical$(EXEEXT): $(pilot_read_ical_OBJECTS) $(pilot_read_ical_DEPENDENCIES) @rm -f pilot-read-ical$(EXEEXT) $(LINK) $(pilot_read_ical_OBJECTS) $(pilot_read_ical_LDADD) $(LIBS) pilot-read-notepad$(EXEEXT): $(pilot_read_notepad_OBJECTS) $(pilot_read_notepad_DEPENDENCIES) @rm -f pilot-read-notepad$(EXEEXT) $(LINK) $(pilot_read_notepad_OBJECTS) $(pilot_read_notepad_LDADD) $(LIBS) pilot-read-palmpix$(EXEEXT): $(pilot_read_palmpix_OBJECTS) $(pilot_read_palmpix_DEPENDENCIES) @rm -f pilot-read-palmpix$(EXEEXT) $(LINK) $(pilot_read_palmpix_OBJECTS) $(pilot_read_palmpix_LDADD) $(LIBS) pilot-read-screenshot$(EXEEXT): $(pilot_read_screenshot_OBJECTS) $(pilot_read_screenshot_DEPENDENCIES) @rm -f pilot-read-screenshot$(EXEEXT) $(LINK) $(pilot_read_screenshot_OBJECTS) $(pilot_read_screenshot_LDADD) $(LIBS) pilot-read-todos$(EXEEXT): $(pilot_read_todos_OBJECTS) $(pilot_read_todos_DEPENDENCIES) @rm -f pilot-read-todos$(EXEEXT) $(LINK) $(pilot_read_todos_OBJECTS) $(pilot_read_todos_LDADD) $(LIBS) pilot-read-veo$(EXEEXT): $(pilot_read_veo_OBJECTS) $(pilot_read_veo_DEPENDENCIES) @rm -f pilot-read-veo$(EXEEXT) $(LINK) $(pilot_read_veo_OBJECTS) $(pilot_read_veo_LDADD) $(LIBS) pilot-reminders$(EXEEXT): $(pilot_reminders_OBJECTS) $(pilot_reminders_DEPENDENCIES) @rm -f pilot-reminders$(EXEEXT) $(LINK) $(pilot_reminders_OBJECTS) $(pilot_reminders_LDADD) $(LIBS) pilot-schlep$(EXEEXT): $(pilot_schlep_OBJECTS) $(pilot_schlep_DEPENDENCIES) @rm -f pilot-schlep$(EXEEXT) $(LINK) $(pilot_schlep_OBJECTS) $(pilot_schlep_LDADD) $(LIBS) pilot-wav$(EXEEXT): $(pilot_wav_OBJECTS) $(pilot_wav_DEPENDENCIES) @rm -f pilot-wav$(EXEEXT) $(LINK) $(pilot_wav_OBJECTS) $(pilot_wav_LDADD) $(LIBS) pilot-xfer$(EXEEXT): $(pilot_xfer_OBJECTS) $(pilot_xfer_DEPENDENCIES) @rm -f pilot-xfer$(EXEEXT) $(LINK) $(pilot_xfer_OBJECTS) $(pilot_xfer_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsedate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-addresses.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-clip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-csd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-debugsh.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-dedupe.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-dlpsh.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-foto-treo600.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-foto-treo650.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-foto.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-getram.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-getrom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-getromtoken.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-hinotes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-install-datebook.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-install-expenses.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-install-hinote.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-install-memo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-install-netsync.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-install-todo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-install-todos.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-install-user.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-memos.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-nredir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-read-expenses.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-read-ical.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-read-notepad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-read-palmpix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-read-screenshot.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-read-todos.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-read-veo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-reminders.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-schlep.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-wav.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot-xfer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plu_args.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userland.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< .y.c: $(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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): @fail= 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; \ ($(am__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" $(RECURSIVE_CLEAN_TARGETS): @fail= 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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 || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f parsedate.c clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-binSCRIPTS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-noinstLTLIBRARIES ctags \ ctags-recursive distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-binSCRIPTS @ENABLE_CONDUITS_TRUE@pilot-ietf2datebook: pilot-ietf2datebook.pl @ENABLE_CONDUITS_TRUE@ $(PERL) $< > $@ @ENABLE_CONDUITS_TRUE@ chmod +x $@ @ENABLE_CONDUITS_TRUE@pilot-undelete: pilot-undelete.pl @ENABLE_CONDUITS_TRUE@ $(PERL) $< > $@ @ENABLE_CONDUITS_TRUE@ chmod +x $@ @ENABLE_CONDUITS_TRUE@pilot-sync-plan: pilot-sync-plan.pl @ENABLE_CONDUITS_TRUE@ $(PERL) $< > $@ @ENABLE_CONDUITS_TRUE@ chmod +x $@ # Magic to update Makefile from Makefile.am $(srcdir)/Makefile.in : $(srcdir)/Makefile.am ( cd $(top_srcdir) && automake src/Makefile ) # 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: pilot-link-0.12.5-dfsg/src/pilot-xfer.c0000644000175000017500000017336411333421636020144 0ustar rousseaurousseau/* * $Id: pilot-xfer.c,v 1.189 2009-12-11 01:48:34 judd Exp $ * * pilot-xfer.c: Palm Database transfer utility * * (c) 1996, 1998, Kenneth Albanowski. * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * * TODO: * - More verbose help output with examples for each function * - palm_backup() enabled for MEDIA_VFS * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "pi-debug.h" #include "pi-socket.h" #include "pi-file.h" #include "pi-header.h" #include "pi-util.h" #include "pi-userland.h" /* unsigned char typedef byte; */ typedef unsigned char byte; typedef struct { byte data[4]; char attr; byte id[3]; } recInfo_t; typedef struct { char name[32]; byte attr[2]; byte version[2]; byte cdate[4]; byte mdate[4]; byte backupdate[4]; byte modno[4]; byte appinfo[4]; byte sortinfo[4]; char dbType[4]; char dbCreator[4]; byte seed[4]; byte nextRecList[4]; char nRec[2]; } pdb_t; typedef enum { palm_op_noop = 0, palm_op_restore = 277, /* keep rest out of ASCII range */ palm_op_backup, palm_op_update, palm_op_sync, palm_op_install, palm_op_merge, palm_op_fetch, palm_op_delete, palm_op_list, palm_op_cardinfo } palm_op_t; /* Flags specifying various bits of behavior. Should be different from the palm_ops and non-ASCII if they can be set explicitly from the command-line. */ #define BACKUP (0x0001) #define UPDATE (0x0002) #define SYNC (0x0004) #define MEDIA_MASK (0x0f00) #define MEDIA_RAM (0x0000) #define MEDIA_ROM (0x0100) #define MEDIA_FLASH (0x0200) #define MEDIA_VFS (0x0400) #define MIXIN_MASK (0xf000) #define PURGE (0x1000) int sd = -1; char *vfsdir = NULL; #define MAXEXCLUDE 100 char *exclude[MAXEXCLUDE]; int numexclude = 0; static int findVFSPath(const char *path, long *volume, char *rpath, int *rpathlen); const char *media_name(int m) { switch (m) { case MEDIA_RAM: return "RAM"; case MEDIA_ROM: return "OS"; case MEDIA_FLASH: return "Flash"; case MEDIA_VFS: return "VFS"; default: return NULL; } } /*********************************************************************** * * Function: make_excludelist * * Summar: Excludes a list of dbnames from the operation called * * Parameters: None * * Return: Nothing * ***********************************************************************/ static void make_excludelist(const char *efile) { char temp[1024]; FILE *f = fopen(efile, "r"); if (!f) { printf(" Unable to open exclude list file '%s'.\n", efile); exit(EXIT_FAILURE); } while ((fgets(temp, sizeof(temp), f)) != NULL) { temp[strlen(temp) - 1] = '\0'; printf("Now excluding: %s\n", temp); exclude[numexclude++] = strdup(temp); if (numexclude == MAXEXCLUDE) { printf("Maximum number of exclusions reached [%d]\n", MAXEXCLUDE); break; } } } /*********************************************************************** * * Function: protect_name * * Summary: Protects filenames and paths which include 'illegal' * characters, such as '/' and '=' in them. * * Parameters: None * * Return: Nothing * ***********************************************************************/ static void protect_name(char *d, const char *s) { /* Maybe even.. char *c = strchr("/=\r\n", foo); if (c) { d += sprintf(d, "=%02X", c); } */ while (*s) { switch (*s) { case '/': *(d++) = '='; *(d++) = '2'; *(d++) = 'F'; break; case '=': *(d++) = '='; *(d++) = '3'; *(d++) = 'D'; break; case '\x0A': *(d++) = '='; *(d++) = '0'; *(d++) = 'A'; break; case '\x0D': *(d++) = '='; *(d++) = '0'; *(d++) = 'D'; break; /* Replace spaces in names with =20 case ' ': *(d++) = '='; *(d++) = '2'; *(d++) = '0'; break; */ default: *(d++) = *s; } ++s; } *d = '\0'; } /*********************************************************************** * * Function: list_remove * * Summary: Remove the excluded files from the op list * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void list_remove(char *name, char **list, int max) { int i; for (i = 0; i < max; i++) { if (list[i] != NULL && strcmp(name, list[i]) == 0) { list[i] = NULL; } } } /*********************************************************************** * * Function: palm_creator * * Summary: Skip Palm files which match the internal Palm CreatorID * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int palm_creator(unsigned long creator) { union { long L; char C[4]; } buf; union buf; int n; static long special_cases[] = { pi_mktag('p', 'p', 'p', '_'), pi_mktag('u', '8', 'E', 'Z'), /* These cause a reset/crash on OS5 when accessed */ pi_mktag('P', 'M', 'H', 'a'), /* Phone Link Update */ pi_mktag('P', 'M', 'N', 'e'), /* Ditto */ pi_mktag('F', 'n', 't', '1'), /* Hires font resource */ pi_mktag('m', 'o', 'd', 'm'), pi_mktag('a', '6', '8', 'k') /* PACE cache files */ }; for (n = 0; n < sizeof(special_cases) / sizeof(long); n++) if (creator == special_cases[n]) return 1; for (n = 0; n < 4; n++) if (buf.C[n] < 'a' || buf.C[n] > 'z') return 0; return 1; } /*********************************************************************** * * Function: palm_backup * * Summary: Build a file list and back up the Palm to destination * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void palm_backup(const char *dirname, unsigned long int flags, int unsaved, const char *archive_dir) { int i = 0, ofile_len = 0, ofile_total = 0, filecount = 1, /* File counts start at 1, of course */ failed = 0, skipped = 0; static int totalsize; char **orig_files = NULL, *name, synclog[70]; const char *synctext = (flags & UPDATE) ? "Synchronizing" : "Backing up"; DIR *dir; pi_buffer_t *buffer; /* Check if the directory exists before writing to it. If it doesn't exist as a directory, and it isn't a file, create it. */ if (access(dirname, F_OK) == -1) { fprintf(stderr, " Creating directory '%s'...\n", dirname); mkdir(dirname, 0700); } else if (access(dirname, R_OK|W_OK|X_OK) != 0) { fprintf(stderr, "\n"); fprintf(stderr, " ERROR: %s\n", strerror(errno)); fprintf(stderr, " Please check ownership and permissions" " on %s.\n\n", dirname); return; } else if (flags & UPDATE) { if ((dir = opendir(dirname)) == NULL) { fprintf(stderr, "\n"); fprintf(stderr, " ERROR: %s\n", strerror(errno)); fprintf(stderr, " Does the directory %s exist?\n\n", dirname); return; } else { struct dirent *dirent; while ((dirent = readdir(dir))) { int dirnamelen; dirnamelen = strlen(dirname); if (dirent->d_name[0] == '.') continue; if (ofile_total >= ofile_len) { ofile_len += 256; orig_files = realloc(orig_files, (sizeof (char *)) * ofile_len); } name = malloc(dirnamelen + strlen (dirent->d_name) + 2); if (name == NULL) { continue; } else { sprintf(name, "%s/%s", dirname, dirent->d_name); orig_files[ofile_total++] = name; } } closedir(dir); } } buffer = pi_buffer_new (sizeof(struct DBInfo)); name = (char *)malloc(strlen(dirname) + 1 + 256); for (;;) { struct DBInfo info; struct pi_file *f; struct utimbuf times; int skip = 0; int excl = 0; struct stat sbuf; char crid[5]; if (!pi_socket_connected(sd)) { printf("\n Connection broken - Exiting. All data was not backed up\n"); exit(EXIT_FAILURE); } if (dlp_ReadDBList(sd, 0, ((flags & MEDIA_MASK) ? dlpDBListROM : dlpDBListRAM), i, buffer) < 0) break; memcpy(&info, buffer->data, sizeof(struct DBInfo)); i = info.index + 1; pi_untag(crid,info.creator); if (dlp_OpenConduit(sd) < 0) { printf("\n Exiting on cancel, all data was not backed up" "\n Stopped before backing up: '%s'\n\n", info.name); sprintf(synclog, "\npilot-xfer was cancelled by the user " "before backing up '%s'.", info.name); dlp_AddSyncLogEntry(sd, synclog); exit(EXIT_FAILURE); } strcpy(name, dirname); strcat(name, "/"); protect_name(name + strlen(name), info.name); if (palm_creator(info.creator)) { printf(" [-][skip][%s] Skipping OS file '%s'.\n", crid, info.name); continue; } if (info.flags & dlpDBFlagResource) { strcat(name, ".prc"); } else if ((info.flags & dlpDBFlagLaunchable) && info.type == pi_mktag('p','q','a',' ')) { strcat(name, ".pqa"); } else { strcat(name, ".pdb"); } for (excl = 0; excl < numexclude; excl++) { if (strcmp(exclude[excl], info.name) == 0) { printf(" [-][excl] Excluding '%s'...\n", name); list_remove(name, orig_files, ofile_total); skip = 1; } } if (info.creator == pi_mktag('a', '6', '8', 'k')) { printf(" [-][a68k][PACE] Skipping '%s'\n", info.name); skipped++; continue; } if (skip == 1) continue; if (!unsaved && strcmp(info.name, "Unsaved Preferences") == 0) { printf(" [-][unsv] Skipping '%s'\n", info.name); continue; } list_remove(name, orig_files, ofile_total); if ((0 == stat(name, &sbuf)) && ((flags & UPDATE) == UPDATE)) { if (info.modifyDate == sbuf.st_mtime) { printf(" [-][unch] Unchanged, skipping %s\n", name); continue; } } /* Ensure that DB-open and DB-ReadOnly flags are not kept */ info.flags &= ~(dlpDBFlagOpen | dlpDBFlagReadOnly); printf(" [+][%-4d]", filecount); printf("[%s] %s '%s'", crid, synctext, info.name); fflush(NULL); setlocale(LC_ALL, ""); f = pi_file_create(name, &info); if (f == 0) { printf("\nFailed, unable to create file.\n"); break; } else if (pi_file_retrieve(f, sd, 0, NULL) < 0) { printf("\n [-][fail][%s] Failed, unable to retrieve '%s' from the Palm.", crid, info.name); failed++; pi_file_close(f); unlink(name); } else { pi_file_close(f); /* writes the file to disk so we can stat() it */ stat(name, &sbuf); totalsize += sbuf.st_size; printf(", %ld bytes, %ld KiB... ", (long)sbuf.st_size, (long)totalsize/1024); fflush(NULL); } filecount++; printf("\n"); times.actime = info.createDate; times.modtime = info.modifyDate; utime(name, ×); } pi_buffer_free(buffer); if (orig_files) { int i = 0; int dirname_len = strlen(dirname); for (i = 0; i < ofile_total; i++) { if (orig_files[i] != NULL) { if (flags & SYNC) { if (archive_dir) { printf("Archiving '%s'", orig_files[i]); sprintf(name, "%s/%s", archive_dir, &orig_files[i] [dirname_len + 1]); if (rename (orig_files[i], name) != 0) { printf("rename(%s, %s) ", orig_files [i], name); perror("failed"); } } else { printf("Removing '%s'.\n", orig_files[i]); unlink(orig_files[i]); } } free(orig_files[i]); } } } free(name); printf("\n %s backup complete.", media_name(flags & MEDIA_MASK)); printf(" %d files backed up, %d skipped, %d file%s failed.\n", (filecount ? filecount - 1 : 0), skipped, failed, (failed == 1) ? "" : "s"); sprintf(synclog, "%d files successfully backed up.\n\n" "Thank you for using pilot-link.", filecount - 1); dlp_AddSyncLogEntry(sd, synclog); } /*********************************************************************** * * Function: fetch_progress * * Summary: Sample progress output for the pi_file_retrieve* * functions. * * Parameters: see pi_file_install docs. * * Returns: PI_TRANSFER_CONTINUE or PI_TRANSFER_STOP if it seems * that the Palm has canceled on us. * ***********************************************************************/ static int fetch_progress(int sd, pi_progress_t *progress) { const char *filename = NULL; if (progress->type == PI_PROGRESS_RECEIVE_DB && progress->data.db.pf && progress->data.db.pf->file_name) { filename = progress->data.db.pf->file_name; } else if (progress->type == PI_PROGRESS_RECEIVE_VFS && progress->data.vfs.path && strlen(progress->data.vfs.path)) { filename = progress->data.vfs.path; } if (!filename) filename=""; fprintf(stdout,"\r Fetching '%s' ... (%d bytes)",filename,progress->transferred_bytes); fflush(stdout); if (!pi_socket_connected(sd)) return PI_TRANSFER_STOP; return PI_TRANSFER_CONTINUE; } /*********************************************************************** * * Function: palm_fetch_internal * * Summary: Grab a file from the Palm, write to disk * * Parameters: dbname --> name of database on Palm to fetch. * * Returns: Nothing * ***********************************************************************/ static void palm_fetch_internal(const char *dbname) { struct DBInfo info; char name[256], synclog[512]; struct pi_file *f; if (access(dbname, F_OK) == 0 && access(dbname, R_OK|W_OK) != 0) { fprintf(stderr, "\n Unable to write to %s, check " "ownership and permissions.\n\n", dbname); exit(EXIT_FAILURE); } printf(" Parsing list of files from handheld... "); fflush(stdout); if (dlp_FindDBInfo(sd, 0, 0, dbname, 0, 0, &info) < 0) { printf("\n Unable to locate app/database '%s', ", dbname); printf("fetch skipped.\n Did you spell it correctly?\n\n"); return; } else { printf("done.\n"); } protect_name(name, dbname); /* Judd - Graffiti hack Graffiti ShortCuts with a space on the end or not is really supposed to be the same file, so we will treat it as such to avoid confusion, remove the space. */ if (strcmp(name, "Graffiti ShortCuts ") == 0) strncpy(name, "Graffiti ShortCuts", sizeof(name)); if (info.flags & dlpDBFlagResource) { strcat(name, ".prc"); } else if ((info.flags & dlpDBFlagLaunchable) && info.type == pi_mktag('p','q','a',' ')) { strcat(name, ".pqa"); } else { strcat(name, ".pdb"); } printf(" Fetching %s... ", name); fflush(stdout); info.flags &= 0x2fd; /* Write the file records to disk as 'dbname' */ f = pi_file_create(name, &info); if (f == 0) { printf("Failed, unable to create file.\n"); return; } else if (pi_file_retrieve(f, sd, 0, plu_quiet ? NULL : fetch_progress) < 0) { printf("Failed, unable to fetch database from the Palm.\n"); } printf(" complete.\n\n"); snprintf(synclog, sizeof(synclog)-1, "File '%s' successfully fetched.\n\n" "Thank you for using pilot-link.", name); dlp_AddSyncLogEntry(sd, synclog); pi_file_close(f); } static int pi_file_retrieve_VFS(const int fd, const char *basename, const int socket, const char *vfspath, progress_func f) { long volume = -1; char rpath[vfsMAXFILENAME]; int rpathlen = vfsMAXFILENAME; FileRef file; unsigned long attributes; pi_buffer_t *buffer; ssize_t readsize,writesize; int filesize; int original_filesize; int written_so_far; pi_progress_t progress; enum { bad_parameters=-1, cancel=-2, bad_vfs_path=-3, bad_local_file=-4, insufficient_space=-5, internal_=-6 } ; if (findVFSPath(vfspath,&volume,rpath,&rpathlen) < 0) { fprintf(stderr,"\n VFS path '%s' does not exist.\n\n", vfspath); return bad_vfs_path; } if (rpath[rpathlen-1] != '/') { rpath[rpathlen] = '/'; rpathlen++; } strncat(rpath,basename,sizeof(rpath)-rpathlen-1); rpathlen=strlen(rpath); /* fprintf(stderr,"* Reading %s on volume %ld\n",rpath,volume); */ if (dlp_VFSFileOpen(socket,volume,rpath,dlpVFSOpenRead,&file) < 0) { fprintf(stderr,"\n Cannot open file '%s' on VFS.\n",rpath); return bad_vfs_path; } if (dlp_VFSFileGetAttributes(socket,file,&attributes) < 0) { fprintf(stderr," Could not get attributes of VFS file.\n"); (void) dlp_VFSFileClose(socket,file); return bad_vfs_path; } if (attributes & vfsFileAttrDirectory) { /* Clear case for later feature. */ fprintf(stderr," Cannot retrieve a directory.\n"); dlp_VFSFileClose(socket,file); return bad_vfs_path; } dlp_VFSFileSize(socket,file,&filesize); original_filesize = filesize; memset(&progress, 0, sizeof(progress)); progress.type = PI_PROGRESS_RECEIVE_VFS; progress.data.vfs.path = (char *)vfspath; progress.data.vfs.total_bytes = filesize; #define FBUFSIZ 65536 buffer = pi_buffer_new(FBUFSIZ); readsize = 0; written_so_far = 0; while ((filesize > 0) && (readsize >= 0)) { int offset; pi_buffer_clear(buffer); readsize = dlp_VFSFileRead(socket,file,buffer, ( filesize > FBUFSIZ ? FBUFSIZ : filesize)); /* fprintf(stderr,"* Read %ld bytes.\n",readsize); */ if (readsize <= 0) break; filesize -= readsize; offset = 0; while (readsize > 0) { writesize = write(fd,buffer->data+offset,readsize); if (writesize < 0) { fprintf(stderr," Error while writing file.\n"); goto cleanup; } written_so_far += writesize; progress.transferred_bytes += writesize; if ((filesize > 0) || (readsize > 0)) { if (f && (f(socket,&progress) == PI_TRANSFER_STOP)) { written_so_far = cancel; pi_set_error(socket,PI_ERR_FILE_ABORTED); goto cleanup; } } readsize -= writesize; offset += writesize; } } cleanup: pi_buffer_free(buffer); #undef FBUFSIZ dlp_VFSFileClose(socket,file); return written_so_far; } static void palm_fetch_VFS(const char *dbname, const char *vfspath) { static unsigned long totalsize = 0; int fd = -1; int filesize; if (NULL == vfspath) { /* how the heck did we get here then? */ fprintf(stderr,"\n No VFS path given.\n"); return; } if (access(dbname, F_OK) == 0 && access(dbname, R_OK|W_OK) != 0) { fprintf(stderr, "\n Unable to write to %s, check " "ownership and permissions.\n\n", dbname); exit(EXIT_FAILURE); } if (dlp_OpenConduit(sd) < 0) { fprintf(stderr, "\nExiting on cancel, some files were not" "fetched.\n\n"); exit(EXIT_FAILURE); } fprintf(stdout, " Fetching '%s'... ", dbname); fflush(stdout); /* Calculate basename, perhaps? */ fd = open(dbname,O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); if (fd < 0) { fprintf(stderr,"\n Cannot open local file for '%s'.\n",dbname); return; } if ((filesize = pi_file_retrieve_VFS(fd,dbname,sd,vfspath,plu_quiet ? NULL : fetch_progress)) < 0) { fprintf(stderr," ERROR: pi_file_retrieve_VFS failed.\n"); /* is the semantics of unlink-open-file standard? */ unlink(dbname); } else { totalsize += filesize; printf(" %ld KiB total.\n", totalsize/1024); fflush(stdout); } close(fd); } static void palm_fetch(unsigned long int flags,const char *dbname) { switch(flags & MEDIA_MASK) { case MEDIA_RAM: case MEDIA_ROM: case MEDIA_FLASH: palm_fetch_internal(dbname); break; case MEDIA_VFS: palm_fetch_VFS(dbname,vfsdir); break; default: fprintf(stderr," ERROR: Unknown media type %lx\n", (flags & MEDIA_MASK)); break; } } /*********************************************************************** * * Function: palm_delete * * Summary: Delete a database from the Palm * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void palm_delete(const char *dbname) { struct DBInfo info; dlp_FindDBInfo(sd, 0, 0, dbname, 0, 0, &info); printf("Deleting '%s'... ", dbname); if (dlp_DeleteDB(sd, 0, dbname) >= 0) { if (info.type == pi_mktag('b', 'o', 'o', 't')) { printf(" (rebooting afterwards) "); } printf("OK\n"); } else { printf("Failed, unable to delete database\n"); } fflush(stdout); printf("Delete complete.\n"); } struct db { int flags, maxblock; char name[256]; unsigned long creator, type; }; static int compare(struct db *d1, struct db *d2) { /* types of 'appl' sort later then other types */ if (d1->creator == d2->creator) if (d1->type != d2->type) { if (d1->type == pi_mktag('a', 'p', 'p', 'l')) return 1; if (d2->type == pi_mktag('a', 'p', 'p', 'l')) return -1; } return d1->maxblock < d2->maxblock; } /*********************************************************************** * * Function: palm_restore * * Summary: Send files to the Palm from disk, restoring Palm * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void palm_restore(const char *dirname) { int dbcount = 0, i, j, max, save_errno = errno; size_t size; DIR *dir; struct dirent *dirent; struct DBInfo info; struct db **db = NULL; struct pi_file *f; struct stat sbuf; struct CardInfo Card; Card.card = -1; Card.more = 1; if ((dir = opendir(dirname)) == NULL) { fprintf(stderr, "\n"); perror(" ERROR"); fprintf(stderr, " opendir() failed. Cannot open directory %s.\n", dirname); fprintf(stderr, " Does the directory exist?\n\n"); errno = save_errno; exit(EXIT_FAILURE); } /* Find out how many directory entries exist, so that we can allocate the buffer. We avoid scandir() for maximum portability. The count is a bit conservative, as it includes . and .. entries. */ while (readdir(dir)) dbcount++; db = (struct db **) calloc(dbcount, sizeof(struct db *)); if (!db) { printf("Unable to allocate memory for directory entry table\n"); exit(EXIT_FAILURE); } dbcount = 0; rewinddir(dir); while ((dirent = readdir(dir)) != NULL) { if (dirent->d_name[0] == '.') continue; db[dbcount] = (struct db *) malloc(sizeof(struct db)); sprintf(db[dbcount]->name, "%s/%s", dirname, dirent->d_name); f = pi_file_open(db[dbcount]->name); if (f == 0) { printf("Unable to open '%s'!\n", db[dbcount]->name); break; } pi_file_get_info(f, &info); db[dbcount]->creator = info.creator; db[dbcount]->type = info.type; db[dbcount]->flags = info.flags; db[dbcount]->maxblock = 0; pi_file_get_entries(f, &max); for (i = 0; i < max; i++) { if (info.flags & dlpDBFlagResource) { pi_file_read_resource(f, i, 0, &size, 0, 0); } else { pi_file_read_record(f, i, 0, &size, 0, 0, 0); } if (size > db[dbcount]->maxblock) db[dbcount]->maxblock = size; } pi_file_close(f); dbcount++; } closedir(dir); for (i = 0; i < dbcount; i++) { for (j = i + 1; j < dbcount; j++) { if (compare(db[i], db[j]) > 0) { struct db *temp = db[i]; db[i] = db[j]; db[j] = temp; } } } for (i = 0; i < dbcount; i++) { f = pi_file_open(db[i]->name); if (f == 0) { printf("Unable to open '%s'!\n", db[i]->name); break; } printf("Restoring %s... ", db[i]->name); fflush(stdout); stat(db[i]->name, &sbuf); while (Card.more) { if (dlp_ReadStorageInfo(sd, Card.card + 1, &Card) < 0) break; } if ((unsigned long)sbuf.st_size > Card.ramFree) { fprintf(stderr, "\n\n"); fprintf(stderr, " Insufficient space to install this file on your Palm.\n"); fprintf(stderr, " We needed %lu and only had %lu available..\n\n", (unsigned long)sbuf.st_size, Card.ramFree); exit(EXIT_FAILURE); } if (pi_file_install(f, sd, 0, NULL) < 0) { printf("failed.\n"); } else { printf("OK\n"); } pi_file_close(f); } for (i = 0; i < dbcount; i++) { free(db[i]); } free(db); printf("Restore done\n"); } /*********************************************************************** * * Function: install_progress * * Summary: Sample progress output for the pi_file_install* * functions. * * Parameters: see pi_file_install docs. * * Returns: PI_TRANSFER_CONTINUE or PI_TRANSFER_STOP if it seems * that the Palm has canceled on us. * ***********************************************************************/ static int install_progress(int sd, pi_progress_t *progress) { const char *filename = NULL; if (progress->type == PI_PROGRESS_SEND_DB && progress->data.db.pf && progress->data.db.pf->file_name) { filename = progress->data.db.pf->file_name; } else if (progress->type == PI_PROGRESS_SEND_VFS && progress->data.vfs.path && strlen(progress->data.vfs.path)) { filename = progress->data.vfs.path; } if (!filename) filename=""; fprintf(stdout,"\r Installing '%s' ... (%d bytes)",filename,progress->transferred_bytes); fflush(stdout); if (!pi_socket_connected(sd)) return PI_TRANSFER_STOP; return PI_TRANSFER_CONTINUE; } /*********************************************************************** * * Function: pi_file_install_VFS * * Summary: Push file(s) to the Palm's VFS (parameters intentionally * similar to pi_file_install). * * Parameters: fd --> open file descriptor for file * basename --> filename or description of file * socket --> sd, connection to Palm * vfspath --> target in VFS, may be dir or filename * f --> progress function, in the style of pi_file_install * * Returns: -1 on bad parameters * -2 on cancelled sync * -3 on bad vfs path * -4 on bad local file * -5 on insufficient VFS space for the file * -6 on memory allocation error * >=0 if all went well (size of installed file) * * Note: Should probably return an ssize_t and refuse to do files > * 2Gb, due to signedness. * ***********************************************************************/ static int pi_file_install_VFS(const int fd, const char *basename, const int socket, const char *vfspath, progress_func f) { enum { bad_parameters=-1, cancel=-2, bad_vfs_path=-3, bad_local_file=-4, insufficient_space=-5, internal_=-6 } ; char rpath[vfsMAXFILENAME]; int rpathlen = vfsMAXFILENAME; FileRef file; unsigned long attributes; char *filebuffer = NULL; long volume = -1; long used, total, freespace; int writesize, offset; size_t readsize; size_t written_so_far = 0; enum { no_path=0, appended_filename=1, retried=2, done=3 } path_steps; struct stat sbuf; pi_progress_t progress; if (fstat(fd,&sbuf) < 0) { fprintf(stderr," ERROR: Cannot stat '%s'.\n",basename); return bad_local_file; } if (findVFSPath(vfspath,&volume,rpath,&rpathlen) < 0) { fprintf(stderr,"\n VFS path '%s' does not exist.\n\n", vfspath); return bad_vfs_path; } if (dlp_VFSVolumeSize(socket,volume,&used,&total)<0) { fprintf(stderr," Unable to get volume size.\n"); return bad_vfs_path; } /* Calculate free space but leave last 64k free on card */ freespace = total - used - 65536 ; if ((unsigned long)sbuf.st_size > freespace) { fprintf(stderr, "\n\n"); fprintf(stderr, " Insufficient space to install this file on your Palm.\n"); fprintf(stderr, " We needed %lu and only had %lu available..\n\n", (unsigned long)sbuf.st_size, freespace); return insufficient_space; } #define APPEND_BASENAME path_steps-=1; \ if (rpath[rpathlen-1] != '/') { \ rpath[rpathlen++]='/'; \ rpath[rpathlen]=0; \ } \ strncat(rpath,basename,vfsMAXFILENAME-rpathlen-1); \ rpathlen = strlen(rpath); path_steps = no_path; while (path_stepsretried appended_filename -> done Note that APPEND_BASENAME takes one off, so retried->appended_basename */ path_steps+=2; if (dlp_VFSFileOpen(socket,volume,rpath,dlpVFSOpenRead,&file) < 0) { /* Target doesn't exist. If it ends with a /, try to create the directory and then act as if the existing directory was given as target. If it doesn't, carry on, it's a regular file to create. */ if ('/' == rpath[rpathlen-1]) { /* directory, doesn't exist. Don't try to mkdir /. */ if ((rpathlen > 1) && (dlp_VFSDirCreate(socket,volume,rpath) < 0)) { fprintf(stderr," Could not create destination directory.\n"); return bad_vfs_path; } APPEND_BASENAME } if (dlp_VFSFileCreate(socket,volume,rpath) < 0) { fprintf(stderr," Cannot create destination file '%s'.\n", rpath); return bad_vfs_path; } } else { /* Exists, and may be a directory, or a filename. If it's a filename, that's fine as long as we're installing just a single file. */ if (dlp_VFSFileGetAttributes(socket,file,&attributes) < 0) { fprintf(stderr," Could not get attributes for destination.\n"); (void) dlp_VFSFileClose(socket,file); return bad_vfs_path; } if (attributes & vfsFileAttrDirectory) { APPEND_BASENAME dlp_VFSFileClose(socket,file); /* Now for sure it's a filename in a directory. */ } else { dlp_VFSFileClose(socket,file); if ('/' == rpath[rpathlen-1]) { /* was expecting a directory */ fprintf(stderr," Destination is not a directory.\n"); return bad_vfs_path; } } } } #undef APPEND_BASENAME if (dlp_VFSFileOpen(socket,volume,rpath,0x7,&file) < 0) { fprintf(stderr," Cannot open destination file '%s'.\n",rpath); return bad_vfs_path; } /* If the file already exists we want to truncate it so if we write a smaller file * the tail of the previous file won't show */ if (dlp_VFSFileResize(socket, file, 0) < 0) { fprintf(stderr," Cannot truncate file size to 0 '%s'.\n",rpath); /* Non-fatal error, continue */ } #define FBUFSIZ 65536 filebuffer = (char *)malloc(FBUFSIZ); if (NULL == filebuffer) { fprintf(stderr," Cannot allocate memory for file copy.\n"); dlp_VFSFileClose(socket,file); close(fd); return internal_; } memset(&progress, 0, sizeof(progress)); progress.type = PI_PROGRESS_SEND_VFS; progress.data.vfs.path = (char *) basename; progress.data.vfs.total_bytes = sbuf.st_size; writesize = 0; written_so_far = 0; while (writesize >= 0) { readsize = read(fd,filebuffer,FBUFSIZ); if (readsize <= 0) break; offset=0; while (readsize > 0) { writesize = dlp_VFSFileWrite(socket,file,filebuffer+offset,readsize); if (writesize < 0) { fprintf(stderr," Error while writing file.\n"); break; } readsize -= writesize; offset += writesize; written_so_far += writesize; progress.transferred_bytes += writesize; if ((writesize>0) || (readsize > 0)) { if (f && (f(socket, &progress) == PI_TRANSFER_STOP)) { sbuf.st_size = 0; pi_set_error(socket,PI_ERR_FILE_ABORTED); goto cleanup; } } } } cleanup: free(filebuffer); dlp_VFSFileClose(socket,file); close(fd); return sbuf.st_size; } /*********************************************************************** * * Function: palm_install_internal * * Summary: Push file(s) to the Palm * * Parameters: filename --> local filesystem path for file to install. * * Returns: Nothing * ***********************************************************************/ static void palm_install_internal(const char *filename) { static unsigned long totalsize; struct pi_file *f; struct stat sbuf; struct CardInfo Card; const char *basename = strrchr(filename,'/'); if (basename) { basename = basename+1; } else { basename = filename; } Card.card = -1; Card.more = 1; f = pi_file_open(filename); if (f == NULL) { fprintf(stderr," ERROR: Unable to open '%s'!\n", filename); return; } if (f->file_name == NULL) { /* pi_file_open doesn't set the filename (or not to anything nice), so set it instead; need strdup because the file struct owns the string. */ f->file_name = strdup(basename); } if (dlp_OpenConduit(sd) < 0) { fprintf(stderr, " CANCEL: Exiting on cancel, some files were not " "installed\n\n"); exit(EXIT_FAILURE); } fprintf(stdout, " Installing '%s'... ", basename); fflush(stdout); stat(filename, &sbuf); while (Card.more) { if (dlp_ReadStorageInfo(sd, Card.card + 1, &Card) < 0) break; } if ((unsigned long)sbuf.st_size > Card.ramFree) { fprintf(stderr, " ERROR: Insufficient space to install this file on your Palm.\n"); fprintf(stderr, " We needed %lu and only had %lu available..\n\n", (unsigned long)sbuf.st_size, Card.ramFree); return; } /* TODO: shouldn't this use Card.card? If we're looking for _a_ card that can hold the file, shouldn't we check in the while loop above? */ if (pi_file_install(f, sd, 0, plu_quiet ? NULL : install_progress) < 0) { /* TODO: Does pi_file_install print a diagnostic? */ fprintf(stderr, "\n ERROR: pi_file_install failed " "(%i, PalmOS 0x%04x).\n", pi_error(sd), pi_palmos_error(sd)); } else { totalsize += sbuf.st_size; printf(" %ld KiB total.\n", totalsize/1024); fflush(stdout); } pi_file_close(f); } /*********************************************************************** * * Function: palm_install_VFS * * Summary: Push file to the Palm's VFS. * * Parameters: localfile --> local filesystem path for file to install. * vfspath --> target for file (may be dir or filename). * * Returns: -1 on bad parameters * -2 on cancelled sync * -3 on bad vfs path * -4 on bad local file * -5 on insufficient VFS space for the file * -6 on memory allocation error * 0 if all went well * ***********************************************************************/ static int palm_install_VFS(const char *localfile, const char *vfspath) { enum { bad_parameters=-1, cancel=-2, bad_vfs_path=-3, bad_local_file=-4, insufficient_space=-5, internal_=-6 } ; static unsigned long totalsize = 0; int fd = -1; struct stat sbuf; const char *basename = strrchr(localfile,'/'); if (basename) { basename = basename+1; } else { basename = localfile; } if (NULL == vfspath) { /* how the heck did we get here then? */ fprintf(stderr,"\n ERROR: No VFS path given.\n"); return bad_parameters; } if (stat(localfile, &sbuf) < 0) { fprintf(stderr," ERROR: Unable to open '%s'!\n", localfile); return bad_local_file; } if (S_IFREG != (sbuf.st_mode & S_IFREG)) { fprintf(stderr," ERROR: Not a regular file.\n"); return bad_local_file; } fd = open(localfile,O_RDONLY); if (fd < 0) { fprintf(stderr," ERROR: Cannot open local file for reading.\n"); return bad_local_file; } if (dlp_OpenConduit(sd) < 0) { fprintf(stderr, " ERROR: Exiting on cancel, some files were not" "installed\n\n"); return cancel; } fprintf(stdout, " Installing '%s'... ", basename); fflush(stdout); if(pi_file_install_VFS(fd,basename,sd,vfspath,plu_quiet ? NULL : install_progress) < 0) { fprintf(stderr," ERROR: pi_file_install_VFS failed.\n"); } else { totalsize += sbuf.st_size; printf(" %ld KiB total.\n", totalsize/1024); fflush(stdout); } close(fd); return 0; } static void palm_install(unsigned long int flags,const char *localfile) { switch(flags & MEDIA_MASK) { case MEDIA_RAM: case MEDIA_ROM: case MEDIA_FLASH: palm_install_internal(localfile); break; case MEDIA_VFS: palm_install_VFS(localfile,vfsdir); break; default: fprintf(stderr," ERROR: Unknown media type %lx\n", (flags & MEDIA_MASK)); break; } } /*********************************************************************** * * Function: palm_merge * * Summary: Adds the records in into the corresponding * Palm database * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void palm_merge(const char *filename) { struct pi_file *f; f = pi_file_open(filename); if (f == 0) { printf("Unable to open '%s'!\n", filename); return; } printf("Merging %s... ", filename); fflush(stdout); if (pi_file_merge(f, sd, 0, NULL) < 0) printf("failed.\n"); else printf("OK\n"); pi_file_close(f); printf("Merge done\n"); } /*********************************************************************** * * Function: palm_list_internal * * Summary: List the databases found on the Palm device's internal * memory. * * Parameters: Media type * * Returns: Nothing * ***********************************************************************/ static void palm_list_internal(unsigned long int flags) { int i = 0, j, dbcount = 0; struct DBInfo info; char synclog[68]; pi_buffer_t *buffer; printf(" Reading list of databases in RAM%s...\n", (flags & MEDIA_MASK) ? " and ROM" : ""); buffer = pi_buffer_new(sizeof(struct DBInfo)); for (;;) { if (dlp_ReadDBList (sd, 0, ((flags & MEDIA_MASK) ? 0x40 : 0) | 0x80 | dlpDBListMultiple, i, buffer) < 0) break; for (j=0; j < (buffer->used / sizeof(struct DBInfo)); j++) { memcpy(&info, buffer->data + j * sizeof(struct DBInfo), sizeof(struct DBInfo)); dbcount++; i = info.index + 1; printf(" %s\n", info.name); } fflush(stdout); } pi_buffer_free(buffer); printf("\n List complete. %d files found.\n\n", dbcount); sprintf(synclog, "List complete. %d files found..\n\nThank you for using pilot-link.", dbcount); dlp_AddSyncLogEntry(sd, synclog); } /*********************************************************************** * * Function: print_fileinfo * * Summary: Show information about the given @p file (which is * assumed to have VFS path @p path). * * Parameters: path --> path to file in VFS volume. * file --> FileRef for already opened file. * * Returns: Nothing * ***********************************************************************/ static void print_fileinfo(const char *path, FileRef file) { int size; time_t date; char *s; (void) dlp_VFSFileSize(sd,file,&size); (void) dlp_VFSFileGetDate(sd,file,vfsFileDateModified,&date); s = ctime(&date); s[24]=0; printf(" %8d %s %s\n",size,s,path); } /*********************************************************************** * * Function: print_dir * * Summary: Show information about the given @p dir on VFS * volume @p volume. The directory is assumed to have * path @p path on that volume. * * Parameters: volume --> volume ref number. * path --> path to directory. * dir --> file ref to already opened dir. * * Returns: Nothing * ***********************************************************************/ static void print_dir(long volume, const char *path, FileRef dir) { unsigned long it = 0; int max = 64; struct VFSDirInfo infos[64]; int i; FileRef file; char buf[vfsMAXFILENAME]; int pathlen = strlen(path); /* Set up buf so it contains path with trailing / and buflen points to the terminating NUL. */ if (pathlen<1) { printf(" NULL path.\n"); return; } memset(buf,0,vfsMAXFILENAME); strncpy(buf,path,vfsMAXFILENAME-1); if (buf[pathlen-1] != '/') { buf[pathlen]='/'; pathlen++; } if (pathlen>vfsMAXFILENAME-2) { printf(" Path too long.\n"); return; } while (dlp_VFSDirEntryEnumerate(sd,dir,&it,&max,infos) >= 0) { if (max<1) break; for (i = 0; i 0) digits++; return digits; } static char * mediatype (struct VFSInfo *info) { size_t ret_size; char *fs, *media, *ret; static char crid1[] = "< >", crid2[] = "on < >"; switch(info->fsType) { case pi_mktag('v','f','a','t'): fs = "VFAT"; break; case pi_mktag('f','a','t','s'): fs = "FAT"; break; case pi_mktag('t','w','M','F'): fs = "Tapwave"; break; default: /* This sortof-untag is gross, but useful */ crid1[1] = (char)(info->mediaType >> 24) & 0xff; crid1[2] = (char)(info->mediaType >> 16) & 0xff; crid1[3] = (char)(info->mediaType >> 8) & 0xff; crid1[4] = (char)(info->mediaType) & 0xff; fs = crid1; } switch(info->mediaType) { case pi_mktag('m','m','c','d'): media = "on MMC"; break; case pi_mktag('s','d','i','g'): media = "on SD"; break; case pi_mktag('m','s','t','k'): media = "on MS"; break; case pi_mktag('c','f','s','h'): media = "on CF"; break; case pi_mktag('T','F','F','S'): media = "in RAM"; break; case pi_mktag('t','w','M','F'): media = "MFS"; break; default: /* It's not less gross the second time... */ crid2[4] = (char)(info->mediaType >> 24) & 0xff; crid2[5] = (char)(info->mediaType >> 16) & 0xff; crid2[6] = (char)(info->mediaType >> 8) & 0xff; crid2[7] = (char)(info->mediaType) & 0xff; media = crid2; } ret_size = strlen(fs) + strlen(media) + 8; ret = (char *)malloc(ret_size); if (ret == NULL) { return NULL; } memset(ret,0,ret_size); snprintf (ret, ret_size-1, "%s %s", fs, media); return ret; } typedef struct cardreport_s { char *type; long size_total; long size_used; long size_free; int cardnum; char *name; struct cardreport_s *next; } cardreport_t; static int palm_cardinfo () { int i, j, ret, volume_count = 16, volumes[16]; cardreport_t *cards = NULL, *t, *t2; struct VFSInfo info; char buf[vfsMAXFILENAME], fmt[64]; long size_used, size_total; int len; /* should be size_t in dlp.c? */ size_t digits_type = 10, digits_total = 4, digits_used = 4, digits_free = 4, digits_cardnum = 1; static const char unknown_type[] = ""; /* VFS info */ if ((ret = dlp_VFSVolumeEnumerate(sd,&volume_count,volumes)) < 0) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "palm_cardinfo: dlp_VFSVolumeEnumerate returned %i\n", ret)); goto cleanup; } for (i = 0; i < volume_count; i++) { if ((ret = dlp_VFSVolumeInfo(sd, volumes[i], &info)) < 0) { LOG ((PI_DBG_USER, PI_DBG_LVL_ERR, "palm_cardinfo: dlp_VFSVolumeInfo returned %i\n", ret)); goto cleanup; } if ((ret = dlp_VFSVolumeSize(sd, volumes[i], &size_used, &size_total)) < 0) { LOG ((PI_DBG_USER, PI_DBG_LVL_ERR, "palm_cardinfo: dlp_VFSVolumeSize returned %i\n", ret)); goto cleanup; } len = sizeof(buf); buf[0] = '\0'; dlp_VFSVolumeGetLabel (sd, volumes[i], &len, buf); t = malloc (sizeof (cardreport_t)); t->size_used = size_used; t->size_total = size_total; t->size_free = size_total - size_used; t->type = mediatype(&info); t->cardnum = info.slotRefNum; t->name = malloc (strlen(buf) + 1); strcpy (&t->name[1], buf); t->name[0] = '/'; /* Insert into sorted order */ if (cards == NULL || cards->cardnum > t->cardnum) { t->next = cards; cards = t; } else { t2 = cards; while (t2->next != NULL && t2->next->cardnum < t->cardnum) t2 = t2->next; t->next = t2->next; t2->next = t; } /* Determine field widths */ #define FIELDWIDTH(NAME, FUNC) \ j = FUNC; \ if (j > NAME) \ NAME = j FIELDWIDTH (digits_type, (t->type==NULL ? sizeof(unknown_type) : strlen(t->type))); FIELDWIDTH (digits_used, numdigits(t->size_used)); FIELDWIDTH (digits_total, numdigits(t->size_total)); FIELDWIDTH (digits_free, numdigits(t->size_free)); FIELDWIDTH (digits_cardnum, numdigits(t->cardnum)); #undef FIELDWIDTH } memset(fmt,0,sizeof(fmt)); snprintf (fmt, sizeof(fmt)-1, "%%-%zus %%%zus %%%zus %%%zus %%-%zus %%s\n", digits_type, digits_used, digits_total, digits_free, digits_cardnum); printf (fmt, "Filesystem", "Size", "Used", "Free", "#", "Card name"); memset(fmt,0,sizeof(fmt)); snprintf (fmt, sizeof(fmt)-1, "%%-%zus %%%zuli %%%zuli %%%zuli %%%zui %%s\n", digits_type, digits_used, digits_total, digits_free, digits_cardnum); for (t = cards; t != NULL; t = t->next) { printf (fmt, t->type==NULL ? unknown_type : t->type, t->size_used, t->size_total, t->size_free, t->cardnum, t->name); } cleanup: t = cards; while (t != NULL) { cards = t->next; free (t->name); if (t->type != NULL) free (t->type); free (t); t = cards; } return 0; } /*********************************************************************** * * Function: findVFSRoot_clumsy * * Summary: For internal use only. May contain live weasels. * * Parameters: root_component --> root path to search for. * match <-> volume matching root_component. * * Returns: -2 on VFSVolumeEnumerate error, * -1 if no match was found, * 0 if a match was found and @p match is set, * 1 if no match but only one VFS volume exists and * match is set. * ***********************************************************************/ static int findVFSRoot_clumsy(const char *root_component, long *match) { int volume_count = 16; int volumes[16]; struct VFSInfo info; int i; int buflen; char buf[vfsMAXFILENAME]; long matched_volume = -1; if (dlp_VFSVolumeEnumerate(sd,&volume_count,volumes) < 0) { return -2; } /* Here we scan the "root directory" of the Pilot. We will fake out a bunch of directories pointing to the various "cards" on the device. If we're listing, print everything out, otherwise remain silent and just set matched_volume if there's a match in the first filename component. */ for (i = 0; i= 0) { *match = matched_volume; return 0; } if ((matched_volume < 0) && (1 == volume_count)) { /* Assume that with one card, just go look there. */ *match = volumes[0]; return 1; } return -1; } /*********************************************************************** * * Function: findVFSPath * * Summary: Search the VFS volumes for @p path. Sets @p volume * equal to the VFS volume matching @p path (if any) and * fills buffer @p rpath with the path to the file relative * to the volume. * * Acceptable root components are /cardX/ for card indicators * or /volumename/ for for identifying VFS volumes by their * volume name. In the special case that there is only one * VFS volume, no root component need be specified, and * "/DCIM/" will map to "/card1/DCIM/". * * Parameters: path --> path to search for. * volume <-> volume containing path. * rpath <-> buffer for path relative to volume. * rpathlen <-> in: length of buffer; out: length of * relative path. * * Returns: -2 on VFSVolumeEnumerate error, * -1 if no match was found, * 0 if a match was found. * ***********************************************************************/ static int findVFSPath(const char *path, long *volume, char *rpath, int *rpathlen) { char *s; int r; if ((NULL == path) || (NULL == rpath) || (NULL == rpathlen)) return -1; if (*rpathlen < strlen(path)) return -1; memset(rpath,0,*rpathlen); if ('/'==path[0]) strncpy(rpath,path+1,*rpathlen-1); else strncpy(rpath,path,*rpathlen-1); s = strchr(rpath,'/'); if (NULL != s) *s=0; r = findVFSRoot_clumsy(rpath,volume); if (r < 0) return r; if (0 == r) { /* Path includes card/volume label. */ r = strlen(rpath); if ('/'==path[0]) ++r; /* adjust for stripped / */ memset(rpath,0,*rpathlen); strncpy(rpath,path+r,*rpathlen-1); } else { /* Path without card label */ memset(rpath,0,*rpathlen); strncpy(rpath,path,*rpathlen-1); } if (!rpath[0]) { rpath[0]='/'; rpath[1]=0; } *rpathlen = strlen(rpath); return 0; } /*********************************************************************** * * Function: palm_list_VFSDir * * Summary: Dispatch listing for given @p path to either * print_dir or print_fileinfo, depending on type. * * Parameters: volume --> volume ref number. * path --> path to file or directory. * * Returns: Nothing * ***********************************************************************/ static void palm_list_VFSDir(long volume, const char *path) { FileRef file; unsigned long attributes; if (dlp_VFSFileOpen(sd,volume,path,dlpVFSOpenRead,&file) < 0) { printf(" %s: No such file or directory.\n",path); return; } if (dlp_VFSFileGetAttributes(sd,file,&attributes) < 0) { printf(" %s: Cannot get attributes.\n",path); return; } if (vfsFileAttrDirectory == (attributes & vfsFileAttrDirectory)) { /* directory */ print_dir(volume,path,file); } else { /* file */ print_fileinfo(path,file); } (void) dlp_VFSFileClose(sd,file); } /*********************************************************************** * * Function: palm_list_VFS * * Summary: Show information about the directory or file specified * in global vfsdir. Listing / will always tell you the * physical VFS cards present; other paths should specify * either a card as /cardX/ in the path of a volume label. * As a special case, /dir/ is mapped to /card1/dir/ if * there is only one card. * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void palm_list_VFS() { char root_component[vfsMAXFILENAME]; int rootlen = vfsMAXFILENAME; long matched_volume = -1; int r; /* Listing the root directory / has special handling. Detect that here. */ if (NULL == vfsdir) vfsdir="/"; /* Find the given directory. Will list the VFS root dir if the requested dir is "/" */ printf(" Directory of %s...\n",vfsdir); r = findVFSPath(vfsdir,&matched_volume,root_component,&rootlen); if (-2 == r) { fprintf(stderr," Not ready reading drive C:\n"); return; } if (r < 0) { fprintf(stderr," No such directory, use pilot-xfer -C to list volumes.\n"); return; } /* printf(" Reading card dir %s on volume %ld\n",root_component,matched_volume); */ palm_list_VFSDir(matched_volume,root_component); } /*********************************************************************** * * Function: palm_list * * Summary: List the databases found on the Palm device. * Dispatches to previous List*() functions. * * Parameters: Media type * * Returns: Nothing * ***********************************************************************/ static void palm_list(unsigned long int flags) { switch(flags & MEDIA_MASK) { case MEDIA_RAM: case MEDIA_ROM: case MEDIA_FLASH: palm_list_internal(flags); break; case MEDIA_VFS: palm_list_VFS(); break; default: fprintf(stderr," ERROR: Unknown media type %lx.\n",flags & MEDIA_MASK); break; } } /*********************************************************************** * * Function: palm_purge * * Summary: Purge any deleted data that hasn't been cleaned up * by a sync * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void palm_purge(void) { int i = 0, h; struct DBInfo info; pi_buffer_t *buffer; printf("Reading list of databases to purge...\n"); buffer = pi_buffer_new(sizeof(struct DBInfo)); for (;;) { if (dlp_ReadDBList(sd, 0, 0x80, i, buffer) < 0) break; memcpy (&info, buffer->data, sizeof(struct DBInfo)); i = info.index + 1; if (info.flags & 1) continue; /* skip resource databases */ printf("Purging deleted records from '%s'... ", info.name); h = 0; if ((dlp_OpenDB(sd, 0, 0x40 | 0x80, info.name, &h) >= 0) && (dlp_CleanUpDatabase(sd, h) >= 0) && (dlp_ResetSyncFlags(sd, h) >= 0)) { printf("OK\n"); } else { printf("Failed\n"); } if (h != 0) dlp_CloseDB(sd, h); } pi_buffer_free (buffer); printf("Purge complete.\n"); } int main(int argc, const char *argv[]) { int optc, /* switch */ unsaved = 0; const char *archive_dir = NULL, *dirname = NULL; unsigned long int sync_flags = 0; palm_op_t palm_operation = palm_op_noop; const char *gracias = "\n Thank you for using pilot-link.\n"; const char **rargv; /* for scanning remaining arguments */ int rargc; poptContext pc; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS /* action indicators that take a argument */ {"backup", 'b', POPT_ARG_STRING, &dirname, palm_op_backup, "Back up your Palm to ", "dir"}, {"update", 'u', POPT_ARG_STRING, &dirname, palm_op_update, "Update with newer Palm data", "dir"}, {"sync", 's', POPT_ARG_STRING, &dirname, palm_op_sync, "Same as -u option, but removes local files if data is removed from your Palm", "dir"}, {"restore", 'r', POPT_ARG_STRING, &dirname, palm_op_restore, "Restore backupdir to your Palm", "dir"}, /* action indicators that take no argument, but eat the remaining command-line arguments. */ {"install", 'i', POPT_ARG_NONE, NULL, palm_op_install, "Install local prc, pdb, pqa files to your Palm", NULL}, {"fetch", 'f', POPT_ARG_NONE, NULL, palm_op_fetch, "Retrieve databases from your Palm", NULL}, {"merge", 'm', POPT_ARG_NONE, NULL, palm_op_merge, "Adds records from local files into the corresponding Palm databases", NULL}, {"delete", '\0', POPT_ARG_NONE, NULL, palm_op_delete, "Delete (permanently) databases from your Palm", NULL}, /* action indicators that take no arguments. */ {"list", 'l', POPT_ARG_NONE, NULL, palm_op_list, "List all application and 3rd party Palm data/apps", NULL}, {"cardinfo", 'C', POPT_ARG_NONE, NULL, palm_op_cardinfo, "Show information on available cards", NULL}, /* action indicators that may be mixed in with the others */ {"Purge", 'P', POPT_BIT_SET, &sync_flags, PURGE, "Purge any deleted data that hasn't been cleaned up", NULL}, /* modifiers for the various actions */ {"archive", 'a', POPT_ARG_STRING, &archive_dir, 0, "Modifies -s to archive deleted files in directory ", "dir"}, {"exclude", 'e', POPT_ARG_STRING, NULL, 'e', "Exclude databases listed in from being included", "file"}, {"vfsdir", 'D', POPT_ARG_STRING, &vfsdir, MEDIA_VFS, "Modifies -lif to use VFS instead of internal storage", "dir"}, {"rom", 0 , POPT_ARG_NONE, NULL, MEDIA_FLASH, "Modifies -b, -u, and -s, to back up non-OS dbs from Flash ROM", NULL}, {"with-os", 0 , POPT_ARG_NONE, NULL, MEDIA_ROM, "Modifies -b, -u, and -s, to back up OS dbs from Flash ROM", NULL}, {"illegal", 0 , POPT_ARG_NONE, &unsaved, 0, "Modifies -b, -u, and -s, to back up the illegal database Unsaved Preferences.prc (normally skipped)", NULL}, /* misc */ {"exec", 'x', POPT_ARG_STRING, NULL, 'x', "Execute a shell command for intermediate processing", "command"}, POPT_TABLEEND }; const char *help_header_text = "\n" " Sync, backup, install, delete and more from your Palm device.\n" " This is the swiss-army-knife of the entire pilot-link suite.\n\n" " Use exactly one of -brsudfimlI; mix in -aexDPv, --rom and --with-os.\n\n"; pc = poptGetContext("pilot-xfer", argc, argv, options, 0); poptSetOtherOptionHelp(pc, help_header_text); /* can't alias both short and long in one go, hence "dupes" */ plu_popt_alias(pc,"List",0,"--bad-option --list --rom"); plu_popt_alias(pc,"Listall",0,"--bad-option --list --rom"); plu_popt_alias(pc,NULL,'L',"--bad-option --list --rom"); plu_popt_alias(pc,"Flash",0,"--bad-option --rom"); plu_popt_alias(pc,NULL,'F',"--bad-option --rom"); plu_popt_alias(pc,"OsFlash", 0,"--bad-option --with-os"); plu_popt_alias(pc,NULL, 'O',"--bad-option --with-os"); plu_popt_alias(pc,"Illegal", 0,"--bad-option --illegal"); plu_popt_alias(pc,NULL, 'I',"--bad-option --illegal"); plu_set_badoption_help( " --rom instead of -F, --Flash\n" " --with-os instead of -O, --OsFlash\n" " --illegal instead of -I, --Illegal\n" " --list --rom instead of -L, --List, --Listall\n\n"); if (argc < 2) { poptPrintUsage(pc,stderr,0); return 1; } while ((optc = poptGetNextOpt(pc)) >= 0) { switch (optc) { /* Actions with a dir argument */ case palm_op_backup: case palm_op_update: case palm_op_sync: case palm_op_restore: case palm_op_install: case palm_op_merge: case palm_op_fetch: case palm_op_delete: case palm_op_list: case palm_op_cardinfo: if (palm_op_noop != palm_operation) { fprintf(stderr," ERROR: specify only one of -brsuimfdlLC.\n"); return 1; } palm_operation = optc; break; /* Modifiers */ case MEDIA_VFS: case MEDIA_ROM: case MEDIA_FLASH: if ((sync_flags & MEDIA_MASK) != 0) { fprintf(stderr," ERROR: specify only one media type (-DFO).\n"); return 1; } sync_flags |= optc; break; /* Misc */ case 'e': make_excludelist(poptGetOptArg(pc)); break; case 'x': if (system(poptGetOptArg(pc))) { fprintf(stderr," ERROR: system() failed, aborting.\n"); return -1; } break; default: /* popt handles all other arguments internally by setting values, setting bits, etc., only options with field val != 0 come though here, and all of them should special processing. */ fprintf(stderr," ERROR: got option %d, arg %s\n", optc, poptGetOptArg(pc)); return 1; break; } } if (optc < -1) { /* an error occurred during option processing */ fprintf(stderr, "%s: %s\n", poptBadOption(pc, POPT_BADOPTION_NOALIAS), poptStrerror(optc)); return 1; } /* collect and count remaining arguments */ rargc = 0; rargv = poptGetArgs(pc); if (rargv) { const char **s = rargv; while (*s) { s++; rargc++; } } /* sanity checking */ switch(palm_operation) { struct stat sbuf; case palm_op_backup: case palm_op_restore: case palm_op_update: case palm_op_sync: if (sync_flags & MEDIA_VFS) { fprintf(stderr," ERROR: Cannot combine -burs with VFS (-D).\n\n"); return 1; } if (stat (dirname, &sbuf) == 0) { if (!S_ISDIR (sbuf.st_mode)) { fprintf(stderr, " ERROR: '%s' is not a directory or does not exist.\n" " Please supply a directory name when performing a " "backup or restore and try again.\n\n", dirname); fprintf(stderr,gracias); return 1; } } /* FALLTHRU */ case palm_op_cardinfo: case palm_op_list: if (rargc > 0) { fprintf(stderr," ERROR: Do not pass additional arguments to -busrlLC.\n"); fprintf(stderr,gracias); return 1; } break; case palm_op_noop: fprintf(stderr," ERROR: Must specify one of -bursimfdlC.\n"); fprintf(stderr,gracias); return 1; break; case palm_op_merge: case palm_op_delete: if (MEDIA_VFS == (sync_flags & MEDIA_VFS)) { fprintf(stderr," ERROR: cannot merge or delete with VFS.\n"); return 1; } /* FALLTHRU */ case palm_op_fetch: case palm_op_install: if (rargc < 1) { fprintf(stderr," ERROR: -imfd require additional arguments.\n"); return 1; } break; } /* plu_connect() prints diagnostics as needed, returns -1 on failure so just bail in that case. */ sd = plu_connect(); if (sd < 0) return 1; /* actual operation */ switch(palm_operation) { case palm_op_noop: /* handled above */ exit(1); break; case palm_op_backup: case palm_op_update: case palm_op_sync: if (palm_op_backup == palm_operation) sync_flags |= BACKUP; if (palm_op_update == palm_operation) sync_flags |= UPDATE; if (palm_op_sync == palm_operation) sync_flags |= UPDATE | SYNC; palm_backup(dirname, sync_flags, unsaved, archive_dir); break; case palm_op_restore: palm_restore(dirname); break; case palm_op_merge: case palm_op_install: case palm_op_fetch: case palm_op_delete: while (rargv && *rargv) { switch(palm_operation) { case palm_op_merge: palm_merge(*rargv); break; case palm_op_fetch: palm_fetch(sync_flags,*rargv); break; case palm_op_delete: palm_delete(*rargv); break; case palm_op_install: palm_install(sync_flags,*rargv); break; default: /* impossible */ break; } rargv++; } break; case palm_op_list: palm_list(sync_flags); break; case palm_op_cardinfo: palm_cardinfo(); break; } if (sync_flags & PURGE) palm_purge(); pi_close(sd); puts(gracias); return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-ietf2datebook.pl0000644000175000017500000000320510437354635022105 0ustar rousseaurousseau#!/usr/bin/env perl ###################################################################### # ietf2datebook.pl -- Convert IETF agenda to suitable format for # install-datebook # # Copyright (c) 1997 Tero Kivinen # # 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 St, Fifth Floor, Boston, MA 02110-1301, USA. ###################################################################### use strict; # use warnings; # use diagnostics; print ; __DATA__; #!/usr/bin/env perl while (<>) { chomp; if (/^(MONDAY|TUESDAY|WEDNESDAY|THURSDAY|FRIDAY|SATURDAY|SUNDAY)\s*,\s*(January|February|March|April|June|July|August|September|October|November|December)\s*(\d+)\s*,\s*(\d+)\s*$/) { $date = "$2 $3, $4"; } elsif (/^(\d\d\d\d)-(\d\d\d\d)\s*(.*)$/) { $timestart = $1; $timeend = $2; $header = $3; printf("$date $timestart GMT+300\t$date $timeend GMT+300\t\t$header\n"); } elsif (/^\s*$/) { } elsif (/^\s*(.*)$/) { printf("$date $timestart GMT+300\t$date $timeend GMT+300\t\t$header: $1\n"); } else { die "Internal error"; } } pilot-link-0.12.5-dfsg/src/plu_args.c0000644000175000017500000000605011211745573017656 0ustar rousseaurousseau/* * $Id: plu_args.c,v 1.9 2006/10/12 14:21:21 desrod Exp $ * * plu_args.c: common popt argument processing routines * * Copyright (C) 2004 by Adriaan de Groot * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "pi-userland.h" #include #include #include #include "pi-header.h" char *plu_port = NULL; int plu_timeout = 0; int plu_quiet = 0; static char *badoption_help = NULL; #define ARGUMENT_BAD_OPTION 17227 static void callback(poptContext pc, int reason, const struct poptOption *opt, const char *arg, void *data) { static int have_complained_already = 0; switch(opt->val) { case 'v' : print_splash(poptGetInvocationName(pc)); exit(0); break; case ARGUMENT_BAD_OPTION: if (!have_complained_already) { fprintf(stderr," WARNING: You are using deprecated options. %s\n\n", badoption_help ? "Use these instead:" : "See --help for more."); if (badoption_help) fprintf(stderr,"%s",badoption_help); have_complained_already=1; } break; } } struct poptOption plu_common_options[] = { { NULL, 0, POPT_ARG_CALLBACK, callback, 0, NULL, NULL}, { "port", 'p', POPT_ARG_STRING, &plu_port, 0 , "Use device to communicate with Palm", ""}, { "timeout", 't', POPT_ARG_INT, &plu_timeout, 0 , "Use timeout seconds", ""}, { "version", 0 , POPT_ARG_NONE, NULL, 'v', "Display version information", NULL}, { "quiet", 'q', POPT_ARG_NONE, &plu_quiet, 0 , "Suppress 'Hit HotSync button' message", NULL}, { "bad-option",0, POPT_ARG_NONE | POPT_ARGFLAG_DOC_HIDDEN, NULL, ARGUMENT_BAD_OPTION, NULL, NULL }, POPT_TABLEEND } ; void plu_badoption(poptContext pc, int optc) { fprintf(stderr, "%s: %s\n", poptBadOption(pc, POPT_BADOPTION_NOALIAS), poptStrerror(optc)); poptPrintUsage(pc, stderr, 0); exit(1); } void plu_popt_alias(poptContext pc, const char *alias_long, char alias_short, const char *expansion) { struct poptAlias alias = { alias_long, alias_short, 0, NULL } ; poptParseArgvString(expansion,&alias.argc,&alias.argv); poptAddAlias(pc,alias,0); } void plu_set_badoption_help(const char *h) { if (badoption_help) free(badoption_help); badoption_help = NULL; if (h) badoption_help = strdup(h); } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-sync-plan.pl0000644000175000017500000014622510417766425021303 0ustar rousseaurousseauuse Config; print $Config{startperl}, "\n"; print ; __DATA__; use IO::Socket; use IO::Select; use Time::Local; use Digest::MD5; use PDA::Pilot; use Carp; use strict; my ($controldir, $dlp, $info, $db, $port); my (%control, %pilothash, %pilotID, %planID, %exceptID, %planRecord, %dbname, %sawName); my ($slowsync, $file, $pilotname, $maxseed, $netplanversion); my $PREFS = { NetplanPort => 5444, Debug => 1, }; my @plversion; # pilot-link version (version, major, minor, patch) # any or alll of these may be undefined, depending on the # pilot-link version. eval { $plversion[0] = PDA::Pilot::PILOT_LINK_VERSION(); $plversion[1] = PDA::Pilot::PILOT_LINK_MAJOR(); $plversion[2] = PDA::Pilot::PILOT_LINK_MINOR(); $plversion[3] = PDA::Pilot::PILOT_LINK_PATCH(); }; # msg and status are here to localize the differences between the # standalone sync-plan.PL and the SyncPlan.pm module for PilotManager. ############################################################ # ############################################################ sub msg { print @_; } sub status { } ############################################################ # CheckErrNotFound: Argument is a PDA::Pilot::DLP or a # PDA::Pilot::DLP::DB. It's in its own package so that croak will # give more useful information. I'm not using the equivalent function # from the PilotMgr package because there is a stand-alone version of # this conduit in the pilot-link distribution. ############################################################ BEGIN { package ErrorCheck; use Carp; sub checkErrNotFound { my($obj) = @_; my $errno = $obj->errno(); if (defined $plversion[0]) { # pilot-link version is >= 0.12.0-pre2 if ($errno != PDA::Pilot::PI_ERR_DLP_PALMOS()) { croak "Error $errno"; } if (($errno = $obj->palmos_errno()) != PDA::Pilot::dlpErrNotFound()) { croak "Error $errno: " . PDA::Pilot::errorText($errno); } } else { croak "Error $errno" if ($errno != -5); # dlpErrNotFound } } } *checkErrNotFound = \&ErrorCheck::checkErrNotFound; ############################################################ # ############################################################ sub DatePlanToPerl { my ($PlanDate) = @_; my ($m,$d,$y) = split(m!/!,$PlanDate); if ($y < 40) { $y += 100; } if ($y > 1900) { $y -= 1900; } $m--; timegm(0,0,0,$d,$m,$y); } ############################################################ # ############################################################ sub TimePlanToPerl { my ($PlanTime) = @_; my ($h,$m,$s) = split(m!:!,$PlanTime); return undef if $h == 99 and $m == 99 and $s == 99; $s + ($m * 60) + ($h * 60 * 60); } ############################################################ # ############################################################ sub TimePerlToPlan { my ($PerlDT) = @_; return "99:99:99" if not defined $PerlDT; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($PerlDT); "$hour:$min:$sec"; } ############################################################ # ############################################################ sub TimeRelPerlToPlan { my ($PerlDT) = @_; return "99:99:99" if not defined $PerlDT; my ($sec,$min,$hour); $hour = int($PerlDT/ (60*60)); $PerlDT -= $hour*60*60; $min = int($PerlDT/ (60)); $PerlDT -= $min*60; $sec = int($PerlDT); $PerlDT -= $sec; "$hour:$min:$sec"; } ############################################################ # ############################################################ sub DatePilotToPerl { my ($s,$m,$h, $mday,$mon,$year) = @_; if (ref $s eq 'ARRAY') { ($s,$m,$h, $mday,$mon,$year) = @$s; } my ($date, $time); if ($year >= 70 and $year <= 138) { $date = eval { timegm($s,$m,$h,$mday,$mon,$year) }; msg("Trouble converting date: $mon/$mday/$year $h:$m$s") if $@; $time = $s + 60 * ($m + 60 * $h); } else { msg("Bad year: $year"); } return wantarray ? ($date, $time) : $date; } ############################################################ # ############################################################ sub DatePerlToPlan { my ($PerlDT) = @_; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($PerlDT); $year += 1900; $mon++; "$mon/$mday/$year"; } ############################################################ # ############################################################ sub RecordPlanToPilot { my ($plan,$pilot) = @_; if (not defined $pilot) { $pilot = PDA::Pilot::AppointmentDatabase->record; } $pilot->{'id'} = $plan->{'pilotid'}; $pilot->{'description'} = join("\xA", @{$plan->{'note'}}) if defined $plan->{'note'}; $pilot->{'note'} = join("\xA", @{$plan->{'message'}}) if defined $plan->{'message'}; $pilot->{'description'} ||= ""; if (defined $plan->{'time'}) { $pilot->{'begin'} = [gmtime($plan->{'date'}+$plan->{'time'})]; $pilot->{'end'} = [gmtime($plan->{'date'}+$plan->{'time'}+$plan->{'length'})]; $pilot->{'event'}=0; } else { $pilot->{'begin'} = [gmtime($plan->{'date'})]; $pilot->{'event'} = 1; $plan->{'early'} = 0; $plan->{'late'} = 0; } if ($plan->{'early'} and $plan->{'late'} and ($plan->{'early'} != $plan->{'late'})) { msg( "Two alarms - using earlier one." ); $plan->{'late'} = $plan->{'early'}; } if ($plan->{'early'} or $plan->{'late'}) { my ($alarm) = $plan->{'early'} || $plan->{'late'}; if ($alarm > (60*60*24)) { $pilot->{'alarm'}->{'units'} = "days"; $pilot->{'alarm'}->{'advance'} = int($alarm / (60*60*24)); } elsif ($alarm > (60*60)) { $pilot->{'alarm'}->{'units'} = "hours"; $pilot->{'alarm'}->{'advance'} = int($alarm / (60*60)); } else { $pilot->{'alarm'}->{'units'} = "minutes"; $pilot->{'alarm'}->{'advance'} = int($alarm / 60); } } if (defined $plan->{'exceptions'}) { foreach (@{$plan->{'exceptions'}}) { push @{$pilot->{'exceptions'}}, [gmtime($_)]; } } else { delete $pilot->{'exceptions'}; } if (defined $plan->{'repeat'}) { msg( "Converting repetition...\n" ) if ($PREFS->{'Debug'} > 2); delete $pilot->{'repeat'}; if ($plan->{'repeat'}->[1]) { $pilot->{'repeat'}->{'end'} = [gmtime($plan->{'repeat'}->[1])]; } my ($days,$end,$weekday,$mday,$yearly) = @{$plan->{'repeat'}}; msg( "Days: $days, End: $end, Weekday: $weekday, Mday: $mday, Yearly: $yearly\n" ) if ($PREFS->{'Debug'} > 2); $pilot->{'repeat'}->{'weekstart'} = 0; $pilot->{'repeat'}->{'frequency'} = 1; if ($days and !$weekday and !$mday and !$yearly) { $pilot->{'repeat'}->{'type'} = "Daily"; $pilot->{'repeat'}->{'frequency'} = $days / (60*60*24); } elsif(!$days and !$weekday and !$mday and $yearly) { $pilot->{'repeat'}->{'type'} = "Yearly"; } elsif(!$days and !$weekday and ($mday == (1 << $pilot->{'begin'}[3])) and !$yearly) { $pilot->{'repeat'}->{'type'} = "MonthlyByDate"; } elsif(!$days and $weekday and (($weekday & 0xff80) == 0) and !$mday and !$yearly) { $pilot->{'repeat'}->{'type'} = "Weekly"; foreach my $i (0..6) { $pilot->{'repeat'}->{'days'}[$i] = !! ($weekday & (1<<$i)); } # If the weekday list does include the day the event is one, abort if (!$pilot->{'repeat'}{'days'}[$pilot->{'begin'}[6]]) { return undef; } } elsif(not $days and $weekday and not $mday and not $yearly) { my ($wday) = $pilot->{'begin'}[6]; my ($week) = int(($pilot->{'begin'}[3]-1)/7); msg( "weekday = $weekday, wday = $wday, week = $week\n" ) if ($PREFS->{'Debug'} > 2); if (($weekday & 0x7f) != (1<<$wday)) { return undef; } if (($weekday & 4096) and ($weekday & 8192)) { $weekday &= ~4096; } if ($week == 4) { $week = 5; } if (($weekday & 0xff00) != (256<<$week)) { return undef; } if ($week == 5) { $week = 4; } $pilot->{'repeat'}->{'type'} = "MonthlyByDay"; $pilot->{'repeat'}->{'day'} = $week*7+$wday; } else { return undef; } } else { delete $pilot->{'repeat'}; } $pilot; } ############################################################ # ############################################################ sub RecordPilotToPlan { my ($pilot,$plan) = @_; $plan = {color => 0} if not defined $plan; $plan->{'pilotid'} = $pilot->{'id'}; $plan->{'id'} ||= 0; $plan->{'message'} = [split("\xA", $pilot->{'note'})] if defined $pilot->{'note'}; $plan->{'note'} = [split("\xA", $pilot->{'description'})] if defined $pilot->{'description'}; my ($date, $time) = DatePilotToPerl($pilot->{'begin'}); unless ($date) { msg("Begin time in Palm record untranslatable."); return undef; } $plan->{'date'} = $date; if ($pilot->{'event'}) { $plan->{'time'} = undef; $plan->{'length'} = 0; } else { $plan->{'time'} = $time; my $end = DatePilotToPerl($pilot->{'end'}); unless ($end) { msg("End time in Palm record untranslatable."); return undef; } $plan->{'length'} = $end - $date; } if (exists $pilot->{'alarm'}) { my($alarm) = 0; if ($pilot->{'alarm'}{'units'} eq "days") { $alarm = $pilot->{'alarm'}->{'advance'} * (60*60*24); } elsif ($pilot->{'alarm'}{'units'} eq "hours") { $alarm = $pilot->{'alarm'}->{'advance'} * (60*60); } elsif ($pilot->{'alarm'}{'units'} eq "minutes") { $alarm = $pilot->{'alarm'}->{'advance'} * (60); } if ($plan->{'late'}) { $plan->{'late'} = $alarm; $plan->{'early'} = 0; } else { $plan->{'late'} = 0; $plan->{'early'} = $alarm; } } else { $plan->{'late'}=0; $plan->{'early'}=0; } if (exists $pilot->{'exceptions'}) { # Plan records can only deal with four exceptions, if (@{$pilot->{'exceptions'}} > 4) { msg("Too many exceptions."); return undef; } foreach (@{$pilot->{'exceptions'}}) { push @{$plan->{'exceptions'}}, timegm(@{$_}); } } delete $plan->{'repeat'}; if (exists $pilot->{'repeat'}) { $plan->{'repeat'} = [0,0,0,0,0]; if ($pilot->{'repeat'}->{'type'} eq "Daily") { $plan->{'repeat'}->[0] = (60*60*24) * $pilot->{'repeat'}->{'frequency'}; $plan->{'repeat'}->[4] = 0; } elsif ($pilot->{'repeat'}->{'type'} eq "Yearly" and ($pilot->{'repeat'}->{'frequency'}==1)) { $plan->{'repeat'}->[4] = 1; } elsif ($pilot->{'repeat'}->{'type'} eq "Weekly" and ($pilot->{'repeat'}->{'frequency'}==1)) { my ($r) = 0; foreach my $i (0..6) { if ($pilot->{'repeat'}->{'days'}[$i]) { $r |= (1<<$i); } } $plan->{'repeat'}->[2] = $r; } elsif ($pilot->{'repeat'}->{'type'} eq "Weekly" and ($pilot->{'repeat'}->{'frequency'}>1)) { # Weekly repeat, not every week. If it repeats only once per week, convert it to a daily # repeat with frequency a multiple of 7. If it repeats more than once a week, bail. my $count = 0; foreach my $i (0..6) { $count ++ if ($pilot->{repeat}->{days}[$i]); } if ($count == 1) { $plan->{'repeat'}->[0] = (60*60*24) * $pilot->{'repeat'}->{'frequency'} * 7; $plan->{'repeat'}->[4] = 0; } else { msg("Repeat pattern too complex."); return undef; } } elsif ($pilot->{'repeat'}->{'type'} eq "MonthlyByDate" and ($pilot->{'repeat'}->{'frequency'}==1)) { $plan->{'repeat'}->[3] = 1 << $pilot->{'begin'}[3]; } elsif ($pilot->{'repeat'}->{'type'} eq "MonthlyByDay" and ($pilot->{'repeat'}->{'frequency'}==1)) { my ($day) = $pilot->{'repeat'}{'day'} % 7; my ($week) = int($pilot->{'repeat'}{'day'} / 7); $week = 5 if $week == 4; $plan->{'repeat'}->[2] = (1 << $day) | (256 << $week); } else { msg("Repeat pattern too complex."); return undef; } if (defined $pilot->{'repeat'}->{'end'}) { $plan->{'repeat'}->[1] = timegm(@{$pilot->{'repeat'}->{'end'}}); } } $plan; } ############################################################ # ############################################################ sub generaterecord { my ($rec) = @_; my (@output); #print "Generating Plan record: ", Dumper($rec),"\n"; push(@output, DatePerlToPlan($rec->{'date'})." ". TimeRelPerlToPlan($rec->{'time'})." ". TimeRelPerlToPlan($rec->{'length'})." ". TimeRelPerlToPlan($rec->{'early'})." ". TimeRelPerlToPlan($rec->{'late'})." ". ($rec->{'suspended'} ? "S" : "-"). ($rec->{'private'} ? "P" : "-"). ($rec->{'noalarm'} ? "N" : "-"). ($rec->{'hide_month'} ? "M" : "-"). ($rec->{'hide_year'} ? "Y" : "-"). ($rec->{'hide_week'} ? "W" : "-"). ($rec->{'hide_yearover'} ? "O" : "-"). ($rec->{'d_flag'} ? "D" : "-"). "-". "-". " ".$rec->{'color'}); if (defined $rec->{'repeat'}) { push @output, "R\t".join(" ",@{$rec->{'repeat'}}); } if (defined $rec->{'exceptions'}) { foreach (@{$rec->{'exceptions'}}) { push @output, "E\t".DatePerlToPlan($_); } } if (defined $rec->{'note'}) { push @output, map("N\t$_", @{$rec->{'note'}}); } if (defined $rec->{'message'}) { push @output, map("M\t$_", @{$rec->{'message'}}); } if (defined $rec->{'script'}) { push @output, map("S\t$_", @{$rec->{'script'}}); } if (defined $rec->{'other'}) { foreach (@{$rec->{'other'}}) { push @output, $_; } } my ($hash) = new Digest::MD5; foreach (@output) { #print "Adding |$_| to hash\n"; $hash->add($_); } $rec->{'pilothash'} = $hash->hexdigest; { my ($i); for ($i=0;$i<@output;$i++) { last if $output[$i] =~ /^S/; } $rec->{'pilotexcept'} += 0; my (@US); @US = @{$rec->{'unhashedscript'}} if defined $rec->{'unhashedscript'}; unshift @US, "S\t#Pilot: 1 $pilotname $rec->{'pilothash'} $rec->{'pilotexcept'} $rec->{'pilotid'}"; splice @output, $i, 0, @US; } msg( "Generated record |" . join("\n", @output). "|\n" ) if ($PREFS->{'Debug'} > 2); join("\n",@output); } ############################################################ # ############################################################ sub PrintPlanRecord { my ($rec) = @_; my ($output); my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($rec->{'date'}); $year += 1900; $mon++; $output = "$year/$mon/$mday"; if ($rec->{'time'}) { my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($rec->{'time'}); $output .= sprintf(" %02d:%02d-", $hour, $min); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($rec->{'time'}+$rec->{'length'}); $output .= sprintf("%02d:%02d", $hour, $min); } $output .= " '".join("\\n",@{$rec->{'note'}})."'" if defined $rec->{'note'}; $output .= " (".join("\\n",@{$rec->{'message'}}).")" if defined $rec->{'message'}; if ($rec->{'repeat'}) { my (@r); if ($rec->{'repeat'}[0]) { push @r, "every " . ($rec->{'repeat'}[0] / (60*60*24)) . " days"; } if ($rec->{'repeat'}[4]) { push @r, "every year"; } if ($rec->{'repeat'}[3]) { my ($i) = $rec->{'repeat'}[3]; if ($i & 1) { push @r, "the last day of each month"; } foreach (1..31) { push @r, "the $_ of each month" if $i & (1<<$_); } } if ($rec->{'repeat'}[2]) { push @r, "until ".scalar(gmtime($rec->{'repeat'}[2])); } if (@r) { $output .= " repeat ".join(", ", @r); } } # $output .= " {ID:$rec->{'pilotid'}, Except:"; # $output .= $rec->{'pilotexcept'} if (defined $rec->{'pilotexcept'}); # $output .= ", Changed:"; # $output .= $rec->{'modified'} if (defined $rec->{'modified'}); # $output .= ", Deleted:"; # $output .= $rec->{'deleted'} if (defined $rec->{'deleted'}); # $output .= "}"; $output; } ############################################################ # ############################################################ sub PrintPilotRecord { my ($rec) = @_; my ($output); $output = ($rec->{'begin'}[5]+1900)."/".($rec->{'begin'}[4]+1)."/".$rec->{'begin'}[3]; if (!$rec->{'event'}) { $output .= " "; $output .= sprintf("%02d:%02d-%02d:%02d", $rec->{'begin'}[2], $rec->{'begin'}[1], $rec->{'end'}[2], $rec->{'end'}[1]); } $output .= " '$rec->{'description'}'"; $output .= " ($rec->{'message'})" if (defined $rec->{'message'}); # $output .= " {ID:$rec->{'id'}, Except:"; # $output .= $exceptID{$rec->{'id'}} if (defined $exceptID{$rec->{'id'}}); # $output .= ", Changed:"; # $output .= $rec->{'modified'} if (defined $rec->{'modified'}); # $output .= ", Deleted:"; # $output .= $rec->{'deleted'} if (defined $rec->{'deleted'}); # $output .= "}"; $output =~ s/\r/\\r/g; $output =~ s/\n/\\n/g; $output; } ############################################################ # # Takes a Plan record in hash format # ############################################################ sub WritePlanRecord { my ($socket, $record) = @_; my ($raw) = generaterecord($record); my ($reply); $record->{'id'} ||= 0; #print "ID is $record->{'id'}\n"; $raw =~ s/\n/\\\n/g; $raw = "w$file $record->{'id'} $raw\n"; $record->{'raw'} = $raw; SendPlanCommand($socket, $raw); $reply = ReadPlanReply($socket); #print "Installing record $record->{'id'} (PilotID: $record->{'pilotid'}) in Plan: ", Dumper($record); # syswrite $socket, $raw, length($raw); # sysread $socket, $reply, 1024; # print "Reply to installation: |$reply|\n"; if ($reply =~ /^w[tf](\d+)/) { $record->{'id'} = $1; $planRecord{$1} = $record; # print "New record id: $1\n"; } else { msg( "Failed write: $reply\n" ); } } ############################################################ # ############################################################ sub LoadPilotRecord { my ($db, $i) = @_; my ($record) = $db->getRecord($i); if ($record) { $pilotID{$record->{'id'}} = $record; } else { checkErrNotFound($db); } $record; } ############################################################ # # takes a Plan record in hash format # ############################################################ sub DeletePlanRecord { my ($socket, $record) = @_; my ($raw); $raw = "d$file $record->{'id'}\n"; # print "Deleting record $record->{'id'} (PilotID: $record->{'pilotid'}) in Plan\n"; # syswrite $socket, $raw, length($raw); SendPlanCommand($socket, $raw); } ############################################################ # # takes a Palm record in hash format # ############################################################ sub WritePilotRecord { my ($db, $control, $record) = @_; $record->{'id'} ||= 0; $record->{'category'} ||= 0; #print "Installing record in Palm: ",Dumper($record); my ($id) = $db->setRecord($record); if ($id) { $pilotID{$id} = $record; my ($hash) = HashPilotRecord($record); $pilothash{$id} = $hash; $dbname{$id} = $control->{'name'}; $record->{'id'} = $id; $exceptID{$id} = 0; } $id; } ############################################################ # ############################################################ sub DeletePilotRecord { my ($db, $id) = @_; my ($result) = $db->deleteRecord($id); if ($result>=0) { delete $pilothash{$id}; delete $pilotID{$id}; delete $dbname{$id}; delete $exceptID{$id}; } $result; } $maxseed = 0; ############################################################ # ############################################################ sub dorecord { my ($db,$socket,$control, $i,$r) = @_; # print "Record: $r\n"; my (@l) = split(/\n/,$r); my ($rec) = { raw => [@l], other => [] }; my (@E,@R,@N,@M,@S,@US); my ($hash) = new Digest::MD5; $l[0] =~ s/\s+/ /g; $hash->add($l[0]); my ($date, $time, $length, $early, $late, $flags, $color) = split(/\s+/, shift @l); $rec->{'pilotrec'} = ""; foreach (@l) { if (/^E\t/) { push @E, $'; } elsif (/^M\t/) { push @M, $'; } elsif (/^N\t/) { push @N, $'; } elsif (/^S\t/) { my ($s) = $'; if ($s =~ /^\s*#Pilot:\s+(\d+)\s*(.*)$/) { if ($1 == 1) { # version number my ($name,$hash,$except,$id) = split(/\s+/, $2); #print Dumper({Name=>$name,Hash=>$hash,Except=>$except,ID=>$id}); if ($name eq $pilotname) { $rec->{'pilotid'} = $id; $rec->{'pilotexcept'} = $except || 0; $rec->{'pilothash'} = $hash; $planID{$id} = $rec; next; } } push @US, $_; next; # skip hash add } else { push @S, $s; } } elsif (/^R\t/) { my ($r) = $'; $r =~ s/\s+/ /g; $rec->{'repeat'} = [split(/\s+/, $r)]; } else { push @{$rec->{'other'}}, $_; } #print "Adding |$_| to hash\n"; $hash->add($_); } $hash = $hash->hexdigest; #print "Old hash: $hash, New hash: $rec->{'pilothash'}\n"; $rec->{'modified'} = (!defined($rec->{'pilothash'}) || ($rec->{'pilothash'} ne $hash)); $rec->{'note'} = \@N if @N; $rec->{'script'} = \@S if @S; $rec->{'unhashedscript'} = \@US if @US; $rec->{'message'} = \@M if @M; $rec->{'date'} = DatePlanToPerl($date); $rec->{'time'} = TimePlanToPerl($time); $rec->{'length'} = TimePlanToPerl($length); $rec->{'early'} = TimePlanToPerl($early); $rec->{'late'} = TimePlanToPerl($late); $rec->{'color'} = $color; $rec->{'suspended'} = substr($flags,0,1) ne "-"; $rec->{'private'} = substr($flags,1,1) ne "-"; $rec->{'noalarm'} = substr($flags,2,1) ne "-"; $rec->{'hide_month'} = substr($flags,3,1) ne "-"; $rec->{'hide_year'} = substr($flags,4,1) ne "-"; $rec->{'hide_week'} = substr($flags,5,1) ne "-"; $rec->{'hide_yearover'} = substr($flags,6,1) ne "-"; $rec->{'d_flag'} = substr($flags,7,1) ne "-"; $rec->{'locked'} = 1; $rec->{'id'} = $i; $rec->{'exceptions'} = [map(DatePlanToPerl($_), @E)] if @E; $planRecord{$i} = $rec; #print "Read plan record:\n"; #print Dumper($rec); } ############################################################ # ############################################################ sub HashPilotRecord { my ($record) = @_; my ($hash) = new Digest::MD5; $hash->add($record->{'raw'}); $hash->hexdigest; } ############################################################ # ############################################################ sub doafterplan { my ($db,$socket,$control) = @_; msg( "After stuff:\n" ) if ($PREFS->{'Debug'} > 2); ################################################################## # This batch of code scans for Plan records with identical Pilot # IDs, presumambly caused by duplicating a plan record. We remove # the ids from the duplicates. The weird sort is magic to prefer # keeping the id (and thus leaving unmodified) of an otherwise # unmodified record. ################################################################## my (@uniq) = sort {$a->{'pilotid'} <=> $b->{'pilotid'} or $a->{'modified'} <=> $b->{'modified'}} grep {exists $_->{'pilotid'}} values %planRecord; my ($i) = 0; for($i=@uniq-1;$i>=1;$i--) { #print "Checking plan record: ", Dumper($uniq[$i]),"\n"; if ($uniq[$i]->{'pilotid'} == $uniq[$i-1]->{'pilotid'}) { delete $uniq[$i]->{'pilotid'}; $planID{$uniq[$i-1]->{'pilotid'}} = $uniq[$i-1]; #print "... A dup, blessed be ye without id, and be ye modified.\n"; $uniq[$i]->{'modified'} = 1; } } ###################################################################### # Use our saved Pilot ID cache to detect deleted Plan records. This # will not catch deleted Plan records that were never assigned a # Pilot ID, but that is OK because such records do not have to be # removed from the Palm. ###################################################################### my ($loop_count) = (0); my ($del) = -1; foreach (keys %pilothash) { # Palm records originally downloaded from a different Plan database # are off-limits during this pass. next if $dbname{$_} ne $control->{'name'}; # print "Palm cached ID: $_\n"; if (not defined $planID{$_} and not $exceptID{$_}) { #print "Deleted plan record, with Pilot ID $_\n"; $planID{$_}->{'deleted'} = 1; $planID{$_}->{'pilotid'} = $_; $planID{$_}->{'id'} = $del; $planRecord{$del} = $planID{$_}; $del--; } } msg( "Palm loop\n" ) if ($PREFS->{'Debug'} > 2); foreach (keys %pilotID) { $dlp->tickle unless (++$loop_count % 50); # Palm records originally downloaded from a different Plan database # are off-limits during this pass. next if $dbname{$_} ne $control->{'name'}; msg( "Palm record: " . PrintPilotRecord($pilotID{$_}) . "\n" ) if ($PREFS->{'Debug'} > 1); #print "Palm record: ",Dumper($pilotID{$_}),"\n"; if ($pilotID{$_}->{'deleted'} || $pilotID{$_}->{'archived'}) { # # # At this point are seeing Palm records marked as deleted or # # archived. In the case of a slow sync, deleted records may not # # be seen until a later pass. # # # Action: If there is an associated Plan record that has not # # already been deleted, delete it. # # if (defined $planID{$_} and not $planID{$_}->{'deleted'}) { # DeletePlanRecord($planID{$_}); # delete $planRecord{$planID{$_}->{'id'}}; # delete $planID{$_}; # } # # # Remove the Pilot ID from the exception cache, if present # delete $exceptID{$_}; # # delete $lastID{$_}; # # delete $pilothash{$_}; } else { my ($hash) = HashPilotRecord($pilotID{$_}); ###################################################### # If the pilot record ID is not cached, then it is # definitely new. If the MD5 hash of the record is # different from the cached hash, then it is # definitely different. These checks are only needed # during a slow sync (which will have inaccurate # flags), but are harmless during a fast sync. ###################################################### #print "Old hash: $pilothash{$_}, new hash: $hash\n"; if ((not exists $pilothash{$_}) or ($hash ne $pilothash{$_})) { $pilotID{$_}->{'modified'} = 1; #print "Note: cache indicates record is changed\n"; } $pilothash{$_} = $hash; # Record the hash and ID for the next sync # Remove the record from the exception cache if it has been # modified: perhaps it is not exceptional any more delete $exceptID{$_} if $pilotID{$_}->{'modified'}; #print "Matching plan record: ", Dumper($planID{$_}),"\n"; if (not defined $planID{$_}) { if (!$exceptID{$_}) { # The Palm record has no matching Plan record # Action: Install the Palm record in Plan, regardless of # changed status msg( "Installing Palm record in Plan: ". PrintPilotRecord($pilotID{$_}). "\n" ) if ($PREFS->{'Debug'}); #print "Installing pilot record in plan: ",Dumper($pilotID{$_}); my ($record) = RecordPilotToPlan($pilotID{$_}); if (not defined $record) { # The record is not translatable to a Plan record. # Action: Abort the install, and mark the record as # uninstallable so that it will not be tried each sync. # Code above will remove the exception flag when the # record is changed. $exceptID{$_} = 1; msg( "Palm record unsyncable\n" ); } else { WritePlanRecord($socket, $record); } } } elsif ($pilotID{$_}->{'modified'} and $planID{$_}->{'deleted'}) { ############################################ # The Palm record has a matching _deleted_ # Plan record. # This is collision, with a relatively # simple solution. replace the Plan record # with the Palm record. As the Plan record # has already been permanently deleted, we # need only copy the Palm record over. # Action: Install the Palm record in Plan ############################################ my ($record) = RecordPilotToPlan($pilotID{$_}, $planID{$_}); if (not defined $record) { # The record is not translatable to a Plan record. # Action: Abort the install, and mark the record as # uninstallable so that it will not be tried each sync. $exceptID{$_} = 1; msg( "Palm record modified while Plan record deleted, but new Palm record unsyncable\n" ); } else { WritePlanRecord($socket, $record); msg( "Palm record modified while Plan record deleted\n" ) if ($PREFS->{'Debug'} > 1); } } elsif ($pilotID{$_}->{'modified'} and $planID{$_}->{'modified'}) { ############################################ # The Palm record has a matching _modified_ # Plan record. # TODO: Use a comparator function to verify # that the records are actually # substantially different. If not, simply # skip any action. # This is collision with an ugly, but # lossless, solution. Neither the Palm or # Plan record is inherantly preferable, so # we duplicate each record on the other # side, severing the link between the # original new records, forging two new # links and two new records, one on each # side. # Action: Install the Palm record in Plan as # a new, distinct, record, and install the # Plan record on the Palm as a new, # distinct, record. ############################################ msg( "Conflicting modified Plan and Palm records\n" ); { my ($record) = RecordPlanToPilot($planID{$_}); if (not defined $record) { # The Plan record is not translatable to a Palm record. # Action: Abort the install. msg( "Conflicting Plan record unsyncable.\n" ); } else { $record->{'id'} = 0; my ($id) = WritePilotRecord($db, $control, $record); #$db->setRecord($record); # #my ($hash) = HashPilotRecord($record); #$pilothash{$id} = $hash; # #$record->{'id'} = $id; #$pilotID{$id} = $record; #$dbname{$id} = $dbname; $planID{$_}->{'pilotid'} = $id; $planID{$_}->{'modified'} = 0; WritePlanRecord($socket, $planID{$_}); msg( "ID of new Palm record is $id\n" ) if ($PREFS->{'Debug'} > 2); } } { my ($record) = RecordPilotToPlan($pilotID{$_}); if (not defined $record) { # The Palm record is not translatable to a Plan record. # Action: Abort the install. $exceptID{$_} = 1; msg( "Conflicting Palm record unsyncable.\n" ); } else { $record->{'modified'} = 0; my ($id) = WritePlanRecord($socket, $record); msg( "ID of new Plan record is $id\n" ) if ($PREFS->{'Debug'} > 2); } } } elsif($pilotID{$_}->{'modified'}) { ########################################## # At this point, we have a changed Palm # record with an existing unmodified Plan # record. # Action: Install the Palm record in Plan, # overwriting the Plan record. ########################################## my ($record) = RecordPilotToPlan($pilotID{$_}, $planID{$_}); if (not defined $record) { # The record is not translatable to a Plan record. # Action: Abort the install, and mark the record as # uninstallable so that it will not be tried each sync. # Code above will remove the exception flag when the # record is changed. $exceptID{$_} = 1; DeletePlanRecord($socket, $planID{$_}); msg( "Palm record modified while Plan record unchanged, but new Palm record unsyncable. Plan record has been deleted.\n" ); } else { #print "Overwriting plan record: ",Dumper($planID{$_}); #print "With pilot record: ",Dumper($pilotID{$_}); #print "As plan record: ",Dumper($record); WritePlanRecord($socket, $record); msg( "Updating Plan record with modified Palm record: ".PrintPilotRecord($pilotID{$_})."\n" ) if ($PREFS->{'Debug'}); #print "New plan record state: ",Dumper($planID{$_}),"\n"; } } } } $dlp->tickle; msg( "Plan loop\n" ) if ($PREFS->{'Debug'} > 2); foreach (keys %planRecord) { $dlp->tickle unless (++$loop_count % 100); msg( "Plan record: " . PrintPlanRecord($planRecord{$_}),"\n" ) if ($PREFS->{'Debug'} > 1); my ($record) = $planRecord{$_}; my ($pid) = $planRecord{$_}->{'pilotid'}; #print "Plan record: ",Dumper($record),"\n"; if ($record->{'deleted'}) { # # # At this point are seeing Palm records marked as deleted or # # archived. In the case of a slow sync, deleted records may not # # be seen until a later pass. # # # Action: If there is an associated Plan record that has not # # already been deleted, delete it. # # if (defined $planID{$_} and not $planID{$_}->{'deleted'}) { # DeletePlanRecord($planID{$_}); # delete $planRecord{$planID{$_}->{'id'}}; # delete $planID{$_}; # } # # # Remove the Pilot ID from the exception cache, if present # delete $exceptID{$_}; # # delete $lastID{$_}; # # delete $pilothash{$_}; } else { # Remove the record from the exception cache if it has been # modified: perhaps it is not exceptional any more delete $record->{'pilotexcept'} if $record->{'modified'}; # If this is a fast sync, it's possible the record hasn't been # fetched yet. # This is dead code. Fast sync was never # implemented, so $slowsync is always 1. I'm # leaving it here as a hint in case someone # ever gets around to implementing fast sync. # But it looks incorrect to me: # LoadPilotRecord takes an index, not an # id. -ANK if (!$slowsync and defined $pid and not exists $pilotID{$pid}) { my ($precord) = LoadPilotRecord($db, $pid); #$db->getRecord($pid); if (defined $precord) { if (not defined $dbname{$pid}) { $dbname{$pid} = $control->{'defaultname'}; } $pilotID{$pid} = $precord; } } if (defined $pid and defined $pilotID{$pid} and ($dbname{$pid} ne $control->{'name'})) { msg( "Weird: Plan database $control->{'name'} claims to own Palm record $pid,\n" ); msg( "but my ID database says it is owned by $dbname{$pid}. I'll skip it.\n" ); next; } #print "Matching pilot record: ", Dumper($pilotID{$pid}),"\n"; if (not defined $pid or not defined $pilotID{$pid}) { if (!$record->{'pilotexcept'}) { # The Plan record has no matching Palm record # Action: Install the Plan record in Palm, regardless of # changed status msg( "Installing Plan record in Palm: ". PrintPlanRecord($record). "\n" ) if ($PREFS->{'Debug'}); #print "Installing plan record in pilot: ",Dumper($record); #print "Trying to install Plan record: ",Dumper($record),"\n"; my ($newrecord) = RecordPlanToPilot($record); if (not defined $newrecord) { # The record is not translatable to a Palm record. # Action: Abort the install, and mark the record as # uninstallable so that it will not be tried each sync. # Code above will remove the exception flag when the # record is changed. $record->{'pilotexcept'} = 1; $record->{'modified'} = 1; msg( "Plan record unsyncable\n" ); } else { #print "Installing Palm record: ", Dumper($newrecord),"\n"; $newrecord->{'id'} = 0; $newrecord->{'secret'} = 0; my ($id) = WritePilotRecord($db,$control,$newrecord); #$db->setRecord($newrecord); msg( "ID of new Palm record is $id\n" ) if ($PREFS->{'Debug'} > 2); #my ($hash) = HashPilotRecord($newrecord); #$pilothash{$id} = $hash; # #$newrecord->{'id'} = $id; #$pilotID{$id} = $newrecord; #$dbname{$id} = $dbname; $record->{'pilotid'} = $id; # Match the Palm record to the Plan record $record->{'modified'} = 1; # and make sure it is written back out } } } elsif ($record->{'modified'} and $pilotID{$pid}->{'deleted'}) { # The Plan record has a matching _deleted_ Palm record. # This is collision, with a relatively simple solution. # replace the Palm record with the Plan record. # Action: Install the Plan record in Palm my ($newrecord) = RecordPlanToPilot($record, $pilotID{$pid}); if (not defined $newrecord) { # The record is not translatable to a Palm record. # Action: Abort the install, and mark the record as # uninstallable so that it will not be tried each sync. $record->{'pilotexcept'} = 1; msg( "Plan record modified while Palm record deleted, but new Plan record unsyncable\n" ); } else { #print "Installing Palm record: ", Dumper($newrecord),"\n"; WritePilotRecord($db,$control,$newrecord); #$db->setRecord($newrecord); #my ($hash) = HashPilotRecord($newrecord); #$pilothash{$pid} = $hash; msg( "Plan record modified while Palm record deleted\n" ) if ($PREFS->{'Debug'} > 1); } } elsif ($record->{'modified'} and $pilotID{$pid}->{'modified'}) { croak("This shouldn't happen..."); } elsif ($record->{'modified'}) { # At this point, we have a changed Plan record with an # existing unmodified Palm record. # Action: Install the Plan record in the Palm, overwriting the # Palm record. #print "Trying to install Plan record: ",Dumper($record),"\n"; my ($newrecord) = RecordPlanToPilot($record, $pilotID{$pid}); if (not defined $newrecord) { # The record is not translatable to a Plan record. # Action: Abort the install, and mark the record as # uninstallable so that it will not be tried each sync. # Code above will remove the exception flag when the # record is changed. $record->{'pilotexcept'} = 1; DeletePilotRecord($db,$pid); #$db->deleteRecord($record->{'pilotid'}); #delete $pilothash{$record->{'pilotid'}}; #delete $exceptID{$record->{'pilotid'}}; msg( "Plan record modified while Palm record unchanged, but new Plan record unsyncable. Palm record has been deleted.\n" ); } else { #print "Overwriting pilot record: ",Dumper($pilotID{$_}); #print "With plan record: ",Dumper($record); #print "As pilot record: ",Dumper($newrecord); #print "Installing Palm record: ", Dumper($newrecord),"\n"; WritePilotRecord($db,$control,$newrecord); #$db->setRecord($newrecord); #my ($hash) = HashPilotRecord($newrecord); #$pilothash{$pid} = $hash; msg( "Updating Palm record with modified Plan record: ".PrintPlanRecord($record)."\n" ) if ($PREFS->{'Debug'}); } } } if ($record->{'modified'}) { WritePlanRecord($socket, $record); } } msg( "Palm delete loop\n" ) if ($PREFS->{'Debug'} > 2); foreach (keys %pilotID) { $dlp->tickle unless (++$loop_count % 100); ############################################################ # Palm records originally downloaded from a different Plan # database are off-limits during this pass. ############################################################ next if $dbname{$_} ne $control->{'name'}; #print "Palm record: ",Dumper($pilotID{$_}),"\n"; msg( "Palm record: " . PrintPilotRecord($pilotID{$_}) . "\n" ) if ($PREFS->{'Debug'} > 1); if ($pilotID{$_}->{'deleted'} || $pilotID{$_}->{'archived'}) { # At this point are seeing Palm records marked as deleted or # archived. In the case of a slow sync, deleted records may not # be seen until a later pass. # Action: If there is an associated Plan record that has not # already been deleted, delete it. msg( "Deleting Palm record.\n" ) if ($PREFS->{'Debug'} > 1); if (defined $planID{$_} and not $planID{$_}->{'deleted'}) { msg( "... and associated Plan record.\n" ) if ($PREFS->{'Debug'} > 1); msg( "Deleting from Plan: ". PrintPlanRecord($planRecord{$planID{$_}->{'id'}}) ."\n") if ($PREFS->{'Debug'}); DeletePlanRecord($socket, $planID{$_}); delete $planRecord{$planID{$_}->{'id'}}; delete $planID{$_}; } # Remove the Pilot ID from the exception cache, if present delete $exceptID{$_}; delete $pilotID{$_}; delete $dbname{$_}; delete $pilothash{$_}; } } msg( "Plan delete loop\n" ) if ($PREFS->{'Debug'} > 2); foreach (keys %planRecord) { $dlp->tickle unless (++$loop_count % 100); my ($record) = $planRecord{$_}; my ($pid) = $planRecord{$_}->{'pilotid'}; #print "Plan record: ",Dumper($record),"\n"; msg( "Plan record: " . PrintPlanRecord($planRecord{$_}) . "\n" ) if ($PREFS->{'Debug'} > 1); # In a fast sync, we might not have loaded the record yet. # This is dead code. Fast sync was never implemented, # so $slowsync is always 1. I'm leaving it here as a # hint in case someone ever gets around to # implementing fast sync. But it looks incorrect to # me: LoadPilotRecord takes an index, not an id. -ANK if (!$slowsync and defined $pid and not exists $pilotID{$pid}) { my ($precord) = LoadPilotRecord($db, $pid); #$db->getRecord($pid); if (defined $precord) { if (not defined $dbname{$pid}) { $dbname{$pid} = $control->{'defaultname'}; } $pilotID{$pid} = $precord; } } if (defined $pid and defined $pilotID{$pid} and ($dbname{$pid} ne $control->{'name'})) { msg( "Weird: Plan database $control->{'name'} claims to own Palm record $pid,\n" ); msg( "but my ID database says it is owned by $dbname{$pid}. I'll skip it.\n" ); next; } if ($record->{'deleted'}) { # At this point are seeing Palm records marked as deleted or # archived. In the case of a slow sync, deleted records may not # be seen until a later pass. # Action: If there is an associated Plan record that has not # already been deleted, delete it. msg( "Deleting Plan record.\n" ) if ($PREFS->{'Debug'} > 1); if (defined $pid and defined $pilotID{$pid} and not $pilotID{$_}->{'deleted'}) { msg( "... and associated Palm record.\n" ) if ($PREFS->{'Debug'} > 1); msg( "Deleting from Palm: " . PrintPilotRecord($pilotID{$pid}) ."\n" ) if ($PREFS->{'Debug'}); DeletePilotRecord($db, $pid); #$db->deleteRecord($pid); #delete $pilotID{$pid}; #delete $pilothash{$pid}; #delete $exceptID{$pid}; } # Remove the Pilot ID from the exception cache, if present delete $planRecord{$_}; } } } ############################################################ # ############################################################ sub loadpilotrecords { msg( "Loading pilot records:\n" ); if ($dlp->getStatus<0) { croak "Cancelled.\n"; } msg( "Synchronizing pilot called '$pilotname'\n" ) if ($PREFS->{'Debug'} > 1); if (not defined $control{$pilotname}) { msg( "Database access list for Palm has not been defined!\n\n" ); msg( "Palm '$pilotname' has been added to $controldir/control.\n" ); msg( "Please edit $controldir/control and add the names of the Plan databases\n" ); msg( "that this Palm should synchronize with.\n" ); open (C, ">>$controldir/control"); print C "$pilotname\n"; close (C); return 0; } $db = $dlp->open("DatebookDB"); my ($r, $i); $i=0; my $max = $db->getRecords(); $max ||= 1; status("Reading Palm Appointments", 0); while(defined($r = LoadPilotRecord($db,$i++))) { status("Reading Palm Appointments", int(100*$i/$max)) if ($i % (int($max/20)+1) == 0); } status("Reading Palm Appointments", 100); msg( "Done reading records\n" ) if ($PREFS->{'Debug'} > 1); $slowsync = 1; if ($slowsync) { foreach (keys %pilothash) { if (not exists $pilotID{$_}) { $pilotID{$_}->{'deleted'} = 1; } } } return 1; } ############################################################ # ############################################################ sub SendPlanCommand { my ($socket,$text) = @_; my ($len); #print "Sending |$text|\n"; while (length($text)) { $len = syswrite $socket, $text, length($text); $text = substr($text,$len); } } my ($partialReply) = ""; ############################################################ # ############################################################ sub ReadPlanReply { my ($socket) = @_; my ($reply) = ""; my ($buf); while (1) { while ($partialReply =~ /\A(.*?)(\\)?\n/m) { $reply .= $1."\n"; $partialReply = $'; if (not defined($2)) { $reply =~ s/\\\n/\n/sg; $reply =~ s/\n$//sg; if ($reply =~ /\AR/) { # Discard next; } elsif ($reply =~ /\A\?/) { # Discard msg( "Plan message: $'" ); next; } else { #print "Reply: |$reply|\n"; return $reply; } $reply = ""; } } do { sysread($socket,$buf,1024); $partialReply .= $buf; } while ($buf !~ /[^\\]\n|\A\n/); # ^^ the regexp matches if $buf contains an unescaped # newline, i.e. a newline that's either the first # character, or preceded by a non-escape character. } } ############################################################ # ############################################################ sub SyncDB { my ($db, $control) = @_; my $dbname = $control->{'dbname'}; #print "Opening database $control->{'name'}\@$control->{'host'}:$control->{'port'}.\n"; my $socket = IO::Socket::INET->new(PeerPort => $control->{'port'}, PeerAddr => $control->{'host'}, Proto => 'tcp'); if (not defined $socket) { croak "Unable to open plan socket on $control->{'host'}:$control->{'port'}\n"; } $socket->autoflush(1); my $select = IO::Select->new(); $select->add($socket); my $reply=ReadPlanReply($socket); if ($reply !~ /^!/) { croak "Unknown response from netplan: $reply\n"; } $netplanversion = $reply; # Authenticate SendPlanCommand($socket, "=sync-plan,pid=$$>\n"); SendPlanCommand($socket, "o$dbname\n"); $reply = ReadPlanReply($socket); if ($reply !~ /^otw(\d+)/) { croak "Failed to open database $control->{'name'}\@$control->{'host'}:$control->{'port'}.\n"; } $file = $1; SendPlanCommand($socket, "n$file\n"); $reply = ReadPlanReply($socket); if ($reply !~ /^n\d+\s+(\d+)/) { croak "Failed to get record count.\n"; } my $records = $1; my @id= (); SendPlanCommand($socket, "r$file 0\n"); while ($records) { $reply = ReadPlanReply($socket); if ($reply =~ /\Art\d+\s+(\d+)\s+/) { push @id, $1; #print "Got ID $1\n"; $records--; } } my ($loop_count) = (0); foreach (@id) { $dlp->tickle unless (++$loop_count % 50); SendPlanCommand($socket, "l$file $_\n"); $reply = ReadPlanReply($socket); if ($reply !~ /^lt/) { croak "Failed to lock record $_.\n"; } SendPlanCommand($socket, "r$file $_\n"); $reply = ReadPlanReply($socket); if ($reply !~ /\Art\d+\s+(\d+)\s+/s) { croak "Didn't get record I was looking for.\n"; } dorecord($db, $socket, $control, $_, $'); } doafterplan($db, $socket, $control); %planRecord = (); # Flush plan records SendPlanCommand($socket, "c$file\n"); $socket->close; } ############################################################ # ############################################################ sub readControlfile { if (! -d $controldir) { croak "Directory $controldir does not exist. It must be created before $0 is run.\n\n"; } if (! -f "$controldir/control") { open(C, ">$controldir/control") || croak "Unable to write to $controldir/control"; print C "# this file is used to control which Palms are allowed to sync, and what databases\n"; print C "# each Palm will sync with. Each line consists of whitespace-separated fields, the\n"; print C "# first one being the name (and ID) of the Palm, and subsequent fields listing\n"; print C "# all plan databases that Palm will synchronize with.\n"; print C "#\n"; print C "# For example: Foo_s_Pilot_1234 myname\@localhost group\@host.io ro:all\@localhostn"; print C "#\n"; print C "# New entries on the Palm are installed in the first database listed.\n"; print C "# Records will not exchanged between separate plan datatabses.\n"; print C "# A database may be prefixed with 'rw:' or 'ro:' to indicate read/write (the\n"; print C "# default) or read only access. If a database is read-only, any record changes\n"; print C "# on the Palm will be discarded. However, for technical reasons, you must have\n"; print C "# read/write access to the plan database itself.\n"; close(C); } open(C,"<$controldir/control"); while () { chomp; next if /^#/; my ($i,@i) = split(/\s+/, $_); my (@I); my ($first) = 1; my ($defaultname); foreach (@i) { my ($mode, $name, $host) = m/^(?:(wr|ro|rw):)?([^\@]+)(?:\@(.+))?$/; if (not defined $mode) { $mode = "rw"; } if (not defined $host) { $host = "localhost"; } if ($mode !~ /^rw$/) { croak "Access mode $mode (for Palm '$i') at line $. of $controldir/control unknown or unsupported.\n"; } if ($first) { $defaultname = $name.'@'.$host; } push @I, {mode => $mode, name => $name.'@'.$host, dbname => $name, host => $host, port => $PREFS->{'NetplanPort'}, 'read' => ($mode =~ /r/), 'write' => ($mode =~ /w/), default => $first, defaultname => $defaultname}; $first = 0; } $control{$i} = [@I]; } close(C); } ############################################################ # ############################################################ sub conduitSync { $dlp = $_[1]; $info = $_[2]; # initialize variables that may still be set from last sync (which # can happen when conduitSync is called from PilotManager). %control = (); %pilothash = (); %pilotID = (); %planID = (); %exceptID = (); %planRecord = (); %dbname = (); %sawName = (); $pilotname = $db = $slowsync = $file = $maxseed = $netplanversion = undef; readControlfile; $pilotname = $info->{'name'} . "_ " . $info->{'userID'}; $pilotname =~ s/[^A-Za-z0-9]+/_/g; foreach (@{$control{$pilotname}}) { $sawName{$_->{'name'}} = 1; } if (open (I, "<$controldir/ids.$pilotname")) { foreach () { chop; my ($id, $hash, $except, $dbname) = split(/\s+/, $_); $pilothash{$id} = $hash; $exceptID{$id} = $except; if (not defined $dbname or not length $dbname) { $dbname = $control{$pilotname}->[0]->{'name'}; } $dbname{$id} = $dbname if defined $dbname and length $dbname; #print Dumper({dbname=>$dbname{$id}}); if (not defined $sawName{$dbname}) { msg( "Warning! The ID file, $controldir/ids.$pilotname, lists a record as belonging\n" ); msg( "to database $dbname, but the control file $controldir/control does not list this\n" ); msg( "this database. If you have renamed a database, please edit $controldir/ids.$pilotname\n" ); msg( "so all references to this database match the new name.\n" ); msg( "\nIf you wish to delete all on the Palm that were originally from $dbname, then\n" ); msg( "delete the database name from the end of each record's line.\n" ); msg( "To merge the records into the default database, delete each affected line entirely.\n" ); $sawName{$dbname} = 1; } } close (I); } if (loadpilotrecords) { if (!@{$control{$pilotname}}) { msg( "No plan databases are registered for the '$pilotname' Palm. Please\n" ); msg( "edit $controldir/control and add one or more databases.\n" ); } foreach (keys %pilotID) { if (not defined $dbname{$_}) { $dbname{$_} = $control{$pilotname}->[0]->{'name'}; } } foreach (@{$control{$pilotname}}) { next if not defined $_->{'host'}; # Sigh. Autoviv problem. SyncDB($db, $_); } # Delete deleted & archived records $db->purge; # Clear modified flags, and set last sync time to now $db->resetFlags; $db->close; open (I, ">$controldir/ids.$pilotname"); foreach (keys %pilothash) { if ($dbname{$_} eq $control{$pilotname}->[0]{'name'}) { $dbname{$_}=""; } $exceptID{$_} = 0 unless (defined $exceptID{$_}); print I "$_ $pilothash{$_} $exceptID{$_} $dbname{$_}\n"; } close(I); } } ############################################################ # main ############################################################ my ($tempdlp, $tempinfo); if (@ARGV<2) { croak "Usage: $0 \n\n is where various information is stored.\nYou might wish to use " . (getpwuid($>))[7] . "/.sync-plan\n"; } $port = $ARGV[0]; $controldir = $ARGV[1]; $controldir =~ s/\/+$//; msg "Please start HotSync now.\n"; my $psocket = PDA::Pilot::openPort($port); if (!$psocket) { croak "Unable to open port $port\n"; } ($tempdlp = PDA::Pilot::accept($psocket)) || croak "Can't connect to Palm"; ($tempinfo = $tempdlp->getUserInfo) || croak "Lost connection to Palm"; conduitSync(undef, $tempdlp, $tempinfo); $dlp->close(); PDA::Pilot::close($psocket); pilot-link-0.12.5-dfsg/src/pilot-addresses.c0000644000175000017500000005072511211746356021154 0ustar rousseaurousseau/* * $Id: pilot-addresses.c,v 1.91 2009/06/04 13:32:30 desrod Exp $ * * pilot-addresses.c: Palm address transfer utility * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include #include "pi-socket.h" #include "pi-dlp.h" #include "pi-address.h" #include "pi-header.h" #include "pi-userland.h" /* These are indexes in the tabledelims array */ enum terminators { term_newline=0, term_comma=1, term_semi=2, term_tab=3 } ; char tabledelims[4] = { '\n', ',', ';', '\t' }; /* Define prototypes */ int inchar(FILE * in); int read_field(char *dest, FILE * in, size_t length); void outchar(char c, FILE * out); int write_field(FILE * out, const char *source, enum terminators more); int match_phone(char *buf, struct AddressAppInfo *aai); int read_file(FILE * in, int sd, int db, struct AddressAppInfo *aai); int write_file(FILE * out, int sd, int db, struct AddressAppInfo *aai, int human /* human-readable or CSV */); int realentry[21] = { 0, 1, 13, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20 }; char *tableheads[21] = { "Last name", /* 0 */ "First name", /* 1 */ "Title", /* 2 (real entry 13)*/ "Company", /* 3 */ "Phone1", /* 4 */ "Phone2", /* 5 */ "Phone3", /* 6 */ "Phone4", /* 7 */ "Phone5", /* 8 */ "Address", /* 9 */ "City", /* 10 */ "State", /* 11 */ "Zip Code", /* 12 */ "Country", /* 13 */ "Custom 1", /* 14 */ "Custom 2", /* 15 */ "Custom 3", /* 16 */ "Custom 4", /* 17 */ "Note", /* 18 */ "Private", /* 19 */ "Category" /* 20 */ }; int tabledelim = term_comma, augment = 0, defaultcategory = 0; /*********************************************************************** * * Function: inchar * * Summary: Turn the protected name back into the "original" * characters * * Parameters: * * Returns: Modified character, 'c' * ***********************************************************************/ int inchar(FILE * in) { int c; /* switch */ c = getc(in); if (c == '\\') { c = getc(in); switch (c) { case 'b': c = '\b'; break; case 'f': c = '\f'; break; case 'n': c = '\n'; break; case 't': c = '\t'; break; case 'r': c = '\r'; break; case 'v': c = '\v'; break; case '\\': c = '\\'; break; default: ungetc(c, in); c = '\\'; break; } } return c; } /*********************************************************************** * * Function: read_field * * Summary: Reach each field of the CSV during read_file * * Parameters: dest <-> Buffer for storing field contents * in --> Inbound filehandle * length --> Size of buffer * * Returns: 0 for end of line * 1 for , termination * 2 for ; termination * 3 for \t termination * -1 on end of file * * Note that these correspond to indexes in the tabledelims * array, and should be preserved. * ***********************************************************************/ int read_field(char *dest, FILE *in, size_t length) { int c; if (length<=1) return -1; /* reserve space for trailing NUL */ length--; do { /* Absorb whitespace */ c = getc(in); if(c == '\n') { *dest = 0; return term_newline; } } while ((c != EOF) && ((c == ' ') || (c == '\t') || (c == '\r'))); if (c == '"') { c = inchar(in); while (c != EOF) { if (c == '"') { c = inchar(in); if (c != '"') break; } *dest++ = c; if (!(--length)) break; c = inchar(in); } } else { while (c != EOF) { if ((c == '\n') || (c == tabledelims[tabledelim])) { break; } *dest++ = c; if (!(--length)) break; c = inchar(in); } } *dest++ = '\0'; /* Absorb whitespace */ while ((c != EOF) && ((c == ' ') || (c == '\t'))) c = getc(in); if (c == ',') return term_comma; else if (c == ';') return term_semi; else if (c == '\t') return term_tab; else if (c == EOF) return -1; /* No more */ else return term_newline; } /*********************************************************************** * * Function: outchar * * Summary: Protect each of the 'illegal' characters in the output * * Parameters: filehandle * * Returns: Nothing * ***********************************************************************/ void outchar(char c, FILE * out) { switch (c) { case '"': putc('"', out); putc('"', out); break; case '\b': putc('\\', out); putc('b', out); break; case '\f': putc('\\', out); putc('f', out); break; case '\n': putc('\\', out); putc('n', out); break; case '\t': putc('\\', out); putc('t', out); break; case '\r': putc('\\', out); putc('r', out); break; case '\v': putc('\\', out); putc('v', out); break; case '\\': putc('\\', out); putc('\\', out); break; default: putc(c, out); break; } } /*********************************************************************** * * Function: write_field * * Summary: Write out each field in the CSV * * Parameters: out --> output file handle * source --> NUL-terminated data to output * more --> delimiter number * * Returns: * ***********************************************************************/ int write_field(FILE * out, const char *source, enum terminators more) { putc('"', out); while (*source) { outchar(*source, out); source++; } putc('"', out); putc(tabledelims[more], out); return 0; } /*********************************************************************** * * Function: match_phone * * Summary: Find and match the 'phone' entries in 'buf' * * Parameters: * * Returns: * ***********************************************************************/ int match_phone(char *buf, struct AddressAppInfo *aai) { int i; for (i = 0; i < 8; i++) if (strncasecmp(buf, aai->phoneLabels[i], sizeof(aai->phoneLabels[0])) == 0) return i; return atoi(buf); /* 0 is default */ } /*********************************************************************** * * Function: read_file * * Summary: Open specified file and read into address records * * Parameters: filehandle * * Returns: * ***********************************************************************/ int read_file(FILE *f, int sd, int db, struct AddressAppInfo *aai) { int i = -1, l, attribute, category; char buf[0xffff]; int showPhone = -1; pi_buffer_t *record; struct Address addr; int fields = 0; /* Number of fields in this entry */ int count = 0; /* Number of entries read */ const char *progress = " Reading CSV entries, writing to Palm Address Book... "; if (!plu_quiet) { printf("%s",progress); fflush(stdout); } while (!feof(f)) { fields = 0; l = getc(f); if (feof(f) || (l<0)) { break; } if ('#' == l) { /* skip remainder of line */ while (!feof(f) && (l!='\n') && (l>=0)) { l = getc(f); } continue; } else { ungetc(l,f); } i = read_field(buf, f, sizeof(buf)); /* fprintf(stderr,"* Field=%s\n",buf); */ memset(&addr, 0, sizeof(addr)); addr.showPhone = 0; showPhone = -1; /* None specified this record */ if ((i == term_semi) && (tabledelim != term_semi)) { /* This is an augmented entry */ category = plu_findcategory(&aai->category,buf, PLU_CAT_CASE_INSENSITIVE | PLU_CAT_DEFAULT_UNFILED); i = read_field(buf, f, sizeof(buf)); if (i == term_semi) { showPhone = match_phone(buf, aai); i = read_field(buf, f, sizeof(buf)); } } else { category = defaultcategory; } if (i < 0) break; attribute = 0; for (l = 0; (i >= 0) && (l < 21); l++) { int l2 = realentry[l]; if ((l2 >= 3) && (l2 <= 7)) { if ((i != term_semi) || (tabledelim == term_semi)) { addr.phoneLabel[l2 - 3] = l2 - 3; } else { addr.phoneLabel[l2 - 3] = match_phone(buf, aai); i = read_field(buf, f, sizeof(buf)); } if (buf[0]) { addr.entry[l2] = strdup(buf); ++fields; } else { addr.entry[l2] = NULL; } } else if (19 <= l2) { if (19 == l2) { attribute = (atoi(buf) ? dlpRecAttrSecret : 0); } if (20 == l2) { category = plu_findcategory(&aai->category,buf, PLU_CAT_CASE_INSENSITIVE | PLU_CAT_DEFAULT_UNFILED); } } else { if (buf[0]) { addr.entry[l2] = strdup(buf); ++fields; } else { addr.entry[l2] = NULL; } } if (i == 0) break; i = read_field(buf, f, sizeof(buf)); } while (i > 0) { /* Too many fields in record */ i = read_field(buf, f, sizeof(buf)); } if (showPhone >= 0) { /* Find which label matches the category to display */ addr.showPhone = 0; for (i=0; i<5; ++i) { if (showPhone == addr.phoneLabel[i]) { addr.showPhone = i; break; } } } if (fields>0) { record = pi_buffer_new(0); pack_Address(&addr, record, address_v1); dlp_WriteRecord(sd, db, attribute, 0, category, (unsigned char *) record->data, record->used, 0); pi_buffer_free(record); ++count; } free_Address(&addr); if (!plu_quiet) { printf("\r%s%d",progress,count); fflush(stdout); } } if (!plu_quiet) { printf("\r%s%d\n Done.\n",progress,count); fflush(stdout); } return 0; } /*********************************************************************** * * Function: write_file * * Summary: Writes Address records in CSV format to * * Parameters: filehandle * * Returns: 0 * ***********************************************************************/ void write_record_CSV(FILE *out, const struct AddressAppInfo *aai, const struct Address *addr, const int attribute, const int category) { int j; char buffer[16]; if (augment && (category || addr->showPhone)) { write_field(out, aai->category.name[category], term_semi); write_field(out, aai->phoneLabels[addr->phoneLabel[addr->showPhone]], term_semi); } for (j = 0; j < 19; j++) { if (addr->entry[realentry[j]]) { if (augment && (j >= 4) && (j <= 8)) { write_field(out, aai->phoneLabels[addr->phoneLabel [j - 4]], term_semi); } write_field(out, addr->entry[realentry[j]], tabledelim); } else { write_field(out, "", tabledelim); } } snprintf(buffer, sizeof(buffer), "%d", (attribute & dlpRecAttrSecret) ? 1 : 0); write_field(out, buffer, tabledelim); write_field(out, aai->category.name[category], term_newline); } void write_record_human(struct AddressAppInfo *aai, struct Address *addr, const int category) { int i; printf("Category: %s\n", aai->category.name[category]); for (i = 0; i < 19; i++) { if (addr->entry[i]) { int l = i; if ((l >= entryPhone1) && (l <= entryPhone5)) { printf("%s: %s\n", aai->phoneLabels[addr->phoneLabel[l - entryPhone1]], addr->entry[i]); } else { printf("%s: %s\n", aai->labels[l], addr->entry[i]); } } } printf("\n"); } int write_file(FILE *out, int sd, int db, struct AddressAppInfo *aai, int human) { int i, j, attribute, category; struct Address addr; pi_buffer_t *buf; int count = 0; const char *progress = " Writing Palm Address Book entries to file... "; if (!human) { /* Print out the header and fields with fields intact. Note we 'ignore' the last field (Private flag) and print our own here, so we don't have to chop off the trailing comma at the end. Hacky. */ fprintf(out, "# "); for (j = 0; j < 21; j++) { write_field(out, tableheads[j], j<20 ? tabledelim : term_newline); } if (augment) { fprintf(out,"### This in an augmented (non-standard) CSV file.\n"); } } if (!plu_quiet) { printf("%s",progress); fflush(stdout); } buf = pi_buffer_new (0xffff); for (i = 0; (j = dlp_ReadRecordByIndex(sd, db, i, buf, 0, &attribute, &category)) >= 0; i++) { if (attribute & dlpRecAttrDeleted) continue; unpack_Address(&addr, buf, address_v1); if (!human) { write_record_CSV(out,aai,&addr,attribute,category); } else { write_record_human(aai,&addr,category); } ++count; if (!plu_quiet) { printf("\r%s%d",progress,count); fflush(stdout); } } pi_buffer_free (buf); if (!plu_quiet) { printf("\r%s%d\n Done.\n",progress,count); fflush(stdout); } return 0; } int main(int argc, const char *argv[]) { int c, /* switch */ db, l, sd = -1; enum { mode_none, mode_read, mode_write, mode_delete_all, mode_delete } run_mode = mode_none; const char *progname = argv[0]; char *defaultcategoryname = 0, *deletecategory = 0, *wrFilename = NULL, *rdFilename = NULL, buf[0xffff]; int writehuman = 0; pi_buffer_t *appblock; struct AddressAppInfo aai; struct PilotUser User; struct SysInfo info; poptContext po; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"delete-all", 0 , POPT_ARG_NONE, NULL, mode_delete_all, "Delete all Palm records in all categories", NULL}, {"delimiter", 't', POPT_ARG_INT, &tabledelim, 0, "Include category, use delimiter (3=tab, 2=;, 1=,)", ""}, {"delete-category", 'd', POPT_ARG_STRING, &deletecategory,'d', "Delete old Palm records in ", "category"}, {"category", 'c', POPT_ARG_STRING, &defaultcategoryname, 0, "Category to install to", "category"}, {"augment", 'a', POPT_ARG_NONE, &augment, 0, "Augment records with additional information", NULL}, {"read", 'r', POPT_ARG_STRING, &rdFilename, 'r', "Read records from and install them to Palm", "file"}, {"write", 'w', POPT_ARG_STRING, &wrFilename, 'w', "Get records from Palm and write them to ", "file"}, {"human-readable",'C', POPT_ARG_NONE, &writehuman, 0, "Write generic human-readable output instead of CSV", NULL}, POPT_TABLEEND }; const char *mode_error = " ERROR: Specify exactly one of read, write, delete or delete all.\n"; po = poptGetContext("pilot-addresses", argc, argv, options, 0); poptSetOtherOptionHelp(po,"\n\n" " Reads addresses from a file and installs on the Palm, or\n" " writes addresses from the Palm to a file.\n\n" " Provide exactly one of --read or --write.\n\n"); plu_popt_alias(po,"delall",0,"--bad-option --delete-all"); plu_popt_alias(po,"delcat",0,"--bad-option --delete-category"); plu_popt_alias(po,"install",0,"--bad-option --category"); /* Useful alias */ plu_popt_alias(po,"no-csv",0,"--human-readable"); if (argc < 2) { poptPrintUsage(po,stderr,0); return 1; } while ((c = poptGetNextOpt(po)) >= 0) { switch (c) { /* These are the mode-setters. delete-all does it through * popt hooks, since it doesn't take an argument. * * Special case is that you can mix -w and -d to write the * file and then delete a category. */ case mode_delete_all : if (run_mode != mode_none) { fprintf(stderr,"%s",mode_error); return 1; } run_mode = mode_delete_all; break; case 'r': if (run_mode != mode_none) { fprintf(stderr,"%s",mode_error); return 1; } run_mode = mode_read; break; case 'w': if ((run_mode != mode_none) && (run_mode != mode_delete)) { fprintf(stderr,"%s",mode_error); return 1; } run_mode = mode_write; break; case 'd': if ((run_mode != mode_none) && (run_mode != mode_write)) { fprintf(stderr,"%s",mode_error); return 1; } run_mode = mode_delete; break; default: fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } } if (c < -1) plu_badoption(po,c); if (mode_none == run_mode) { fprintf(stderr,"%s",mode_error); return 1; } /* The first implies that -t was given; the second that it wasn't, so use default, and the third if handles weird values. */ if ((tabledelim < 0) || (tabledelim > sizeof(tabledelim))) { fprintf(stderr," ERROR: Invalid delimiter number %d (use 0-%d).\n", tabledelim,(int)(sizeof(tabledelim))); return 1; } sd = plu_connect(); if (sd < 0) goto error; if (dlp_ReadUserInfo(sd, &User) < 0) goto error_close; if (dlp_ReadSysInfo(sd,&info) < 0) { fprintf(stderr," ERROR: Could not read Palm System Information.\n"); return -1; } if (info.romVersion > 0x05003000) { printf(" PalmOS 5.x (Garnet) and later devices are not currently supported by this\n" " tool. The data format of the AddressBook has changed. The legacy format\n" " is called \"Classic\" and PalmOS 5.x and later uses \"Extended\" databases\n" " with a different structure. Your Palm has \"Contacts\", and this tool reads\n" " the \"AddressBook\" database. (Found OS version: %x)\n\n" " Due to this change, pilot-addresses and other tools must be rewritten to\n" " compensate. Sorry about the inconvenience.\n\n", info.romVersion); /* return -1; FIXME: Need to adjust this to clealy detect OS version and rewrite */ } /* Open the AddressDB.pdb database, store access handle in db */ if (dlp_OpenDB(sd, 0, 0x80 | 0x40, "AddressDB", &db) < 0) { puts("Unable to open AddressDB"); dlp_AddSyncLogEntry(sd, "Unable to open AddressDB.\n"); goto error_close; } appblock = pi_buffer_new(0xffff); l = dlp_ReadAppBlock(sd, db, 0, 0xffff, appblock); unpack_AddressAppInfo(&aai, appblock->data, l); pi_buffer_free(appblock); if (defaultcategoryname) { defaultcategory = plu_findcategory(&aai.category,defaultcategoryname, PLU_CAT_CASE_INSENSITIVE | PLU_CAT_DEFAULT_UNFILED); } else { defaultcategory = 0; /* Unfiled */ } switch(run_mode) { FILE *f; int i; int old_quiet; case mode_none: /* impossible */ fprintf(stderr,"%s",mode_error); break; case mode_write: /* FIXME - Must test for existing file first! DD 2002/03/18 */ if (strcmp(wrFilename,"-") == 0) { f = stdout; old_quiet = plu_quiet; plu_quiet = 1; } else { f = fopen(wrFilename, "w"); } if (f == NULL) { sprintf(buf, "%s: %s", progname, wrFilename); perror(buf); goto error_close; } write_file(f, sd, db, &aai, writehuman); if (f == stdout) { plu_quiet = old_quiet; } if (deletecategory) { dlp_DeleteCategory(sd, db, plu_findcategory(&aai.category,deletecategory,PLU_CAT_CASE_INSENSITIVE | PLU_CAT_WARN_UNKNOWN)); } if (f != stdout) { fclose(f); } break; case mode_read: f = fopen(rdFilename, "r"); if (f == NULL) { fprintf(stderr, "Unable to open input file"); fprintf(stderr, " '%s' (%s)\n\n", rdFilename, strerror(errno)); fprintf(stderr, "Please make sure the file"); fprintf(stderr, "'%s' exists, and that\n", rdFilename); fprintf(stderr, "it is readable by this user"); fprintf(stderr, " before launching.\n\n"); goto error_close; } read_file(f, sd, db, &aai); fclose(f); break; case mode_delete: i = plu_findcategory (&aai.category,deletecategory,PLU_CAT_CASE_INSENSITIVE | PLU_CAT_WARN_UNKNOWN); if (i>=0) { dlp_DeleteCategory(sd, db, i); } break; case mode_delete_all: for (i = 0; i < 16; i++) if (aai.category.name[i][0]) dlp_DeleteCategory(sd, db, i); break; } /* Close the database */ dlp_CloseDB(sd, db); /* Tell the user who it is, with a different PC id. */ User.lastSyncPC = 0x00010000; User.successfulSyncDate = time(NULL); User.lastSyncDate = User.successfulSyncDate; dlp_WriteUserInfo(sd, &User); if (run_mode == mode_read) { dlp_AddSyncLogEntry(sd, "Wrote entries to Palm Address Book.\n"); } else if (run_mode == mode_write) { dlp_AddSyncLogEntry(sd, "Successfully read Address Book from Palm.\n"); } dlp_EndOfSync(sd, 0); pi_close(sd); return 0; error_close: pi_close(sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pix/0000755000175000017500000000000011333433323016465 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/src/pix/Makefile.in0000644000175000017500000003300411333433244020534 0ustar rousseaurousseau# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ target_triplet = @target@ subdir = src/pix DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/bluez.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/tcl.m4 \ $(top_srcdir)/m4/threads.m4 \ $(top_srcdir)/m4/vl_lib_readline.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/include/pi-md5.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pixdir)" DATA = $(pix_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLUEZ_CFLAGS = @BLUEZ_CFLAGS@ BLUEZ_LIBS = @BLUEZ_LIBS@ CAT_ENTRY_END = @CAT_ENTRY_END@ CAT_ENTRY_START = @CAT_ENTRY_START@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOCBOOK_ROOT = @DOCBOOK_ROOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVA = @JAVA@ JAVABASE = @JAVABASE@ JAVAC = @JAVAC@ JAVA_VERSION = @JAVA_VERSION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PIC_LIBS = @PIC_LIBS@ PILOT_LINK_MAJOR = @PILOT_LINK_MAJOR@ PILOT_LINK_MINOR = @PILOT_LINK_MINOR@ PILOT_LINK_PATCH = @PILOT_LINK_PATCH@ PILOT_LINK_VERS = @PILOT_LINK_VERS@ PISOCK_AGE = @PISOCK_AGE@ PISOCK_CURRENT = @PISOCK_CURRENT@ PISOCK_REVISION = @PISOCK_REVISION@ PISYNC_AGE = @PISYNC_AGE@ PISYNC_CURRENT = @PISYNC_CURRENT@ PISYNC_REVISION = @PISYNC_REVISION@ PKG_CONFIG = @PKG_CONFIG@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ POPT_INCLUDES = @POPT_INCLUDES@ POPT_LIBS = @POPT_LIBS@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_H = @PYTHON_H@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RL_LIBS = @RL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ XML_CATALOG = @XML_CATALOG@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ builddir = @builddir@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ usb_libs = @usb_libs@ PIX = \ b1.gif \ b2.gif \ b3.gif \ b4.gif \ b5.gif \ b6.gif \ b7.gif \ case.gif \ casemask.xbm \ case.xbm @ENABLE_CONDUITS_TRUE@pixdir = $(datadir)/pilot-link/pix @ENABLE_CONDUITS_TRUE@pix_DATA = $(PIX) EXTRA_DIST = $(PIX) all: all-am .SUFFIXES: $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/pix/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/pix/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pixDATA: $(pix_DATA) @$(NORMAL_INSTALL) test -z "$(pixdir)" || $(MKDIR_P) "$(DESTDIR)$(pixdir)" @list='$(pix_DATA)'; test -n "$(pixdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pixdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pixdir)" || exit $$?; \ done uninstall-pixDATA: @$(NORMAL_UNINSTALL) @list='$(pix_DATA)'; test -n "$(pixdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(pixdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pixdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(DATA) installdirs: for dir in "$(DESTDIR)$(pixdir)"; 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-pixDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pixDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pixDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-pixDATA # 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: pilot-link-0.12.5-dfsg/src/pix/case.gif0000644000175000017500000011112307176416226020103 0ustar rousseaurousseauGIF89aŬQ÷$†D$F1LNR”’ŒLjLÄÊÌ"v44B<2,4V4\†dlnlœœ46,T^\4BP|‚‚ÜĉìLv[2<´²´Œ’…œ˘” lvt\^L4JTTjlLR\ÜÚÜ$%$4VT|ŽD†Zĵşôöü 4J,$>$:<N,lv|$ŽT”žDNTdjd4>TL^n\v\ÄÂÄ$FDÌÖĠ.DFDĴìĉäDRYŒŽŒLl~„”šžLZKDf4„Œ”$Œ“—TZ_dfl$V4|~tlŽ|T‚lDJDdŽ|¤ĥĴLfD.0DnRl~t<Š\,Läâä<‚T„†<ŽL$>3DfN4VD46<œ˘¤$FT$LZl\j\d~|Ĵĥĵ,6LĵşĵdfttŽ|LfTDZL$6Lüúüt~ŒĵĈÄLRL”–”&$4F44FO´ĥ´ 4NXLVdÜŜÜ$>DlzdnlLblÄĈÁĴ²´ìêìDVT<,Tblœž ,>A,FK ÌÎÏ&!\nldnt!ŝthe GIMP was here,ŬQŝû1a‚IM|BxĦC‡Ĝ  ‘‰E,’ËÈE6@xq$ı‘&,¸$FˆŸĜ0À$Ĉğìòh‚';ôd1'9;3|br´ž™œL¸éwÑI?}ú™pÂD+“İ:™ĵœjħ,ɋb~íç¤^?7ŸŜÊ­ÇÉ­[Ğk·ö‰[֍En™Xeĉĉ™aUŒ¤™“Í NfĜµ2dŒw%Ġ|’ €ˆ)Š‘Í³g=ħĥöœL†• îÊpkȓWŸġcSŻşçßŝı"§z#j*ÔiĞv›ÉTĤÏh ü[TÊtƒħ_íî`¸QÏTġ ˜HŭĵWÏNñL|Šñ O òÀó†ôԊr81D=r\ÁĦˆÖs…+'ŠˆŽr Ó"=°b"":qbĥ&Ĉ˘+ †F<Ĉˆ˘+(^ac‡ş‘)¸‘˘+¤XK"µœ”6Ò :ú$’H ) AşD NúAPç‰ĵAg ठ=.˘˘‡o¤ Ħèh˜Â~zèb=CxÈád˘¨‡:ħ":)ôò†`ŠÎ;< C2–ĤpİŸ¤ è!Ž<ŝ<菊é EĞĵjìŞ† ½ŝşk'żŞñĞqš1ħ>ʲİpœ ÈY8ġ c†8„Ş:rc1)£Ĥ({+ÏÁG  ¸#'°Ĥ>fè Ľ˜²)PœÊè¨ÙóÁ.Lĝ†b˜ĦfĞècµĠfÀ€µĠ‚Ĥp3ş¸,NĜ++û­>-·luQĞì²Êħ>,£‰fÊ6§,ġŝÊJóm¸ÊĤj4‹ħ+7ñGàj„ëŞËròĴĊ.§İ2Âb-çÍq>K 5n~ĤœĞñµµş|ĥ²Ê&ĞËÈv+Ë7É›A1ĥ:ŭµ5c,1iŝNòù€>cÀĵ˘bNĴ ƒ#ìm!èk³ĠÚ\íw0ÄËĤĵİ{ğj9@„íw³p4k„î=ÄĜ|ó üï6ÓqÍÔD!ÎçĦCÌŞċVÙ×Ĵ×İïm–cSÊĵ5²5½Îap¨ßèât³ĴnenS›üÖ25ħouTÙÍŜE@·­Ìr$KÔV…7ĞÁ€}ÙZ 8†0I@1Qp6`Ğ·iïmŝj2[ŻPĤĤfùíwFŭ¨µ6qħ.xr‹é'5àİ ÙçFo­o‚; Òd•İM)K_–2²aq„İ£1Τ&9,M1K—ĤdEú³ÌÖ&4}‹e裤÷6qMMŒ‚ŝ˘ 5eı (Ӛšn€À…äċÎ×,ÖµMúH ċ¤ĥƒA.oq‚˙âä?9‘S‹` ÓDı×ÙÌv ,ċíö5=Vñfje#†-*m-[Ŝà öÁŽgĤ._§,ÒÁ†krfñĥ:ŠÁrz LßÉH™Ì”İ*}ppBá\6}ÔC1$ŝsFŜˆI½‘Rlë™Ëä—À‘İLvû³cIö·‡ñrŒ T.aDHÎMÀK ċ˄öŻ›EdfŜĈ3ñU.ЍĥŜ%6Ëf7hÁĜdIéS| ĦíÈù;ŠÑ-œ(ĠĊ¸w­½kd‰À'ûĜ—MR.~ ^ĊYĝ Q€Èè@˙ĊëLâ¸ÇUÍiNeñ‹g铃vJŒĴ2eâ"†”`NwŠ o‹ çV0’­r\Êܚ2Šs­”#†›é2XĤŻeÊÄc8Iö:ʽÁr[Ŝ°e†|´‘§0Ú“ĉÀ5­Ó+Œ@RàÈŞpñ‚ŝIQöÓŞÊç0@:ÔpTq‹ë-³>4+r£‹Â!Ëı7´…mlC‰9Ö1xvt Ó·½“‘Ì™Vû£wö7gR݆CYäâä2,ò푋ôì_SN6Z‘•XKShż{HĠ ô¨ S Ê8§HĜ].‹òÓÛçñ-èBˆÄġÔ[Á†Q# çƒÒhÉElŒ´Òègaİ`+^:ĉçĴéK4Ŝ,cÄ1ÊD <ƒ !­™dYÓb| Á9ŠÀ |ĸŝÖà²&ĝ!XĴĜ,ÎÁ‡@X:ŽÁ‹”q÷àOĠ,°ùU0ĝPhéĤI|€=Ĥ*ìà+àݨ…²wd)ˆB@;ĝHV^Œ&‹ŬHzPşEpż1q%W(Qî%`‘EŻì́|`pĵn ígI&Ê8ŞVÀV‡gŭVE’Áġm³b5ĝq[¨Â8EÎQ ›Éâ~èôŭñ[œĝ€ôĦ„âʸǁpr£,Ŭa FŠ´!eĉ9$ĵtŸ{3Û_œêkŻykŜġ¨úZĝ]oğŸhOƒèaˆ‰ö…¤½cÌŝäĊ>îáñ’ß#F÷ÔÔ½}ÁġœÜËìÁ 7îMÜû]ÖtI–vpÀÇ9䭃s@"eÈCžùĦtšŽ¸/pp%DĠ‡r˲v 8‡ŝñ1£ yˆAĝÁàU#é‘àC'˜.^Xܛۤĵ¨‘Q˘ëNH l iZ8ì—~ŭ$2݈6Ú]OeûúÉɽ‘ŭ$ċ,Ĉ#öĊĞ9“Îŝ.ĦˆĊȣ˃²?}‰²Ìj(Dƒ‰a61X¨A:½N Ï#eZÈCˆQxÇ@…ÂÈ`hp#ĥˆÚÀeùÛífżú9ĉŝpn(á˙^¸DÍi>lÖn”W½f×vğZ‹“â'Üézëx’-[•z›qê=ċÇQüR;ÛS@.“4÷ÄZ{D ÖJQä2*ô:é#t÷[)ƒa‘°p ŻD2Ä òB}À#tÜ çPz·&s&3 ސétµvá7ç3âàwn\'äEHRġHc@‘·B͢*#%Yßä-‘çK;óE3Vk ×FŒ‡55Rïµ6Z6…&q@°Zb9+†…q6ÓA•4C‡ :£Â7 vġ“2ÛĈ$‡2éĥBŝ'ÖüÀġö}ŞÀ3üoşo™…u~0G@ ĤCK^ÄY/N¤•+xóTÂf>x~<ÓT„e­•I7ƒ5–„1˘SI6q2”r”5żö_c…¸t…5Ĥ*VF^]ĥ2†'=­t;Y“jN³G <[i’B÷ü@Ÿó:Ä5ëp‘ó@Rm€nó\jġ:@0eâÀŽç jÒàYĠpx3wÀ Z€ T@p„i"*YT5l²L•SÛ#U|³_NäġHcHíċ*ıĈ7ñPFòòrİ“IuD˘E?F?y£<°ZT`pĠJ§”9Eĥŝ/B§pPtF2ĵPv|€7CˆuìÀƒm oSçvÂċ]¸ejB”ĥp0l×,ìx_ܐnè–m#EV×-*dIß3Í&?D`6s¨7cTqÊZŝ÷;eR5—s̖2ÂÖeñÒA[s5„K÷ċa Ô@ÇĈZ U_*³7´;ßXé€z,ó Ĝ èVó³EZGfU0óÈY÷6 H z0w 2÷Pa07S°l"ĝ°d™ópd” Är…˘T&-#úU–*·Bû•‚F2Yj3v0xô^š´HÖ˘]@gX¤BßòžT:ŝgIYS]ñzÀ/*™2@mŠ”:—$˜b—ój–×2ܰ}j 5%wEµˆd‡É<:f3Ğĥ/ñ"<,„bĉ6Vt091%§PzdCA°t;F&6‰yD^INF–ĵ¸5żD  5 WAôp–£RèSM *ܒ>{ĠH $*2‡äIù;V:`›™sE1M"y•XRSž££ ıG3p¤#bĵ4E|Ė—Ä›€C8—R5˜kCŸj'ôS›Î%q>46ˆ“L s`AäY†ġ74WMëôŝ³³@Ċ=ä-&jĤ ]„6FԖgZìҒ$ÎàH ö´-3·9eaSžµ96ޤ]4U1"s33V $'Żä?¸´bŽç¤Ġµ5_˜—`#˜gAXƒIġEƒôp}Nı†c”£,Vĉ£T¤7XyÒ#JŠ Ġ"P€#HWÓ ,5T&Tİ“ĈAÏ 8Öz_äElt2#³;,óœú@â@k%;*·AċÙĤ›ž$cKDKy÷Ż`ċ0+ô A”&Ÿ³9'C%Ş<ë“7{“4ú°;½FĊF3†Qŭ1C0sèI3•—9˘Ġò JU-3ÖJ:'²;%ŝ?ÌD/· XS4kÂ/ÉfQ0Â,-S5~B-ùcj£‰….72,£r.À0@!ċµ.W™ŜZ1$ƒFÊÉaë-gâ­ ·&_’2”>ê5í† H@H„A„Ty(ë@bƒc˘N$D 3Šá*›1=`›wC ÜŞ4&ı*Ó ).´P é".Q ½‚s! Q+¸zà z -…+•Ğ.€ [ıZ@ PıéòşŻ{ğ•û+ÀÂÂÀ2ĵW aëKèÂşžËşjĵž›ş˘ûĞA¸ŝ+ĵ ĵ·Ë<Žëıžk½Í;GŽĞşŞò,À[ıB² ëÀJžr Ċĝ6·6*#[fyP0ô7ûàı¸˜. ?Z°À[àPŒ c·ĴZ°°: ÁY Ĵ  ÒğÀ€$ĵÀ¸`Áĉ[ ?0  ĵÀ P )|ÁĵŒÁ(ĴÁ[` |[ĵ÷p%,ÄŝPZ`Ä`Äê Á5ŒÁ °€Â(œÁ\Â\M€ (Œ z€÷R,ÁLĦË,œšpĥ%J6E !@ &ĉŠĦw܆ъĦŝ‹Dċ' Pŝpê ˙[à˙€` ?€|Ä˙/È/@˙ ŠĴ˙+pa`Ê À ¨Ĵw°ĤĴ Ü0˳Œ ˙àÜ˙À ép˜pÊw€Êa0ÌŞÊĊÌ ¤ĵéÀ˙|Ä˜Í ÷àYG|ÄêÉ ŝàĵ€°È[ ”\ɋŒ˙` Ĝ äÜ[@MÈt×LÊıŞ@Êa°ùüŭĵÌŝÀĥH@t@xżÇZ9çJ§D[˘Ú <àaOP@°ÂÒ{U Ħ‹ UàşOÁ´ ŝÁU`LĈïnlU0z`ŠSÒ.`! ïPOàӚ ò @Àoˆ.àò‚– *d'ˆb'°"Ġ’b'‚)ŜÛş"… Fb Ù@ O ¸ï ğRF 7`…à֍PQk'<…3Vŭá(P ˜B¤‚)„\ ġ¸U`bfpz-Sžxc6YS)ĵf¸Dm…M.ûL&ïÁ.°!Ŭ”zàĠÙ ” ”PĤ@hM Ù°ÒĤ O@ fm” F`<Ôà $MÒ,ÍÒUŝÀĈÒÛÜÙlŬÍŬÜlŬÁ@Ĝ€ âí Ĝ€ ĜŬŬĜßŬëŜĜPč FŬFPßßŬê-Ŝ\ŜÖ Œ 2PŜíŬ2à—à ŝ ˙ M2 áÍŜÁ ~Ŝ:Ñ  òÙeà#& —·é7­ÒÄÇ9}çdahŻ $TLŒ 2Ûìŭ/ ï`Ŝ@ŜĜà2ßà , ܸP´ßíM tŬSäMò VŜt°Pĉ]@n Ĝ  ˆ@ä­ˆ  g Êp ë]ŜsNçïí ?Ŝĉ—  ŝ€âŬ Ž b~ ˆp ƒî ˆà — ĈbŜ€ŜŠ^Ŝˆpĉï]Ŝ:PçGnNçè} ò=éŽ Ĥ` ”“€ àr0tÌ\ÀHeĝ·$û$5á2;ÏHêş=ÜFp  Ĝ†^ˆ^Š>è}.çÄèÌ.çŸì†.爎 Ê>ìÒ~èĜêÄNíÉ^é— ‡Nè€Ŝ~Ž •NîÛè>çrîé„nìÎèèìí½í„Îèë êíĉè}Ŝíŭïëíï .éŸèÀÎÖĤ:ĴRSµ6 Í(ġl°¤_#i6͓UF ”ÀÓv0ò$_ŝò&ò(Ÿò*żò,ßò.˙ò0ó+ż . gšÂIS?+‹˜óRRŒ:ç­hûH8vWŻĜÔoí 2˙ôPġR?ġTġ„n  wmDÀJR²Dt°Ç$e>]֗ÛÉrçJğmM N_ġr?÷t_÷vá4ğ2=3&‹žT¨4i2_ ÈH ´NŬš ÉM`÷ù’?ù&/—` ÀĠ3šŠ`¸…@0ö5÷pĤċOç&І-ġ°İ(àñUp ”û²?ûOoè”` X A-[h›I§ÖeÁˆ(†˜ÄK t;ÀÓ ‡ÒĤŝp ÉMûÒ?ŭÔ?òäŝ`ápÔAÔO3ôL‚Ì ´¨Ï"1b Íû!…+áLAPgGċJ–-]„SĉLš5mŜęóe4D”NĵI!ob8 &Η!½­Gž^$-)?AJ £a]m hyK éTì"ĞâZ´·Ĵƒµß0ˆŠ§Bި°–Ò‡:qĜb닆ħ*rT„ëч èqĠ+S›3Ï⍇G3cëĊ(†*_ ݍĴêµH Òtıϔwšĝbuç×òċ‹:Ó§¨nbÄ êèêˆ Í+꤈ Ló¤@ÇJ°1ûy÷qÂfHK­Wq ÍG?{ç4#…(@^ò%\ĊJٚŝ>‚¤ Ĝh‚áŜ7Á™ĝ"Ĥ° Rà‚ëe@˘ÎRžŜP‘Šn¨‚˘½$pà;|!A Ö%ñëVz;t|ï#>ëu>²ğ‡è0˘CxŒ'Ñ`ÉM"İG#L‘!Vñ%(ë–%…şt$oĜıˆ.´Rš!Db/‚>›ÄF!RSˆ+Á=ĝŠw\ 6.xKôâ @HAx:çŸûY䀍ènÄñ\EJĦTêñŻ'ĆÁL+È#ó)żdD4ĊšÍ×°“€Eì!QˆÀÛ\–ÚL{F# IÍ#XR˘Ğ‘Šä¸Û$~2bj•ĴÍ+ ßXi›Š@¸R.\úRÄĦLM•‡P4ˆk EiÌGĊQˆid™§Z£ ?Rħz £–06–ÊT´İmŸàÊŭ@;Ċ䆁S ´ ŝ›7Pe…ÁN×8ò†+ à ġ\+[‘Ĥƒà>ÙaÖΌ‡ ½ài×R$µžjI\IF"Ŝp„?4Oħϋ6ş3D•xj¨1Pg yTĥ—AĠëT dŠËXġJ@àž§UÒ%qÄs^ĴAĥ"¨@,·Á‹Ż˜µĈê£b{Ç,‘ëĵmQ˘_J€To‹‹ˆñ* áÁŠ)ÀŻĜë?ÔıA: ’dĵ!2¸ĉxUGeœÀħ½à`ĊŜ 4Ŝ°]İ.€&Òµ­ydY4˘ÈHÌ@ eĝb V/TË´?"ÉĴĞQ@2š@fĥÓ)S6B•ŝ{Ù  xÂŽ b¤Ġê –ĝÒk?ĉEŞ/”)@äA'a?­0+!™:я7d£ĤċñÙĥ…AѤy2HJCˆEĦeı0#­Ş ş :’*ì8Ë%£%ĤŽĵ£şİ]6’/~TşÒH“W XeÉ3è†E û×Úmòh#ÌŝĦ5żÛ Äu›†­ ™çҚXI?*ĤtĊ; ƒĵ-ҍߓ’„h %ó* €V„yĉU­>Z.Ž$ (@ȇ’Îc›ĞĝĴxħjÄds]4rm"Ù=ˆYà_#\Ù&+g€ÂÁŝh:+–n ¨ ĜL§A[ĉ,t¸Â3GĜıK?e4'(ïšÏY¨Aɓ§Ĵì!ŒG¤š1P5_Ŝ0”Ñ ; \`Üç}d}Ġ6Ï8ŜA¤ÔG:/ñàX$‹+Ä"C;{ÜĠpù‰ş.ŭ뎐!ûNd°-›ôŞWŭÑŻ~Nt!$"YÇm>+ċŜç ħÊí$DB$ĞôŽÙĈì %ePú)Í! jVAêS•²1ż˜"žÛġ+R¸xšŜL*”^\èÄwsÇž@E¸Ëj ÁàcÇсšËJ·ƒ³ştí‚Lè( H‰üċÊĦŝfhÄ;xÔxYŬƒ”‡z-Ĵ]~ï]ñ¤ÂŭcŞIQ"x@Í?ĵġfÂĈfNp$qԅ÷C‘M˘G+]?m)<`eyÊÇĈ…Ìjgğ|Qó˙H!ìşÒËʑô?ú(–2;êQ‹° ˙VDœBP‚ñċ7§:Ji„KİQRٙѵ(HèÙMaĈ°ôS½1@‚Q­ ’‡û5ïX Nˆœ‘ƒ×( ™Q%‰KÀ†Ù™7¨ċñżë@2ñ…T@„pĉÂBı%Š ¨ù ̉€QQ‘è> +ÜÙ ôxƒp¨&ğÁ ÙŝĠú ÉS˘–sĦ˜ÀPƒay‡!şŜ`™é-Žè…H„FÂ€ĞB ’ĝ‰1…áı­À(Û¨ŠÀıœ‡8ˆP gɔ†QŒéŸp­7dµ8<lÀ%Çzƒoš0By0Üı+%[—"ê èÀ.k33ħÏ@sÄñQĜi™ĴȍŠÓhZ43DxR2ù§T˘‘ĵYˆ¨”iÄTÄ ĊِXŠ€ Žƒà¨AĴ…Pr1:ݰ·ĞúıĜ˜³tH€Ċ£Bb„˜:^ˆ‚;4†x°Ù ?–àŒ”aKˆıI#ó00™:G Aeŝ†p(ğ‚û“6ˍ?b—ğx1ÚqJ‘ĠàÑkêÇ A™L†ĉ[7ħ-îÙ îħEbхj1eáޏ‚¤ÏÜÍ´Ï(ħŸA Ŭ;BŠĦĥ µiĈBŜ€ƒzPʳĴN¸_˜„p¸ŠÊH“y`—œ›â ıf ·~ ħùżö´Œ€‹¸Nˆ_ᛪœŽ–z56Š(z)Ka = ĊŒHy‚oÙ ĴûŽŞ+`:vq&éĦѳŽ܈ì$›* QÂÄ[yŽx šŻAа0"˘·!Ğ8àÙ:Z£‘PŞGà0ŝ Sĝ̝\êŒ %†˘ż|É›Û Ìñíä›îŒÈˆÉ§#.²RÖÙ#]â 7°)Á£à˜CÚ5ß+ ‰@ ìa'ßÀÍ'lÓµ¸˜\qK;ħ?˙XŠG}$5Àñ+“s/SÄGSl(ÔĥP6Ÿ˜/ l˘ħ­h:£İ¨Ž`‹‘žLŠD(‰pƒ*íԚPn1,Çù˘6Žh³Öş% Š”ë¨8Ż ïŞjâÔZU H|K¨( h„B&9‘>˜O̜:ÉËm;5ߐ)zBuVˆž Ip@éŠıŽQƒƒbıš4ò?yÛŝ‚Ùhş~˜#(€tM H,°dH*¤p£Ĝƒ ,D2U˘+`3ĴèWH”´"X´ˆ”¸àğ¨¨8Ĵˆ‘ œ2Z Wè‡êĠëE™#HÏè„'\°ôœÒ $u@Fİ‘*i08HmP/!˘ß™H·rô2Ät #óäŠ|S2Âz\ż–œÁ'Xž–‰ñë–èĦĞ’ˆŒMĞ @½ 9ñŝ é²%"Z›&a`މZy=\ˆŜ£Šı™&€(HŠ9!A:ĠĦÚËùDé0,† X›£ê9Ŭa#àŠ×a‘—|}7'ÎĦ¨X,ËħL,•Dŭ#]:JĴ¸Ÿ@£ˆiMpa>á;m¤›ħ€—(/Ĥ $ €Aì™P?Á„`‘ŽÌCÛşÌˆé•D3ƒ2şÜTJàÀO^‰/PSċ;ĵjĤ "µĞ7“—¨)Ò“Y‰-S ]]ĥƒÂìŒô&• £a+0–MÜ5Ħ“cɍ‹8şĦ¸ĈZVĤĉ• D]€ŝQżÛÜ3Ìŝ›dˆRĜÔ95Sއw0e˜f]N7Ĥİ€üÀ.|)Œıħ,3`‘QiÌ@ÂÚĦŽ"‘Żau6‰Ämg;° uKSXŭ ³Ĵ@&ìÉàèÖ³ğO‚o żlƒ^àßĊ!oİyh7żŞByp–‘yĠ„ĴŬ( ‡>=8èO&Çpp…ݍ0RۋÑ ŝ‰ÒÔ0F‘–.iS i‘†‹[Á°óÉ˙ 0 ‘†™Ì‡!(AĦ•žìĦ“%R—¸ܜÄ~ëÀèŽá9:£àŸᑌ‚1 =Ïa4  ½Gx4UÛéÒŭXÓvœ $ÚS`Š›`™äQÛRfáPìixìÏ0…Khjn‚{pàp= DğÂ,9­Ŭç%{Ŝ™"}Êë~@J@„WÜ[ġ– ˆ„y£uRŠ'ƒ³ïŽŬ@ŝA;ìñ wˆÖ‡phJàQŬÖ$ ĝ398“J¨İéÀh_Şñ£ğ`˜hB§pŒŞ†O]™ˆ†% ġĴP(Ħ‰ù“è[{ğ0xK¸ċ+éZYšpxxˆˆˆ)áùo8U¨.üÌôĠdÀˆB#@7Çbl°IĥAGŒ S†; HgCÀ8!xTˆĵá`%àùŠgˆ’Sd”·.€ċpĴz@5LÏıPŠ‘hq/RY/UÙ5ƒrƒ‚gèŒÎD„ÄvŞ[1?;5U—ˆ}sè‡ùò`Z¤‡Ŝò%p‡)5ôvŜ‚µišnóUŝùë8p pi¨ħÓ5Ú×5+ug“0èÄîé^xşŒ˜ şĞ % q&C[7@VêˆGh„D‘‡Cöa·£aŠx!ó0­”‘ÄgTcwŠ›&1’A¤‚e?áTH˜F †‰tİЉx­½<Ħd0ÖË>r@*eĈ҅ċVWݽV2{‡ÑSğ.°Âüät¸…DYeĝ°·î€/xQĈxv޵y|xèĦ”uĊ .üÒ¨é‡Nx“Àyú}wĉxƒbyÉ—YŝXˆêZ 5[ßt‘T1½)7äÄÎÙ·7…ŝ8Í?:8ȟàÚË.ĤrŝŠW zQ:z˜F“ ÄÖĤM˜éèğxÉ)Ìħ Ü(òSI'’*~4²}Oüëġ1ĥ”óŭžKÀé!ÂP{°ĞPĦÖ?¨aÈDx ۏÄ7p ĝ&V|…P]ŸÙ üFÉq*D1k/˜ÈDy‡O×|n™òÁ5èÄ „C }Ä"3Ž8q<\ ĈL]ù"ˆ3£O a !–‚Ê0]9ËTĥKìĴió&Μ:wòìéó' B‡ĉìàËԂ7É\yPMď u1Ì(Žc½Š@ˆ‰ƒŝÁ1J3âLꋀ1ÄhÇħñFĜ;DˆÒ­k÷.Ŝĵ?;DCš E' )òy5³°B³c# ›XñbQ™ÌŽ™3WNôĉ 'sġ’.mút^£Ĥ…KT¨i„şÂ^…!N_ċ² UŒrĞZµ·z]hü²It6Ì<1U  êèÒ§SÇÖa%{ġ€ÈK1HĈŞb9.&ĉxÄoo4kÖÌĝŽÂ;ż1ġî6êú÷ó'ÚD%áôò†jü& —ÙÄd@ -$YY 1Tže)ƒÎfóD3ġ7"‰%ځ 6áX’L @QCe-ĤOˆ1EŝZd{j9uUÄèRœaêSŸù™¸$“¨Ñ!ƒ)Ĥ|öÎVcAYf8e\fŒĦW‰9eB%X&1@¤ċ™)Fà×$œqŜ…âjÚQé]H ÉCU5H‘EóFq xĠÑp|†ĉ‰ô҈)ĜŒ&'•öô_”½$£G!aVeÜx |ʃU6Ä–4¨’Z Qdaž! µÚZGħÖ˘ h÷F| Y¨K j ÄUƒ6”,Fc6t\UâÈĤ)—Lz+ĥrÒ RSĤÇĠemDŒŒİŠ£Ĉƒò”ìeÍ&RCfè"/Gğ½Á%¸dğoœòÄġĵĜŝ¸ĈĊË.WWEñ óÖVĤ‚É4•aï%N}ïˆÈ/Ç%"R@# è"ĦS™EÜĞò ú%„ġVHâ 1U^5ˆŽ£áP‚­ûÌ_6´€|ħ)[qä•>ĊlDoŒQjÌò™ìUXiĜĵ)äüŽ/üüµ~ĝòŽ)ġèDŜ]%Î1VœU8W$²‰=KUĊ]ñàlÁ™ä¨%Fàr-Ĝ…—ĉË%„ƒ‚<ĴmUş™,–è¤À2¸Ġk Ĉ7–aÂjɐ ɜ„=z^Mĝò„ġô"O!è@„pĊé:€<&óyÒɆñ@Lj§Ö)ÔGŝ áĴKO”/FDùĈÙ JˆhçQò<è‚aeu>no#— Ôĸ% LJN?˙PbSro/OÑAÛĤhèV=D+•ÎÚf>T9£€İG"` adƒ~ Ê˘Ña<` bƒíNf à8*â‚^ÀM,ë›bâ]èC`{6h€ÂÑp/Şà I5á@›Ĝ$%2‘‰bëá}_@ ˘›¨Ċ-Fƒ—èâ³XĊŝ@‹_ˆĈ΁+!Uĵâ›àĈ/qSœbAħÄ)nÑe$"â:€Kx1´@\4|˜Ċ,&ŝr‹˘0Ċĥp”ˆ£XU2ıb„*•ˆ˜ëŠ  b‡œê# 2‰€À7$ƒ‚…0›H‹%ÎR–´db-ı¨ËYžñ–şÜâk)Ì&öò—ĊDc.miH3Ĉ—fLĉ2}éË\Ró—8¤–AĤ  TİÂR"b†DáZñßÚ…·gİ$>/â’ÁƒFTáÀĊ˙Ĉ?|aVŒFƒĈ/üĦM8(B]gZlÁuŭ_äĜ„/4A’8è%zQ_üÁˆ$I9^˘  c):ÑÂu½Ä!ż`-Ä}—İµy‰+úp–rä¨/(şQ×ñ…ŝ XâQ!úŝtĤÖ² J :âŠ2À… ‘ K˜Ħ9‰8zPifm@ĝ ġ)!£s IBÄmÀÀ Qp‚Ì#ñMĝƒ\ĝéPÁúp˘KM$-d Inᐪ/°şĊNöIOÒ¨ëS„&6Á˜Ĵ/$ Dı84´ĤUéF/úÓ{¨ö˘BD"l[{na …AċxĊ‰ĉ³´ċ! lˆ¸Ĝ)/ñ!'ĵġ*AJ•ä"üNİ̳ú´,"i2MjˆBĜr„l8ŻyĊĞ^ġš·½è=/|Íğ÷ĥ—é½/{×+_üĈ7żŝïŻû‹ß‹·"È{ŭ›^ŭŝ·Áî…oçû_°—W`F'×#5q½ŒrWqƒ ǐĵ§Bİ*SòA•  ÎÓ_‰ !ş´‹Ĝ€@ÂHĊ&ċŠ>Mä8K:¤âtxÁ ŝĦ:t¤LŜB"Éä%RuÊÇl"#™e:ĝ‰KDÄ ĉhˆÙ|1 Ž9ÊÄ 09˘Uœê]JE /1Ê[Ä-œSF,Vħz0‚„a €ıhm–Œ·¤äCIDĉ’I“Ç…ÎŭŽ\aŠ*`AR2àh‰ Imkƒ‹FùZI€Ġ(ÂO0°Ħ e$EĜŝ €­o}ë!˘H­î56ž£ŒKTA֗ƒMħ!D ÛÖĝĥ"^]€aÏqŻî­mZü\? ÀuPkpSÀ¤ƒÛ­BQôëVğŠx·ĞŒ!Ò[ˆÊÇ2Á”S&eхX…T1”j-ppĞ+XŻzĴНTáH"àŞ J¤‘:‚ĊQ ˜‚˘PFĊMÁ€I`cˆ@š@`(Cħ/0ÂQ_ $2WLbMۄÒB˘Xâ ~ÎϜáV”âfı[Ùŝ!Ôö„À š@\GÖ°M$.äÈÄ£FCŻ,ò@!Šˆ-êÍ%”AъMÊ`ŝı/‚Iaµ ħVğmjD-ĠÊx‡Ô‹#”!£e0Â"JŽeȀÊȆĴ)@2HŬáÍ/}ÉÁ†×˜ &pym_ß×^ĵ²/í,ûŜ³·ĵö]Żï* ݈5¸ƒñrÇ=£N…è€a4Ħ H¤D!~J(.ò`<Ğ Ĥ ômȜŽĈL´Ž“˜zyċş;€ìè#4!àĈ† üÙA $Á? ĊAÜ)C@é(…=$½ÈA<<^m`2$ƒ<@8t 0°F2ŝT ”`` Ş +T`2„ RC+Ħ(Ċ Ę×'8İÀƒ=€`2`A <€&ĜC&ĜZ`=Ì $‚Ĥ½A"Ĝd‡ä %H 6ĵƒPùŸ ,”Á@8´ ¨B4ĝ$” è@Ĵedƒ€$C`DFP˙Ï xREĵƒßPF=0DĉÄ BD.Ì Ôƒ/èŠÄÁ=L=ƒ|ĈI2 qa)"Q04hĞEVĞ—QÈ@H˘ˆ)†ßĊZÀùù‚ ÀñkhÉ,‚*\Â_ŠÀy-B(4 èoĤVÂTlŻċâ!ÁVżĉ˘Ô% ½ábÑÛ*–Ŭc‘­ĠZdej’à‡2²Ú½íĞ€Ôc‰ĝäÂ^Ħ>AqÊ&ĊZg)Ô…d|ş†îk„^ԃÒhbŬ­Á(ĝŬĤאĝB= TCzÉ^5ü"9pa#4B2<á;¸\IäYĈéF9ħ TX|g—ċYÀ€çŝŞ’g„6,@¤.œ—=ĵ€ ĵ@ Â"ÄA*`Ÿ!(Bl€ïC /kÙ¨[ÀFj’f„žè2ŝZÛRìoâǨâî]°=Ĵöra|bÁ–íÂ=$"Ü-úB(‚µlC*B*ÄW8`À&‚(œÁ>˜€(ĝ?ĵÀìùCll6˜B/˜A`ôŽ:ħJX ħ¨ûEĵ„l˜Z¨èIç"ì„ƒ2˜)ëħ8@ÀÓ*`*H£TÁ ĞBVœW*ˆMʕA 0 GĤœbqĝġíF1`ΛĊV,ŠŞ‚ŜC%}hüm˘&#~Têŝ‡žïÄrqNÔE]ÂĈ4-,Àbá.ËĥĴ'´À˜—°0XA4d@#0ĝ6àù)…+¸È¸ÈL‚Ĝș`W`Wä‰"£eĊPeĝJ8ĈÁ&Ŝ14È@*,\î8‹×d50Áìy×RÀ%†J nÁ‘Â*OžŻù^qU ½C’LèÂVAÁ"Q˜m.~ŒÛf1GŸ/3ÂâFıÚJs(Ğáljß'Rr–†!7îD@¨W„‚ À ƒ(%ˆÀĵ5Áġ˜Ŭ CċɧäŽÌȸ_z\E pu˘œòȇlı-œµ*dŝ€ B‚÷ĠC¤W(ĵ€ ´¨ƒ'RÀ=ĝƒ= 2Ċê­§QÖ+–&Ñblİh-òLú2ċDŭÔEuiÑtcĞ$OÂmoħm¤ż°'Wœ¨B{í‚ P8&l‚'|%´9Eˆ€ dƒ/Ĉ$ôÊb€ç˘„‡êzËO”DŸĵJŒŒ ‘‡q¨Á›ÊZ'‚ ˜Â §Âa6‚Š0`‚…ZÜٝ 8Ô˘ÊIŬ*’¨/š 1£-ÏT•hĊšbĊÒ´şeèµ R|B,ĞĉŬ›9d(†ráà„ß%ĝf4 çÈE ôC|Ae9´ŝ°ƒ C_d^Âj܋‹x‡w„Ç"kÈl WWDƒLZzJEqŒI 8 C}ä |ݤÂċ@*¤W?˜=,‚„İĈdÀÀ",ƒƒuöz™Ñ1%Sú2Û˘èIï qżf‘ë$’Öŭd˙C3 RùZùŒ)IŠ)Â=l³ÈċŠÀ˜— |Ây1B›ŽB° ĴB"m0„·$ €<ÈbŜÉDĉ¨A9€‡˘0„¨tF8—Y„çÀ/„WìÀ"dIÊÀ/š€7RĴרBž×t<Às¸­—ĤĥÚŝÉ%ÉŜŭ}›(.P4Oò7Üښħ£fŻ'ÇÔ7Ĉ=l×"—­Nħ²İœĜ §b‚*ì>$˜xátŜB?9\íxá)"ˆ€0ÈÀ½èƒ<ÀA ,0kv°ŭ-ŻĤë ç„`@?ĵ@ĵ} fk ‚:\EÀW=„B{½œ@#hÇù „sI†Œ•Ì\ŽšnbH;ħÁиY A €C/ä"ÀĈ£AoA›ú^›n½(Ï59"D[=˜Àʟü³ĵ¸½oïFISNuĥÛ“İ2@Šĉ‹`_Ò FB“`Á Ê0H 6l 4ÁvŝİI´…}!–€Kt„Ŭ ƒäEŞháĜ°!Ç&<1ÉŬ ×â–&ĵ|ÓˆbâÄ3A_3H‰EˆJìM„g¸ FL—TLš‰F°LáPMôĉ AZ̤…„–&1oâ¤%ĊÁŬ?Fö„"˘ •)6Ĝ4j´xÑ×H_/miħcĊ‹#‹ĴX ñâÎáŞĵQôF#Ĝp]ú<úÈhDFšˆĴ2ÚsċĈ¸D6‰Ĵˆ ›Vˆ|ñE €›P"‚0ı `&››­˘½€Eî›T/ ³',BQa•*NŞÓşÄ-×+³p€ŒÚ•<¤fìë‚ñ4ÂŝZSʎ ċçĜêş NyA‹hp‘–k`yÁ„3n1â‚T”Ħ ‹g>ĦÈĦ…Šƒ!DšÈ(š&šè#_ ê 1гˆÏ|‰Ĥ m|ĴFƒP|È …JŒƒşD"Î&*¨‰/˘‘¨Ĉh2ÊÈŒ ˆŽ7¨`##6–P pÂ9a^x!Œ°ÂĦ$_Âİ"‘päQ#ò˘zJ—¨ôÙŽĤ‰Ĵ˘ )݃#è§+ô‰*…ôI¤‘˙Ŝ!(TáĦQe‡ vÁ!„1‚XLTŜĵ‡ \ ˘I¤Êl3­€*P“ #D:{›ŝC6Jb9ÛÈĜĈ”éX‹”Q­³(ĞÄ›wvĊĴ ‘"Cè6NğFÉ RZD”EŒ A„aCĜp…_LÁfpRx'>ûÌj*,*ŠÚK˜I'Òòšr´ĵ¤"§tz1ċ„K˘y§tÉ ĊJb‚?n¤ŸO`ùĈ X$Ê —ÈıˆH_dprg‘I!šhâß!oôE Ç„Ñ˘cG3èCŻAòe Ĉš,šE'‡ŜâĊÇ2ê@ڋha‰l°9‚ uÈĊÁ'úyu8#†‰Â`£ CʐáSž'™‚8*üŝëN}€@Ç Ĵ\°SżİÂZĝ+ñ'…DRÈĈ”wŒ@d Rħç‰?l âËPbÑ÷Ĉiŭœ-°¨ŒĈN‘ÈXż‡ i#&ZÜ(Í"_z­,2ccDÖ˘È h^ZíİV1‘NÛ¨Š&pÙ(S_֟ž×µħ‰FĠ*Êé_‰¨ !×B QÀ ĜyB¸E Sà ½HĈ;đògOƒž’¤\w‡{îğ<§<]1ƒ ĠPİ^P˘ là‘Š*„ ‰ĝ‚:”CƒŞX%ˆĤ l@¤ É ÇÎŝEZÄ!HÈE B : è "êŝH°ĥtÍI ĈÒ$B$ħ("qH’C<’$ĠlħŠÖÂEcJ´˜*ĝB˙@6Ŝ dC"oj92&”ÁÉh„(Ñ_¤B2P†hX§Œ7„.ˆÀ˘•ó8ċb{˘J 8ȃ ŽG,KÑÇ1Hħċ(fG8LA‰'Io<pˆzĝÂUh=Ê0c"‘ÁyAĴ°}Ċš  ŒŒ8ĉ"£1BŻ“ô!†2È˘Ş ŒÓÌW‹y6^c½Ĉĵ ‘bnstj$6ÍAŽ0r)1ˆž)Ò1ˆ?4ÁˆÈ@ ˘Ñl!MFŝFšpÌK¨î ÓAñDËqĴ•fyVä‘dcw"FŸÓ¤`bàx²A T)xÛòE‚!:ü#qĜ(ƒEŽÙ„ÄQà2hH=ÈA=m˜yȄ“˘,Z&lšZˆˆ€¤4­:äF ĦÀż"şĥ§ $P$Z4Ә(DKb‚ħS,qÀP0Ê`-¨ [ÈĞÎnZ†6AuĤ¸T/Ŝı7Œr)ĝi WÈâA0´Ç)$UŠÑò³ŒnRŽ0Şp‰'ÄÁxUÄ Ú:Ÿ–á†PFâ2‡c‘7ŞÇ>ÓĜP+7ċ<j$šK ‚İÁlŝŜV΍T\䤌´ÚJf1ĈEĉCD6že´Ċ§ùÌj¨‡/T Â?ƒAœ"¤–ÀRá*CĜ‡Aô°‘FT´. á‹‰c?œĵd €òiRO™ )3À@p^z‰t€3ˆƒĴ^Ûև D¨­Ŭ‚ÙÒİ2h’ÔÈ ‘‡<ä1 Ù˘BH‡ ħ 5úHĴÖ x@GċĞħWô"9ÄC YÑ´F´EmDkœç‹?dÀğ ^6f Dï1ò“)˜ĝS_`Ù%zİ>;JGµ²,SA yä‘àMjò+M”XLŝ(ž£ à`œ)é! ˘‰Po0îĦ^!â”Ğab0üQ\¤ËŸıµŒşgvwžĜħ£hEŻ3šİŒ?]­k˘3Ħ™A:`‘¤ç.µ2ÂO÷ɍÇ †)€ P͈ĝ–*Febó%ސpĵác@¨JUîCŒ?aPa\I:nÒzè"L‡}F:žó@vŜ@G l€ŽFt7ğ„@…/ `0İ ġHÀÔĥ…AÄĦƒ C˘c‰ ugM 6’¸3ZVä1Z‹èğ6ÄUÌ\CŒA.‡*ÖHQ.kDeËT'U•dgHzŝUDÈày Ĉ ¨  qD¤„°UÁ˙HĊ?ŜáW_ȃ7¸”2°ŒÈ#rû!ŬT2™§Ìqb÷„-ñx‚•}C"̐*ĠL‚¨ÁPÇ"Ü@ ìâ&û(ƒ”„NÜT#3ş2 ȁ !‚ùs4.7·—¤O+5¸y£ŽÀ†½Oâİ12f,b„#p+6%*ħ¸ÈMv^䜝ĦDŒÎ‰ˆ‡ˆ—\bĵx[àE|ĦÎÉ ^Dñ„kħ#ÀîKS €½ÜxšŠ>†`ïA >$DÇèèSÊ­¨)pxCĉô†ĠıEĞÂMvÁ†]¤?&4ĦBϚ0‰ŝ˘M+˘)ĜÇ1Şİ5$I\#È "zL­èèÓ√,"jÌJG€G!<âğ 5šĞ²EÊjìGâ1ŞÄy^€\t­ÖÌò%/LÀœcĜ€ ‡DXh8²!(‰(" ĥb³î$²Ì‚ŬLgú¤"•¤âħŽnp+Ä-O$ R Œ p! 5²„ ĝÎ9àA6   Ê ĝI½ÂÊĜ œÇyÖ§Ĵg[!#ž 2 ç6"Œ+#Ŝ(Ž0OJ6\žà4NFŻyԊnx%­ÂFˆ‚ A#š'2ĝi]žàӎE"ž@òb”c˜á€AUŝàžŽ# à(ÁRà D‰,ȃ)…<Ĉ€•ĝC6‡úA˘ot¸Ï„ô)& aô P ÚŠĵÀ2€ |AD Z˜q ­.Ħ´šĤ`˜Š­D$"ITng:B"rD"ÂC¸¨Â3¨IJtl"ŠĈŠlCò¤FÉĥ‡›#Şó,î hŝ€\ŜȨXŠ L n˘a‚Àf‚ &’‘Ià N`Û:FÜ8ĉb‚îDž"ĤO R`OôÀF ĉÎ^êĥí‡' ŽÑ ëÁRĦĝ* 0@A ^&òЇh ì!İŝCˆĥĉ3àWÜéWşK¸Zg3ŒXÔJ˙ q$~Ğ|Lĉ™.AÈİZ€H#fm›F⠘ĞZ<͝Ş`´Pƒ ŝeˆ"ÊĦr˜9¤@Bè V.ŬàÊ dŒÀŜ ’Á€€l<„p+Ŝí„ôȝ˘+ö¤#½B=ìc•@ü ”Áŝá è2x`9 `0 ÔH”9èà ‚ŞdÀR€ .ĦÒK¨aȨ"LŻFĴĈ£fHƒ 9nzŞKGP„kĴċ˙ŝO7j,‚³˙Ş*˘†DŽĉlàÊ ċá#°!dbœàĜ€ ~À úÁ!ŝ@ÓĜ üd€¸>+P âƒ,À΃R ,,ĤŬaúޏbĈÂPä-  ÀŜ€tvfâb‚ŭnà'Làڏŭ²!Ô!( h6^/l€[¸…|&ƒd^ Lƒ ş F2hC_I¤2R*C\Ž \ Ĉìĥ @"J ŝòüN˙4Bïî‚JÈ! ÀBá­sôŽ R€"'3IìX‰)D2Á:ac˜‚O*+;2£2é Ê˘a ŜúÁSœcKl@nÂĝ€<â" `Šĉ !£!ê ŝ€ŞD|á bD34 ĥ(¤d•èj(˘‰CDœ$I£1ĵŠÉşv êa–ú!ĠúA ‚öa&úà.ĥ#D2 ~‚ şħ3êĦ+),,„Ì?‹xà &‹úÄâħ"àżHJĞ)tP-`y”C6Á4Í D!! Œ`!ŭŠÑA!°"JLŜ!;êa € j Lá J¤ÀjĤĤÇôbÄ{ŽËĝñ×£Üi$ q#„h;c+'#ĵ„H¸eôfİ T#wƍ böîÂÒ r"ŝV! ¸êAfbâ™L!Ì Bj)Žb öƒÀ*=HHbħì&ÌŜÊ#â”)Ĉ`³,eu€5T%&CO!gÀ0 P Ĥ0&BĦI˜¨¨–É @@ÜÀBáM°Ħh²!8"Œ/­F˘ĵĞiÌñ˙$â‹d,óèàGdˊ(b”hEd”"ĥ€2Ġ’@jÒV@BŝÁÈEßҍ.ċ ŭlÀ9rv>Ï gĊÄ,ğëÂÁâ̤ΠÊb)np΢ ĈĠ=TjQ,'*âĦ™p‚€ì~o9b ¨@LD„¸!&@‰A%ó$Ŝ”RÌkÛc—íƒb4R˜G'³8ĈÂáR„Ñ˘ŝ˘LP@ĦÖ× obOe@<ğH*x€Ê ^ëPGFY˨`ß·1âÓşg#Dä_PÄmB‚Ç.BĥR¤jÈÊ I¤“r-wŝŻ>ßmCĦ„ p”Ħ9™qK,hC½ô ZàŠ‘ 8ô6´Œ3à˜Ĝ‡L!€*<.SN£Â—ݏ+"礒—?ÌÂëĥvbÈ#AèHÊ ˜>!ĜƒTÁóBħÙ  î€"2Ä`!ʰ1X(&Tàfİ„ S‚aŽbäZö0­D–2&"şÁ: ŽÊ J6!.Ï2àŝe€ 2@ĤešF‚Jdàf`&0 ŽÑħs›5ëbtŒb)x!r" RZaΣûÌ@x@bQ+jOér.KÜT ?\AlÂ!BMá îb&4î@Lf"/êáˆ$z†hœšÂHmtÌËàäx€N!Ż\ž`öž…:QŽQC{¸&"4✜¤Ĉˆk^Gr™ˆEŒ`–š@Ŝ  Œ „ ŜÄR•!Cf„ĵìyˆJL X“ʘ úᜀ ˜€Ĝƒ ’AÔĤuŒà ì!ŜĦDêż=Š$ħB –”.Ë\·/„ô!Ĥ{Á&ŝ‰Œàò”œ Í9Ô `ĝ4z!šˆĥ pKÒ;X7Ħ”!h‚'d%-Œre¸”k4!dğ5£ xŠ˙Œ‚ݘ(`˜ˆ¤¸§˘ ò'<ġDnċâĈ™É#eFÄ3½>íâb$#.Nö²Gİl£áòpk‹h: ċ˘ †Vŝù”ğşèĜšà†úœL€ òî.äÜRġâL!Ĉ€ Ò">  “ÈCĈĠ(2¨²ò„¸BôAöä„ á³^˵é€7/pBˆ Ż!½şè“ ÂQÁ\„HÙà „‘JÔ‚éè·<T§‹›ĝi s%Ÿ§˘ċâJnœ#ƒ{šàŞe ÛPˆâÛ\§  i„!„6„è S\Ĝ"4 4ÀLp£ $ `áu6"6S0ëëfñ‚m0†`bˆ!Á, a2JĤ‚Ì€rà úL‡ °Û²ÁµĦòJ*5x úŝš`Èöí!²!ˆÊˆ†ĤôKhPc\Aƒô¨İpcó¨ç1"_ bkr°€/lš(ôïÉ%l:ô5—ż`›ĝ2ò%ŽŒdT°Í”Œ&êhùú­a6F:¤ÂĤ̗ lF. ú÷"š°=ŭ"† µËB F(eCd*\¸d€‹@Ì*Öz] î+şg§KVqfÔÂe†XÜ0"èKLœ36Ŝĵ3•!ĥ25ħHUuU4`[” —Ż22ÂFÇKèĜ4ċ+Ú‚ÑŒ4‰ö—„/˙d({‡-›²&G H&X ÊKŝîèË%ÁїF{ô…KÔ*TŜEÓ½#ˆLg >|- DTIĠá%#Ħż9X€;*–j‹Œ Ħ`%•*T(°DDKġatD8o¤N!jċĊXù`eĈ[é‚N"eÎUÄĵQ[f`UW[q™ƒpˆ#Îġ˜Òˆ=ä5‘Ê"_dà9ÉÔNLêĜ%TÀ˘ €İ# €MĵÁ%Oĵ#̍҈0„ÓÈ XÜpƒÂĵC <\6ÂÂ4òä˜P bF e™QŽùF#OP"L6)áÄIaĘ`ŝy™…Œ)Ìt†cÄ ‰V&ŝ˘½$bè’˘J4àĈl¤ġQϰıÄ6—CAUÜr'™dRğĥKïĵòŜ;oîê[ÖûîݽúâK°Àĝ2ÑÏ a#`0eĵƒ,·Ĝàc?3ñE‘ ˆ4!%Ĥ,i @ȓ°aÍċV„\݁˘… #Î!Ôu•>Wé²Wr˜+W‰$ÒK8 ˜˘Ì{2”M2ĤĵC…0"0Á— `ŝC*ÒD0÷ Û%zô (“•²ÀòVğp%.r&\tl%Š<› ²ĵȖ°K rĉ7+ÙàJvî˜\à²a%.q•+Y:ö·ÁmnqĦë/Hw¸Äu— ëĜî‚×]{.yéµ ç>7¸Ŝ@zÍğŻ]l÷¸Ï ĴbÓët@ ĊWjğ•ì9/ÌÀ;Ĝƒ 8.oK]̚¨AxN¸‚+žAŽ g äĜ0gŬŒ 0wèI0 &d˜ "΀ \œƒj*Ŝ0‹g| Ş=#Ç& Ç-vœá½v¸Ëu/˜§ŝwä`2fœŞÉĝéÍÀ3úb­:"ÇQC‹ûrÔĦàĜ1TlP0ÔÄ`¸˜ûá†?àè3ÀP‹D(ĠaV3äàtÔ#ЃlÀM  †C‡Ö´ž O2EözWêiÈypĝPZHÄß1Kşp†T£èxƒ+Ì09Tà@Ĵĥ01êW$˘è¸ÂP]+¤ pE \q9ú CpE=œmlWä×Â)@GŞO}êzÄ:ÊNAމ­ TG@Ġĥlġ‘T›AÙÉNµğS†ĥx{B3Şċ ĥ(ĝĜf°ĥ8à-!İEŝBú‚ôo t"`ı‹>„G oc( j‚ĵ•¸”-ǃĜZ´ċ­Y„"W‚öµÌBkı1qdE:ƒË°”u,é›C€^§³ĥŒ-rÑ:jN,(ÎjÓÉÒP\¸ĝ_e }DeMV[’omŞYxƒÎ Ä2°\‹oÉÙ³WĞì™èë(Ñ­Útl^eWÚ:WPT+qÔE îw[ ‡cİVB²ÚJnmµ }({×ZáÒ “§Ċ˜w)ëŬQ„–ÈĞċ‹Ĝ¤•ˆÍğG Ó'ŞĠô¸bWÔGÑÛ)PĵiUyZuڋc‡F„Lo¨-ŝ[WÖíMž³­£ˆĉ¨^\”ċx88šeqI@­äÒĦ(ЍXfX+3eöŽŻáVwOÑħ’ .gµUÓGdëá<-IOŜô‘/WßË%C)˜‹Î"nmtTßípE² Ä3vqxĜ„+7yrgÄòt C×ExQ=§ġu—Essbçt+s+™çDOç{‘Ĉ~Ë š&|B—jĥ%€xUU´Lç~˄+kás·BVÀ·3 †kuWÉRuĥċ{=ƒwrĊ{˙•,)à_ıġ}x=2=|:Ói1ˆ<,7|–WVĵgLŞĊ{|Esµy â„M¤€>stħL…×Dta<ŝB /h}XÑ,vgm•F€Ü§r[!!*%Â~ x"_ÄR+é§xĠ—†Š÷Ç×D•wEĜ$" "̇'Y€¤‡LÄ2Dw,UÇ}˙‡|Äe%èyĞ÷VlÑsĥw+c`oEeçE˙µZse•ĝL¤LšĝŠ<£3wEw![_x¸!à—=‡÷DYäxt‚\çpĈsIG~2ׅ˘èvpħKèt\$jÄRĠC úP[Wˆ"<3Ş5|j@‚ ˘€\q£gyÄp<Í"§,yÑibè3qqtt?EÇclqŸ6!ÂB„ı%"݇#—2ŝMY¤şRWW‘ĠǎBxv·çE V|J÷!`Ñi£ˆ¤E× xÇq¨´˘žçrr§‰ˆG,Ô`=¨§L%™˜z¸y@£Em÷3ú°Ž¨v^8|ı¸2>S|eUˆPİVTĝDIH"ŭ×oÍTE³²L·Ž|è j—‹´H=¤È’Bˆ"Šç3¤¨wp" †qĜDpG"awˆ˜túbgz1È七Èò9çDĈòoÉÈLŒˆEÏgwU…†`ù˜gWÜgL5iLrY’ıĝv̸VT‡2ı‚`iüˆ[yQ„W·’$úÌuaŠ6§(ŝr+Aّ83,@@ u3ĜtR 383›ĵHsòuO·€—¸‡µ5+L„lœ¸1áÄ; 3dèG@żOlÈĠC×D]•7ĀĦ/ÂQĦpˆÁ1ƒ.ħD$Kh’—aYÉ0ò‚L%2ä\àRCMŸ83êTù&C=9`œ°a³£š†ŝ%š½À¤^Ÿ[:Sdġ' ."¸(”ñWğj9q²ĞAVh,°ĦWÏ`=NsÙĝ­ò珚½ÄġB÷ΑÌè2ŠÎŒ§p€E—œ.R İŒZ(-aŝ½1ħËMĤ~}à+Q“C;LÔsÉfW9AèàŞ$äÑ7.´lá!g÷>&TµİA ;;ċ˜0Hıd|Âĉ("p $bˆaŒŜ`¸-‚^ܐ*™a0ô‚Œĥò ŝHšó”ç-êÉ`ÜHèëç6Ĥ„;LH vz—-àAžÄ€pĦŠ&İgċp/;JŝÈA–2H ëı%´À2páŸŜAg¨Ħˆ =äg7>ZÌ8qĦ18K fhà)ÔK `—vaÂ;p¸ÁŽQ€If€†ê'f˜ì:ŝ D‡ÌЉXÀ…>ú£Ħ a?;j`£2p"!*êyB? ÇÀ§"0#AĦÄŠ˜ß ,Âa䑯6üêÙaĜÂW]t‰ù#!9\Cn˘´£',b#Qz5A™yÁ´ws‡ÂŞàaE0ä˜l—0^‘‘r"p nÉWŽ>˜äĦӄíÄ@3Èı" bt¸G8ŝ¸ÇŸ{ŝ²# "0ÉBišP05êq¤b܌˘ :œ`0êıOŬ ìx€Lĝħ ~ju£z0=šhd€JiY -pÇ 6"Hč]ì§ڙ/w€éCêGŽ÷ĝ§1Ċê×^…u£Rxœ°Ä °È&FšĈ~ˆ ÚˆqE#äa‚ĊZYÂ:;~‚ ¨€ëÀ•+À¸û ŝÀÎ>£xÇ4—žĦFŽ+´İ;›ġ W\݇0RĜ…÷[à$ Óuİ ¤7Ŝ g-ôĝg…ÒÉân²€‚ˆtVXAUŝı#ŒŝĝgršBŝ8û£ a˜`‰7Ş÷–<ì=˅XÙ `Ü%=Ï`3p‘Pìa{€ ^6|hġ¨Ž \S•ôMFBLbZD6ŞA((£<ñ‡ô€ HûÈmDS€êc Œ$‚YàJePRİQq½Ü=c^r#Òx°¤¸Ò´;"f=1äá.­ÚE` ‹ p҄>(Ž(¤ ğ€Ípbê„ ĜW†ż~À#˘àG˜­ë(y-!nÜĤP9Ü­ġ¨Ç²È XĴ8‹ ;%ŝgVƒS7¸R o¨.êxvAÀ˜ fäé=F!RF?HM˙$B@xùCÔ(e‚ s@9“}  ü¨>ĝƒtbpH3‡2Ĥb9jŠ0Wŝ¸³05c`5FèĦş˘ŒT˘‡*¨‚— ò„tñ( À8J“ŝ"BĴú²;,2ĵ-`żHŽNbˆQh ¨8‘$:18 û2gÂĦ–‘h˘jĜ!P GDŸĦ¸MTğò#Ĝ1Lx*P‡L‘°ĝĜ‡ĝ‚Ĩˆ]aù`a8W0€#$Qux'è†p ĜQ *‚ ¨&@8Ħĝ}X5Rıĵ–ZJfHc@obËÀ d‘¨c tà€+¨5esƒ ¨ĊsOĜ'ĜŽšşH˘g˜¨ŝL3 ]荂I‰~xÒXu P‡P…`•0"€( ‹ à„>€ b †ñ•| XĦ€‚G”‡q#}ˆ%aı!Üĝ•gJ9Ȁğİ@0Ĝ‚@ƒ< È;¨†]ĝƒ0@àş W@I>- 46è‡-@DuPè‘UÀ;È&Ó Ì*ˆDqóaù•xXµ§8 ߐĴÈ S“ĦGxħĞ–y‚ŝ ĵҁΌ/V%Nh xŒ7Î7ĠxDߨ7˜6é +Œ‚0‡0ĝ'¨âÂĴQÄK'à3pD‡(ꍏŝIȇ+W09 †ˆ3Ĝ­ÜÄ!8Àş`ˆ‚ ‚PVy…÷Á„òǣۉë ËĠ2_Á’™Ħ—ĝ‡-¸\ĝ‡~ ;§w0#¨N'à i :òF•“Ä· ž 0nʊ/x„J@€ P`г(lLîL"ÓŞq‰’s`ƒ? 1䘋]‰İKa³:t"W–€ ZȂ?à…;‡ à:&@4¸TÒô–Š ‰ÛC­‚ÂhP0vӁ*ƒ‹ Ó-Sò0<3 ÒÌr\i‚>8ƒ8½ û hî47 ĝŝA‹$½{ƒ+£–€NÀş0H3)Ô8’”ĉ & C6iÇÚ{Šk b¸˙`ex„@`„˜·ĦÍ9ĦĦ8A˙Àĥ?h„ h ¸ƒ?ÈuˆPh€TRJh²r;@M²7è‡@‡âŠ‚‚)úNà…{ĝf& Ì"ż@r’V[“,òPÊŞ7HħĝÁzà¤`)ġ°AXÀĥ“¨tŞĊT’-l­èXñ ž-HTRމ˘Ĵ½˘¨Ç”Ä1Ŭßh\ \H"Ì2 ı‡G$Ë^İ› n›‰âZQŝ£y¸ş R˜79è‡LL/İÛXÍxtJ$ 5ƒ(è…/Ó+L4°âÒBÒÒ0ÒAD{ÑÜc‚uĤPò3·¨‘£ .ÊŬ­‘[`†[½Ü(£)„ŒœGòĜ‚‹£ëÎrÓlhÚEiŽéƒĝĠÓ1 üƒ ï0”D·Ĥ`ŠvÔD>{Ĥ5ñ3cŬJë!4ĥó‰ È*ĦR5pfƒOàâڃ˜Ô?H™yŜ˙`‚J; }àT^äÛĠp‹K]ÏO‡Dtƒ_LÌŞĈüÊŬé­7`0HG ˆKMaö ‚È/ĵŝĊĦq‚˘‚Ä, ‚JeÛŬZAĠèNÓBĤ@ÉÑ`¨^\‚h‘}8:½µ +żòc9 Ü+‚y*Bh è„ KßĝÄŻş]x¨‡+èÜ!ĜW ÔGB‡y‘M³ä4´À!Ġ070/0ċ pĊĝ²y1ß4(îDà:&Û[17&•Ò%ô•bÚgĜrXÔkžâVƒ[8€c"hĥğ9e&Hmìİ€ }8·Šg3Ħ0 ú|&—,#eëháġ$MW.áÂŞ7€ĉ:ŻŻ´D Ĉ.²‹)ŜİğaÙB£êì‡0(#ġfېÑ3ĵÄİ3HNx á@ĴÛHœ/3ċ¸8¨ïPçRĥÏjf ƒ›_İšĈĊ×Gx†ŝ‰.& ê 0˜ƒĦWIœS>ô!Ş€Dh‚Š€€JšÎĦP­Y†l 'ĜÑÈêá"‡ıŬi™f2âĊO4K)ĉ{œ >ì[pàÑb[-äÛ™ħUà@hgŜ×½óÛÄù žÚ… ä´9}ğ2JpH샊hÑ+҂¤í_ùfşÙBò˘‰…Q$‡> ìŽ6> žrşĊNé^IÍ_ ßL. I7SĥĠ:Œf;Ÿ;b ˜\„ğ~J„zÓKoÉ<äoN–)BH„›YĤ&ĉœò–+hSŻ€DpŠ-v&ĉ~;Aaŝ‚òPƒ€ê·q2Ù³X‚f šùƒ?ÎMaĦiĵĵD˘nıËİË1q;fŽx Z…›g‚HŸXòÍ~*ra°ú<À–/{ì£8b^Á"ÔŻcyƒFh€; ƒ €™…üN6÷^˜AÄyIÒÄ9ż7è ²zp^ ["™ iN^àc´¨;ĵ;#ĞE‡r£¨+›¨„bd/O û|z€£µĝu„a}Êaŭ‡ĜuÈ@H‡a…Î*˜=e3 hâÈ´î Wèáë²ÄíQAìv  À„°-0ŒĴ] şKVx9ô4=½rn„ëlÀL!Nž€bîó¸*`Ħ£$utĝîQ…Œm€0¸(¸UƒÀŒ×x>UhuxçC‹=CŠ"ö[Ûĵ fúJ‰ċgb_j ĝ„X'K8X閁&Ú§ÜÜÍLË͔?@FŸyƒĝ‚  hLĜŽjÓ‰)7à‰~J=˜yĜ@‚äÀkuÇĊ~°÷**êfV9ô9‹úĤyeŭwZO@?t•kÇ:·QŠŭíŝ…ùƒ,>8†‹_BÒ#1í…Ĝ*£I ' ħD$,?8°£ċŬœ½•ŜcÚCI:ÊNXéÌwG'çi–[Ûó)żÍ!=H6 8†0°  ¨|¸L*äßÚ²~7À ­¨ĜU艣! ”ûŭ7éü=gŻo„Ĉ;] ĤĝĈ|#ĴÂÄ!¸·”aŽÎ€Ó„Ù?X÷Ş‚nqïAq#qbƒ1(}Ŭb€GÌL]# Dh†B…Â!ˆ 1}ĉ#Èᘆşˆ‰C'B ê‰.ş‹,qışò'E•0JŝĝÀ1ǸqpXĜ4€‹ Ï\ıŞ—ÌĠ-'`Ü$êó”IŞğnÙUÏ :@Şl Ó ÌŠ-îéqqq-oH^$FŽ8b Ċ`8pEq1’\xPŜÄÚÂc˜ ŽLdĜ@29äveçäMKtNì&ĦŜ…024Rnɇpôİ°Á…‚-‚Ô#]Á1‚TÒ%Ft‰Ċ‘äò{Ş`:À§…œ<}°@‚€“!l\ɋH§(ï"˜G˙‡ωœÔJ.drġx¤pħe  aŝŭáÏLòà G’.âÀĦ‹jp $NJ~‰Gŝ1ŻE0›jeô1!´K)„”ÂÄÈ!ÇÈQ‹)ĵÁƒ8jĵ…ÑH0À„ĞİĈ AŞé5‘…ĠċP•d ‘ĥZCħ%BùDÄ)Î;Vfù.Y¨˘Ê{0ħ@ùäĠeK‰d GĤ„d†,]$ci™˘Frz4‚_WɸAÎeÏ\Q<€…Ë Şœċ [òĊ5^TׅuÑR_1h×Eoè£äQĉu‘pŜĊƒ Żê‘˜ŸjĴډ.ġh3#pkċxWH bôQ:xáIĥɅ,jƒ™WkÈĊAo“B^ıÜĞ@< ?ŝ¨ÂŝM{öD?ñdÁuÔ@ĉVĞÑ N/Ğñ€"Œ+5˘–bȽêÂb)¨ĝLTôQO òlĦÁ?˙¨óèàBÓ&ĜcDÉ2TĴ„VDšAi”‚m]´&ƒŽ>*ĜҌ:&D •nȚ_ĊFE4gƒ°%A8Ĝjô,I@DiWka›m¸üñÔêÜfèèᆠDO<¨›ĉlV3Ž„á„+\m˜Âk½X$IEšNŬ)Ä4~^$Ï)8‘ˆ ‚U€ûİ£NèÁƒ<ÌFêC˘Hyá@¸…DBj˜T>ŬuŞÍuÉ!j¨š›ŝ!„Q$˜fÔa´ĴġXíğ3pâ@I jDîB!ŻâREò[Hĉ?U^O]b )@@ş@½½/ôFQ„¤Ë‚Es§T.´Zúv%ċ _UÓ‰\•}ùцި[¸˜TĴÔ ħÂĊcĦàpk(â XPH?ZËŻ"’^ĴoˆI ĥàBĴÄEFa=R0€Äi@a.´-¤Ä£“’Ï8_8àİ–r.H‚tS£FaV‰™Tbꨃx÷aS„Ŭ1銪 1Ú2#4Xɒыx`áí0ĉ1}ÒÈŻW'2ċZb—1¸\‹ĴâŬlpjœM'#HôB>(@<ÀÂäĠì˜^íSċĊ4D@EAgĴEg†Û1$@‰ˆCëÀà ÒdHĤà[ÔÎW,^ŒtĊˆÜŭ € (#U<.`ĈePA\R<ƒFÑg\=È£UZe?„ŝOÁħA° LFW:%`Ċ-¸B<‚Aġ˜ ĵҟéÀş‰H½LŒŸƒ xÀö‚ŸD0üX9A#´E–] ‡Ġ{8dNċC/ìÁ7ÓäɂÚÌ rÔи€DÄDϽJÓĝ½Û˜ÓĞš ÄÊşiÉ×5—żXf À}Wö‘&.l `–]…y×ĜEŒò(ÇÓ°ċŸñ‡YXƒ?Bá żÔƒTÔCcԝWQĊWQÑáOɕ\, C‹-ÀB1ŭÔäá@.A PÁ-ˆ,8€A?€C?084gU|ÖAn"ôC ĴQħ#0Á|ôÀ@F>CWÎÇ.P^W2ÁWŽnd8S–e"[f@än<öħġÁ‘,$BcC?Ñ­8cÛ-,'Ô´.xSNFe°‘ÑŬB?ä.}€ ԟ.3Üfle Ż1/V4'Xċ22ĉFlî*oEA=€È’Ü Żş²0–ĜĝŸĜ@¨n³˜À³AWŞîƒċî1OoëÒÇö>…üîċ^, ‘+„ÑbɕìĦ#O&\I3nEĈR,ĊÒÏ:Á 8üÂÇ6ı0:Ăp½A2¨íÂCŒ@#ÀìC <{4gC– _ƒ0ÈCì–4Bñ•¤Ġ W–Áƒˆ8àxċİ.d€/WĊöĈBë.|8Z¨M^@;pilot-link-0.12.5-dfsg/src/pix/case.xbm0000644000175000017500000000726107176416226020133 0ustar rousseaurousseau#define case4_width 55 #define case4_height 84 static unsigned char case4_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xee, 0xef, 0xff, 0xff, 0xff, 0x7f, 0xff, 0x1a, 0x11, 0xfc, 0xff, 0xff, 0x7f, 0xff, 0x68, 0x53, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x40, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x10, 0x02, 0x7f, 0xff, 0x00, 0x42, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x08, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x20, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x02, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x04, 0x7f, 0xff, 0x00, 0x08, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x20, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x01, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x20, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x40, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x08, 0x00, 0x80, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x04, 0x08, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x10, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x01, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x02, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x42, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xfa, 0xaf, 0xab, 0xeb, 0xf7, 0x7f, 0xff, 0xd7, 0xf7, 0xff, 0xbf, 0xaf, 0x7f, 0xff, 0xf8, 0xdb, 0xab, 0xc7, 0x9f, 0x7f, 0x7f, 0xe9, 0xfb, 0x7f, 0x87, 0x8f, 0x7f, 0xff, 0xf4, 0xd3, 0xd7, 0x97, 0x3f, 0x7f, 0x7f, 0xd8, 0xe7, 0x6f, 0xcf, 0x2f, 0x7f, 0xff, 0xff, 0xbf, 0xff, 0xf7, 0xf7, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f}; pilot-link-0.12.5-dfsg/src/pix/b5.gif0000644000175000017500000000275107176416226017504 0ustar rousseaurousseauGIF89a"÷$:<4VT.,DBL,FD$"$4:<,.,LVT&  $>L$6DTblT,6D ,B< ,:<$*,4TV\TR\$.,4FD LNL &,DVT424<,2,LVd,>L\jd$6, ,><",,*,*,24DJL,FT$&$LZ\\flDTZ\$244FTLRT DVd,BL$6< $>4$<$.44FL$LNT&4DZLD"$4>D,24 ,>T$64,>D,*4*4$&,gżHc (^ÜpÇsoŬHĝÜób –9“&‹„+2$€EM’$XäÁ’䐘 bŞŝ ¤Í7P”8rDš7, Ĝ r" ›7lJ„T‚ oü ÁUüq†ĝ1 oQÒ ĈcȑG!hñì0AxTñ—Fù‚N¨àÄE=q%ĦB:„ÇPAĊWYĈBÁ bpÀZ°PÁ‚ è FpĜqCpq†>ĵáD zÜ X¨@H`ˆ LÂ0X‘D À D[¸ħĊ50‘@IœE|00ExÜà{à† $ Xl ƒQ1$(&ˆn,„q0Ä<‘Ĉ ğ$Ñ[=ĵñE ™ ò… K0á-|ÑÁ @ÌÀ x„T0<À’Zô6\qġ!°ÂĦ<„Ĉ ]Èဠ †WGüĜ+a„zL †J 1†İ™ÀwX¸‡ W<ƒR pP@`RP}ìñÁ>t†%Lƒ¤”‘‹ ÁĤ—I\`ù„G„ÌKÏÚaRT8AĈ3ıŞ£Q‘™U}TpF qÇO0\A‘^3ġPC;pilot-link-0.12.5-dfsg/src/pix/b4.gif0000644000175000017500000000272607176416226017505 0ustar rousseaurousseauGIF89a#÷$BT &Tbl,*4DBD24$:<$:D$$2<,BTDFDDRT&, $&44>T4FDDNLLZ\ 4:D $&$$.4*,424L,>DLV\t~|$*,4:<D$*4$.DTfdDBL6<$>4DJTDVdtvtDDFL4FLDNT $$&,$.<*442<,.4&$,FL $>L$*<òÈÜ˙ ż@ĜX‹Ü˙ż\ĜòÜ˙ż`LĜòëÜ˙żĝ‹È @ĜÜòÜï˙˙żżP8„¨ëê@D‹ċ#üüQ@ĝĝÈÈ @@GüTï˙@żoï@d òñ˙˙˙żżż`oòï˙ż@ĜòÜ˙żŒ8¨ëĝä‹Èä @! Over5Ĝw(Ürit¤ĝeÈ  e@xġiñsd˙tżi(nñg˙ żfÎoiïle@ !ŝthe GIMP was here,#ŝ@ ”BJ 8” HÙ# JA šhΧ@IĜ)"‰”àà™HN <Ôħ`He%8Ċ4Ib'8Rp X1L’0„ Ya¨CE‰$I”„Q [ˆ‰‚£cŠ@!Àٚ… ‘/{ô0 ááˆ2 %– ƒ%%eÁƒ#Ħ@Euq(Jƒ™#9RĊƒ21XÄhËvS‡•bîÂŽC‰ŠÀçÂ4À\´$‰‚jÀ3)†ĉżQöhÜJI…A#š\ٔQH²0‚“¨0jéòdDòpQ¸'‘Ÿd”È@ĦĈˆ ˆFŝ<1Ž‹‚À À(Ò$ĝD¤ .z¤Q`„w˜)S’€oœ´œqĊ%Ç%GàĈV†IÔ † xD0&ÈQCYìÉhh FÔà(—ÑNtA \bÇ$$t`]`Ç‘PñA#•D!*  ĵqb „aÀ@B‘†4ĜqXXĊd1,RÁ' т^ĵ°Ċ4”…M܀ĊK4p‚t°H’<G#m°ˆޏq‡Bxp‘BAAèqE ›4PÀ\q‰›`a€¨81jìÁž$aBŸ¸Y8@cÄ@ħg1v{„T0ħÇ^ŠhRB a”0‚&(EŠ.&a(‡&€rŸI)pё $!D%P˘!tĴ€‡!Qmaï‹Ç\a<”‚…Ÿà°@!;W['Pr…”à@1ÄE]”%;dqU)|’A>tÇu!Ôİ R€ Qȁ;pilot-link-0.12.5-dfsg/src/pix/b2.gif0000644000175000017500000000431707176416226017501 0ustar rousseaurousseauGIF89a"(÷|‚|$FD"DfTĵÂÄ6,DBD Üĉìœ˘”dfd424DRT$"$,VDÌÒÔlvt  4FD$>4ôöô´²´Œ’„4:DTRL.DJD4:<$*$ÌÊÌ L„†„&$$24LFDœ˘¤djd46,DVd$&$ ´ĥ´DNL$., ,64&ôîä´¤ÜÚÜTĵşĵüúü|~|l~„Œ’”,FTLZ\dr|tz|\nlLNLTfd\^\$>D<>4äĉäÔÖÔlrtĵĈÄDFDDVT4><ÜÚÌÌĈĵ<64 ¤Ĥ¤üúì$.4,6<ÄĈĔ–”ĵĵ "$œ˘œdfllv| ôöüDJL$*,ÌÊÔL<><äĉìÔÖÜ˙żŒ8¨ë¨ĝ”Èċ @! Over3Ĝw(Ürit¤ĝeÈ  e@xġiñsd˙tżi(nñg˙ żfGoi&ïle@ !ŝthe GIMP was here,"(ŝ‘Aĉˆ 5Ċrċò˅ _#ĜÊġPšFHñ%— @¨9˜ËW.bjsàh#aÂäûâˤ [.Ssİ!Á‚Ä,8ĦĊHiÙd⑉g1mñTì’!‡W ş@Fq„-?ž)2Ʉ٧fmzö£°—\P$Ĝ‰œ\.#]az&ۈbĊüŒ”ÍÄ&Y›jIJaˏC†jâR˜‰'„ùAĠf]¨. Aċ§Ĉ Y6esd ‰”’&{Şô¨’ G5,¤<Šž1Aŝ ı„ îg‹Ñ q1ÂĦ' •„k™jÛ^P²g ŭ×ÀŝɊġÒäb.TŠd˘’f;²O™‚È*ˆ€€ HÔ°ÖD.ĜႸE2ˆ)„…3à' (£Ÿ P`hT²‰Rcˆ-ž I$ޏĊ2P(Ó /ĠP’<@˒l׆ı°çˆĸPC%•Ôwġáa†v€%6pD`8‰0~}Ìe‘8 Ì2’¤0 “HLk$ÂÀż¤P$³R3Hè0H ‚PŒ01X³Ì1·( Û°°Ĉ!™Ó …KˆŠlÀ…3¨ ĝL6Ċ4a‚5(E faĈ!H%@AŝĴĴaÉ08CD)PÒ5ÔàIO B /„ÒpÌ]´€PԐÀ eÀ‚÷ñ 6Ç58òE ĥ *tàZ@´¤À+`ÀPˆ ĠŒa;\R‚ rxàG1ƒÜA,ÁAÇ26˜’ĊѰ‡ ّPEO³PP° ƒxrà *òò3ǘTÁ”P(°.w`Pf¤€]*— á‡Ċ aK îâ )ì€҆5B’ÌN|´Ó8RÂnwÍ%,˘†Žx„8Ö×8ÇA·ĴÀ1HqÂ`1g¸ÄÖZé‹FPŻ @…$* P` vÊĠ-°Œ•|ŒPԐ‚!H*îp‡C—¤8Fv0Ä1xÁ Hhġ0 Ha$|¤CI.ŠaÉ]\À w`9×xkÜa4pAp Ĥ =i@ iƒ´Ĉ!ÑXR ŽÙˆ/ „DœÀħ€‰·rÁŒFÀ˘Ħg@!) 85#2¸iC ƒÈA3 'ÜĤg°4,Lœ6çSÉE0•xO제¨h@1^`ƒœ!›x‚,L“bŒHxL\Ĵ˘Ä„$ ;pilot-link-0.12.5-dfsg/src/pix/Makefile.am0000644000175000017500000000034110142004216020507 0ustar rousseaurousseauPIX = \ b1.gif \ b2.gif \ b3.gif \ b4.gif \ b5.gif \ b6.gif \ b7.gif \ case.gif \ casemask.xbm \ case.xbm if ENABLE_CONDUITS pixdir = $(datadir)/pilot-link/pix pix_DATA = $(PIX) endif EXTRA_DIST = $(PIX) pilot-link-0.12.5-dfsg/src/pix/b1.gif0000644000175000017500000000224407176416226017475 0ustar rousseaurousseauGIF89a÷    ,, $$&-)$/*$04$<+$<4$X;í˜Ĥx`’… p[ĵ Bg 1Luš€Pƒl kÔ¸#ĊêĈş jÁˆ Ñm¤ À9€TÒ “ '`R7aä F(¤@(UhM°H d*  ˘ "’" À@‚2ÌAW+JA„"˘ˆŒp0Œ)ô¸_;pilot-link-0.12.5-dfsg/src/pix/casemask.xbm0000644000175000017500000000727207176416226021011 0ustar rousseaurousseau#define casemask_width 55 #define casemask_height 84 static unsigned char casemask_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f}; pilot-link-0.12.5-dfsg/src/pix/b7.gif0000644000175000017500000000410007176416226017474 0ustar rousseaurousseauGIF89a"%÷|‚|,B4"LfT24ĵÂÄLJL 424DRDÔâì$"$ljl œ˘”4ÔÒÔ.4\nlĴ²ĴDLZ\l~„ĵşĵDJL4F4ÄÊÌLRL  D,*4,>D „‚„&,LNL<24DZL,&, DFDtv|äÚÔ*,´²´4FL,6,ôîä<>4dfd &TV\DNL  äêì ,FD&$Tbl464DRT$&4¤Ĥ¤<$.$,:<ÜÚÜdntT6<,:DLZLÔÖÜĵ´äĉä$64ÄĈÄ.,´ĥĵTZ\Tfddr|ĵĈÄ$&$lnl\^dĴĴüŝü4>D$.4$,.4„†„tz|DVT,><œžœ4FD|‚„,B<"$LJT4:LDJT $24lr| $,>LLNT 4FT,64<>DTZ\<,2<T*,,FT\jd&$46,6<$&$ 4F<ôîä´ŞĴ,:<T^ddnt,64 4FLDNTÜÖÔLZ\üúü$6,,>DTDVT$>4Œ’”„†ŒLVTdr|$>D4><$.4 46<\^d,6<<|~|üŝü$*,TZdL,FLÌÎÔ.4Q@'ĝĝÈÈ @@GüTï˙@żoï@d òñ˙˙˙żżż`oòï˙ż@ĜòÜ˙żŒ8¨ëxĝä¤Èä @! Over4Ĝw(Ürit¤ĝeÈ  e@xġiñsd˙tżi(nñg˙ żf³oi"ïle@ !ŝthe GIMP was here,"'ŝƒ}HóAĜÀOiˆÒkH‡ KQŝğ]üÚSÈ”â~ĈW§Žèê%‚IŻĜOYbÒÓ§9(҈)*1ÊvnèRÁ)¸Âb,  0d¸rD)9€˘Ĉ¨}°d°Š ”á†$ ¸b‡&³$"q ”²ž.K¨˘R‰|‰+İœŒ+™”€ qD$+`p p“ݘ≨!Ô(¨¸âÊ+§0‡ĜˆHôRH-§`àF)-Ĵp…jĵ”È#ld`Š*6TPd*¸Â‡&$ÀH|àË#{”Rä)6ˆ)C exòËYXò„ †”9ƒH …œAf¨Ä Ċ ŝ@’Êz;‘A#”ÇI,½ÂÄ)WDrÄ :ĴĦÁ#KXĈ.z¤Œ/dˆ°z¨Â†DtĊ'ôjÈ À ]à„ C€B†pE˙ĵ°2DbĝÀ ‚Ħˆdd§èƒv<á¸pBœ  íhĈ„"Bòa!&AE'$Á›ëħ7€Ü΀€IĴ 3I$o°‹ zdx˜IÉ  ÈÌBè" ŠdXÈhÉ÷˜Úİ€+ĵŠHDÂùE bÜ$ è˘",  ô‘¨<0½ T áŠÈH"oRaÄòVĜE.°"êáݍE$@Š;D‚Äx">aü˘bZ|D ‚‘‹=Â/@ĊpT°Ê‹1]ĝAp²O8‹ŸuÈĉ…/ì s\ä.bà˜uĉ3VĝÎvD_àĦ‡,€Š]îrë„f>ÙyEÊR–i¸4*Œ8ā.]\È.„aZž3˘X '?;pilot-link-0.12.5-dfsg/src/pix/b6.gif0000644000175000017500000000413307176416226017501 0ustar rousseaurousseauGIF89a"&÷|‚„$FD"$LfTDBDÄĈÌ$24DRT,",ljdäĉ䔢œ 424*,TRTDœš” l~„ôîä<.4,FDDFD  LRL 46D LZ\LôòôTblÌÊÄìĉä46,.,dnt4FD´ĥ´$&$tvd4>TTZd djd"4ìâä ,.,„ŠŒĵşĵ4¤Ĥ¤dfdDŒŽŒ$.4  ÜÚÔLœšœôîì,FLDFLLRTTV\ \flDNT  LZd$.,$LNT\^d&$ĴŞĴ,>T ÌÊÌ464.4´ĥĵ$&, ,.4$t~„dflĜŝÌ0bD„S9{ 2˜'“œ´Ïžù€ @2ÌP0Ğdl8 8¸  -µƒË´'‡ÀìÇ_5ĵġ€+PÀ ²Œ Ż`ĦˆY=TċĊ´x! ĠhÈÌ~]DƒHòÌÀŒlX 1^(bÌ+žÈ@‹Ss@á3H°QÍ ŞHQĈ¤È(D°áÇ1VGÑ`á…$0èĊ-_Ñ[+°Aƒ$d 9Äq ;pŒaüâƒż„x‹ ž|‘ D8,ÉM°!F#.Qƒ0BŒBÇĜ0 âI&“$w İğ1Y€#uì`Š5ŝZ˘Ä €<sLŬü™Ĉ˜ cFœÑۋżPòÈo§4ÂAÏ*áKB8ğ´ÈxµüÁJ›3ÌKk #include #include #include #include #include #include "pi-source.h" #include "pi-file.h" #include "pi-todo.h" #include "pi-memo.h" #include "pi-datebook.h" #include "pi-address.h" typedef void (*funcPtr_t)(void *); void dump (void *buf, int n) { int i, j, c; for (i = 0; i < n; i += 16) { printf ("%04x: ", i); for (j = 0; j < 16; j++) { if (i+j < n) printf ("%02x ", ((unsigned char *)buf)[i+j]); else printf (" "); } printf (" "); for (j = 0; j < 16 && i+j < n; j++) { c = ((unsigned char *)buf)[i+j] & 0x7f; if (c < ' ' || c >= 0x7f) putchar ('.'); else putchar (c); } printf ("\n"); } } // This makes sure all the data matches. It compares with what Ken gets // so that, if mine is wrong, I can tell if it's my code or his code. void compare(void *fromPilot, int pilotSize, void *pack1, int pack1size, void *pack2, int pack2size, void *kenPack, int kenPackSize) { if (pack1size != pack2size) { cerr << "Pack with malloc returned a size of " << pack1size << endl; cerr << "Pack with buffer returned a size of " << pack2size << endl; return; } if (pack1size != pilotSize) { cerr << "My pack routine gave a size of " << pack1size << endl; cerr << "Palm's packed buffer had size " << pilotSize << endl; return; } if (pack1size != kenPackSize) { cerr << "My pack routine gave a size of " << pack1size << endl; cerr << "Ken's pack routine had size of " << kenPackSize << endl; // If we get here, it just means ken got it wrong, not me. Go on } if (memcmp(pack1, pack2, pack1size)) { cerr << "My two pack routines produced different data!" << endl; return; } if (memcmp(pack1, fromPilot, pack1size)) { cerr << "My data is different from the pilot data" << endl; dump(pack1, pack1size); dump(fromPilot, pilotSize); return; } if (memcmp(pack1, kenPack, pack1size)) cerr << "Ken's packed data differs from the pilot" << endl; } unsigned char packedBuf[0xffff], kenBuf[0xffff]; int size, packedSize1, packedSize2, kenSize, nentries, entnum; void *packed; void memos(void *buf) { memo_t memo(buf); packed = memo.pack(&packedSize1); packedSize2 = sizeof(packedBuf); if (memo.pack(packedBuf, &packedSize2) == NULL) { cerr << "Record number " << (entnum + 1) << " too big for " << "the buffer you passed in." << endl; return; } Memo m; unpack_Memo(&m, (unsigned char *) buf, size); kenSize = pack_Memo(&m, kenBuf, 0xffff); free_Memo(&m); compare(buf, size, packed, packedSize1, packedBuf, packedSize2, kenBuf, kenSize); delete packed; } void todos(void *buf) { todo_t todo(buf); packed = todo.pack(&packedSize1); packedSize2 = sizeof(packedBuf); todo.pack(packedBuf, &packedSize2); ToDo m; unpack_ToDo(&m, (unsigned char *) buf, size); kenSize = pack_ToDo(&m, kenBuf, 0xffff); free_ToDo(&m); compare(buf, size, packed, packedSize1, packedBuf, packedSize2, kenBuf, kenSize); delete packed; } void appointments(void *buf) { appointment_t appointment(buf); packed = appointment.pack(&packedSize1); // Fake packed + 7, as it's not used unsigned char *ptr = (unsigned char *) buf; *(((unsigned char *)packed) + 7) = *(ptr + 7); packedSize2 = sizeof(packedBuf); if (appointment.pack(packedBuf, &packedSize2) == NULL) { cerr << "Record number " << (entnum + 1) << " too big for " << "the buffer you passed in." << endl; return; } packedBuf[7] = *(ptr + 7); Appointment m; unpack_Appointment(&m, ptr, size); kenSize = pack_Appointment(&m, kenBuf, 0xffff); free_Appointment(&m); kenBuf[7] = *(ptr + 7); // Fake the byte just before the description. It's not used if (appointment.repeatType() != appointment_t::none) { int fakePos = 15; if (appointment.hasAlarm()) fakePos += 2; *(((unsigned char *)packed) + fakePos) = *(ptr + fakePos); packedBuf[fakePos] = *(ptr + fakePos); kenBuf[fakePos] = *(ptr + fakePos); } compare(buf, size, packed, packedSize1, packedBuf, packedSize2, kenBuf, kenSize); delete packed; } void addresses(void *buf) { address_t address(buf); packed = address.pack(&packedSize1); // buf[0] is gapfill, so make them match unsigned char *ptr = (unsigned char *) buf; *(((unsigned char *) packed)) = *ptr; packedSize2 = sizeof(packedBuf); if (address.pack(packedBuf, &packedSize2) == NULL) { cerr << "Record number " << (entnum + 1) << " too big for " << "the buffer you passed in." << endl; return; } packedBuf[0] = *ptr; Address m; pi_buffer_t *record; record = pi_buffer_new(); unpack_Address(&m, record, address_v1); pi_buffer_free(record); record = pi_buffer_new(); pack_Address(&m, record, address_v1); free_Address(&m); kenBuf[0] = *ptr; /* From before pi_buffer-ification. What did it do? */ compare(buf, size, packed, packedSize1, packedBuf, packedSize2, record->buf, record->used); pi_buffer_free(record); delete packed; } /* ARGSUSED */ int main(int argc, char **argv) { chdir("/afs/pdx/u/g/r/grosch/.xusrpilot/backup"); struct { char *db; funcPtr_t func; } *aptr, apps[] = { { "MemoDB.pdb", memos }, { "ToDoDB.pdb", todos }, { "DatebookDB.pdb", appointments }, { "AddressDB.pdb", addresses }, { NULL, NULL } }; void *app_info, *buf; int app_info_size, attrs; pi_file *pf; for (aptr = &apps[0]; aptr->db; aptr++) { cout << "Examining " << aptr->db << endl; if ((pf = pi_file_open(aptr->db)) == NULL) { cerr << "\tUnable to open " << aptr->db << ": " << strerror(errno) << endl; continue; } if (pi_file_get_app_info(pf, &app_info, &app_info_size) < 0) { cerr << "Unable to get app info" << endl; continue; } pi_file_get_entries(pf, &nentries); for (int entnum = 0; entnum < nentries; entnum++) { if (pi_file_read_record(pf, entnum, (void **) &buf, &size, &attrs, NULL, NULL) < 0) { cout << "Error reading record number " << entnum << endl; continue; } if ((attrs & dlpRecAttrDeleted) || (attrs & dlpRecAttrArchived)) continue; (*(aptr->func))(buf); } pi_file_close(pf); } return 0; } pilot-link-0.12.5-dfsg/src/pilot-read-notepad.c0000644000175000017500000002664411211745573021545 0ustar rousseaurousseau/* * $Id: pilot-read-notepad.c,v 1.42 2007/02/04 23:06:02 desrod Exp $ * * pilot-read-notepad.c: Translate Palm NotePad database into generic * picture format * * Copyright (c) 2002, Angus Ainslie * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "pi-source.h" #include "pi-notepad.h" #include "pi-file.h" #include "pi-header.h" #include "pi-userland.h" #ifdef HAVE_PNG #include "png.h" #if (PNG_LIBPNG_VER < 10201) #define png_voidp_NULL (png_voidp)NULL #define png_error_ptr_NULL (png_error_ptr)NULL #endif #endif const char *progname; #ifdef HAVE_PNG void write_png( FILE *f, struct NotePad *n ); #endif /*********************************************************************** * * Function: fmt_date * * Summary: * * Parameters: None * * Return: Nothing * ***********************************************************************/ static const char *fmt_date ( noteDate_t d ) { static char buf[24]; sprintf (buf, "%d-%02d-%02d %02d:%02d:%02d", d.year, d.month, d.day, d.hour, d.min, d.sec); return buf; } /*********************************************************************** * * Function: write_ppm * * Summary: * * Parameters: None * * Return: Nothing * ***********************************************************************/ void write_ppm( FILE *f, struct NotePad *n ) { int i,j,k,datapoints = 0; unsigned long black = 0; unsigned long white = 0xFFFFFFFF; fprintf( f, "P6\n# " ); if( n->name != NULL ) fprintf( f, "%s (created on %s)\n", n->name, fmt_date( n->createDate )); else fprintf( f, "%s\n", fmt_date( n->createDate )); /* NotePad says that the width is only 152 but it encodes 160 bits */ /* of data! - AA */ fprintf( f, "%ld %ld\n255\n", n->body.width+8, n->body.height ); if( n->body.dataType == NOTEPAD_DATA_BITS ) for( i=0; ibody.dataLen/2; i++ ) { datapoints += n->data[i].repeat; for( j=0; jdata[i].repeat; j++ ) { for( k=0; k<8; k++ ) { if( n->data[i].data & 1<<(7-k) ) fwrite( &black, 3, 1, f ); else fwrite( &white, 3, 1, f ); } } } else for( i=0; ibody.dataLen/2; i++ ) { for( k=0; k<8; k++ ) { if( n->data[i].repeat & 1<<(7-k) ) fwrite( &black, 3, 1, f ); else fwrite( &white, 3, 1, f ); } for( k=0; k<8; k++ ) { if( n->data[i].data & 1<<(7-k) ) fwrite( &black, 3, 1, f ); else fwrite( &white, 3, 1, f ); } } } /*********************************************************************** * * Function: write_png * * Summary: * * Parameters: None * * Return: Nothing * ***********************************************************************/ #ifdef HAVE_PNG void write_png( FILE *f, struct NotePad *n ) { int i,j,k = 0, width; png_structp png_ptr; png_infop info_ptr; png_bytep row; width = n->body.width + 8; png_ptr = png_create_write_struct ( PNG_LIBPNG_VER_STRING, png_voidp_NULL, png_error_ptr_NULL, png_error_ptr_NULL); if(!png_ptr) return; info_ptr = png_create_info_struct(png_ptr); if( !info_ptr ) { png_destroy_write_struct(&png_ptr, (png_infopp)NULL); return; } if( setjmp( png_jmpbuf( png_ptr ))) { png_destroy_write_struct( &png_ptr, &info_ptr ); fclose( f ); return; } png_init_io( png_ptr, f ); png_set_IHDR( png_ptr, info_ptr, width, n->body.height, 1, PNG_COLOR_TYPE_GRAY, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT ); png_write_info( png_ptr, info_ptr ); row = (png_bytep)malloc( width/8 * sizeof( png_byte )); if( NULL == row ) return; if( n->body.dataType == NOTEPAD_DATA_BITS ) for( i=0, k=0; ibody.dataLen/2; i++ ) for( j=0; jdata[i].repeat; j++ ) { row[k] = n->data[i].data ^ 0xFF; if( ++k >= width/8 ) { png_write_row( png_ptr, row ); k = 0; png_write_flush(png_ptr); } } else for( i=0, k=0; ibody.dataLen/2; i++ ) { row[k] = n->data[i].repeat ^ 0xFF; row[k+1] = n->data[i].data ^ 0xFF; k += 2; if( k >= width/8 ) { png_write_row( png_ptr, row ); k = 0; png_write_flush(png_ptr); } } png_write_end(png_ptr, info_ptr); free( row ); row = NULL; png_destroy_write_struct( &png_ptr, &info_ptr ); } #endif /*********************************************************************** * * Function: write_png_v2 * * Summary: * * Parameters: None * * Return: Nothing * ***********************************************************************/ void write_png_v2( FILE *f, struct NotePad *n ) { if( n->body.dataType != NOTEPAD_DATA_PNG ) { fprintf( stderr, "Bad data Type" ); return; } fwrite( n->data, n->body.dataLen, 1, f ); fflush( f ); } /*********************************************************************** * * Function: print_note_info * * Summary: * * Parameters: None * * Return: Nothing * ***********************************************************************/ void print_note_info( struct NotePad n, struct NotePadAppInfo nai, int category ) { if( n.flags & NOTEPAD_FLAG_NAME ) printf( "Name: %s\n", n.name ); printf( "Category: %s\n", nai.category.name[category] ); printf( "Created: %s\n", fmt_date( n.createDate )); printf( "Changed: %s\n", fmt_date( n.changeDate )); if( n.flags & NOTEPAD_FLAG_ALARM ) printf( "Alarm set for: %s\n", fmt_date( n.alarmDate )); else printf( "Alarm set for: none\n" ); printf( "Picture: " ); if( n.flags & NOTEPAD_FLAG_BODY ) printf( "yes\n" ); else printf( "no\n" ); printf( "Picture version: %ld\n", n.body.dataType ); } /*********************************************************************** * * Function: output_picture * * Summary: * * Parameters: None * * Return: Nothing * ***********************************************************************/ void output_picture( int type, struct NotePad n ) { char fname[FILENAME_MAX]; FILE *f; char extension[8]; static int i = 1; if( n.body.dataType == NOTEPAD_DATA_PNG ) type = NOTE_OUT_PNG; if( n.flags & NOTEPAD_FLAG_NAME ) { if( type == NOTE_OUT_PNG ) sprintf( extension, ".png" ); else if( type == NOTE_OUT_PPM ) sprintf( extension, ".ppm" ); sprintf( fname, "%s", n.name ); } else { if( type == NOTE_OUT_PNG ) sprintf( extension, "_np.png" ); else if( type == NOTE_OUT_PPM ) sprintf( extension, "_np.ppm" ); sprintf( fname, "%4.4d", i++ ); } if (plu_protect_files( fname, extension, sizeof(fname) ) < 1) { goto cleanup; } printf ("Generating %s...\n", fname); f = fopen (fname, "wb"); if( f ) { switch( n.body.dataType ) { case NOTEPAD_DATA_PNG: fprintf( stderr, "Notepad data version 2 defaulting to png output.\n" ); write_png_v2( f, &n ); break; case NOTEPAD_DATA_BITS: case NOTEPAD_DATA_UNCOMPRESSED: switch( type ) { case NOTE_OUT_PPM: write_ppm( f, &n ); break; case NOTE_OUT_PNG: #ifdef HAVE_PNG write_png( f, &n ); #else fprintf( stderr, "read-notepad was built without png support\n" ); #endif break; } break; default: fprintf( stderr, "Picture version is unknown - unable to convert\n" ); } fclose (f); } else { fprintf (stderr, "Can't write to %s\n", fname); } cleanup: free_NotePad( &n ); } int main(int argc, const char *argv[]) { int c, /* switch */ db, i, sd = -1, action = NOTEPAD_ACTION_OUTPUT; int type = NOTE_OUT_PPM; const char *typename = #ifdef HAVE_PNG "png" #else "ppm" #endif ; struct PilotUser User; struct NotePadAppInfo nai; pi_buffer_t *buffer; poptContext pc; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"list", 'l', POPT_ARG_VAL, &action, NOTEPAD_ACTION_LIST, "List Notes on device", NULL}, {"type", 't', POPT_ARG_STRING, &typename, 0, "Specify picture output type, either \"ppm\" or \"png\"", "type"}, POPT_TABLEEND }; pc = poptGetContext("read-notepad", argc, argv, options, 0); poptSetOtherOptionHelp(pc,"\n\n" " Copy or list your NotePad database.\n\n"); if (argc<2) { poptPrintUsage(pc,stderr,0); return 1; } while ((c = poptGetNextOpt(pc)) >= 0) { fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } if (c < -1) { plu_badoption(pc,c); } if( !strncmp( "png", typename, 3 )) { #ifdef HAVE_PNG type = NOTE_OUT_PNG; #else fprintf( stderr, " WARNING: read-notepad was built without png support,\n" " using ppm instead.\n" ); type = NOTE_OUT_PPM; #endif } else if( !strncmp( "ppm", typename, 3 )) { type = NOTE_OUT_PPM; } else { fprintf( stderr, " WARNING: Unknown output type defaulting to ppm\n" ); type = NOTE_OUT_PPM; } sd = plu_connect(); if( sd < 0 ) goto error; if (dlp_ReadUserInfo(sd, &User) < 0) goto error_close; /* Open the NotePad database, store access handle in db */ if( dlp_OpenDB(sd, 0, 0x80 | 0x40, "npadDB", &db ) < 0) { fprintf(stderr," ERROR: Unable to open NotePadDB on Palm.\n"); dlp_AddSyncLogEntry(sd, "Unable to open NotePadDB.\n"); exit(EXIT_FAILURE); } buffer = pi_buffer_new (0xffff); dlp_ReadAppBlock(sd, db, 0, 0xffff, buffer); unpack_NotePadAppInfo( &nai, buffer->data, buffer->used); for (i = 0;; i++) { int attr, category, len = 0; struct NotePad n; if( sd ) { len = dlp_ReadRecordByIndex(sd, db, i, buffer, 0, &attr, &category); if (len < 0) break; } else pi_buffer_clear(buffer); /* Skip deleted records */ if ((attr & dlpRecAttrDeleted) || (attr & dlpRecAttrArchived)) continue; unpack_NotePad( &n, buffer->data, buffer->used); switch( action ) { case NOTEPAD_ACTION_LIST: print_note_info( n, nai, category ); printf( "\n" ); break; case NOTEPAD_ACTION_OUTPUT: if (!plu_quiet) { print_note_info( n, nai, category ); } output_picture( type, n ); if (!plu_quiet) { printf( "\n" ); } break; } } if( sd ) { /* Close the database */ dlp_CloseDB( sd, db ); dlp_AddSyncLogEntry( sd, "Successfully read NotePad from Palm.\n\n" "Thank you for using pilot-link."); dlp_EndOfSync( sd, 0 ); pi_close(sd); } pi_buffer_free (buffer); return 0; error_close: pi_close(sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-read-screenshot.c0000644000175000017500000002355311211745573022264 0ustar rousseaurousseau/* * $Id: pilot-read-screenshot.c,v 1.16 2006/11/02 14:54:31 desrod Exp $ * * pilot-read-screenshot.c * * Copyright (c) 2003-2004, Angus Ainslie * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #ifdef HAVE_STDINT_H #include #endif #include "pi-source.h" #include "pi-file.h" #include "pi-header.h" #include "pi-userland.h" #ifdef HAVE_PNG # include "png.h" # if (PNG_LIBPNG_VER < 10201) # define png_voidp_NULL (png_voidp)NULL # define png_error_ptr_NULL (png_error_ptr)NULL # endif #endif #define pi_mktag(c1,c2,c3,c4) (((c1)<<24)|((c2)<<16)|((c3)<<8)|(c4)) #define OUT_PPM 1 #define OUT_PNG 2 struct ss_state { int w, h, depth; unsigned char *pix_map; }; #define max(a,b) (( a > b ) ? a : b ) #define min(a,b) (( a < b ) ? a : b ) /*********************************************************************** * * Function: write_png * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ #ifdef HAVE_PNG void write_png ( char *fname, struct ss_state *state ) { unsigned char *gray_buf; int i, j; png_structp png_ptr; png_infop info_ptr; FILE *f; if( state->depth < 8 ) gray_buf = malloc( state->w ); png_ptr = png_create_write_struct (PNG_LIBPNG_VER_STRING, png_voidp_NULL, png_error_ptr_NULL, png_error_ptr_NULL); if (!png_ptr) return; info_ptr = png_create_info_struct (png_ptr); if (!info_ptr) { png_destroy_write_struct (&png_ptr, (png_infopp) NULL); return; } if (setjmp (png_jmpbuf (png_ptr))) { png_destroy_write_struct (&png_ptr, &info_ptr); fclose (f); return; } f = fopen (fname, "wb"); png_init_io (png_ptr, f); if( state->depth < 8 ) png_set_IHDR (png_ptr, info_ptr, state->w, state->h, 8, PNG_COLOR_TYPE_GRAY, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); else png_set_IHDR (png_ptr, info_ptr, state->w, state->h, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); png_write_info (png_ptr, info_ptr); if( state->depth < 8 ) { for (i = 0; i < state->h; i++) { for( j=0; jw; j++ ) gray_buf[j] = state->pix_map[i*3*state->w+j*3]; png_write_row (png_ptr, gray_buf ); png_write_flush (png_ptr); } } else { for (i = 0; i < state->h; i++) { png_write_row (png_ptr, &state->pix_map[i*3*state->w] ); png_write_flush (png_ptr); } } png_write_end (png_ptr, info_ptr); png_destroy_write_struct (&png_ptr, &info_ptr); fclose( f ); if( state->depth < 8 ) free( gray_buf ); } #endif void write_ppm ( char *fname, struct ss_state *state) { int i; FILE *f; f = fopen (fname, "wb"); fprintf (f, "P6\n# "); fprintf (f, "%s\n", fname ); fprintf (f, "%d %d\n", state->w, state->h ); fprintf (f, "255\n" ); for( i = 0; i < 3*state->h*state->w; i += 3 ) fwrite( &state->pix_map[i], 3, 1, f); fclose( f ); } /*********************************************************************** * * Function: WritePictures * * Summary: FIXME * * Parameters: * * Returns: * ***********************************************************************/ void WritePictures (int sd, int db, int type ) { char fname[FILENAME_MAX]; char extension[8]; int i, len, idx = 0, recs, imgNum = 0; // unsigned char inBuf[61440], *pixelBuf; pi_buffer_t *inBuf, *pixelBuf; unsigned long clut[256], magic; int attr, category, val, mask, j, k; struct ss_state state; if( type == OUT_PPM ) sprintf (extension, ".ppm"); else if( type == OUT_PNG ) sprintf (extension, ".png"); else return; inBuf = pi_buffer_new (61440); if (sd) while( 1 ) { len = dlp_ReadRecordByIndex (sd, db, idx, inBuf, 0, &attr, &category); if( len <= 0 ) { /* EOF */ break; } idx++; state.w = ( inBuf->data[4] << 8 )+ inBuf->data[5]; state.h = ( inBuf->data[6] << 8 ) + inBuf->data[7]; recs = inBuf->data[9]; state.depth = inBuf->data[8]; magic = ((unsigned long *)inBuf->data)[0]; if( magic != 0xBECEDEFE && magic != 0xDEDEFEFE ) { /* no magic must version 1 db */ // fprintf( stderr, "No Magic !\n" ); state.w = 160; state.h = 160; recs = 1; switch( len ) { case 3200: state.depth = 1; mask = 1; break; case 6400: state.depth = 2; mask = 3; break; case 12800: state.depth = 4; mask = 0x0f; break; case 26624: state.depth = 8; break; case 51200: state.depth = 16; break; default: /* unknown record */ /* get next */ fprintf( stderr, "Unknown record" ); continue; } } pixelBuf = pi_buffer_new (state.h * state.w * state.depth / 8 + 10 + 1024); // pixelBuf = malloc( state.h * state.w * state.depth / 8 + 10 + 1024 ); state.pix_map = malloc( state.h * state.w * 3 ); if( !pixelBuf || !state.pix_map ) { fprintf( stderr, "Memory Allocation failed\n" ); return; } if( magic == 0xBECEDEFE || magic == 0xDEDEFEFE ) memcpy( pixelBuf->data, &inBuf->data[10], len - 10 ); else memcpy( pixelBuf->data, inBuf->data, len ); for( i=1; i< recs; i++ ) { len = dlp_ReadRecordByIndex (sd, db, idx, inBuf, 0, &attr, &category); memcpy( &pixelBuf->data[i*61440-10], inBuf->data, len ); idx++; } sprintf (fname, "ScreenShot%d", ++imgNum ); if (plu_protect_files (fname, extension, sizeof(fname)) < 1) { goto cleanup; } printf ("Generating %s...\n", fname); fprintf( stderr, "height: %d width: %d records: %d bit depth: %d\n" , state.h, state.w, recs, state.depth ); if( state.depth == 8 ) memcpy( clut, &inBuf->data[len-1024], 1024 ); switch( state.depth ) { case 1: case 2: case 4: for( i = 0; i < state.h*state.w/(8/state.depth); i++) { for( j=(8/state.depth-1), k=0; j >= 0; j--, k++ ) { /* get right bits */ val = ((pixelBuf->data[i] >> (j * state.depth)) & mask); /* invert */ val = mask - val; /* stretch */ val *= (255/mask); state.pix_map[3*(i*(8/state.depth)+k)] = val; state.pix_map[3*(i*(8/state.depth)+k)+1] = val; state.pix_map[3*(i*(8/state.depth)+k)+2] = val; } } break; case 8: for( i = 0; i < state.h*state.w; i++) { state.pix_map[3*i] = *(1 + (char *)&clut[pixelBuf->data[i]]); state.pix_map[3*i+1] = *(2 + (char *)&clut[pixelBuf->data[i]]); state.pix_map[3*i+2] = *(3 + (char *)&clut[pixelBuf->data[i]]); } break; case 16: for( i = 0; i < state.h*state.w; i++) { state.pix_map[i*3] = pixelBuf->data[i*2] & 0xF8; state.pix_map[i*3+1] = ((pixelBuf->data[i*2] & 0x07 ) << 5) + (( pixelBuf->data[i*2+1] & 0xE0 ) >> 3 ); state.pix_map[i*3+2] = ( pixelBuf->data[i*2+1] & 0x1F ) << 3; } break; default: fprintf( stderr, "I'm out of my depth :)\n" ); break; } if( type == OUT_PPM ) write_ppm( fname, &state ); #ifdef HAVE_PNG else write_png( fname, &state ); #endif cleanup: pi_buffer_free (pixelBuf); // free( pixelBuf ); free( state.pix_map ); // fclose (f); } else return; pi_buffer_free (inBuf); } int main (int argc, const char *argv[]) { int c, /* switch */ db, sd = -1, dbcount = 0, type = OUT_PPM; const char *pformat; struct PilotUser User; poptContext po; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"format", 'f', POPT_ARG_STRING, &pformat, 0, "Specify picture output type (ppm or png)"}, POPT_TABLEEND }; po = poptGetContext("pilot-read-screenshot", argc, argv, options, 0); poptSetOtherOptionHelp(po,"\n\n"); if (argc<2) { poptPrintUsage(po,stderr,0); return 1; } while ((c = poptGetNextOpt(po)) >= 0) { fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } if (c<-1) { plu_badoption(po,c); } if (!strncmp ("png", pformat, 3)) { #ifdef HAVE_PNG type = OUT_PNG; #else fprintf (stderr, " ERROR: pilot-read-screenshot was built without png support.\n"); #endif } else if (!strncmp ("ppm", pformat, 3)) { type = OUT_PPM; } else { fprintf (stderr, " ERROR: Unknown output type, defaulting to ppm\n"); type = OUT_PPM; } sd = plu_connect (); if (sd < 0) goto error; if (dlp_ReadUserInfo (sd, &User) < 0) goto error_close; if (dlp_OpenDB (sd, 0, dlpOpenRead, "ScreenShotDB", &db) < 0) { fprintf (stderr," ERROR: Unable to open Screen Shot database on Palm.\n"); dlp_AddSyncLogEntry (sd, "Unable to open Screen Shot database.\n"); goto error_close; } WritePictures (sd, db, type ); if (sd) { /* Close the database */ dlp_CloseDB (sd, db); } if (sd) { dlp_AddSyncLogEntry (sd, "Successfully read screenshots from Palm.\n" "Thank you for using pilot-link."); dlp_EndOfSync (sd, 0); pi_close (sd); } if (!plu_quiet) { printf ("\nList complete. %d files found.\n", dbcount); } return 0; error_close: pi_close (sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-hinotes.c0000644000175000017500000002000611211745573020635 0ustar rousseaurousseau/* * $Id: pilot-hinotes.c,v 1.35 2006/10/12 14:21:21 desrod Exp $ * * pilot-hinotes.c: Translate Palm Hi-Note Text Memos into e-mail format * * Copyright (c) 1996, Kenneth Albanowski * Based on code by Bill Goodman, modified by Michael Bravo * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include "pi-source.h" #include "pi-hinote.h" #include "pi-dlp.h" #include "pi-header.h" #include "pi-userland.h" /* constants to determine how to produce memos */ #define MEMO_MBOX_STDOUT 0 #define MEMO_DIRECTORY 1 #define MAXDIRNAMELEN 1024 void write_memo_mbox(struct PilotUser User, struct HiNoteNote m, struct HiNoteAppInfo mai, int category); void write_memo_in_directory(char *dirname, struct HiNoteNote m, struct HiNoteAppInfo mai, int category); void write_memo_mbox(struct PilotUser User, struct HiNoteNote m, struct HiNoteAppInfo mai, int category) { int j; time_t ltime; struct tm *tm_ptr; char c, fromtmbuf[80], recvtmbuf[80]; time(<ime); tm_ptr = localtime(<ime); c = *asctime(tm_ptr); strftime(fromtmbuf, 80, "%a, %d %b %H:%M:%S %Y (%Z)\n", tm_ptr); strftime(recvtmbuf, 80, "%d %b %H:%M:%S %Y\n", tm_ptr); printf("From your.Palm.device %s" "Received: On your Palm by Hi-Note %s" "To: %s\n" "Date: %s" "Subject: [%s] ", fromtmbuf, recvtmbuf, User.username, fromtmbuf, mai.category.name[category]); /* print (at least part of) first line as part of subject: */ for (j = 0; j < 40; j++) { if ((!m.text[j]) || (m.text[j] == '\n')) break; printf("%c", m.text[j]); } if (j == 40) printf("...\n"); else printf("\n"); printf("\n"); printf(m.text); printf("\n"); } void write_memo_in_directory(char *dirname, struct HiNoteNote m, struct HiNoteAppInfo mai, int category) { int j; char pathbuffer[MAXDIRNAMELEN + (128 * 3)] = "", tmp[5] = ""; FILE *fd; /* Should check if dirname exists and is a directory */ mkdir(dirname, 0755); /* create a directory for the category */ strncat(pathbuffer, dirname, MAXDIRNAMELEN); strncat(pathbuffer, "/", 1); /* Should make sure category doesn't have slashes in it */ strncat(pathbuffer, mai.category.name[category], 60); /* Should check if dirname exists and is a directory */ mkdir(pathbuffer, 0755); /* Should check if there were problems creating directory */ /* open the actual file to write */ strncat(pathbuffer, "/", 1); for (j = 0; j < 40; j++) { if ((!m.text[j]) || (m.text[j] == '\n')) break; if (m.text[j] == '/') { strncat(pathbuffer, "=2F", 3); continue; } if (m.text[j] == '=') { strncat(pathbuffer, "=3D", 3); continue; } /* escape if it's an ISO8859 control chcter (note: some are printable on the Palm) */ if ((m.text[j] | 0x7f) < ' ') { tmp[0] = '\0'; sprintf(tmp, "=%2X", (unsigned char) m.text[j]); } else { tmp[0] = m.text[j]; tmp[1] = '\0'; } strcat(pathbuffer, tmp); } if (!plu_quiet) { printf(" Writing to file %s\n", pathbuffer); } if (!(fd = fopen(pathbuffer, "w"))) { fprintf(stderr," WARNING: can't open file \"%s\" for writing\n", pathbuffer); return; } fputs(m.text, fd); fclose(fd); } int main(int argc, const char **argv) { int c, /* switch */ db, i, sd = -1, mode = MEMO_MBOX_STDOUT; char *dirname = NULL; struct HiNoteAppInfo mai; struct PilotUser User; pi_buffer_t *buffer; poptContext pc; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"dirname", 'd', POPT_ARG_STRING, &dirname, 0, "Save memos in instead of writing to STDOUT", "dir"}, POPT_TABLEEND }; pc = poptGetContext("hinotes", argc, argv, options, 0); poptSetOtherOptionHelp(pc,"\n\n" " Synchronize your Hi-Notes database with your desktop machine\n\n" " By default, the contents of your Palm's Hi-Notes database will be written to\n" " STDOUT as a standard Unix mailbox (in mbox-format) file, with each\n" " memo as a separate message. The subject of each message will be the\n" " category.\n\n" " The memos will be written to STDOUT unless the '-d' option is specified.\n" " Using '-d' will be save the memos in subdirectories of . Each\n" " subdirectory will contain the name of a category on the Palm where the\n" " record was stored, and will contain the memos found in that category. \n\n" " Each memo's filename will be the first line (up to the first 40\n" " characters) of the memo. Control characters, slashes, and equal signs\n" " that would otherwise appear in filenames are converted using the correct\n" " MIME's quoted-printable encoding.\n\n" " ----------------------------------------------------------------------\n" " WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING\n" " ----------------------------------------------------------------------\n" " Note that if you have two memos in the same category whose first lines\n" " are identical, one of them will be OVERWRITTEN! This is unavoidable at\n" " the present time, but may be fixed in a future release. Also, please note\n" " that syncronizing Hi-Note images is not supported at this time, only text.\n\n" " Please see http://www.cyclos.com/ for more information on Hi-Note.\n\n" " Example arguments:\n" " -p /dev/pilot -d ~/Palm\n\n"); if (argc < 2) { poptPrintUsage(pc,stderr,0); return 1; } while ((c = poptGetNextOpt(pc)) >= 0) { fprintf(stderr," ERROR: Unhandled option %d.\n",c); return -1; } if (c < -1) { plu_badoption(pc,c); } if (dirname != NULL) { mode = MEMO_DIRECTORY; } sd = plu_connect(); if (sd<0) { goto error; } /* Did we get a valid socket descriptor back? */ if (dlp_OpenConduit(sd) < 0) { goto error_close; } /* Tell user (via Palm) that we are starting things up */ dlp_ReadUserInfo(sd, &User); dlp_OpenConduit(sd); /* Open the Memo Pad's database, store access handle in db */ if (dlp_OpenDB(sd, 0, 0x80 | 0x40, "Hi-NoteDB", &db) < 0) { fprintf(stderr," ERROR: Unable to open Hi-NoteDB on the Palm.\n"); dlp_AddSyncLogEntry(sd, "Unable to locate or open Hi-NoteDB.\nFile not found.\n"); goto error_close; } buffer = pi_buffer_new (0xffff); dlp_ReadAppBlock(sd, db, 0, 0xffff, buffer); unpack_HiNoteAppInfo(&mai, buffer->data, 0xffff); for (i = 0;; i++) { int attr, category; struct HiNoteNote m; int len = dlp_ReadRecordByIndex(sd, db, i, buffer, NULL, &attr, &category); if (len < 0) break; /* Skip deleted records */ if ((attr & dlpRecAttrDeleted) || (attr & dlpRecAttrArchived)) continue; unpack_HiNoteNote(&m, buffer->data, buffer->used); switch (mode) { case MEMO_MBOX_STDOUT: write_memo_mbox(User, m, mai, category); break; case MEMO_DIRECTORY: write_memo_in_directory(dirname, m, mai, category); break; } } pi_buffer_free(buffer); /* Close the Hi-Note database and write out to the Palm logfile */ dlp_CloseDB(sd, db); dlp_AddSyncLogEntry(sd, "Successfully read Hi-Notes from Palm.\nThank you for using pilot-link.\n"); dlp_EndOfSync(sd, 0); pi_close(sd); return 0; error_close: pi_close(sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-clip.c0000644000175000017500000001106311211745573020116 0ustar rousseaurousseau/* * $Id: pilot-clip.c,v 1.38 2006/10/12 14:21:21 desrod Exp $ * * pilot-clip.c: Transfer data to or from the Palm's clipboard * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include "pi-source.h" #include "pi-syspkt.h" #include "pi-dlp.h" #include "pi-header.h" #include "pi-userland.h" static void *GetClip(int sock, int type, int *length) { int len, err; struct RPC_params p; unsigned long handle, ptr; void *buffer; /* ClipboardGetItem */ PackRPC(&p, 0xA10C, RPC_PtrReply, RPC_Byte(type), RPC_ShortPtr(&len), RPC_End); err = dlp_RPC(sock, &p, &handle); if (err) return 0; if (!handle) return 0; /* MemHandleLock */ PackRPC(&p, 0xA021, RPC_PtrReply, RPC_Long(handle), RPC_End); err = dlp_RPC(sock, &p, &ptr); if (err) return 0; buffer = malloc(len); /* MemMove */ PackRPC(&p, 0xA026, RPC_IntReply, RPC_Ptr(buffer, len), RPC_Long(ptr), RPC_Long(len), RPC_End); err = dlp_RPC(sock, &p, 0); /* MemHandleUnlock */ PackRPC(&p, 0xA022, RPC_IntReply, RPC_Long(handle), RPC_End); err = dlp_RPC(sock, &p, 0); if (length) *length = len; return buffer; } static int SetClip(int sock, int type, void *data, int length) { int err; char *b = data; struct RPC_params p; unsigned long handle, ptr; /* MemHandleNew */ PackRPC(&p, 0xA01E, RPC_PtrReply, RPC_Long(length), RPC_End); err = dlp_RPC(sock, &p, &handle); if (err) return 0; if (!handle) return 0; /* MemHandleLock */ PackRPC(&p, 0xA021, RPC_PtrReply, RPC_Long(handle), RPC_End); err = dlp_RPC(sock, &p, &ptr); if (err) return 0; /* MemMove */ PackRPC(&p, 0xA026, RPC_IntReply, RPC_Long(ptr), RPC_Ptr(b, length), RPC_Long(length), RPC_End); err = dlp_RPC(sock, &p, 0); length--; /* ClipboardAddItem */ PackRPC(&p, 0xA10A, RPC_IntReply, RPC_Byte(type), RPC_Long(ptr), RPC_Short(length), RPC_End); err = dlp_RPC(sock, &p, 0); /* MemPtrFree */ PackRPC(&p, 0xA012, RPC_IntReply, RPC_Long(ptr), RPC_End); err = dlp_RPC(sock, &p, 0); return 1; } int main(int argc, const char *argv[]) { int c, /* switch */ sd = -1, ret; enum { mode_none, mode_set='s', mode_get='g' } mode = mode_none; char buffer[0xffff]; poptContext po; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"get", 'g', POPT_ARG_NONE, NULL, 'g', "Print the contents of the clipboard on STDOUT", NULL}, {"set", 's', POPT_ARG_NONE, NULL, 's', "Set the value in the clipboard from STDIN", NULL}, POPT_AUTOHELP POPT_TABLEEND }; po = poptGetContext("pilot-clip", argc, argv, options, 0); poptSetOtherOptionHelp(po,"\n\n" " Get or Set the Palm Clipboard contents from STDOUT/STDIN.\n" " Must provide one of -g or -s.\n\n"); if (argc < 2) { poptPrintUsage(po,stderr,0); return 1; } while ((c = poptGetNextOpt(po)) >= 0) { switch (c) { case 's': case 'g': if (mode != mode_none) { fprintf(stderr, " ERROR: --get or --set, not both.\n"); return 1; } mode = c; break; default: fprintf(stderr," ERROR: Unhandled option %d.\n", c); return 1; } } if (mode_none == mode) { fprintf(stderr, " ERROR: You must specify whether to " "\"Get\" or \"Set\" the clipboard\n"); return -1; } sd = plu_connect(); if (sd < 0) goto error; if (dlp_OpenConduit(sd) < 0) goto error_close; if (mode == mode_set) { ret = read(fileno(stdin), buffer, 0xffff); if (ret >= 0) { buffer[ret++] = 0; if (SetClip(sd, 0, buffer, ret) <= 0) goto error_close; } } else { char *b; ret = 0; b = GetClip(sd, 0, &ret); if (b == NULL) goto error_close; if (ret > 0) write(fileno(stdout), b, ret); } if (pi_close(sd) < 0) goto error; return 0; error_close: pi_close(sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pd-tty.c0000644000175000017500000002667711211745573017304 0ustar rousseaurousseau/* * $Id: pd-tty.c,v 1.20 2006/10/12 14:21:21 desrod Exp $ * * pd-tty.c: Text asynchronous input/output support for pilot-debug. * Currently includes interfaces to STDIO (using plus-patch style * handlers), readline 2.0 (using hack of readline internals to * simulate co-routine), readline 2.1 (using callback mechanism) * and Tk (using a standard text widget.) * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ void display(char *text, char *tag, int type); void do_readline(void); #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "pi-source.h" #include "pi-dlp.h" #include "pi-syspkt.h" #ifdef TK extern int usetk; #include #else #include #endif #ifndef TCL_ACTIVE #define TCL_ACTIVE TCL_READABLE #endif extern int Interactive; extern Tcl_Interp *interp; extern int tty; /* Non-zero means standard input is a terminal-like device. Zero means it's NULL */ #ifdef HAVE_READLINE_EXTRA #include #include static Tcl_DString command; static int mode = 0; static void Readable(ClientData d, int mask) { mode = 1; rl_callback_read_char(); } static void Exit(ClientData d) { rl_callback_handler_remove(); if (mode) puts(""); } /*********************************************************************** * * Function: execline * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void execline(char *line) { int gotPartial = 0; char *cmd; if (line == 0) { char buf[20]; int exitCode = 0; sprintf(buf, "exit %d", exitCode); Tcl_Eval(interp, buf); return; } (void) Tcl_DStringAppend(&command, line, -1); cmd = Tcl_DStringAppend(&command, "\n", -1); add_history(line); if (!Tcl_CommandComplete(cmd)) { gotPartial = 1; } else { int code; gotPartial = 0; mode = 0; code = Tcl_RecordAndEval(interp, cmd, TCL_EVAL_GLOBAL); Tcl_DStringFree(&command); if (*interp->result != 0) { Tcl_Channel chan; if (code != TCL_OK) { chan = Tcl_GetChannel(interp, "stderr", NULL); } else { chan = Tcl_GetChannel(interp, "stdout", NULL); } if (chan) { Tcl_Write(chan, interp->result, -1); Tcl_Write(chan, "\n", 1); } } Tcl_ResetResult(interp); } rl_callback_handler_install(gotPartial ? "> " : "pilot-debug> ", execline); } /*********************************************************************** * * Function: do_readline * * Summary: Internal readline routine * * Parameters: None * * Returns: Nothing * ***********************************************************************/ void do_readline(void) { char buf[20]; int exitCode = 0; Tcl_Channel in = Tcl_GetStdChannel(TCL_STDIN); Tcl_SetChannelOption(interp, in, "-blocking", "off"); Tcl_CreateChannelHandler(in, TCL_READABLE, Readable, 0); rl_callback_handler_install("pilot-debug> ", execline); Tcl_CreateExitHandler((Tcl_ExitProc *) Exit, (ClientData) 0); while (Tcl_DoOneEvent(0)) { } sprintf(buf, "exit %d", exitCode); Tcl_Eval(interp, buf); return; } #else static void StdinProc(ClientData clientData, int mask); static void Prompt(Tcl_Interp * interp, int partial); static Tcl_DString command; /* Used to buffer incomplete commands being read from stdin. */ static Tcl_DString line; /* Used to read the next line from the terminal input. */ static int gotPartial = 0; static int mode = 0; /*********************************************************************** * * Function: do_readline * * Summary: Process commands from stdin until there's an end-of-file * * Parameters: None * * Returns: Nothing * ***********************************************************************/ void do_readline(void) { char buf[20]; int exitCode = 0; Tcl_Channel inChannel, outChannel; /* Note that we need to fetch the standard channels again after every eval, since they may have been changed. */ inChannel = Tcl_GetChannel(interp, "stdin", NULL); if (inChannel) { Tcl_CreateChannelHandler(inChannel, TCL_READABLE | TCL_ACTIVE, StdinProc, (ClientData) inChannel); } if (tty) { Prompt(interp, 0); } outChannel = Tcl_GetChannel(interp, "stdout", NULL); if (outChannel) { Tcl_Flush(outChannel); } Tcl_DStringInit(&command); Tcl_CreateExitHandler((Tcl_ExitProc *) Tcl_DStringFree, (ClientData) & command); Tcl_DStringInit(&line); Tcl_ResetResult(interp); /* Loop infinitely until all event handlers are passive. Then exit. Rather than calling exit, invoke the "exit" command so that users can replace "exit" with some other command to do additional cleanup on exit. The Tcl_Eval call should never return. */ while (Tcl_DoOneEvent(0)) { } sprintf(buf, "exit %d", exitCode); Tcl_Eval(interp, buf); return; } /*********************************************************************** * * Function: StdinProc * * Summary: This procedure is invoked by the event dispatcher whenever * standard input becomes readable. It grabs the next line of * input chcters, adds them to a command being assembled, * and executes the command if it's complete. * * Parameters: None * * Returns: Nothing * * Comments: Could be almost arbitrary, depending on the command * that's used * ***********************************************************************/ static void StdinProc(clientData, mask) ClientData clientData; /* Not used. */ int mask; /* Not used. */ { int code, count; char *cmd; Tcl_Channel newchan, chan = (Tcl_Channel) clientData; count = Tcl_Gets(chan, &line); if (count < 0) { if (!gotPartial) { if (tty) { Tcl_Exit(0); } else { Tcl_DeleteChannelHandler(chan, StdinProc, (ClientData) chan); } return; } else { count = 0; } } (void) Tcl_DStringAppend(&command, Tcl_DStringValue(&line), -1); cmd = Tcl_DStringAppend(&command, "\n", -1); Tcl_DStringFree(&line); if (!Tcl_CommandComplete(cmd)) { gotPartial = 1; goto prompt; } gotPartial = 0; /* Disable the stdin channel handler while evaluating the command; otherwise if the command re-enters the event loop we might process commands from stdin before the current command is finished. Among other things, this will trash the text of the command being evaluated. */ Tcl_CreateChannelHandler(chan, TCL_ACTIVE, StdinProc, (ClientData) chan); code = Tcl_RecordAndEval(interp, cmd, TCL_EVAL_GLOBAL); newchan = Tcl_GetChannel(interp, "stdin", NULL); if (chan != newchan) { Tcl_DeleteChannelHandler(chan, StdinProc, (ClientData) chan); } if (newchan) { Tcl_CreateChannelHandler(newchan, TCL_READABLE | TCL_ACTIVE, StdinProc, (ClientData) newchan); } Tcl_DStringFree(&command); if (*interp->result != 0) { if (code != TCL_OK) { chan = Tcl_GetChannel(interp, "stderr", NULL); } else if (tty) { chan = Tcl_GetChannel(interp, "stdout", NULL); } else { chan = NULL; } if (chan) { Tcl_Write(chan, interp->result, -1); Tcl_Write(chan, "\n", 1); } } /* Output a prompt. */ prompt: if (tty) { Prompt(interp, gotPartial); } Tcl_ResetResult(interp); } /*********************************************************************** * * Function: Prompt * * Summary: Issue a prompt on standard output, or invoke a script * to issue the prompt * * Parameters: None * * Returns: Outputs a prompt, Tcl script may be evaluated in interp * ***********************************************************************/ static void Prompt(interp, partial) Tcl_Interp *interp; /* Interpreter to use for prompting. */ int partial; /* Non-zero means there already exists a partial command, so use the secondary prompt. */ { char *promptCmd; int code; Tcl_Channel outChannel, errChannel; errChannel = Tcl_GetChannel(interp, "stderr", NULL); promptCmd = Tcl_GetVar(interp, partial ? "tcl_prompt2" : "tcl_prompt1", TCL_GLOBAL_ONLY); if (promptCmd == NULL) { outChannel = Tcl_GetChannel(interp, "stdout", NULL); defaultPrompt: if (!partial && outChannel) { Tcl_Write(outChannel, "% ", 2); } } else { code = Tcl_Eval(interp, promptCmd); outChannel = Tcl_GetChannel(interp, "stdout", NULL); if (code != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (script that generates prompt)"); /* We must check that errChannel is a real channel - it is possible that someone has transferred stderr out of this interpreter with "interp transfer". */ errChannel = Tcl_GetChannel(interp, "stdout", NULL); if (errChannel != (Tcl_Channel) NULL) { Tcl_Write(errChannel, interp->result, -1); Tcl_Write(errChannel, "\n", 1); } goto defaultPrompt; } else if (*interp->result && outChannel) { Tcl_Write(outChannel, interp->result, strlen(interp->result)); } } if (outChannel) { Tcl_Flush(outChannel); } } #endif /* !HAVE_READLINE_EXTRA */ /*********************************************************************** * * Function: display * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ void display(char *text, char *tag, int type) { int i; #ifdef TK if (usetk) { Tcl_DString disp; Tcl_DStringInit(&disp); if (mode == 0) { Tcl_DStringAppend(&disp, ".f.t mark set display {insert linestart};", -1); mode = 1; } Tcl_DStringAppend(&disp, ".f.t insert display", -1); Tcl_DStringAppendElement(&disp, text); if (tag) Tcl_DStringAppendElement(&disp, tag); if (strlen(text) && (text[strlen(text) - 1] == '\n')) { mode = 0; } if (mode == 0) Tcl_DStringAppend(&disp, ";.f.t mark unset display", -1); /* printf("Exec |%s|\n", Tcl_DStringValue(&disp)); */ Tcl_Eval(interp, Tcl_DStringValue(&disp)); /* puts(interp->result); */ Tcl_DStringFree(&disp); return; } #endif type++; for (i = 0; i < strlen(text); i++) { if (mode == 0) { /* At prompt */ /* Dumb hack to erase prompt */ printf ("\r \r"); mode = -1; /* Beginning of line */ } if (mode != type) { if (mode != -1) printf("\n"); /* end current line */ printf("%s", tag); mode = type; } printf("%c", text[i]); if (text[i] == '\n') { mode = 0; #ifdef HAVE_READLINE_EXTRA rl_forced_update_display(); /* Bring the prompt back */ #else Prompt(interp, gotPartial); #endif } } } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/kittykiller.c0000644000175000017500000000371011211745573020411 0ustar rousseaurousseau/* * $Id: kittykiller.c,v 1.12 2006/10/12 14:21:21 desrod Exp $ * * kittykiller.c - Kill the HotSync Manager * * Copyright (c) 1999, Tilo Christ * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #define WM_POKEHOTSYNC WM_USER + 0xbac5 /* Terminate without displaying the "Are you sure?" confirmation dialog. */ #define PHS_QUIET_WM_CLOSE 1 #define HOTSYNC_APP_CLASS "KittyHawk" int main(int argc, char *argv[]) { /* obtain the handle for the HotSync Manager's window */ HWND hWnd = FindWindow(HOTSYNC_APP_CLASS, NULL); printf(" .--------------------------------------------.\n" " | (c) Copyright 1996-2004, pilot-link team |\n" " | Join the pilot-link lists to help out. |\n" " `--------------------------------------------'\n\n"); if (!hWnd) { printf(" HotSync Manager was not running... exiting.\n"); } else { printf(" Shutting down HotSync Manager...\n"); SendMessage(hWnd, WM_POKEHOTSYNC, PHS_QUIET_WM_CLOSE, 0); } printf(" Thank you for using pilot-link.\n\n"); return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-install-todo.c0000644000175000017500000001420411211745573021600 0ustar rousseaurousseau/* * $Id: pilot-install-todo.c,v 1.27 2006/10/12 14:21:20 desrod Exp $ * * install-todo.c: Palm ToDo list installer * * Copyright 2002, Martin Fick, based on code in install-todos by Robert A. * Kaplan * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "pi-userland.h" #include #include #include "pi-source.h" #include "pi-dlp.h" #include "pi-todo.h" #include "pi-header.h" poptContext po; #ifndef HAVE_BASENAME /* Yes, this isn't efficient... scanning the string twice */ #define basename(s) (strrchr((s), '/') == NULL ? (s) : strrchr((s), '/') + 1) #endif #define DATE_STR_MAX 1000 char *strptime(const char *s, const char *format, struct tm *tm); /*********************************************************************** * * Function: read_file * * Summary: Reads a file from disk to import into ToDoDB.pdb * * Parameters: Pointer to a filename * * Returns: Text inside the file, of course * ***********************************************************************/ int read_file(char *filename, char **text) { FILE *f; size_t filelen; f = fopen(filename, "r"); if (f == NULL) { fprintf(stderr," ERROR: Could not open '%s': %s\n", filename,strerror(errno)); return -1; } fseek(f, 0, SEEK_END); filelen = ftell(f); fseek(f, 0, SEEK_SET); *text = (char *) malloc(filelen + 1); if (*text == NULL) { fprintf(stderr," ERROR: Could not allocate memory.\n"); return -1; } fread(*text, filelen, 1, f); return 0; } /*********************************************************************** * * Function: install_ToDo * * Summary: Adds the entry to ToDoDB.pdb * * Parameters: * * Returns: Nothing * ***********************************************************************/ void install_ToDo(int sd, int db, struct ToDo todo) { pi_buffer_t *ToDo_buf; char duedate[DATE_STR_MAX]; printf("Indefinite: %i\n", todo.indefinite); /* Assume DATE_STR_MAX is at least 40 or so. */ if (todo.indefinite == 0) { strftime(duedate, DATE_STR_MAX, "%a %b %d %H:%M:%S %Z %Y", &todo.due); } else { strncpy(duedate,"",DATE_STR_MAX); } printf("Due Date: %s\n", duedate); printf("Priority: %i\n", todo.priority); printf("Complete: %i\n", todo.complete); printf("Description: %s\n", todo.description); printf("Note: %s\n", todo.note); ToDo_buf = pi_buffer_new(0); pack_ToDo(&todo, ToDo_buf, todo_v1); dlp_WriteRecord(sd, db, 0, 0, 0, ToDo_buf->data, ToDo_buf->used, 0); pi_buffer_free(ToDo_buf); return; } int main(int argc, const char *argv[]) { int sd = -1, db, po_err = -1; char *due = NULL, *description = NULL, *note = NULL, *filename = NULL; int priority = 1; int completed = 0; struct PilotUser User; struct ToDo todo; const struct poptOption options[] = { USERLAND_RESERVED_OPTIONS { "priority", 'P', POPT_ARG_INT, &priority, 0, "The Priority (default is 1)", "[1|2|3|4|5]"}, { "due", 'd', POPT_ARG_STRING, &due, 0, "The due Date of the item (default is no date)", "mm/dd/yyyy"}, { "completed", 'c', POPT_ARG_NONE, &completed, 0, "Mark the item complete (default is incomplete)"}, { "description", 'D', POPT_ARG_STRING, &description, 0, "The title of the ToDo entry", "[title]"}, { "note", 'n', POPT_ARG_STRING, ¬e, 0, "The Note(tm) text (a single string)", ""}, { "file", 'f', POPT_ARG_STRING, &filename, 0, "A local filename containing the Note text", "[filename]"}, POPT_TABLEEND }; po = poptGetContext("install-todo", argc, (const char **) argv, options, 0); poptSetOtherOptionHelp(po, " [-p port] \n\n" " Updates the Palm ToDo list with a single new entry\n\n" " Example:\n" " -p /dev/pilot -n 'Buy Milk' -D 'Go shopping, see note for items'\n\n"); if (argc < 2) { poptPrintUsage(po,stderr,0); return 1; } while ((po_err = poptGetNextOpt(po)) >= 0) { fprintf(stderr," ERROR: Unhandled option %d.\n",po_err); return 1; } if (po_err < -1) { plu_badoption(po,po_err); } if ((priority < 1) || (priority > 5)) { priority=1; fprintf(stderr," WARNING: Changed illegal priority to 1.\n"); } /* Setup some todo defaults */ todo.indefinite = 1; todo.priority = priority; todo.complete = completed; todo.description = description; if (filename) { int c = read_file(filename,&todo.note); if (c<0) { return 1; } } else { todo.note = note; } if (due != NULL) { strptime(due, "%m/%d/%Y", &todo.due); todo.indefinite = 0; todo.due.tm_sec = 0; todo.due.tm_min = 0; todo.due.tm_hour = 0; } sd = plu_connect(); if (sd < 0) return 1; /* Open the ToDo database, store access handle in db */ if (dlp_OpenDB(sd, 0, 0x80 | 0x40, "ToDoDB", &db) < 0) { fprintf(stderr," ERROR: Unable to open ToDo Database on Palm.\n"); dlp_AddSyncLogEntry(sd, "Unable to open ToDo Database.\n"); pi_close(sd); return 1; } install_ToDo(sd, db, todo); dlp_CloseDB(sd, db); /* Tell the user who it is, with a different PC id. */ User.lastSyncPC = 0x00010000; User.lastSyncDate = User.successfulSyncDate = time(0); dlp_WriteUserInfo(sd, &User); dlp_AddSyncLogEntry(sd, "Wrote ToDo entry to Palm.\n\n" "Thank you for using pilot-link.\n"); dlp_EndOfSync(sd, 0); pi_close(sd); return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-debug.c0000644000175000017500000014667011211745573020272 0ustar rousseaurousseau/* * $Id: pilot-debug.c,v 1.43 2006/10/12 14:21:21 desrod Exp $ * * pilot-debug.c: Palm debugging console, with optional graphics support * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include #include #include #include #include #include #include "pi-source.h" #include "pi-dlp.h" #include "pi-syspkt.h" /* Definitions for functions in pd-tty.c */ extern void do_readline(void); /* Display text asynchronously, and make sure it doesn't interfere with the current prompt */ extern void display(char * text, char * tag, int type); #ifndef LIBDIR #define LIBDIR "." #endif #ifdef TK int usetk; #include #else #include #endif #ifndef TCL_ACTIVE #define TCL_ACTIVE TCL_REA #endif #ifndef TCL_RELEASE_LEVEL #define TCL_RELEASE_LEVEL 8 #endif #ifdef SUNOS /* The following variable is a special hack that is needed in order for Sun shared libraries to be used for Tcl. */ int *tclDummyMathPtr = (int *) matherr; #endif int done = 0; int Interactive = 1; Tcl_Interp * interp; struct Pilot_state state; int debugger = 0; /* If non-zero, then debugger is thought to be active */ int console = 0; /* If non-zero, then console is thought to be active Note: if both console and debugger are thought to be active, only the debugger will be usable. If execution is continued, the console be be usable again. */ int stalestate = 1; /* If non-zero, then the current Palm state (in particular the registers) should be assumed out-of-date */ int port = 0; int tty; /* Non-zero means standard input is a terminal-like device. Zero means it's */ /* Misc utility */ static void SetLabel(const char * label, const char * value) { #ifdef TK if (usetk) Tcl_VarEval(interp, label, " configure -text "", value, """,NULL); #endif } static char *itoa(int val) { static char buf[20]; sprintf(buf, "%d", val); return buf; } static char *htoa(int val) { static char buf[9]; sprintf(buf, "%8.8X", val); return buf; } static char *h4toa(int val) { static char buf[5]; sprintf(buf, "%4.4X", val); return buf; } static int SayInteractive(char *text) { Tcl_DString d; if (!Interactive) return 0; Tcl_DStringInit(&d); #ifdef TK if (usetk) { Tcl_DStringAppendElement(&d, ".f.t"); Tcl_DStringAppendElement(&d, "insert"); Tcl_DStringAppendElement(&d, "insert"); Tcl_DStringAppendElement(&d, text); Tcl_Eval(interp, Tcl_DStringValue(&d)); Tcl_DStringFree(&d); Tcl_DStringAppendElement(&d, ".f.t"); Tcl_DStringAppendElement(&d, "see"); Tcl_DStringAppendElement(&d, "insert"); Tcl_Eval(interp, Tcl_DStringValue(&d)); Tcl_DStringFree(&d); } else { #endif Tcl_DStringAppendElement(&d, "puts"); Tcl_DStringAppendElement(&d, text); Tcl_Eval(interp, Tcl_DStringValue(&d)); Tcl_DStringFree(&d); #ifdef TK } #endif Tcl_Eval(interp, Tcl_DStringValue(&d)); Tcl_DStringFree(&d); return 0; } /*********************************************************************** * * Function: Say * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int Say(char *text) { Tcl_DString d; if (Interactive) { Tcl_DStringInit(&d); #ifdef TK if (usetk) { Tcl_DStringAppendElement(&d, ".f.t"); Tcl_DStringAppendElement(&d, "insert"); Tcl_DStringAppendElement(&d, "insert"); Tcl_DStringAppendElement(&d, text); Tcl_Eval(interp, Tcl_DStringValue(&d)); Tcl_DStringFree(&d); Tcl_DStringAppendElement(&d, ".f.t"); Tcl_DStringAppendElement(&d, "see"); Tcl_DStringAppendElement(&d, "insert"); Tcl_Eval(interp, Tcl_DStringValue(&d)); Tcl_DStringFree(&d); } else { #endif Tcl_DStringAppendElement(&d, "puts"); Tcl_DStringAppendElement(&d, text); Tcl_Eval(interp, Tcl_DStringValue(&d)); Tcl_DStringFree(&d); #ifdef TK } #endif } else Tcl_AppendResult(interp, text, NULL); return 0; } static int Error(char *text) { Tcl_SetResult(interp, text, TCL_STATIC); return TCL_ERROR; } /*********************************************************************** * * Function: SetModeLabel * * Summary: What state are we starting up in * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void SetModeLabel(void) { SetLabel(".state.halted", debugger ? "Debugger" : console ? "Console" : "None"); } /*********************************************************************** * * Function: Read_Pilot * * Summary: Read input from the Palm. Called both via Tcl event * loop on serial input, and explicitly by any function * has thinks there should be a packet ready * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void Read_Pilot(ClientData clientData, int mask) { unsigned char buf[4096]; int l; memset(buf, 0, 4096); l = pi_read(port, buf, 4096); if (l < 6) return; /* puts("From Palm:"); pi_dumpdata((unsigned char *)buf, l); */ if (buf[2] == 0) { /* SysPkt command */ if (buf[0] == 2) { /* UI */ if ((!console) || debugger) { Say("Console active\n"); console = 1; debugger = 0; SetModeLabel(); Tcl_VarEval(interp, "checkin 25", NULL); } if (buf[4] == 0x0c) { /* Screen update */ #ifdef TK if (usetk) { int i, x1, y1, sx, sy, w, h, bytes; int y, x; char buffer[8192]; Tk_PhotoImageBlock block; Tk_PhotoHandle handle; bytes = get_short(buf + 6); y1 = get_short(buf + 8); x1 = get_short(buf + 10); sy = get_short(buf + 12); sx = get_short(buf + 14); h = get_short(buf + 16); w = get_short(buf + 18); block.width = w + x1; block.height = h; block.pitch = w + x1; block.pixelSize = 1; block.offset[0] = 0; block.offset[1] = 0; block.offset[2] = 0; block.pixelPtr = buffer; #if (TK_MAJOR_VERSION < 8) || ((TK_MAJOR_VERSION == 8) && (TK_RELEASE_LEVEL < 2)) handle = Tk_FindPhoto("Case"); #else handle = Tk_FindPhoto(interp, "Case"); #endif i = 0; l = 0; for (y = 0; y < h; y++) { l = 20 + (y * bytes); for (x = 0; x < (w + x1); x++) { int mask = 1 << (7 - (x % 8)); buffer[i++] = (buf[x / 8 + l] & mask) ? 0 : 0xff; } } /* for(i=0;i<((l-20)*8);i++) { int p = i/8+20; int b = 1<<(7-(i%8)); buffer[i] = (buf[p] & b) ? 0 : 0xff; } */ Tk_PhotoPutBlock(handle, &block, 32 + sx - x1, 33 + sy - y1, w + x1, h); Tcl_VarEval(interp, "global show; set show(.remote) 1; update", NULL); } #endif return; } } else if (buf[0] == 1) { /* Console */ if (buf[4] == 0x7f) { /* Message from Palm */ int i; for (i = 6; i < l; i++) if (buf[i] == '\r') buf[i] = '\n'; /* Insert message into both debug and console windows */ #ifdef TK if (usetk) { Tcl_VarEval(interp, ".console.t insert end "", buf + 6, """, NULL); Tcl_VarEval(interp, ".console.t mark set insert end", NULL); Tcl_VarEval(interp, ".console.t see insert", NULL); } #endif display(buf + 6, "Console: ", 2); return; } } else if (buf[0] == 0) { /* Debug */ if (!debugger) { debugger = 1; SetModeLabel(); Tcl_VarEval(interp, "checkin 25", NULL); } if (buf[4] == 0x7f) { /* Message */ int i; for (i = 6; i < l; i++) if (buf[i] == '\r') buf[i] = '\n'; display(buf + 6, "Debug: ", 1); return; } else if (buf[4] == 0x8c) { /* Breakpoints set */ Say("Breakpoint set\n"); return; } else if (buf[4] == 0x80) { /* State response */ sys_UnpackState(buf + 6, &state); if (stalestate) { char buffer[40]; sprintf(buffer, "Palm halted at %8.8lX (function %s) with exception %d\n", state.regs.PC, state.func_name, state.exception); display(buffer, "Debug: ", 1); stalestate = 0; } SetLabel(".state.exception", itoa(state.exception)); SetLabel(".state.funcname", state.func_name); SetLabel(".state.funcstart", htoa(state.func_start)); SetLabel(".state.funcend", htoa(state.func_end)); SetLabel(".state.d0", htoa(state.regs.D[0])); SetLabel(".state.a0", htoa(state.regs.A[0])); SetLabel(".state.d1", htoa(state.regs.D[1])); SetLabel(".state.a1", htoa(state.regs.A[1])); SetLabel(".state.d2", htoa(state.regs.D[2])); SetLabel(".state.a2", htoa(state.regs.A[2])); SetLabel(".state.d3", htoa(state.regs.D[3])); SetLabel(".state.a3", htoa(state.regs.A[3])); SetLabel(".state.d4", htoa(state.regs.D[4])); SetLabel(".state.a4", htoa(state.regs.A[4])); SetLabel(".state.d5", htoa(state.regs.D[5])); SetLabel(".state.a5", htoa(state.regs.A[5])); SetLabel(".state.d6", htoa(state.regs.D[6])); SetLabel(".state.a6", htoa(state.regs.A[6])); SetLabel(".state.d7", htoa(state.regs.D[7])); SetLabel(".state.ssp", htoa(state.regs.SSP)); SetLabel(".state.usp", htoa(state.regs.USP)); SetLabel(".state.sr", h4toa(state.regs.SR)); SetLabel(".state.pc", htoa(state.regs.PC)); SetLabel(".state.reset", state.reset ? "Yes" : "No"); SetLabel(".state.b1", htoa(state.breakpoint[0].address)); SetLabel(".state.b1a", (state.breakpoint[0].enabled) ? "Yes" : "No"); SetLabel(".state.b2", htoa(state.breakpoint[1].address)); SetLabel(".state.b2a", (state.breakpoint[1].enabled) ? "Yes" : "No"); SetLabel(".state.b3", htoa(state.breakpoint[2].address)); SetLabel(".state.b3a", (state.breakpoint[2].enabled) ? "Yes" : "No"); SetLabel(".state.b4", htoa(state.breakpoint[3].address)); SetLabel(".state.b4a", (state.breakpoint[3].enabled) ? "Yes" : "No"); SetLabel(".state.b5", htoa(state.breakpoint[4].address)); SetLabel(".state.b5a", (state.breakpoint[4].enabled) ? "Yes" : "No"); SetLabel(".state.b6", htoa(state.breakpoint[5].address)); SetLabel(".state.b6a", (state.breakpoint[5].enabled) ? "Yes" : "No"); /* Show the state window if it is hidden */ Tcl_VarEval(interp, "set show(.state) 1", NULL); return; } } } } /*********************************************************************** * * Function: ParseAddress * * Summary: Turn an address string into a numeric value. Ideally, * it should also know about traps, function names, etc. * As it is, it just assumed the text is a hexadecimal * number, with or with '0x' prefix. * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static unsigned long ParseAddress(char *address) { return strtoul(address, 0, 16); } /*********************************************************************** * * Function: SetBreakpoint * * Summary: Utility function to modify breakpoint table * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int SetBreakpoint(int bp, unsigned long address, int enabled) { state.breakpoint[bp].address = address; state.breakpoint[bp].enabled = enabled; SetLabel(".state.b1", htoa(state.breakpoint[0].address)); SetLabel(".state.b1a", (state.breakpoint[0].enabled) ? "Yes" : "No"); SetLabel(".state.b2", htoa(state.breakpoint[1].address)); SetLabel(".state.b2a", (state.breakpoint[1].enabled) ? "Yes" : "No"); SetLabel(".state.b3", htoa(state.breakpoint[2].address)); SetLabel(".state.b3a", (state.breakpoint[2].enabled) ? "Yes" : "No"); SetLabel(".state.b4", htoa(state.breakpoint[3].address)); SetLabel(".state.b4a", (state.breakpoint[3].enabled) ? "Yes" : "No"); SetLabel(".state.b5", htoa(state.breakpoint[4].address)); SetLabel(".state.b5a", (state.breakpoint[4].enabled) ? "Yes" : "No"); SetLabel(".state.b6", htoa(state.breakpoint[5].address)); SetLabel(".state.b6a", (state.breakpoint[5].enabled) ? "Yes" : "No"); sys_SetBreakpoints(port, &state.breakpoint[0]); Read_Pilot(0, 0); return 0; } int majorVersion, minorVersion, stateVersion, buildVersion; /*********************************************************************** * * Function: DbgGetDeviceVersion * * Summary: Return the device version in use * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void DbgGetDeviceVersion(void) { int result; struct RPC_params p; unsigned long ROMversion; ROMversion = 0x12345678; PackRPC(&p, 0xA27B, RPC_IntReply, RPC_Long(makelong("psys")), RPC_Short(1), RPC_LongPtr(&ROMversion), RPC_End); DoRPC(port, 1, &p, &result); majorVersion = (((ROMversion >> 28) & 0xf) * 10) + ((ROMversion >> 24) & 0xf); minorVersion = (((ROMversion >> 20) & 0xf) * 10) + ((ROMversion >> 16) & 0xf); stateVersion = ((ROMversion >> 12) & 0xf); buildVersion = (((ROMversion >> 8) & 0xf) * 10) + (((ROMversion >> 4) & 0xf) * 10) + (ROMversion & 0xf); } /*********************************************************************** * * Function: DbgAttach * * Summary: Attempt to verify a connection to either the debugger * or console * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int DbgAttach(int verify) { struct RPC_params p; if (!port) { Error ("No serial port selected, use 'port' command to choose one.\n"); return 0; } again: if (verify || (!debugger && !console)) { int old = debugger; sys_QueryState(port); debugger = 0; Read_Pilot(0, 0); if (debugger && !old) { if (verify > 1) Say("Attaching to Palm debugger\n"); else SayInteractive ("(attaching to Palm debugger)\n"); } } if (!debugger && (verify || !console)) { int err, old = console; console = 0; PackRPC(&p, 0xA09E, RPC_IntReply, RPC_End); /* TaskID, a harmless call */ DoRPC(port, 1, &p, &err); if (err == 0) console = 1; else console = 0; if (console && !old) { if (verify > 1) Say("Attaching to Palm console\n"); else SayInteractive ("(attaching to Palm console)\n"); } } if (!debugger && !console && !verify) { verify = 1; goto again; } SetModeLabel(); return (debugger || console); } /*********************************************************************** * * Function: DbgAttachDebugger * * Summary: Bind the debugger to the open socket and port * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int DbgAttachDebugger(int verify) { if (!port) { Error ("No serial port selected, use 'port' command to choose one.\n"); return 0; } if (!debugger || verify) { int old = debugger; debugger = 0; sys_QueryState(port); Read_Pilot(0, 0); SetModeLabel(); if (debugger && !old) SayInteractive("(attaching to Palm debugger)\n"); } if (!debugger) { Error ("Unable to attach to debugger on Palm. Is the Palm connected and in debugging mode?\n"); } return debugger; } /*********************************************************************** * * Function: DbgAttachConsole * * Summary: Attach an interactive debugging console to the socket * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int DbgAttachConsole(int verify) { int err; struct RPC_params p; if (!port) { Error ("No serial port selected, use 'port' command to choose one.\n"); return 0; } if (verify || debugger || !console) { int old = console && !debugger; PackRPC(&p, 0xA09E, RPC_IntReply, RPC_End); /* TaskID, a harmless call */ DoRPC(port, 1, &p, &err); if (err == 0) { console = 1; debugger = 0; SetModeLabel(); } else { if (!debugger) console = 0; } if ((console && !debugger) && !old) SayInteractive("(attaching to Palm console)\n"); } if (!console || debugger) { Error ("Unable to attach to console on Palm. Is the Palm connected, in console mode, and not in debugger mode?\n"); } return console; } /*********************************************************************** * * Function: DbgRPC * * Summary: Low-level debugging routines via RPC to the Palm * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static unsigned long DbgRPC(struct RPC_params *p, int *error) { unsigned long result = 0; int err = -1; if (!port) { Error ("No serial port selected, use 'port' command to choose one.\n"); return 0; } if (p->reply == RPC_NoReply) { /* If the RPC call will normally generate no reply (as in a call that reboots the machine) then we need to do some special work to verify that the connection is active */ DbgAttach(1); if (!debugger && !console) { if (error) *error = -1; Error ("Unable to invoke RPC on Palm. Is the Palm connected and in debugging or console mode?\n"); return 0; } } if (debugger) { result = DoRPC(port, 0, p, &err); if ((err < 0) && (p->reply != RPC_NoReply)) { /* Failure, assume no response */ debugger = 0; SetModeLabel(); } } else if (console) { result = DoRPC(port, 1, p, &err); if ((err < 0) && (p->reply != RPC_NoReply)) { /* Failure, assume no response */ console = 0; SetModeLabel(); } } /* else { Say("(attaching to Palm)\n"); } */ if (!console && !debugger) { DbgAttach(0); if (debugger) { result = DoRPC(port, 0, p, &err); } else if (console) { result = DoRPC(port, 1, p, &err); } else { /* complete failure to attach */ Error ("Unable to invoke RPC on Palm. Is the Palm connected and in debugging or console mode?\n"); } } if (error) *error = err; return result; } unsigned char buffer[0xffff]; /*********************************************************************** * * Function: proc_g * * Summary: Go, restart execution * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int proc_g(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { /* Use verify since the sys_Continue command produces no return value */ if (!DbgAttachDebugger(1)) return TCL_ERROR; if (argc == 2) { /* argv[1] is address to start execution at */ state.regs.PC = ParseAddress(argv[1]); SetLabel(".state.pc", htoa(state.regs.PC)); /*SetBreakpoint(port, 5, ParseAddress(argv[1]), 1); */ } sys_Continue(port, &state.regs, 0); Say("Resuming execution\n"); /* Assume the Palm is no longer halted */ debugger = 0; console = 0; stalestate = 1; SetModeLabel(); Tcl_VarEval(interp, "checkupin 25", NULL); Tcl_ResetResult(interp); return TCL_OK; } /*********************************************************************** * * Function: proc_t * * Summary: Till, restart execution * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int proc_t(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { /* Use verify since the sys_Continue command produces no return value */ if (!DbgAttachDebugger(1)) return TCL_ERROR; if (argc >= 2) { /* argv[1] is address to stop execution at */ SetBreakpoint(5, ParseAddress(argv[1]), 1); } if (argc >= 3) { /* argv[2] is address to start execution at */ state.regs.PC = ParseAddress(argv[2]); SetLabel(".state.pc", htoa(state.regs.PC)); } sys_Continue(port, &state.regs, 0); Say("Resuming execution\n"); /* Assume the Palm is no longer halted */ debugger = 0; console = 0; stalestate = 1; SetModeLabel(); Tcl_VarEval(interp, "checkupin 25", NULL); Tcl_ResetResult(interp); return TCL_OK; } /*********************************************************************** * * Function: proc_attach * * Summary: Attach to a Palm that has already crashed into the * debugger without notifying us * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int proc_attach(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { DbgAttach(2); /* Two means explicit verify, as opposed to implicit */ if (!debugger && !console) { Say("Unable to attach to to Palm. Is the Palm connected and in debugging or console mode?\n"); } return TCL_OK; } /*********************************************************************** * * Function: proc_sendscreen * * Summary: Display the screen output in the GUI window * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int proc_sendscreen(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { struct RPC_params p; PackRPC(&p, 0xA0F1, RPC_IntReply, RPC_Short(0), RPC_Short(0), RPC_Short(160), RPC_Short(160), RPC_End); DbgRPC(&p, 0); return TCL_OK; } /*********************************************************************** * * Function: proc_coldboot * * Summary: Drop all communication, restart device * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int proc_coldboot(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { struct RPC_params p; PackRPC(&p, 0xA08B, RPC_NoReply, RPC_Long(0), RPC_Long(0), RPC_Long(0), RPC_Long(0), RPC_End); DbgRPC(&p, 0); /* And sever attachment */ debugger = 0; console = 0; stalestate = 1; SetModeLabel(); Tcl_VarEval(interp, "checkupin 25", NULL); Tcl_ResetResult(interp); return TCL_OK; } /*********************************************************************** * * Function: proc_warmboot * * Summary: Simple "pin reset" restart * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int proc_warmboot(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { struct RPC_params p; PackRPC(&p, 0xA08C, RPC_NoReply, RPC_End); DbgRPC(&p, 0); /* And sever attachment */ debugger = 0; console = 0; stalestate = 1; SetModeLabel(); Tcl_VarEval(interp, "checkupin 25", NULL); Tcl_ResetResult(interp); return TCL_OK; } /*********************************************************************** * * Function: proc_battery * * Summary: Display and query battery status information * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int proc_battery(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { int err, warn, critical, maxTicks, v, kind, pluggedin; char buffer[30]; struct RPC_params p; if (!DbgAttach(0)) return TCL_ERROR; warn = 0x1234; critical = 0x2345; maxTicks = 0x3456; kind = 2; pluggedin = 3; PackRPC(&p, 0xA0B6, RPC_IntReply, RPC_Byte(0), RPC_ShortPtr(&warn), RPC_ShortPtr(&critical), RPC_ShortPtr(&maxTicks), RPC_BytePtr(&kind), RPC_BytePtr(&pluggedin), RPC_End); v = DbgRPC(&p, &err); if (err) return TCL_ERROR; /* printf("Volts = %f, crit = %f, warn = %f, ticks = %d, kind = %d, pluggedin= %d, err = %d\n", (float)v/100, (float)critical/100, (float)warn/100, maxTicks, kind, pluggedin, err); */ sprintf(buffer, "%.2f %s%s", (float) v / 100, (kind == 0) ? "Alkaline" : (kind == 1) ? "NiCd" : (kind == 2) ? "Lithium" : "", pluggedin ? " Ext" : ""); Say(buffer); SetLabel(".state.battery", buffer); #ifdef TK if (usetk) Tcl_VarEval(interp, ".state.battery configure -fg ", (v <= critical) ? "red" : (v <= warn) ? "darkred" : "blue", NULL); #endif Say((v <= critical) ? " power critical!\n" : (v <= warn) ? " power low\n" : "\n"); return TCL_OK; } /*********************************************************************** * * Function: proc_mirror * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int proc_mirror(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { int e1, e2, active, scrGlobals, doDrawNotify; struct RPC_params p; unsigned long addr; if (!DbgAttachConsole(0)) return TCL_ERROR; DbgGetDeviceVersion(); switch (majorVersion) { case 1: scrGlobals = 356; doDrawNotify = 18; break; case 2: scrGlobals = 356; doDrawNotify = 18; break; default: Say("I don't know how to change mirroring on this device version\n"); return TCL_ERROR; } /* Fetch scrGlobals ptr */ PackRPC(&p, 0xA026, RPC_IntReply, RPC_LongPtr(&addr), RPC_Long(scrGlobals), RPC_Long(4), RPC_End); e1 = DbgRPC(&p, &e2); /* Fetch current drawnotify setting */ PackRPC(&p, 0xA026, RPC_IntReply, RPC_BytePtr(&active), RPC_Long(addr + doDrawNotify), RPC_Long(1), RPC_End); e1 = DbgRPC(&p, &e2); /*printf("addr=%d\nactive=%d\n", addr, active); */ /* Change setting */ if (argc < 2) active = !active; else if (Tcl_GetBoolean(interp, argv[1], &active) != TCL_OK) return TCL_ERROR; /* Put it back */ PackRPC(&p, 0xA026, RPC_IntReply, RPC_Long(addr + doDrawNotify), RPC_BytePtr(&active), RPC_Long(1), RPC_End); e1 = DbgRPC(&p, &e2); if (Interactive) { if (active) Say("Mirroring is active.\n"); else Say("Mirroring is inactive.\n"); } if (active) { /* Try to prod Palm into immediately giving us a screen update */ PackRPC(&p, 0xA0F1, RPC_IntReply, RPC_Short(0), RPC_Short(0), RPC_Short(160), RPC_Short(160), RPC_End); e1 = DbgRPC(&p, &e2); } return TCL_OK; } /*********************************************************************** * * Function: proc_updatedisplay * * Summary: Force a screen update from the Palm * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int proc_updatedisplay(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { int e1, e2; struct RPC_params p; if (!DbgAttachConsole(0)) return TCL_ERROR; /* Try to prod Palm into immediately giving us a screen update */ PackRPC(&p, 0xA0F1, RPC_IntReply, RPC_Short(0), RPC_Short(0), RPC_Short(160), RPC_Short(160), RPC_End); e1 = DbgRPC(&p, &e2); return TCL_OK; } #define DB 0xFFFF0000 #define LSSA 0xFA00 static int proc_getdisplay(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { #ifndef TK Say("getdisplay is not available due to pilot-debug being compiled without Tk support"); return TCL_ERROR; #else int e1, e2, l; char buffer[0xffff], buffer2[0xffff]; Tk_PhotoImageBlock block; Tk_PhotoHandle handle; struct RPC_params p; unsigned long addr; if (!usetk) { Say("getdisplay is not usable when graphical display is disabled"); return TCL_ERROR; } if (!DbgAttach(0)) return TCL_ERROR; if (debugger) { l = sys_ReadMemory(port, DB + LSSA, 4, buffer); addr = get_long(buffer); l = sys_ReadMemory(port, addr, 160 * 160 / 8, buffer); } else { PackRPC(&p, 0xA026, RPC_IntReply, RPC_LongPtr(&addr), RPC_Long(DB + LSSA), RPC_Long(4), RPC_End); e1 = DbgRPC(&p, &e2); for (l = 0; l < 160 * 160 / 8; l += 64) { PackRPC(&p, 0xA026, RPC_IntReply, RPC_Ptr(buffer + l, 128), RPC_Long(addr + l), RPC_Long(128), RPC_End); e1 = DbgRPC(&p, &e2); } } block.width = 160; block.height = 160; block.pitch = 160; block.pixelSize = 1; block.offset[0] = 0; block.offset[1] = 0; block.offset[2] = 0; #if (TK_MAJOR_VERSION < 8) || ((TK_MAJOR_VERSION == 8) && (TK_RELEASE_LEVEL < 2)) handle = Tk_FindPhoto("Case"); #else handle = Tk_FindPhoto(interp, "Case"); #endif for (l = 0; l < 160 * 160; l++) { int p = l / 8; int b = 1 << (7 - (l % 8)); buffer2[l] = (buffer[p] & b) ? 0 : 0xff; } block.pixelPtr = buffer2; Tk_PhotoPutBlock(handle, &block, 32, 33, 160, 160); return TCL_OK; #endif } /*********************************************************************** * * Function: proc_transmit * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int proc_transmit(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { if (argc < 2) return TCL_OK; if (!DbgAttachConsole(0)) return TCL_ERROR; buffer[0] = 1; buffer[1] = 1; buffer[2] = 0; buffer[3] = 0; buffer[4] = 0x7f; buffer[5] = 0; strcpy(buffer + 6, argv[1]); strcat(buffer + 6, "\n"); pi_write(port, buffer, 6 + strlen(argv[1]) + 2); return TCL_OK; } /*********************************************************************** * * Function: proc_pushbutton * * Summary: Simulate and emulate the button press actions * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int proc_pushbutton(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { struct RPC_params p; unsigned int key = 0; unsigned int scan = 0; unsigned int mod = 0; if (!DbgAttachConsole(0)) return TCL_ERROR; sys_RPCerror = 0; switch (atoi(argv[1])) { case 0: /* Backlight */ key = 0x0113; mod = 0x08; break; case 1: /* Power */ key = 0x0208; mod = 0x08; break; case 2: /* Datebook */ key = 0x0204; mod = 0x08; break; case 3: /* Address */ key = 0x0205; mod = 0x08; break; case 6: /* ToDo */ key = 0x0206; mod = 0x08; break; case 7: /* Memo */ key = 0x0207; mod = 0x08; break; case 4: /* Page Up */ key = 0x000b; mod = 0; break; case 5: /* Page Down */ key = 0x000c; mod = 0; break; default: return Error("Button number out of range (1-7)"); } PackRPC(&p, 0xA12D, RPC_IntReply, RPC_Short(key), RPC_Short(scan), RPC_Short(mod), RPC_End); DbgRPC(&p, 0); return TCL_OK; } /*********************************************************************** * * Function: proc_pen * * Summary: Tcl procedure to simulate a pen tap -- primarily used * by Remote UI bindings * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int proc_pen(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { int x = atoi(argv[1]) - 32, y = atoi(argv[2]) - 33, pen = atoi(argv[3]); /* Transmit Pen event to Palm */ /*printf("Pen %d, %d, %d\n", x, y, pen); */ if (!DbgAttachConsole(0)) return TCL_ERROR; sys_RemoteEvent(port, pen, x, y, 0, 0, 0, 0); return TCL_OK; } /*********************************************************************** * * Function: proc_key * * Summary: Tcl procedure to simulate a key press -- primarily used * by Remote UI bindings * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int proc_key(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { /*struct RPC_params p; */ int key = argv[1][0]; /* Change \r to \n */ if (key == 13) key = 10; /* Transmit ASCII key to Palm */ /*printf("Key %d\n", key); */ /*PackRPC(&p, 0xA12D, RPC_IntReply, RPC_Short(key),RPC_Short(0),RPC_Short(0x0), RPC_End); if (key != 0) DbgRPC(&p, 0); */ if (!DbgAttachConsole(0)) return TCL_ERROR; sys_RemoteEvent(port, 0, 0, 0, 1, 0, key, 0); /* int sd, int penDown, int x, int y, int keypressed, int keymod, int keyasc, int keycode)*/ return TCL_OK; } /*********************************************************************** * * Function: proc_port * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int proc_port(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { static struct pi_sockaddr laddr; static Tcl_Channel channel; int fd; if (argc < 2) { if (port) Tcl_SetResult(interp, laddr.pi_device, TCL_STATIC); return TCL_OK; } if (port) { Tcl_DeleteChannelHandler(channel, Read_Pilot, (ClientData) port); Tcl_UnregisterChannel(interp, channel); pi_close(port); port = 0; } if (strcmp(argv[1], "close") == 0) { return TCL_OK; } /* port = pi_socket(PI_AF_SLP, PI_SOCK_RAW, PI_PF_SLP); */ /* laddr.pi_family = PI_AF_SLP; */ strcpy(laddr.pi_device, argv[1]); if (pi_bind(port, (struct sockaddr *) &laddr, sizeof(laddr)) == -1) { Say("Unable to open port '"); Say(argv[1]); Say("': "); Say(Tcl_ErrnoMsg(errno)); Say("\n"); port = 0; return TCL_ERROR; } fd = port; #if (TCL_MAJOR_VERSION<8 || (TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION <3)) channel = Tcl_MakeFileChannel((ClientData) fd, 0, TCL_READABLE); #else channel = Tcl_MakeFileChannel((ClientData) fd, TCL_READABLE); #endif Tcl_RegisterChannel(interp, channel); /* And register it to TCL */ Tcl_CreateChannelHandler(channel, TCL_READABLE, Read_Pilot, (ClientData) port); Tcl_SetResult(interp, laddr.pi_device, TCL_STATIC); return TCL_OK; } /*********************************************************************** * * Function: proc_feature * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int proc_feature(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { if (argc < 2) { Tcl_SetResult(interp, "feature: -all|-unreg |-set |-get ", TCL_STATIC); return TCL_OK; } if (!DbgAttach(0)) return TCL_ERROR; if (strcmp(argv[1], "-all") == 0) { struct RPC_params p; unsigned long type, value; unsigned short int id_; int i, j; for (j = 0; j < 2; j++) { /* 0: RAM, 1: ROM */ Say(j ? "ROM:\n" : "RAM:\n"); for (i = 0;; i++) { unsigned long e1 = 0; int e2 = 0; char buffer[40]; PackRPC(&p, 0xA27D, RPC_IntReply, RPC_Short(i), RPC_Byte(j), RPC_LongPtr(&type), RPC_ShortPtr(&id_), RPC_LongPtr(&value), RPC_End); e1 = DbgRPC(&p, &e2); if (e1 || e2) break; sprintf(buffer, "\t%s, 0x%4.4x (%d) = 0x%8.8lx (%lu)", printlong(type), id_, id_, value, value); Say(buffer); } } } else if (strcmp(argv[1], "-unreg") == 0) { struct RPC_params p; unsigned long type, e1; unsigned short int id_; int e2; type = makelong(argv[2]); id_ = atoi(argv[3]); PackRPC(&p, 0xA27A, RPC_IntReply, RPC_Long(type), RPC_Short(id_), RPC_End); e1 = DbgRPC(&p, &e2); } return TCL_OK; } /*********************************************************************** * * Function: proc_inittkdbg * * Summary: Build the GUI and import all the usable elements * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int proc_inittkdbg(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]) { #ifndef TK Say("This executable does not contain Tk support!\n"); return TCL_ERROR; #else static int created = 0; if (created) { Say("Graphical debugger already initialized.\n"); return TCL_OK; } Tcl_EvalFile(interp, "proc_inittkdbg.tcl"); return TCL_OK; #endif } static int proc_help(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]) { Tcl_EvalFile(interp, "myfunc.tcl"); return TCL_OK; } struct { char * name; Tcl_CmdProc * proc; } cmds[] = { { "coldboot", proc_coldboot }, { "warmboot", proc_warmboot }, { "sendscreen", proc_sendscreen }, { "pushbutton", proc_pushbutton }, { "pen", proc_pen }, { "key", proc_key }, { "g", proc_g }, { "t", proc_t }, { "attach", proc_attach }, { "transmit", proc_transmit }, { "getdisplay", proc_getdisplay }, { "updatedisplay", proc_updatedisplay }, { "mirror", proc_mirror }, { "battery", proc_battery }, { "port", proc_port }, { "help", proc_help }, { "inittkdbg", proc_inittkdbg }, { "feature", proc_feature }, { 0, 0} }; int Tcl_AppInit(myinterp) Tcl_Interp *myinterp; /* Interpreter for application. */ { int i; interp=myinterp; if (Tcl_Init(interp) == TCL_ERROR) { return TCL_ERROR; } #ifdef TK if (usetk) { if (Tk_Init(interp) == TCL_ERROR) { return TCL_ERROR; } Tcl_StaticPackage(interp, "Tk", Tk_Init, (Tcl_PackageInitProc *) NULL); } #endif /*** Load custom Tcl procedures ***/ for (i=0;cmds[i].name;i++) { Tcl_CreateCommand(interp, cmds[i].name, cmds[i].proc, 0, NULL); } Tcl_VarEval(interp,"\ proc Say {text} {\ global Interactive\ if {$Interactive} {\ puts $text\ } else {\ upvar result result\ set result $result$text\ }\ }",NULL); Tcl_LinkVar(interp, "Interactive", (char*)&Interactive, TCL_LINK_INT); #ifdef TK if (usetk) Tcl_VarEval(interp,"inittkdbg",NULL); else Tcl_VarEval(interp,"set tkdbg 0", NULL); #endif static char welcomeScript[] = "Welcome to pilot-debug!\n\n" "\tType 'help' for further information.\n" "\tType 'exit' to quit the application\n\n"; Say(welcomeScript); #if 0 static char welcomeScriptDebug[] = "\tWelcome to pilot-debug!\n\n" "Please connect your Palm and start console or debugging mode.\n\n" "(Console mode is a background task that can respond to a few\n" "commands, most importantly RPC which lets any function on the Palm\n" "be invoked. The Palm operates as usual while console mode is active,\n" "except that since the serial port is held open, HotSync and other\n" "applications that use the serial port will not work. Debug mode is\n" "activated on demand or when the Palm crashes. In debug mode, the CPU\n" "is halted, and no commands may be executed, except via a debugging\n" "console like this one.)\n\n" "In the absence of special utilities, the console can be started by\n" "the ".2\" shortcut, and debugging via \".1\". To clear either mode,\n" "reboot via the reset button. If console mode is active, you may also\n" "reboot via the "coldboot" or "warmboot" commands.\n\n" "The Remote UI window lets you manipulate the Palm if console mode is\n" "active. By clicking the mouse button on the screen or buttons, you\n" "can simulate pen taps, and if you type anything while the window has\n" "the focus, the Palm will receive the keystrokes.\n\n" "The Remote Console window is specifically for the transmission and\n" "reception of console packets. Pressing Return on a line will\n" "transmit it, and any incoming packets will be displayed here in\n" "addition to the Debug Console.\n\n" "The Remote State window shows the current Palm CPU state. It is only\n" "updated on request or when the Palm halts.\n\n" "The Debugging Console window is the primary interface for\n" "pilot-debug. Pressing Return on a line that contains text will\n" "execute that line as a Tcl command. (Try 'expr 3+4'.) All of the\n" "usual Tcl and Tk commands are available, as well as some\n" "special-purpose ones, including 'help', 'coldboot', 'warmboot',\n" "'attach', 't', and 'g', (the last one continues after the Palm\n" "halts.)\n\n" "Execute 'help' for the list of commands currently implemented.\n\n"; Say(welcomeScriptDebug); #endif /* Specify a user-specific startup file to invoke if the application is run interactively. Typically the startup file is "~/.apprc" where "app" is the name of the application. If this line is deleted then no user-specific startup file will be run under any conditions. */ Tcl_SetVar(interp, "tcl_rcFileName", "~/.pdebugrc", TCL_GLOBAL_ONLY); static char debugPrompt[] = "set tcl_prompt1 myprompt" "proc myprompt {} {" "puts -nonewline \"pilot-debug> \"" "}"; Tcl_VarEval(interp, debugPrompt, NULL); /* Deal with command-line arguments */ static char commandArgs[] = "if {$argc > 0} {" "set p [lindex $argv 0]" "set argv [lrange $argv 1 end]" "port $p" "} else {" "Say \"As you have not entered a serial port on the command like, you might like to" "set one with 'port /dev/something'\n\n\"" "}"; Tcl_VarEval(interp, commandArgs, NULL); return TCL_OK; } int main(int argc, char *argv[]) { int code, exitCode = 0; char *args, *fileName, buf[20]; size_t length; Tcl_Channel errChannel; Tcl_FindExecutable(argv[0]); interp = Tcl_CreateInterp(); fileName = NULL; if (argc > 2) { length = strlen(argv[1]); if ((length >= 2) && (strncmp(argv[1], "-file", length) == 0)) { fileName = argv[2]; argc -= 2; argv += 2; } } #ifdef TK usetk = 1; #endif if (argc > 1) { length = strlen(argv[1]); if ((length >= 2) && (strncmp(argv[1], "-notk", length) == 0)) { #ifdef TK usetk = 0; #endif argc--; argv++; } } /* Make command-line arguments available in the Tcl variables "argc" and "argv". */ args = Tcl_Merge(argc - 1, argv + 1); Tcl_SetVar(interp, "argv", args, TCL_GLOBAL_ONLY); ckfree(args); sprintf(buf, "%d", argc - 1); Tcl_SetVar(interp, "argc", buf, TCL_GLOBAL_ONLY); Tcl_SetVar(interp, "argv0", (fileName != NULL) ? fileName : argv[0], TCL_GLOBAL_ONLY); /* Set the "tcl_interactive" variable. */ tty = isatty(0); Tcl_SetVar(interp, "tcl_interactive", ((fileName == NULL) && tty) ? "1" : "0", TCL_GLOBAL_ONLY); #ifdef TK if (!getenv("DISPLAY") || (strlen(getenv("DISPLAY")) == 0)) usetk = 0; #endif /* Invoke application-specific initialization. */ if (Tcl_AppInit(interp) != TCL_OK) { errChannel = Tcl_GetStdChannel(TCL_STDERR); if (errChannel) { Tcl_Write(errChannel, "application-specific initialization failed: ", -1); Tcl_Write(errChannel, interp->result, -1); Tcl_Write(errChannel, "\n", 1); } } /* Invoke the script specified on the command line, if any. */ if (fileName != NULL) { code = Tcl_EvalFile(interp, fileName); if (code != TCL_OK) { errChannel = Tcl_GetStdChannel(TCL_STDERR); if (errChannel) { /* The following statement guarantees that the errorInfo variable is set properly. */ Tcl_AddErrorInfo(interp, ""); Tcl_Write(errChannel, Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY), -1); Tcl_Write(errChannel, "\n", 1); } exitCode = 1; } goto done; } /* Tcl 7.5 did not support this command */ #if (TCL_MAJOR_VERSION > 7) || (TCL_MINOR_VERSION > 5) /* We're running interactively. Source a user-specific startup file if the application specified one and if the file exists. */ Tcl_SourceRCFile(interp); #endif /* Loop infinitely, waiting for commands to execute. When there are no windows left, Tk_MainLoop returns and we exit. */ #ifdef TK if (!usetk) { #endif /* Process commands from stdin until there's an end-of-file. Note that we need to fetch the standard channels again after every eval, since they may have been changed. */ do_readline(); #ifdef TK } #endif done: #ifdef TK if (usetk) { Tcl_VarEval(interp, ".f.t insert end {pilot-debug> }; .f.t set mark insert end", 0); Tk_MainLoop(); Tcl_DeleteInterp(interp); Tcl_Exit(0); } #endif return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-getromtoken.c0000644000175000017500000000170111211745573021523 0ustar rousseaurousseau/* * $Id: pilot-getromtoken.c,v 1.19 2006/10/12 14:21:21 desrod Exp $ * * pilot-getromtoken.c: Retrieve a rom token from a device. * * Copyright (C) 2002, Owen Stenseth * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #define DEFAULT_MODE mode_gettoken #include "pilot-getrom.c" pilot-link-0.12.5-dfsg/src/pilot-install-memo.c0000644000175000017500000002003511211746360021562 0ustar rousseaurousseau/* * $Id: pilot-install-memo.c,v 1.60 2009/06/04 13:32:32 desrod Exp $ * * install-memo.c: Palm MemoPad Record Syncronization Conduit * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include "pi-dlp.h" #include "pi-memo.h" #include "pi-header.h" #include "pi-userland.h" poptContext po; typedef struct { char **filenames; unsigned int filenames_allocated; unsigned int filenames_used; } filename_array; filename_array memos = { NULL, 0, 0 } ; unsigned int check_filenames(filename_array *m) { int i; int count = 0; struct stat sbuf; if (!m || !m->filenames) return 0; for (i = 0; ifilenames_used; i++) { if (!(m->filenames[i])) continue; if (stat(m->filenames[i], &sbuf) <0) { fprintf(stderr," ERROR: cannot determine size of file '%s'\n",m->filenames[i]); m->filenames[i] = NULL; } else { count++; } } return count; } void append_filename(filename_array *m, const char *filename) { if (!m || !m->filenames) return; if (!filename) return; if (m->filenames_used >= (m->filenames_allocated-1)) { fprintf(stderr," ERROR: More filenames listed than were expected.\n"); fprintf(stderr," File `%s' is ignored.\n", filename); return; } m->filenames[m->filenames_used] = strdup(filename); m->filenames_used++; } void append_filenames(filename_array *m, const char **names) { if (!m || !m->filenames) return; if (!names) return; while (*names) { append_filename(m,*names); names++; } } int install_memo(int sd, int db, int category, int add_title, char *filename) { struct stat sbuf; FILE *f = NULL; char *tmp = NULL; char *memo_buf = NULL; int memo_size, preamble; /* Check the file still exists and its size. */ if (stat(filename, &sbuf) <0) { fprintf(stderr," ERROR: Unable to open %s (%s)\n\n", filename, strerror(errno)); return 1; } memo_size = sbuf.st_size; preamble = add_title ? strlen(filename) + 1 : 0; memo_buf = calloc(1, memo_size + preamble + 16); if (!memo_buf) { fprintf(stderr," ERROR: cannot allocate memory for memo (%s)\n", strerror(errno)); return 1; } if (memo_size + preamble > 65490) { fprintf(stderr, " WARNING: `%s'\n",filename); fprintf(stderr, " File is larger than the allowed size for Palm memo size. Please\n"); fprintf(stderr, " decrease the file size to less than 65,490 bytes and try again.\n\n"); return 1; } if (preamble) sprintf(memo_buf, "%s\n", filename); f = fopen(filename, "rb"); if (f == NULL) { fprintf(stderr," ERROR: Unable to open %s (%s)\n\n", filename, strerror(errno)); return 1; } fread(memo_buf + preamble, memo_size, 1, f); fclose(f); dlp_WriteRecord(sd, db, 0, 0, category, memo_buf, -1, 0); free(memo_buf); if ((memo_size < 65490) && (memo_size > 4096)) { fprintf(stderr, " WARNING: `%s'\n", filename); fprintf(stderr, " This file was synchonized successfully, but will remain uneditable,\n"); fprintf(stderr, " because it is larger than the Palm limitation of 4,096 bytes in\n"); fprintf(stderr, " size.\n\n"); } else if (memo_size < 4096) { fprintf(stderr, " File '%s' was synchronized to your Palm device\n\n", filename); } return 0; } int main(int argc, char *argv[]) { int sd = -1, po_err = -1, add_title = 0, category = -1, replace = 0, db, ReadAppBlock; unsigned int i; unsigned int count = 0; char *category_name = NULL, *filename = NULL; char messagebuffer[256]; struct PilotUser User; struct MemoAppInfo mai; pi_buffer_t *appblock; const struct poptOption options[] = { USERLAND_RESERVED_OPTIONS { "category", 'c', POPT_ARG_STRING, &category_name, 0, "Place the memo entry in this category (category must already exist)", "name"}, { "replace", 'r', POPT_ARG_NONE, &replace, 0, "Replace all memos in specified category"}, { "title", 't', POPT_ARG_NONE, &add_title, 0, "Use the filename as the title of the Memo entry"}, { "file", 'f', POPT_ARG_STRING, &filename, 'f', "File containing the target memo entry"}, POPT_TABLEEND }; po = poptGetContext("install-memo", argc, (const char **) argv, options, 0); poptSetOtherOptionHelp(po,"[file ...]\n\n" " Adds a single memo from a file to the memo database.\n\n"); if (argc < 2) { poptPrintUsage(po,stderr,0); return 1; } /* How many files _might_ we have as arguments? Clearly, argc is the maximum that is on the command-line, so use that as a good guess. */ memos.filenames = (char **)calloc(argc, sizeof(char *)); memos.filenames_allocated = argc; memos.filenames_used = 0; while ((po_err = poptGetNextOpt(po)) >= 0) { switch (po_err) { case 'f' : append_filename(&memos,filename); break; default : fprintf(stderr," ERROR: Unhandled option %d.\n",po_err); return 1; } } if (po_err < -1) plu_badoption(po,po_err); append_filenames(&memos, poptGetArgs(po)); if (replace && !category_name) { fprintf(stderr," ERROR: memo category required when specifying replace\n"); return 1; } if (!check_filenames(&memos)) { fprintf(stderr," ERROR: must specify an existing file with -f filename\n"); return 1; } sd = plu_connect(); if (sd < 0) goto error; if (dlp_OpenConduit(sd) < 0) goto error_close; dlp_ReadUserInfo(sd, &User); dlp_OpenConduit(sd); /* Open the Memo Pad's database, store access handle in db */ if (dlp_OpenDB(sd, 0, 0x80 | 0x40, "MemoDB", &db) < 0) { fprintf(stderr, " ERROR:\n"); fprintf(stderr, " Unable to open MemoDB. Please make sure you have hit the MemoPad\n"); fprintf(stderr, " button at least once, to create a MemoDB.pdb file on your Palm,\n"); fprintf(stderr, " then sync again.\n\n"); dlp_AddSyncLogEntry(sd, "Unable to open MemoDB.\n"); goto error_close; } appblock = pi_buffer_new(0xffff); ReadAppBlock = dlp_ReadAppBlock(sd, db, 0, 0xffff, appblock); unpack_MemoAppInfo(&mai, appblock->data, ReadAppBlock); pi_buffer_free(appblock); if (category_name) { category = plu_findcategory(&mai.category,category_name, PLU_CAT_CASE_INSENSITIVE | PLU_CAT_DEFAULT_UNFILED | PLU_CAT_WARN_UNKNOWN); if (replace) { dlp_DeleteCategory(sd, db, category); } } else { category = 0; /* Unfiled */ } for (i=0; i #include #include "pi-source.h" #include "pi-file.h" #include "pi-header.h" #include "pi-util.h" #include "pi-userland.h" static int Fetch(int sd, char *filename) { int db, i, l, fd; pi_buffer_t *buffer; fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); if (fd < 0) return -1; if (!plu_quiet) { printf(" Fetching to %s ", filename); fflush(stdout); } if (dlp_OpenDB(sd, 0, dlpOpenRead, "Schlep", &db) < 0) return -1; buffer = pi_buffer_new (0xffff); for (i = 0; (l = dlp_ReadResourceByType(sd, db, pi_mktag('D', 'A', 'T', 'A'), i, buffer, 0)) > 0; i++) { if (write(fd, buffer->data, l) < 0) { if (!plu_quiet) { printf("%d bytes read (Incomplete)\n\n", l); } close(fd); return -1; } if (!plu_quiet) { printf("."); fflush(stdout); } } pi_buffer_free(buffer); close(fd); if (!plu_quiet) { printf("%d bytes read\n\n", l); } return 0; } static int Install(int sd, char *filename) { int db, j, l, fd, segment = 4096; unsigned long len; char buffer[0xffff]; fd = open(filename, O_RDONLY); if (fd < 0) return -1; dlp_DeleteDB(sd, 0, "Schlep"); if (!plu_quiet) { printf(" Installing %s ", filename); fflush(stdout); } if (dlp_CreateDB (sd, pi_mktag('S', 'h', 'l', 'p'), pi_mktag('D', 'A', 'T', 'A'), 0, dlpDBFlagResource, 1, "Schlep", &db) < 0) return -1; l = 0; for (j = 0; (len = read(fd, buffer, segment)) > 0; j++) { if (dlp_WriteResource (sd, db, pi_mktag('D', 'A', 'T', 'A'), j, buffer, len) < 0) { if (!plu_quiet) { printf(" %d bytes written (Incomplete)\n\n", l); } close(fd); dlp_CloseDB(sd, db); return -1; } l += len; if (!plu_quiet) { printf("."); fflush(stdout); } } close(fd); if (!plu_quiet) { printf(" %d bytes written\n\n", l); } if (dlp_CloseDB(sd, db) < 0) return -1; return 0; } static int Delete(int sd) { if (!plu_quiet) { printf(" Deleting... "); fflush(stdout); } if (dlp_DeleteDB(sd, 0, "Schlep") < 0) { if (!plu_quiet) { printf("failed\n\n"); } return -1; } if (!plu_quiet) { printf("completed\n\n"); } return 0; } int main(int argc, const char *argv[]) { int c, /* switch */ sd = -1, delete = 0; char *install_filename = NULL, *fetch_filename = NULL; poptContext pc; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"install", 'i', POPT_ARG_STRING, &install_filename, 0, "Pack and install to your Palm", "file"}, {"fetch", 'f', POPT_ARG_STRING, &fetch_filename, 0, "Unpack the file from your Palm device", "file"}, {"delete", 'd', POPT_ARG_NONE, &delete, 0, "Delete the packaged file from your Palm device", NULL}, POPT_TABLEEND }; pc = poptGetContext("pilot-schlep", argc, argv, options, 0); poptSetOtherOptionHelp(pc,"\n\n" " Package up any arbitrary file and sync it to your Palm device\n\n" " Currently the stored name and file type is not queried so you can\n" " potentially Install a PDF file, and retrieve it as a ZIP file.\n\n" " You must take care to remember what type of file you are installing and\n" " fetching. This will be updated in a later release to handle this type of\n" " capability, as well as handle multiple 'Schlep' files.\n\n" " Example arguments:\n" " To package up and store a file for later retrieval on your Palm:\n" " -p /dev/pilot -i InstallThis.zip\n\n" " To unpack a file that has been stored on your Palm with the '-i' option:\n" " -p /dev/pilot -f RetrieveThis.pdf\n\n" ); if (argc < 2) { poptPrintUsage(pc,stderr,0); return 1; } while ((c = poptGetNextOpt(pc)) >= 0) { fprintf(stderr," ERROR: Unhandled option %d.\n", c); return 1; } if (c < -1) { plu_badoption(pc,c); } if ((install_filename && fetch_filename) || (delete && (install_filename || fetch_filename))) { fprintf(stderr, " ERROR: You must specify only one action.\n"); return -1; } if (!delete && !install_filename && !fetch_filename) { fprintf(stderr, " ERROR: You must specify at least one action.\n"); return -1; } sd = plu_connect(); if (sd < 0) goto error; if (dlp_OpenConduit(sd) < 0) goto error_close; if (install_filename != NULL) { if (Install (sd, install_filename) < 0) goto error_close; } else if (fetch_filename != NULL) { if (Fetch (sd, fetch_filename) < 0) goto error_close; } else if (delete == 1) { if (Delete (sd) < 0) goto error_close; } if (dlp_AddSyncLogEntry(sd, "pilot-schlep, exited normally.\n" "Thank you for using pilot-link.\n") < 0) goto error_close; if (dlp_EndOfSync(sd, 0) < 0) goto error_close; if (pi_close(sd) < 0) goto error; return 0; error_close: pi_close(sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-install-netsync.c0000644000175000017500000001027111211745573022316 0ustar rousseaurousseau/* * $Id: pilot-install-netsync.c,v 1.49 2007/06/01 01:13:55 desrod Exp $ * * pilot-install-netsync.c: Palm Network Information Installer * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include #include "pi-dlp.h" #include "pi-header.h" #include "pi-userland.h" poptContext po; int main(int argc, char *argv[]) { int enable = -1, sd = -1, po_err = -1; const char *hostname = NULL, *address = NULL, *netmask = NULL; const struct poptOption options[] = { USERLAND_RESERVED_OPTIONS { "enable", 'e', POPT_ARG_VAL, &enable, 1, "Enables LANSync on the Palm"}, { "disable", 'd', POPT_ARG_VAL, &enable, 0, "Disable the LANSync setting on the Palm"}, { "name", 'n', POPT_ARG_STRING, &hostname, 0, "The hostname of the remote machine you sync with", ""}, { "address", 'a', POPT_ARG_STRING, &address, 0, "IP address of the remote machine you connect to", "
"}, { "mask", 'm', POPT_ARG_STRING, &netmask, 0, "Subnet mask of the network your Palm is on", ""}, POPT_TABLEEND }; struct NetSyncInfo Net; struct in_addr addr; po = poptGetContext("pilot-install-netsync", argc, (const char **) argv, options, 0); poptSetOtherOptionHelp(po," [-p port] \n\n" " Assigns your Palm device NetSync information\n\n" " Example:\n" " -p usb: -e -n \"NEPTUNE\" -a 10.0.1.10 -m 255.255.255.0\n\n"); if (argc < 2) { poptPrintUsage(po,stderr,0); return 1; } while ((po_err = poptGetNextOpt(po)) >= 0) { } if (po_err < -1) plu_badoption(po,po_err); /* FIXME: Take the user-supplied IP or hostname and reverse it to get the other component, which reduces the complexity of this by one argument passed in. getnameinfo() will help here. */ if (address && !inet_pton(AF_INET, address, &addr)) { fprintf(stderr," ERROR: The address you supplied, '%s' is in invalid.\n" " Please supply a dotted quad, such as 1.2.3.4\n\n", address); return 1; } if (netmask && !inet_pton(AF_INET, netmask, &addr)) { fprintf(stderr," ERROR: The netmask you supplied, '%s' is in invalid.\n" " Please supply a dotted quad, such as 255.255.255.0\n\n", netmask); return 1; } sd = plu_connect(); if (sd < 0) goto error; if (dlp_OpenConduit(sd) < 0) goto error_close; /* Read and write the LANSync data to the Palm device */ if (dlp_ReadNetSyncInfo(sd, &Net) < 0) goto error_close; if (enable != -1) Net.lanSync = enable; if (!plu_quiet) { printf(" LANSync....: %sabled\n", (Net.lanSync == 1 ? "En" : "Dis")); fflush(stdout); } if (hostname) strncpy(Net.hostName, hostname, sizeof(Net.hostName)); if (address) strncpy(Net.hostAddress, address, sizeof(Net.hostAddress)); if (netmask) strncpy(Net.hostSubnetMask, netmask, sizeof(Net.hostSubnetMask)); if (!plu_quiet) { printf(" Hostname...: %s\n", Net.hostName); printf(" IP Address.: %s\n", Net.hostAddress); printf(" Netmask....: %s\n\n", Net.hostSubnetMask); } if (dlp_WriteNetSyncInfo(sd, &Net) < 0) goto error_close; if (dlp_AddSyncLogEntry(sd, "pilot-install-netsync, exited normally.\n" "Thank you for using pilot-link.\n") < 0) goto error_close; if (dlp_EndOfSync(sd, 0) < 0) goto error_close; if (pi_close(sd) < 0) goto error; return 0; error_close: pi_close(sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-install-user.c0000644000175000017500000000633611211745573021620 0ustar rousseaurousseau/* * $Id: pilot-install-user.c,v 1.68 2006/10/12 14:21:21 desrod Exp $ * * install-user.c: Palm Username installer * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include "pi-dlp.h" #include "pi-header.h" #include "pi-userland.h" const char *user = NULL, *userid = NULL; int list = 0; const struct poptOption options[] = { USERLAND_RESERVED_OPTIONS { "user", 'u', POPT_ARG_STRING, &user, 0, "Set the username, use quotes for spaces (see example)", ""}, { "id", 'i', POPT_ARG_STRING, &userid, 0, "A 5-digit numeric UserID, required for PalmOS", ""}, { "list", 'l', POPT_ARG_NONE, &list, 0, "List the current username and ID (default)",NULL}, POPT_TABLEEND }; poptContext po; int main(int argc, char *argv[]) { int sd = -1, po_err = -1; char *environment; struct PilotUser User; environment = getenv("PILOTPORT"); po = poptGetContext("install-user", argc, (const char **) argv, options, 0); poptSetOtherOptionHelp(po, "\n\n" " Set a username and ID on the Palm.\n\n" " Example:\n" " -p /dev/pilot -u \"John Q. Public\" -i 12345\n"); if ((environment == NULL) && (argc < 2)) { poptPrintUsage(po,stderr,0); return 1; } while ((po_err = poptGetNextOpt(po)) >= 0) { /* Everything is handled by popt magic */ } if (po_err < -1) { plu_badoption(po,po_err); } sd = plu_connect(); if (sd < 0) { goto error; } if (dlp_ReadUserInfo(sd, &User) < 0) { goto error_close; } if (list || (!user && !userid)) { printf(" Palm user: %s\n", User.username); printf(" UserID: %lu\n\n", User.userID); goto cleanup; } if (userid) { User.userID = abs(atoi(userid)); } if (user) { strncpy(User.username, user, sizeof(User.username) - 1); } User.lastSyncDate = time(NULL); if (dlp_WriteUserInfo(sd, &User) < 0) { goto error_close; } if (!plu_quiet && user) { printf(" Installed User Name: %s\n", User.username); } if (!plu_quiet && userid) { printf(" Installed User ID: %lu\n", User.userID); } if (!plu_quiet && (user || userid)) { printf("\n"); } cleanup: if (dlp_AddSyncLogEntry(sd, "install-user exited normally.\n" "Thank you for using pilot-link.\n") < 0) { goto error_close; } if (dlp_EndOfSync(sd, 0) < 0) { goto error_close; } if (pi_close(sd) < 0) { goto error; } return 0; error_close: pi_close(sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-file.c0000644000175000017500000002611311211745573020110 0ustar rousseaurousseau/* * $Id: pilot-file.c,v 1.39 2006/10/12 14:21:21 desrod Exp $ * * pilot-file.c - Palm File dump utility * * Pace Willisson December 1996 * Additions by Kenneth Albanowski * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include "pi-header.h" #include "pi-source.h" #include "pi-file.h" #include "pi-userland.h" /*********************************************************************** * * Function: iso_time_str * * Summary: Build an ISO-compliant date string * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static char *iso_time_str(time_t t) { struct tm tm; static char buf[50]; tm = *localtime(&t); sprintf(buf, "%04d-%02d-%02d %02d:%02d:%02d", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); return (buf); } /*********************************************************************** * * Function: dump * * Summary: Dump data as requested by other functions * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void dump(void *buf, int n) { int ch, i, j; for (i = 0; i < n; i += 16) { printf("%04x: ", i); for (j = 0; j < 16; j++) { if (i + j < n) printf("%02x ", ((unsigned char *) buf)[i + j]); else printf(" "); } printf(" "); for (j = 0; j < 16 && i + j < n; j++) { ch = ((unsigned char *) buf)[i + j] & 0x7f; if (ch < ' ' || ch >= 0x7f) putchar('.'); else putchar(ch); } printf("\n"); } } /*********************************************************************** * * Function: dump_header * * Summary: Dump the header section of the database * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void dump_header(struct pi_file *pf, struct DBInfo *ip) { printf("Name..........: %s\n", ip->name); printf("flags.........: 0x%x", ip->flags); if (ip->flags & dlpDBFlagNewer) printf(" NEWER"); if (ip->flags & dlpDBFlagReset) printf(" RESET"); if (ip->flags & dlpDBFlagResource) printf(" RESOURCE"); if (ip->flags & dlpDBFlagReadOnly) printf(" READ_ONLY"); if (ip->flags & dlpDBFlagAppInfoDirty) printf(" APP-INFO-DIRTY"); if (ip->flags & dlpDBFlagBackup) printf(" BACKUP"); if (ip->flags & dlpDBFlagCopyPrevention) printf(" COPY-PREVENTION"); if (ip->flags & dlpDBFlagStream) printf(" STREAM"); if (ip->flags & dlpDBFlagOpen) printf(" OPEN"); printf("\n"); printf("version.......: %d\n", ip->version); printf("creation_time.: %s\n", iso_time_str(ip->createDate)); printf("modified_time.: %s\n", iso_time_str(ip->modifyDate)); printf("backup_time...: %s\n", iso_time_str(ip->backupDate)); printf("mod_number....: %ld\n", ip->modnum); printf("type..........: %s\n", printlong(ip->type)); printf("CreatorID.....: %s\n", printlong(ip->creator)); printf("\n"); } /*********************************************************************** * * Function: dump_app_info * * Summary: Dump the AppInfo segment of the database(s) * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void dump_app_info(struct pi_file *pf, struct DBInfo *ip) { size_t app_info_size; void *app_info; pi_file_get_app_info(pf, &app_info, &app_info_size); printf("app_info_size %zu\n", app_info_size); dump(app_info, app_info_size); printf("\n"); } /*********************************************************************** * * Function: dump_sort_info * * Summary: Dump the SortInfo block of the database(s) * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void dump_sort_info(struct pi_file *pf, struct DBInfo *ip) { size_t sort_info_size; void *sort_info; pi_file_get_sort_info(pf, &sort_info, &sort_info_size); printf("sort_info_size %zu\n", sort_info_size); dump(sort_info, sort_info_size); printf("\n"); } /*********************************************************************** * * Function: list_records * * Summary: List all records in the database(s) * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void list_records(struct pi_file *pf, struct DBInfo *ip, int filedump, int verbose) { int attrs, cat, entnum, /* Number of the entry record */ id_, nentries; /* Number of entries in the list */ size_t size; void *buf; unsigned long type, uid; pi_file_get_entries(pf, &nentries); if (ip->flags & dlpDBFlagResource) { printf("entries\n"); printf("index\tsize\ttype\tid\n"); for (entnum = 0; entnum < nentries; entnum++) { if (pi_file_read_resource (pf, entnum, &buf, &size, &type, &id_) < 0) { printf("error reading %d\n\n", entnum); return; } printf("%d\t%zu\t%s\t%d\n", entnum, size, printlong(type), id_); if (verbose) { dump(buf, size); printf("\n"); if (filedump) { FILE *fp; char name[64]; sprintf(name, "%4s%04x.bin", printlong(type), id_); fp = fopen(name, "w"); fwrite(buf, size, 1, fp); fclose(fp); printf("(written to %s)\n", name); } } } } else { printf("entries\n"); printf("index\tsize\tattrs\tcat\tuid\n"); for (entnum = 0; entnum < nentries; entnum++) { if (pi_file_read_record(pf, entnum, &buf, &size, &attrs, &cat, &uid) < 0) { printf("error reading %d\n\n", entnum); return; } printf("%d\t%zu\t0x%x\t%d\t0x%lx\n", entnum, size, attrs, cat, uid); if (verbose) { dump(buf, size); printf("\n"); } } } printf("\n"); } /*********************************************************************** * * Function: dump_record * * Summary: Dump a record * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void dump_record(struct pi_file *pf, struct DBInfo *ip, char *rkey, int filedump) { int attrs, cat, id_, record; size_t size; void *buf; unsigned long type; unsigned long uid; if (ip->flags & dlpDBFlagResource) { printf("entries\n"); printf("index\tsize\ttype\tid\n"); if (sscanf(rkey, "%d", &record) == 1) { if (pi_file_read_resource (pf, record, &buf, &size, &type, &id_) < 0) { printf("error reading resource #%d\n\n", record); return; } } else { type = makelong(rkey); id_ = 0; sscanf(&rkey[4], "%d", &id_); if (pi_file_read_resource_by_type_id (pf, type, id_, &buf, &size, &record) < 0) { printf ("error reading resource %s' #%d (0x%x)\n\n", printlong(type), id_, id_); return; } } printf("%d\t%zu\t%s\t%d\n", record, size, printlong(type), id_); dump(buf, size); if (filedump) { FILE *fp; char name[64]; sprintf(name, "%4s%04x.bin", printlong(type), id_); fp = fopen(name, "w"); fwrite(buf, size, 1, fp); fclose(fp); printf("(written to %s)\n", name); } } else { printf("entries\n"); printf("index\tsize\tattrs\tcat\tuid\n"); if (sscanf(rkey, "0x%lx", &uid) == 1) { if (pi_file_read_record_by_id(pf, uid, &buf, &size, &record, &attrs, &cat) < 0) { printf ("error reading record uid 0x%lx\n\n", uid); return; } } else { record = 0; sscanf(rkey, "%d", &record); if (pi_file_read_record(pf, record, &buf, &size, &attrs, &cat, &uid) < 0) { printf("error reading record #%d\n\n", record); return; } } printf("%d\t%zu\t0x%x\t%d\t0x%lx\n", record, size, attrs, cat, uid); dump(buf, size); } printf("\n"); } int main(int argc, const char **argv) { int c, /* switch */ hflag = 0, aflag = 0, sflag = 0, dflag = 0, lflag = 0, rflag = 0, filedump = 0; char *rkey = NULL; const char **rargv = NULL; struct pi_file *pf; struct DBInfo info; poptContext po; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"header", 'H', POPT_ARG_NONE, &hflag, 0, "Dump the header of the database(s)"}, {"appinfo", 'a', POPT_ARG_NONE, &aflag, 0, "Dump app_info segment of the database(s)"}, {"sortinfo", 's', POPT_ARG_NONE, &sflag, 0, "Dump sort_info block of database(s)"}, {"list", 'l', POPT_ARG_NONE, &lflag, 0, "List all records in the database(s)"}, {"record", 'r', POPT_ARG_STRING, &rkey, 0, "Dump a record by index ('code0') or uid ('1234')"}, {"to-file", 'f', POPT_ARG_NONE, &filedump, 0, "Same as above but also dump records to files"}, {"dump", 'd', POPT_ARG_NONE, &dflag, 0, "Dump all data and all records, very verbose"}, POPT_TABLEEND }; po = poptGetContext("pilot-file", argc, argv, options, 0); poptSetOtherOptionHelp(po," ...\n\n" " Dump application and header information from your local PRC/PDB files\n\n" " Example arguments:\n" " -l Foo.prc\n" " -H -a Bar.pdb\n\n"); plu_popt_alias(po,"dump-rec",0,"--bad-option --to-file --record"); plu_popt_alias(po,NULL,'R',"--bad-option --to-file --record"); plu_popt_alias(po,"dump-res",0,"--bad-option --to-file --dump"); plu_popt_alias(po,NULL,'D',"--bad-option --to-file --dump"); if (argc < 2) { poptPrintUsage(po,stderr,0); return 1; } while ((c = poptGetNextOpt(po)) >= 0) { fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } if (c < -1) { plu_badoption(po,c); } if (rkey) { rflag = 1; } rargv = poptGetArgs(po); if (!rargv || !rargv[0]) { fprintf(stderr," ERROR: Must provide one or more filenames.\n"); return 1; } while (*rargv) { const char *name = *rargv++; if ((pf = pi_file_open(name)) == NULL) { fprintf(stderr, " ERROR: Can't open '%s' Does '%s' exist?\n\n", name, name); continue; } pi_file_get_info(pf, &info); if (hflag || dflag) dump_header(pf, &info); if (aflag || dflag) dump_app_info(pf, &info); if (sflag || dflag) dump_sort_info(pf, &info); if (lflag || dflag) list_records(pf, &info, filedump, dflag); if (rflag) dump_record(pf, &info, rkey, filedump); } return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-dedupe.c0000644000175000017500000001214311211745573020435 0ustar rousseaurousseau/* * $Id: pilot-dedupe.c,v 1.44 2006/10/12 14:21:21 desrod Exp $ * * pilot-dedupe.c: Palm utility to remove duplicate records * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include "pi-header.h" #include "pi-source.h" #include "pi-dlp.h" #include "pi-userland.h" struct record { struct record *next; unsigned long id_; char *data; int cat; int index; int len; }; /*********************************************************************** * * Function: compare_r * * Summary: Compare records * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int compare_r(const void *av, const void *bv) { int i, o; struct record *a = *(struct record **) av; struct record *b = *(struct record **) bv; if (a->cat < b->cat) o = -1; else if (a->cat > b->cat) o = 1; else if (a->len < b->len) o = -1; else if (a->len > b->len) o = 1; else if ((i = memcmp(a->data, b->data, a->len))) o = i; else if (a->index < b->index) o = -1; else if (a->index > b->index) o = 1; else o = 0; return o; } static int DeDupe (int sd, const char *dbname) { int c, db, dupe = 0, j, k, l; struct record *r, **sortidx, *records = NULL; pi_buffer_t *buffer; char buf[200]; /* Open the database, store access handle in db */ printf("Opening %s\n", dbname); if (dlp_OpenDB(sd, 0, dlpOpenReadWrite, dbname, &db) < 0) { printf("Unable to open %s\n", dbname); return -1; } printf("Reading records...\n"); l = 0; c = 0; buffer = pi_buffer_new (0xffff); for (;;) { int attr, cat; recordid_t id_; int len = dlp_ReadRecordByIndex(sd, db, l, buffer, &id_, &attr, &cat); l++; if (len < 0) break; /* Skip deleted records */ if ((attr & dlpRecAttrDeleted) || (attr & dlpRecAttrArchived)) continue; c++; r = (struct record *) malloc(sizeof(struct record)); r->data = (char *) malloc(buffer->used); memcpy(r->data, buffer->data, buffer->used); r->len = len; r->cat = cat; r->id_ = id_; r->index = l; r->next = records; records = r; } pi_buffer_free (buffer); sortidx = malloc(sizeof(struct record *) * c); r = records; for (k = 0; r && (k < c); k++, r = r->next) sortidx[k] = r; qsort(sortidx, c, sizeof(struct record *), compare_r); printf("Scanning for duplicates...\n"); for (k = 0; k < c; k++) { struct record *r2; int d = 0; r = sortidx[k]; if (r->len < 0) continue; for (j = k + 1; j < c; j++) { r2 = sortidx[j]; if (r2->len < 0) continue; if ((r->len != r2->len) || memcmp(r->data, r2->data, r->len)) break; printf ("Deleting record %d, duplicate #%d of record %d\n", r2->index, ++d, r->index); dupe++; dlp_DeleteRecord(sd, db, 0, r2->id_); r2->len = -1; r2->id_ = 0; } k = j - 1; } free(sortidx); while (records) { if (records->data) free(records->data); r = records; records = records->next; free(r); } /* Close the database */ dlp_CloseDB(sd, db); sprintf(buf, "Removed %d duplicates from %s\n", dupe, dbname); printf("%s", buf); dlp_AddSyncLogEntry(sd, buf); return 0; } int main(int argc, const char *argv[]) { int c, /* switch */ sd = -1; const char *db = NULL; poptContext pc; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS POPT_TABLEEND }; pc = poptGetContext("pilot-dedupe", argc, argv, options, 0); poptSetOtherOptionHelp(pc," ...\n\n" " Removes duplicate records from any Palm database\n\n" " Example arguments:\n" " -p /dev/pilot AddressDB ToDoDB\n\n"); if (argc < 2) { poptPrintUsage(pc,stderr,0); return 1; } while ((c = poptGetNextOpt(pc)) >= 0) { fprintf(stderr," ERROR: Unhandled option %d.\n", c); return 1; } if (c < -1) { plu_badoption(pc,c); } if(poptPeekArg(pc) == NULL) { fprintf(stderr, " ERROR: You must specify at least one database\n"); return -1; } sd = plu_connect (); if (sd < 0) goto error; while((db = poptGetArg(pc)) != NULL) DeDupe(sd, db); if (dlp_ResetLastSyncPC(sd) < 0) goto error_close; if (pi_close(sd) < 0) goto error; return 0; error_close: pi_close(sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-nredir.c0000644000175000017500000000762311211745573020461 0ustar rousseaurousseau/* * $Id: pilot-nredir.c,v 1.54 2006/10/12 14:21:21 desrod Exp $ * * pilot-nredir.c: Redirect a connection over the network * * Copyright (C) 1997, Kenneth Albanowski * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include "pi-dlp.h" #include "pi-header.h" #include "pi-userland.h" int main(int argc, const char *argv[]) { int c, /* switch */ len, sd = -1, netsd = -1, /* This is the network socket */ state; size_t size; const char *progname = "pi-nredir"; char port2[255] = "net:"; pi_buffer_t *buffer; struct NetSyncInfo Net; poptContext po; enum { mode_none=0, mode_net=257 } run_mode = mode_none; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"net", 'n', POPT_ARG_NONE, NULL, mode_net, "Redirect to net:", NULL}, POPT_AUTOHELP POPT_TABLEEND }; po = poptGetContext(progname, argc, argv, options, 0); poptSetOtherOptionHelp(po,"\n\n" " Accept connection and redirect via Network Hotsync Protocol.\n" " This will bind your locally connected device to a network port, and\n" " redirect them through the network device to a listening server as\n" " specified in the LANSync Preferences panel on your Palm.\n\n" " Example arguments:\n" " -n -p /dev/pilot\n\n"); if (argc < 2) { poptPrintUsage(po,stderr,1); return 1; } while ((c = poptGetNextOpt(po)) >= 0) { switch(c) { case mode_net : if (mode_none == run_mode) { run_mode = c; } else { if (c != run_mode) { fprintf(stderr," ERROR: Specify only one mode (-n)\n"); return 1; } } break; default: fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } } if (c < -1) { plu_badoption(po,c); } sd = plu_connect(); if (sd < 0) goto error; if (dlp_ReadNetSyncInfo(sd, &Net) < 0) { fprintf(stderr, " ERROR: Unable to read network information, cancelling sync.\n"); goto error_close; } if (!Net.lanSync) { fprintf(stderr, " ERROR: LANSync not enabled on your Palm, cancelling sync.\n"); goto error_close; } netsd = pi_socket(PI_AF_PILOT, PI_SOCK_STREAM, PI_PF_NET); if (netsd < 0) goto error_close; strncat(port2, Net.hostAddress, 251 - strlen(Net.hostAddress)); if (!plu_quiet) { printf("\tTrying %s... ", Net.hostAddress); fflush(stdout); } if (pi_connect(netsd, port2) < 0) { fprintf(stderr," ERROR: Failed to connect to network.\n"); goto error_close; } if (!plu_quiet) { printf("Connected\n"); fflush(stdout); } buffer = pi_buffer_new (0xffff); while ((len = pi_read(netsd, buffer, 0xffff)) > 0) { pi_write(sd, buffer->data, len); buffer->used = 0; len = pi_read(sd, buffer, 0xffff); if (len < 0) break; pi_write(netsd, buffer->data, len); buffer->used = 0; } pi_buffer_free (buffer); state = PI_SOCK_CONN_END; size = sizeof (state); pi_setsockopt (sd, PI_LEVEL_SOCK, PI_SOCK_STATE, &state, &size); pi_setsockopt (netsd, PI_LEVEL_SOCK, PI_SOCK_STATE, &state, &size); pi_close(sd); pi_close(netsd); return 0; error_close: if (netsd >=0) { pi_close(netsd); } pi_close(sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-port.c0000644000175000017500000001375711211745573020167 0ustar rousseaurousseau/* * $Id: pilot-port.c,v 1.39 2006/10/12 14:21:21 desrod Exp $ * * pilot-port.c: Serial server * * Copyright (c) 1997, Kenneth Albanowski * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include #include #include #include #include #include #include "pi-source.h" #include "pi-socket.h" #include "pi-dlp.h" #include "pi-serial.h" #include "pi-slp.h" #include "pi-header.h" #include "pi-userland.h" void do_read(struct pi_socket *ps, int type, char *buffer, int length); /*********************************************************************** * * Function: do_read * * Summary: Read the incoming data from the network socket * * Parameters: None * * Returns: Nothing * ***********************************************************************/ void do_read(struct pi_socket *ps, int type, char *buffer, int length) { int len; printf("A %d byte packet of type %d has been received from the network\n", length, type); pi_dumpdata(buffer, length); if (type == 0) { struct pi_skb *nskb; nskb = (struct pi_skb *) malloc(sizeof(struct pi_skb)); nskb->source = buffer[0]; nskb->dest = buffer[1]; nskb->type = buffer[2]; len = get_short(buffer + 3); nskb->id_ = buffer[5]; memcpy(&nskb->data[10], buffer + 7, len); slp_tx(ps, nskb, len); } else if (type == 1) { ps->rate = get_long(buffer); pi_serial_flush(ps); ps->serial_changebaud(ps); } } int main(int argc, char *argv[]) { int c, /* switch */ sd = -1, netport = 4386, serverfd, fd; struct pi_socket *ps; struct sockaddr_in serv_addr; char *buffer, *slpbuffer; poptContext pc; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS POPT_TABLEEND }; pc = poptGetContext("pilot-port", argc, argv, options, 0); poptSetOtherOptionHelp(pc,"\n\n" " Reads incoming remote Palm data during a Network HotSync\n\n"); if (argc < 2) { poptPrintUsage(pc,stderr,0); return 1; } while ((c = poptGetNextOpt(pc)) >= 0) { fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } if (c < -1) { plu_badoption(pc,c); } sd = plu_connect(); if (sd < 0) goto error; if (dlp_OpenConduit(sd) < 0) goto error_close; buffer = malloc(0xFFFF + 128); slpbuffer = malloc(0xFFFF + 128); if ((serverfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { fprintf(stderr," ERROR: Unable to obtain socket: %s.\n",strerror(errno)); goto end; } memset((char *) &serv_addr, 0, sizeof(serv_addr)); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); serv_addr.sin_port = htons(netport); if (bind (serverfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { fprintf(stderr," ERROR: Unable to bind local address: %s.\n",strerror(errno)); goto end; } listen(serverfd, 5); ps = find_pi_socket(sd); ps->rate = 9600; ps->serial_changebaud(ps); for (;;) { int l, max, sent; fd_set rset, wset, eset, oset; struct sockaddr_in conn_addr; unsigned int connlen = sizeof(conn_addr); fd = accept(serverfd, (struct sockaddr *) &conn_addr, &connlen); if (fd < 0) { fprintf(stderr," ERROR: accept error: %s.\n",strerror(errno)); goto end; } FD_ZERO(&oset); FD_SET(fd, &oset); FD_SET(sd, &oset); sent = 0; l = 0; max = fd; if (sd > max) max = sd; max++; for (;;) { rset = wset = eset = oset; select(max, &rset, &wset, &eset, 0); if (FD_ISSET(fd, &rset)) { int r = read(fd, buffer + l, 0xFFFF - l); if (r < 0) break; if (r == 0) goto skip; printf("Read %d bytes from network at block+%d:\n", r, l); pi_dumpdata(buffer + l, r); l += r; if (l >= 4) { int blen; while (l >= 4 && (l >= (blen = get_short(buffer + 2)) + 4)) { printf("l = %d, blen = %d\n", l, blen); do_read(ps, get_short(buffer), buffer + 7, blen); l = l - blen - 4; if (l > blen) { memmove(buffer, buffer + 4 + blen, l); } printf("Buffer now is:\n"); pi_dumpdata(buffer, l); } } skip: ; } if (FD_ISSET(sd, &rset)) { ps->serial_read(ps, 1); if (ps->rxq) { printf("A %d byte packet has been received from the serial port\n", ps->rxq->len); } } if (FD_ISSET(fd, &wset) && ps->rxq) { int w = write(fd, ps->rxq->data + sent, ps->rxq->len - sent); if (w < 0) break; sent += w; if (w >= ps->rxq->len) { struct pi_skb *skb = ps->rxq; ps->rxq = ps->rxq->next; printf("A %d byte packet has been sent over the network\n", skb->len); free(skb); sent = 0; } } if (FD_ISSET(sd, &wset) && ps->txq) { printf("A %d byte packet is being sent to the serial port\n", ps->txq->len); ps->serial_write(ps); } if (FD_ISSET(fd, &eset)) { break; } if (FD_ISSET(sd, &eset)) { break; } } } end: return 0; error_close: pi_close(sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-install-todos.c0000644000175000017500000001105711211745573021766 0ustar rousseaurousseau/* * $Id: pilot-install-todos.c,v 1.44 2006/10/12 14:21:20 desrod Exp $ * * install-todolist.c: Palm ToDo list installer * * Copyright 1996, Robert A. Kaplan * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "pi-userland.h" #include #include #include "pi-source.h" #include "pi-dlp.h" #include "pi-todo.h" #include "pi-header.h" #include "pi-buffer.h" void install_ToDos(int sd, int db, char *filename) { int cLen = 0, i = 0, filelen; char *file_text = NULL, *cPtr = file_text, *begPtr = cPtr, note_text[] = ""; pi_buffer_t *ToDo_buf; struct ToDo todo; FILE *f; f = fopen(filename, "r"); if (f == NULL) { perror("fopen"); exit(EXIT_FAILURE); } fseek(f, 0, SEEK_END); filelen = ftell(f); fseek(f, 0, SEEK_SET); file_text = (char *) malloc(filelen + 1); if (file_text == NULL) { perror("malloc()"); exit(EXIT_FAILURE); } fread(file_text, filelen, 1, f); cPtr = file_text; begPtr = cPtr; cLen = 0; i = 0; while (i < filelen) { i++; /* printf("c:%c.\n",*cPtr); */ if (*cPtr == '\n') { todo.description = begPtr; /* replace CR with terminator */ *cPtr = '\0'; todo.priority = 4; todo.complete = 0; todo.indefinite = 1; /* now = time(0); todo.due = *localtime(&now); */ todo.note = note_text; ToDo_buf = pi_buffer_new(0); pack_ToDo(&todo, ToDo_buf, todo_v1); printf("Description: %s\n", todo.description); /* printf("todobuf: %s\n",ToDo_buf->data); */ dlp_WriteRecord(sd, db, 0, 0, 0, ToDo_buf->data, ToDo_buf->used, 0); pi_buffer_free(ToDo_buf); cPtr++; begPtr = cPtr; cLen = 0; } else { cLen++; cPtr++; } } return; } int main(int argc, const char *argv[]) { int c, /* switch */ db, sd = -1; const char *progname = argv[0]; char *filename = NULL; poptContext po; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"filename", 'f', POPT_ARG_STRING, &filename, 0, "A local file with formatted ToDo entries"}, POPT_TABLEEND }; po = poptGetContext("install-todos", argc, argv, options, 0); poptSetOtherOptionHelp(po, "\n\n" " Updates the Palm ToDo list with entries from a local file\n\n" " Example:\n" " -p /dev/pilot -f $HOME/MyTodoList.txt\n\n" " The format of this file is a simple line-by-line ToDo task entry.\n" " For each new line in the local file, a new task is created in the\n" " ToDo database on the Palm.\n\n"); if (argc<2) { poptPrintUsage(po,stderr,0); return 1; } while ((c = poptGetNextOpt(po)) >= 0) { fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } if (c < -1) { plu_badoption(po,c); } if (filename == NULL) { fprintf(stderr,"\n ERROR: You must specify a filename to read ToDo entries from.\n" " Please see %s --help for more information.\n\n", progname); exit(EXIT_FAILURE); } sd = plu_connect(); if (sd < 0) return 1; /* Did we get a valid socket descriptor back? */ if (dlp_OpenConduit(sd) < 0) { pi_close(sd); return 1; } /* Tell user (via Palm) that we are starting things up */ dlp_OpenConduit(sd); /* Open the ToDo Pad's database, store access handle in db */ if (dlp_OpenDB(sd, 0, 0x80 | 0x40, "ToDoDB", &db) < 0) { fprintf(stderr," ERROR: Unable to open ToDoDB on Palm.\n"); dlp_AddSyncLogEntry(sd, "Unable to open ToDoDB.\n"); pi_close(sd); return 1; } /* Actually do the install here, passed a filename */ install_ToDos(sd, db, filename); /* Close the database */ dlp_CloseDB(sd, db); dlp_AddSyncLogEntry(sd, "Wrote ToDo list entries to Palm.\nThank you for using pilot-link.\n"); dlp_EndOfSync(sd, 0); pi_close(sd); return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-read-todos.c0000644000175000017500000001450011211746360021222 0ustar rousseaurousseau/* * $Id: pilot-read-todos.c,v 1.60 2009/06/04 13:32:32 desrod Exp $ * * pilot-read-todos.c: Translate Palm ToDo database into generic format * * Copyright (c) 1996, Kenneth Albanowski * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ /* 12-27-2003: FIXME: Add "Private" and "Delete" flags */ #include #include #include #include #include "pi-socket.h" #include "pi-todo.h" #include "pi-file.h" #include "pi-header.h" #include "pi-userland.h" void print_unarchived(struct ToDoAppInfo *tai, struct ToDo *todo, int category) { printf("Category: %s\n", tai->category.name[category]); printf("Priority: %d\n", todo->priority); printf("Completed: %s\n", todo->complete ? "Yes" : "No"); if (todo->indefinite) { printf("Due: No Date\n"); } else { printf("Due: %s\n", asctime(&todo->due)); } if (todo->description) printf("Description: %s\n", todo->description); if (todo->note) printf("Note: %s\n", todo->note); printf("\n"); } void print_archived(struct ToDoAppInfo *tai, struct ToDo *todo, int category) { printf("\"Category\", "); printf("\"%s\", ", tai->category.name[category]); printf("\"Priority\", "); printf("\"%d\", ", todo->priority); printf("\"Completed\", "); printf("\"%s\", ", todo->complete ? "Yes" : "No"); if (todo->indefinite) { printf("\"Due\", \"No Date\", "); } else { printf("\"Due\", "); printf("\"%s\", ", asctime(&todo->due)); } if (todo->description) { printf("\"Description\", "); printf("\"%s\", ", todo->description); } if (todo->note) { printf("\"Note\", "); printf("\"%s\", ", todo->note); } printf("\n\n"); } int main(int argc, const char *argv[]) { int c, /* switch */ db, i, sd = -1; enum { mode_none, mode_write=257 } run_mode = mode_none; int archived = 0; char *filename = NULL, *ptr; struct PilotUser User; struct pi_file *pif = NULL; struct ToDoAppInfo tai; pi_buffer_t *recbuf, *appblock; poptContext po; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"write", 'w', POPT_ARG_NONE,NULL,mode_write, "Write output" }, {"file", 'f', POPT_ARG_STRING, &filename, 0, "Save ToDO entries in instead of STDOUT"}, {"archived", 'A', POPT_ARG_NONE, &archived, 0, "Write archived entries only, in human-readable format"}, POPT_TABLEEND }; po = poptGetContext("read-todos", argc, argv, options, 0); poptSetOtherOptionHelp(po,"\n\n" " Synchronize your ToDo database with your desktop machine.\n" " If you use --port, the contents of your Palm's ToDo database will be written to\n" " standard output in a generic text format/ Otherwise, use --file to read a todo\n" " database file from disk for printing.\n\n" " Example arguments:\n" " -w -A -p /dev/pilot \n" " -w -f ToDoDB.pdb\n"); if (argc<2) { poptPrintUsage(po,stderr,0); return 1; } while ((c = poptGetNextOpt(po)) >= 0) { switch(c) { case mode_write : if (run_mode == mode_none) { run_mode = c; } else { if (c!=run_mode) { fprintf(stderr," ERROR: Specify exactly one of -w.\n"); return 1; } } break; default: fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } } if (c < -1) { plu_badoption(po,c); } if (mode_none == run_mode) { fprintf(stderr," ERROR: Specify exactly one of -w.\n"); return 1; } if (!plu_port && !filename) { fprintf(stderr," ERROR: Specify either --port or --file.\n"); return 1; } /* Read ToDoDB.pdb from the Palm directly */ appblock = pi_buffer_new(0xffff); if (!filename) { sd = plu_connect(); if (sd < 0) goto error; if (dlp_ReadUserInfo(sd, &User) < 0) goto error_close; /* Open the ToDo database, store access handle in db */ if (dlp_OpenDB(sd, 0, 0x80 | 0x40, "ToDoDB", &db) < 0) { puts(" Unable to open ToDoDB"); dlp_AddSyncLogEntry(sd, " Unable to open ToDoDB.\n"); exit(EXIT_FAILURE); } dlp_ReadAppBlock(sd, db, 0, appblock->allocated, appblock); /* Read ToDoDB.pdb from disk */ } else { size_t len; pif = pi_file_open(filename); if (!pif) { fprintf(stderr, " ERROR: %s\n", strerror(errno)); fprintf(stderr, " Does %s exist?\n\n", filename); exit(EXIT_FAILURE); } pi_file_get_app_info(pif, (void *) &ptr, &len); pi_buffer_append(appblock, ptr, len); } unpack_ToDoAppInfo(&tai, appblock->data, appblock->used); pi_buffer_free(appblock); recbuf = pi_buffer_new (0xffff); for (i = 0;; i++) { int attr, category, len; struct ToDo todo; if (!filename) { len = dlp_ReadRecordByIndex(sd, db, i, recbuf, 0, &attr, &category); if (len < 0) break; } else { if (pi_file_read_record (pif, i, (void *) &ptr, &len, &attr, &category, 0)) break; pi_buffer_clear(recbuf); pi_buffer_append(recbuf, ptr, len); } /* Skip deleted records */ if (attr & dlpRecAttrArchived) { if (archived) { unpack_ToDo(&todo, recbuf, todo_v1); print_archived(&tai,&todo,category); free_ToDo(&todo); } continue; } if (attr & dlpRecAttrDeleted) continue; if (!archived) { unpack_ToDo(&todo, recbuf, todo_v1); print_unarchived(&tai,&todo,category); free_ToDo(&todo); } } pi_buffer_free (recbuf); if (!filename) { /* Close the database */ dlp_CloseDB(sd, db); dlp_AddSyncLogEntry(sd, "Successfully read ToDos from Palm.\n" "Thank you for using pilot-link."); dlp_EndOfSync(sd, 0); pi_close(sd); } else { pi_file_close(pif); } return 0; error_close: pi_close(sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-foto-treo600.c0000644000175000017500000001320011211746356021326 0ustar rousseaurousseau/* * $Id: pilot-foto-treo600.c,v 1.15 2009/06/04 13:32:30 desrod Exp $ * * pilot-treofoto.c: Grab jpeg photos off a Treo 600 camera phone. * * (c) 2004, Matthew Allum * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include #include #include "pi-file.h" #include "pi-header.h" #include "pi-dlp.h" #include "pi-socket.h" #include "pi-userland.h" #define MAIN_PDB_NAME "ImageLib_mainDB.pdb" #define IMG_PDB_NAME "ImageLib_imageDB.pdb" /* Record formats via script from * http://www.xent.com/~bsittler/treo600/dumphotos */ typedef struct MainDBImgRecord { unsigned char name[32]; /* padded NULL */ unsigned char unknown_1[8]; recordid_t first_image_uid; unsigned int unknown_2; recordid_t first_thumb_uid; unsigned short image_n_blocks; unsigned short thumb_n_blocks; unsigned int timestamp; unsigned short image_n_bytes; unsigned short thumb_n_bytes; unsigned char padding[56]; } MainDBImgRecord; int extract_image(struct pi_file *pi_fp, MainDBImgRecord * img_rec) { int i, attr, cat, nentries, fd; size_t size; void *Pbuf; recordid_t uid, req_uid; char imgfilename[1024]; snprintf(imgfilename, 1024, "%s.jpg", img_rec->name); req_uid = img_rec->first_image_uid; if ((fd = open(imgfilename, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1) { fprintf(stderr, " WARNING: failed to open '%s' for writing\n", imgfilename); return 0; } pi_file_get_entries(pi_fp, &nentries); for (i = 0; i < nentries; i++) { if (pi_file_read_record (pi_fp, i, &Pbuf, &size, &attr, &cat, &uid) < 0) { fprintf(stderr," WARNING: Error reading image record %d\n\n", i); return -1; } if (req_uid && uid == req_uid) { memcpy(&req_uid, Pbuf, 4); /* get next req_uid for image 'block' */ write(fd, Pbuf + 4, size - 4); /* The rest is just jpeg data */ } } if (!plu_quiet) { printf(" Wrote '%s' \n", imgfilename); } close(fd); return 1; } int fetch_remote_file(int sd, char *fullname) { struct DBInfo info; char *basename = NULL; struct pi_file *pi_fp; basename = strdup(fullname); basename[strlen(fullname) - 4] = '\0'; if (dlp_FindDBInfo(sd, 0, 0, basename, 0, 0, &info) < 0) { free(basename); return 0; } /* info.flags &= 0x2fd; needed ? */ pi_fp = pi_file_create(fullname, &info); if (pi_file_retrieve(pi_fp, sd, 0, NULL) < 0) { free(basename); return 0; } pi_file_close(pi_fp); free(basename); return 1; } int main(int argc, const char *argv[]) { struct pi_file *pi_fp = NULL, *img_fp = NULL; int i, attr, cat, nentries; size_t size; recordid_t uid; MainDBImgRecord *img_rec; int sd = -1; int c; int ret = 1; enum { mode_none, mode_write = 257 } run_mode = mode_none; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"write",'w', POPT_ARG_NONE,NULL,mode_write,"Write data"}, POPT_TABLEEND } ; poptContext po = poptGetContext("pilot-treofoto",argc,argv,options,0); poptSetOtherOptionHelp(po,"\n\n" " Copies Treo foto databases to current directory and\n" " extracts .jpg files from them."); if ((argc < 2)) { poptPrintUsage(po,stderr,0); return 1; } while ((c = poptGetNextOpt(po)) >= 0) { switch(c) { case mode_write : if (run_mode == mode_none) { run_mode = c; } else { if (c != run_mode) { fprintf(stderr," ERROR: Specify exactly one of -w.\n"); return 1; } } break; default: fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } } if (c < -1) { plu_badoption(po,c); } if (mode_none == run_mode) { fprintf(stderr," ERROR: Specify --write (-w) to output data.\n"); return 1; } if ((sd = plu_connect()) < 0) { return 1; } if (!fetch_remote_file(sd, MAIN_PDB_NAME)) { fprintf(stderr, " ERROR: unable to fetch '%s'\n", MAIN_PDB_NAME); goto cleanup; } if (!fetch_remote_file(sd, IMG_PDB_NAME)) { fprintf(stderr, " ERROR: unable to fetch '%s'\n", IMG_PDB_NAME); goto cleanup; } if ((pi_fp = pi_file_open(MAIN_PDB_NAME)) == NULL) { fprintf(stderr," ERROR: could not open local '%s'\n", MAIN_PDB_NAME); goto cleanup; } if ((img_fp = pi_file_open(IMG_PDB_NAME)) == NULL) { fprintf(stderr," ERROR: could not open '%s'\n", IMG_PDB_NAME); goto cleanup; } pi_file_get_entries(pi_fp, &nentries); for (i = 0; i < nentries; i++) { if (pi_file_read_record (pi_fp, i, (void **) &img_rec, &size, &attr, &cat, &uid) < 0) { fprintf(stderr," WARNING: Could not read record: %d\n\n", i); continue; } extract_image(img_fp, img_rec); } ret=0; cleanup: if (img_fp) { pi_file_close(img_fp); unlink(IMG_PDB_NAME); } if (pi_fp) { pi_file_close(pi_fp); unlink(MAIN_PDB_NAME); } if (sd >= 0) { dlp_EndOfSync(sd, 0); pi_close(sd); } return ret; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-reminders.c0000644000175000017500000002143611211745573021164 0ustar rousseaurousseau/* * $Id: pilot-reminders.c,v 1.56 2006/10/12 14:21:21 desrod Exp $ * * pilot-reminders.c: Translate Palm datebook into REMIND format * * Copyright (c) 1996, Kenneth Albanowski * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include "pi-source.h" #include "pi-datebook.h" #include "pi-dlp.h" #include "pi-header.h" #include "pi-userland.h" static char *Weekday[7] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }, *Month[12] = { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"}; int main(int argc, const char *argv[]) { int c, /* switch */ db, i, sd = -1; enum { mode_none, mode_write = 257 } run_mode = mode_none; pi_buffer_t *buffer; poptContext pc; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"write",'w', POPT_ARG_NONE,NULL,mode_write,"Write data"}, POPT_TABLEEND }; pc = poptGetContext("reminders", argc, argv, options, 0); poptSetOtherOptionHelp(pc,"\n\n" " Exports your Palm Datebook database into a 'remind' data file format.\n" " Your Datebook database will be written to STDOUT as it is converted\n" " unless redirected to a file.\n\n" " Please see http://www.roaringpenguin.com/remind.html for more\n" " information on the Remind Calendar Program.\n"); if ((argc < 2)) { poptPrintUsage(pc,stderr,0); return 1; } while ((c = poptGetNextOpt(pc)) >= 0) { switch(c) { case mode_write : if (run_mode == mode_none) { run_mode = c; } else { if (c != run_mode) { fprintf(stderr," ERROR: Specify exactly one of -w.\n"); return 1; } } break; default: fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } } if (c < -1) { plu_badoption(pc,c); } if (mode_none == run_mode) { fprintf(stderr," ERROR: Specify --write (-w) to output data.\n"); return 1; } sd = plu_connect(); if (sd < 0) goto error; /* Open the Datebook's database, store access handle in db */ if (dlp_OpenDB(sd, 0, 0x80 | 0x40, "DatebookDB", &db) < 0) { fprintf(stderr," ERROR: Unable to open DatebookDB on Palm.\n"); dlp_AddSyncLogEntry(sd, "Unable to open DatebookDB.\n"); goto error_close; } printf("PUSH-OMIT-CONTEXT\n"); printf("CLEAR-OMIT-CONTEXT\n"); buffer = pi_buffer_new (0xffff); for (i = 0;; i++) { int attr, j; char delta[80], satisfy[256]; struct Appointment a; if (dlp_ReadRecordByIndex(sd, db, i, buffer, 0, &attr, 0) < 0) break; /* Skip deleted records */ if ((attr & dlpRecAttrDeleted) || (attr & dlpRecAttrArchived)) continue; unpack_Appointment(&a, buffer, datebook_v1); strcpy(delta, "+7 "); satisfy[0] = 0; if (a.exceptions) { printf("PUSH-OMIT-CONTEXT\n"); for (j = 0; j < a.exceptions; j++) { printf("OMIT %d %s %d\n", a.exception[j].tm_mday, Month[a.exception[j].tm_mon], a.exception[j].tm_year + 1900); } } if (a.advance) { sprintf(delta + strlen(delta), "AT %2.2d:%2.2d +%d ", a.begin.tm_hour, a.begin.tm_min, a.advance * ((a.advanceUnits == advMinutes) ? 1 : (a.advanceUnits == advHours) ? 60 : (a. advanceUnits == advDays) ? 60 * 24 : 0)); } if (!a.repeatForever) { sprintf(delta + strlen(delta), "UNTIL %d %s %d ", a.repeatEnd.tm_mday, Month[a.repeatEnd.tm_mon], a.repeatEnd.tm_year + 1900); } if (a.repeatFrequency) { if (a.repeatType == repeatDaily) { /* On the specified day... */ printf("REM %d %s %d ", a.begin.tm_mday, Month[a.begin.tm_mon], a.begin.tm_year + 1900); if (a.repeatFrequency > 1) { /* And every x days afterwords */ printf("*%d ", a.repeatFrequency); } } else if (a.repeatType == repeatMonthlyByDate) { /* On the x of every month */ printf("REM %d ", a.begin.tm_mday); if (a.repeatFrequency > 1) { /* if the month is equal to the starting month mod x */ snprintf(satisfy, 256, "SATISFY [(trigdate()>=date(%d,%d,%d)) " "&& (!isomitted(trigdate())) " "&& (((monnum(trigdate())-1+year(trigdate())*12)%%%d) " "== ((%d+%d*12)%%%d))] ", a.begin.tm_year + 1900, a.begin.tm_mon + 1, a.begin.tm_mday, a.repeatFrequency, a.begin.tm_year + 1900, a.begin.tm_mon, a.repeatFrequency); } else { snprintf(satisfy, 256, "SATISFY [(trigdate()>=date(%d,%d,%d))" "&& (!isomitted(trigdate()))] ", a.begin.tm_year + 1900, a.begin.tm_mon + 1, a.begin.tm_mday); } } else if (a.repeatType == repeatWeekly) { int k; /* On the chosen days of the week */ printf("REM "); for (k = 0; k < 7; k++) if (a.repeatDays[k]) printf("%s ", Weekday[k]); if (a.repeatFrequency > 1) { /* if the week is equal to the starting week mod x */ snprintf(satisfy, 256, "SATISFY [(trigdate()>=date(%d,%d,%d)) " "&& (!isomitted(trigdate()))" "&& (((coerce(\"int\",trigdate())/7)%%%d)" "== ((coerce(\"int\",date(%d,%d,%d))/7)%%%d))] ", a.begin.tm_year + 1900, a.begin.tm_mon + 1, a.begin.tm_mday, a.repeatFrequency, a.begin.tm_year + 1900, a.begin.tm_mon + 1, a.begin.tm_mday, a.repeatFrequency); } else { snprintf(satisfy, 256, "SATISFY [(trigdate()>=date(%d,%d,%d)) " "&& (!isomitted(trigdate()))] ", a.begin.tm_year + 1900, a.begin.tm_mon + 1, a.begin.tm_mday); } } else if (a.repeatType == repeatMonthlyByDay) { int day, weekday; if (a.repeatDay >= domLastSun) { day = 1; weekday = a.repeatDay % 7; printf("REM %s %d -7 ", Weekday[weekday], day); } else { day = a.repeatDay / 7 * 7 + 1; weekday = a.repeatDay % 7; printf("REM %s %d ", Weekday[weekday], day); } if (a.repeatFrequency > 1) { snprintf(satisfy, 256, "SATISFY [(trigdate()>=date(%d,%d,%d)) " "&& (!isomitted(trigdate())) " "&& (((monnum(trigdate())-1+year(trigdate())*12)%%%d) " "== ((%d+%d*12)%%%d))]", a.begin.tm_year + 1900, a.begin.tm_mon + 1, a.begin.tm_mday, a.repeatFrequency, a.begin.tm_year + 1900, a.begin.tm_mon, a.repeatFrequency); } else { snprintf(satisfy, 256, "SATISFY [(trigdate()>=date(%d,%d,%d)) " "&& (!isomitted(trigdate()))]", a.begin.tm_year + 1900, a.begin.tm_mon + 1, a.begin.tm_mday); } } else if (a.repeatType == repeatYearly) { /* On one day each year */ printf("REM %d %s ", a.begin.tm_mday, Month[a.begin.tm_mon]); if (a.repeatFrequency > 1) { /* if the year is equal to the starting year, mod x */ snprintf(satisfy, 256, "SATISFY [(trigdate()>=date(%d,%d,%d)) " "&& (!isomitted(trigdate())) " "&& ((year(trigdate())%%%d) == (%d%%%d))]", a.begin.tm_year + 1900, a.begin.tm_mon + 1, a.begin.tm_mday, a.repeatFrequency, a.begin.tm_year + 1900, a.repeatFrequency); } else { snprintf(satisfy, 256, "SATISFY [(trigdate()>=date(%d,%d,%d)) " "&& (!isomitted(trigdate()))]", a.begin.tm_year + 1900, a.begin.tm_mon + 1, a.begin.tm_mday); } } } else { /* On that one day */ printf("REM %d %s %d ", a.begin.tm_mday, Month[a.begin.tm_mon], a.begin.tm_year + 1900); } printf("%s%s", delta, satisfy); printf("MSG %s %%a", a.description); if (a.note) printf(" (%s)", a.note); if (!a.event) { printf(" from %2.2d:%2.2d", a.begin.tm_hour, a.begin.tm_min); printf(" to %2.2d:%2.2d", a.end.tm_hour, a.end.tm_min); } printf("\n"); if (a.exceptions) printf("POP-OMIT-CONTEXT\n"); free_Appointment(&a); } printf("POP-OMIT-CONTEXT\n"); pi_buffer_free(buffer); /* Close the database */ dlp_CloseDB(sd, db); dlp_AddSyncLogEntry(sd, "Successfully read Datebook from Palm\n" "Thank you for using pilot-link\n"); dlp_EndOfSync(sd, 0); pi_close(sd); return 0; error_close: pi_close(sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/Makefile.am0000644000175000017500000002006610716064236017734 0ustar rousseaurousseauSUBDIRS=prc pix if ENABLE_CONDUITS INCLUDES = \ -I/usr/include \ -I$(top_srcdir)/include \ $(POPT_INCLUDES) \ $(PNG_CFLAGS) \ $(TCL_INCLUDES) \ $(RL_CFLAGS) noinst_LTLIBRARIES = libpiuserland.la bin_PROGRAMS = \ pilot-addresses \ pilot-clip \ pilot-csd \ pilot-debugsh \ pilot-dedupe \ pilot-dlpsh \ pilot-file \ pilot-foto \ pilot-getram \ pilot-getrom \ pilot-getromtoken \ pilot-hinotes \ pilot-install-datebook \ pilot-install-expenses \ pilot-install-hinote \ pilot-install-memo \ pilot-install-netsync \ pilot-install-todo \ pilot-install-todos \ pilot-install-user \ pilot-memos \ pilot-nredir \ pilot-read-expenses \ pilot-read-ical \ pilot-read-notepad \ pilot-read-palmpix \ pilot-read-screenshot \ pilot-read-todos \ pilot-read-veo \ pilot-reminders \ pilot-schlep \ pilot-foto-treo600 \ pilot-foto-treo650 \ pilot-wav \ pilot-xfer if WITH_PERL PERLSCRIPTS = \ pilot-ietf2datebook \ pilot-undelete \ pilot-sync-plan else PERLSCRIPTS = endif bin_SCRIPTS = \ $(PERLSCRIPTS) #ccexample_SOURCES = \ # ccexample.cc #ccexample_LDADD = \ # $(top_builddir)/libpisock++/libpisock++.la \ # $(top_builddir)/libpisock/libpisock.la libpiuserland_la_SOURCES = \ plu_args.c \ userland.c libpiuserland_la_LDFLAGS = \ -static #getrom_SOURCES = \ # getrom.c #getrom_LDADD = \ # $(top_builddir)/libpisock/libpisock.la pilot_install_datebook_SOURCES = \ pilot-install-datebook.c \ parsedate.y pilot_install_datebook_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_install_hinote_SOURCES = \ pilot-install-hinote.c pilot_install_hinote_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_install_memo_SOURCES = \ pilot-install-memo.c pilot_install_memo_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_install_todos_SOURCES = \ pilot-install-todos.c pilot_install_todos_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_install_todo_SOURCES = \ pilot-install-todo.c pilot_install_todo_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_install_user_SOURCES = \ pilot-install-user.c pilot_install_user_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_memos_SOURCES = \ pilot-memos.c pilot_memos_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_csd_SOURCES = \ pilot-csd.c pilot_csd_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_debugsh_SOURCES = \ pilot-debugsh.c pilot_debugsh_LDADD = \ $(top_builddir)/libpisock/libpisock.la pilot_dlpsh_SOURCES = \ pilot-dlpsh.c pilot_dlpsh_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(RL_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_getram_SOURCES = \ pilot-getram.c pilot_getram_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_getrom_SOURCES = \ pilot-getrom.c pilot_getrom_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_getromtoken_SOURCES = \ pilot-getromtoken.c pilot_getromtoken_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_hinotes_SOURCES = \ pilot-hinotes.c pilot_hinotes_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_install_expenses_SOURCES = \ pilot-install-expenses.c pilot_install_expenses_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_install_netsync_SOURCES = \ pilot-install-netsync.c pilot_install_netsync_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_nredir_SOURCES = \ pilot-nredir.c pilot_nredir_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_addresses_SOURCES = \ pilot-addresses.c pilot_addresses_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_clip_SOURCES = \ pilot-clip.c pilot_clip_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_dedupe_SOURCES = \ pilot-dedupe.c pilot_dedupe_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_file_SOURCES = \ pilot-file.c pilot_file_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_foto_SOURCES = \ pilot-foto.c pilot_foto_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_read_screenshot_SOURCES = \ pilot-read-screenshot.c pilot_read_screenshot_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(PNG_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_reminders_SOURCES = \ pilot-reminders.c pilot_reminders_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_schlep_SOURCES = \ pilot-schlep.c pilot_schlep_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_foto_treo600_SOURCES = \ pilot-foto-treo600.c pilot_foto_treo600_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_foto_treo650_SOURCES = \ pilot-foto-treo650.c pilot_foto_treo650_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_wav_SOURCES = \ pilot-wav.c pilot_wav_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_xfer_SOURCES = \ pilot-xfer.c pilot_xfer_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_read_expenses_SOURCES = \ pilot-read-expenses.c pilot_read_expenses_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_read_ical_SOURCES = \ pilot-read-ical.c pilot_read_ical_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_read_notepad_SOURCES = \ pilot-read-notepad.c pilot_read_notepad_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(PNG_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_read_palmpix_SOURCES = \ pilot-read-palmpix.c pilot_read_palmpix_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(PNG_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_read_todos_SOURCES = \ pilot-read-todos.c pilot_read_todos_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot_read_veo_SOURCES = \ pilot-read-veo.c pilot_read_veo_LDADD = \ libpiuserland.la \ $(POPT_LIBS) \ $(PNG_LIBS) \ $(top_builddir)/libpisock/libpisock.la pilot-ietf2datebook: pilot-ietf2datebook.pl $(PERL) $< > $@ chmod +x $@ pilot-undelete: pilot-undelete.pl $(PERL) $< > $@ chmod +x $@ pilot-sync-plan: pilot-sync-plan.pl $(PERL) $< > $@ chmod +x $@ CLEANFILES = $(PERLSCRIPTS) endif EXTRA_DIST = \ ccexample.cc \ pilot-ietf2datebook.pl \ kittykiller.c \ parsedate.y \ pd-tty.c \ pilot-addresses.c \ pilot-clip.c \ pilot-csd.c \ pilot-debug.c \ pilot-debugsh.c \ pilot-dedupe.c \ pilot-dlpsh.c \ pilot-file.c \ pilot-foto.c \ pilot-getram.c \ pilot-getrom.c \ pilot-getromtoken.c \ pilot-hinotes.c \ pilot-install-datebook.c \ pilot-install-expenses \ pilot-install-hinote.c \ pilot-install-memo.c \ pilot-install-netsync.c \ pilot-install-todo.c \ pilot-install-todos.c \ pilot-install-user.c \ pilot-memos.c \ pilot-nredir.c \ pilot-port.c \ pilot-read-expenses.c \ pilot-read-ical.c \ pilot-read-notepad.c \ pilot-read-palmpix.c \ pilot-read-screenshot.c \ pilot-read-todos.c \ pilot-read-veo.c \ pilot-reminders.c \ pilot-schlep.c \ pilot-foto-treo600.c \ pilot-foto-treo650.c \ pilot-undelete.pl \ pilot-wav.c \ pilot-xfer.c \ pilot-sync-plan.pl \ validate.cc # Magic to update Makefile from Makefile.am $(srcdir)/Makefile.in : $(srcdir)/Makefile.am ( cd $(top_srcdir) && automake src/Makefile ) pilot-link-0.12.5-dfsg/src/parsedate.c0000644000175000017500000015567511211745573020034 0ustar rousseaurousseau/* A Bison parser, made by GNU Bison 1.875d. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 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. */ /* Written by Richard Stallman by simplifying the original so called ``semantic'' parser. */ /* 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. */ /* Identify Bison output. */ #define YYBISON 1 /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Using locations. */ #define YYLSP_NEEDED 0 /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { tDAY = 258, tDAYZONE = 259, tMERIDIAN = 260, tMONTH = 261, tMONTH_UNIT = 262, tSEC_UNIT = 263, tSNUMBER = 264, tUNUMBER = 265, tZONE = 266 }; #endif #define tDAY 258 #define tDAYZONE 259 #define tMERIDIAN 260 #define tMONTH 261 #define tMONTH_UNIT 262 #define tSEC_UNIT 263 #define tSNUMBER 264 #define tUNUMBER 265 #define tZONE 266 /* Copy the first part of user declarations. */ #line 1 "parsedate.y" /* $Revision: 1.16 $ ** ** Originally written by Steven M. Bellovin while ** at the University of North Carolina at Chapel Hill. Later tweaked by ** a couple of people on Usenet. Completely overhauled by Rich $alz ** and Jim Berets in August, 1990. ** Further revised (removed obsolete constructs and cleaned up timezone ** names) in August, 1991, by Rich. Paul Eggert ** helped in September, 1992. ** ** This grammar has six shift/reduce conflicts. ** ** This code is in the public domain and has no copyright. */ /* SUPPRESS 530 *//* Empty body for statement */ /* SUPPRESS 593 on yyerrlab *//* Label was not used */ /* SUPPRESS 593 on yynewstate *//* Label was not used */ /* SUPPRESS 595 on yypvt *//* Automatic variable may be used before set */ #include #include #include #include #include #include int date_lex(); #define yyparse date_parse #define yylex date_lex #define yyerror date_error /* See the LeapYears table in Convert. */ #define EPOCH 1970 #define END_OF_TIME 2038 /* Constants for general time calculations. */ #define DST_OFFSET 1 #define SECSPERDAY (24L * 60L * 60L) /* Readability for TABLE stuff. */ #define HOUR(x) (x * 60) #define LPAREN '(' #define RPAREN ')' #define IS7BIT(x) ((unsigned int)(x) < 0200) #define SIZEOF(array) ((int)(sizeof array / sizeof array[0])) #define ENDOF(array) (&array[SIZEOF(array)]) /* ** An entry in the lexical lookup table. */ typedef struct _TABLE { char *name; int type; time_t value; } TABLE; /* ** Daylight-savings mode: on, off, or not yet known. */ typedef enum _DSTMODE { DSTon, DSToff, DSTmaybe } DSTMODE; /* ** Meridian: am, pm, or 24-hour style. */ typedef enum _MERIDIAN { MERam, MERpm, MER24 } MERIDIAN; /* ** Global variables. We could get rid of most of them by using a yacc ** union, but this is more efficient. (This routine predates the ** yacc %union construct.) */ static char *yyInput; static DSTMODE yyDSTmode; static int yyHaveDate; static int yyHaveRel; static int yyHaveTime; static time_t yyTimezone; static time_t yyDay; static time_t yyHour; static time_t yyMinutes; static time_t yyMonth; static time_t yySeconds; static time_t yyYear; static MERIDIAN yyMeridian; static time_t yyRelMonth; static time_t yyRelSeconds; extern struct tm *localtime(); static void date_error(); /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) #line 101 "parsedate.y" typedef union YYSTYPE { time_t Number; enum _MERIDIAN Meridian; } YYSTYPE; /* Line 191 of yacc.c. */ #line 203 "parsedate.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ /* Line 214 of yacc.c. */ #line 215 "parsedate.c" #if ! defined (yyoverflow) || YYERROR_VERBOSE # ifndef YYFREE # define YYFREE free # endif # ifndef YYMALLOC # define YYMALLOC malloc # endif /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca # endif # else # if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca # else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # 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 YYMALLOC # define YYSTACK_FREE YYFREE # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short int yyss; YYSTYPE yyvs; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined (__GNUC__) && 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_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char; #else typedef short int yysigned_char; #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 40 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 15 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 9 /* YYNRULES -- Number of rules. */ #define YYNRULES 30 /* YYNRULES -- Number of states. */ #define YYNSTATES 44 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 266 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const unsigned 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 14, 2, 2, 13, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 12, 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, 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, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const unsigned char yyprhs[] = { 0, 0, 3, 4, 7, 9, 12, 14, 16, 19, 24, 29, 36, 43, 45, 47, 50, 52, 54, 58, 64, 67, 72, 75, 79, 85, 88, 91, 94, 97, 98 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yysigned_char yyrhs[] = { 16, 0, -1, -1, 16, 17, -1, 18, -1, 18, 19, -1, 21, -1, 22, -1, 10, 23, -1, 10, 12, 10, 23, -1, 10, 12, 10, 20, -1, 10, 12, 10, 12, 10, 23, -1, 10, 12, 10, 12, 10, 20, -1, 11, -1, 4, -1, 11, 20, -1, 20, -1, 9, -1, 10, 13, 10, -1, 10, 13, 10, 13, 10, -1, 6, 10, -1, 6, 10, 14, 10, -1, 10, 6, -1, 10, 6, 10, -1, 3, 14, 10, 6, 10, -1, 9, 8, -1, 10, 8, -1, 9, 7, -1, 10, 7, -1, -1, 5, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short int yyrline[] = { 0, 115, 115, 116, 119, 128, 132, 135, 140, 152, 158, 165, 171, 181, 185, 189, 197, 203, 224, 228, 240, 244, 249, 253, 258, 265, 268, 271, 274, 279, 282 }; #endif #if YYDEBUG || YYERROR_VERBOSE /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "tDAY", "tDAYZONE", "tMERIDIAN", "tMONTH", "tMONTH_UNIT", "tSEC_UNIT", "tSNUMBER", "tUNUMBER", "tZONE", "':'", "'/'", "','", "$accept", "spec", "item", "time", "zone", "numzone", "date", "rel", "o_merid", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const unsigned short int yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 58, 47, 44 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { 0, 15, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 19, 19, 20, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const unsigned char yyr2[] = { 0, 2, 0, 2, 1, 2, 1, 1, 2, 4, 4, 6, 6, 1, 1, 2, 1, 1, 3, 5, 2, 4, 2, 3, 5, 2, 2, 2, 2, 0, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const unsigned char yydefact[] = { 2, 0, 1, 0, 0, 0, 29, 3, 4, 6, 7, 0, 20, 27, 25, 30, 22, 28, 26, 0, 0, 8, 14, 17, 13, 5, 16, 0, 0, 23, 29, 18, 15, 0, 21, 0, 10, 9, 0, 24, 29, 19, 12, 11 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yysigned_char yydefgoto[] = { -1, 1, 7, 8, 25, 26, 9, 10, 21 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -29 static const yysigned_char yypact[] = { -29, 1, -29, -11, 11, 20, 12, -29, 4, -29, -29, 13, 16, -29, -29, -29, 21, -29, -29, 22, 23, -29, -29, -29, 5, -29, -29, 28, 25, -29, 17, 24, -29, 26, -29, 29, -29, -29, 30, -29, 0, -29, -29, -29 }; /* YYPGOTO[NTERM-NUM]. */ static const yysigned_char yypgoto[] = { -29, -29, -29, -29, -29, -24, -29, -29, -28 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const unsigned char yytable[] = { 32, 2, 37, 11, 3, 15, 36, 4, 22, 23, 5, 6, 43, 23, 23, 24, 42, 15, 16, 17, 18, 12, 15, 27, 19, 20, 23, 13, 14, 35, 28, 29, 30, 31, 33, 34, 39, 38, 0, 40, 41 }; static const yysigned_char yycheck[] = { 24, 0, 30, 14, 3, 5, 30, 6, 4, 9, 9, 10, 40, 9, 9, 11, 40, 5, 6, 7, 8, 10, 5, 10, 12, 13, 9, 7, 8, 12, 14, 10, 10, 10, 6, 10, 10, 13, -1, 10, 10 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned char yystos[] = { 0, 16, 0, 3, 6, 9, 10, 17, 18, 21, 22, 14, 10, 7, 8, 5, 6, 7, 8, 12, 13, 23, 4, 9, 11, 19, 20, 10, 14, 10, 10, 10, 20, 6, 10, 12, 20, 23, 13, 10, 10, 10, 20, 23 }; #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 yyerrorlab /* 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); \ yytoken = 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). */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ ((Current).first_line = (Rhs)[1].first_line, \ (Current).first_column = (Rhs)[1].first_column, \ (Current).last_line = (Rhs)[N].last_line, \ (Current).last_column = (Rhs)[N].last_column) #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* 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) # define YYDSYMPRINT(Args) \ do { \ if (yydebug) \ yysymprint Args; \ } while (0) # define YYDSYMPRINTF(Title, Token, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yysymprint (stderr, \ Token, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_stack_print (short int *bottom, short int *top) #else static void yy_stack_print (bottom, top) short int *bottom; short int *top; #endif { YYFPRINTF (stderr, "Stack now"); for (/* Nothing. */; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_reduce_print (int yyrule) #else static void yy_reduce_print (yyrule) int yyrule; #endif { int yyi; unsigned int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", yyrule - 1, yylno); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YYDSYMPRINT(Args) # define YYDSYMPRINTF(Title, Token, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #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 defined (YYMAXDEPTH) && YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if 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 /* !YYERROR_VERBOSE */ #if YYDEBUG /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) #else static void yysymprint (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; if (yytype < YYNTOKENS) { YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); # ifdef YYPRINT YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif } else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); switch (yytype) { default: break; } YYFPRINTF (yyoutput, ")"); } #endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yydestruct (int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yytype, yyvaluep) int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM); # else int yyparse (); # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM) # else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void) #else int yyparse () #endif #endif { 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 yytoken = 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 int yyssa[YYINITDEPTH]; short int *yyss = yyssa; register short int *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #define YYPOPSTACK (yyvsp--, yyssp--) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* 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; 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 (yyss + yystacksize - 1 <= yyssp) { /* 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 int *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. 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), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyoverflowlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyoverflowlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { short int *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) 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 == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; /* 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 garbage. 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]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 4: #line 119 "parsedate.y" { yyHaveTime++; #ifdef lint /* I am compulsive about lint natterings... */ if (yyHaveTime == -1) { YYERROR; } #endif /* lint */ } break; case 5: #line 128 "parsedate.y" { yyHaveTime++; yyTimezone = yyvsp[0].Number; } break; case 6: #line 132 "parsedate.y" { yyHaveDate++; } break; case 7: #line 135 "parsedate.y" { yyHaveRel = 1; } break; case 8: #line 140 "parsedate.y" { if (yyvsp[-1].Number < 100) { yyHour = yyvsp[-1].Number; yyMinutes = 0; } else { yyHour = yyvsp[-1].Number / 100; yyMinutes = yyvsp[-1].Number % 100; } yySeconds = 0; yyMeridian = yyvsp[0].Meridian; } break; case 9: #line 152 "parsedate.y" { yyHour = yyvsp[-3].Number; yyMinutes = yyvsp[-1].Number; yySeconds = 0; yyMeridian = yyvsp[0].Meridian; } break; case 10: #line 158 "parsedate.y" { yyHour = yyvsp[-3].Number; yyMinutes = yyvsp[-1].Number; yyTimezone = yyvsp[0].Number; yyMeridian = MER24; yyDSTmode = DSToff; } break; case 11: #line 165 "parsedate.y" { yyHour = yyvsp[-5].Number; yyMinutes = yyvsp[-3].Number; yySeconds = yyvsp[-1].Number; yyMeridian = yyvsp[0].Meridian; } break; case 12: #line 171 "parsedate.y" { yyHour = yyvsp[-5].Number; yyMinutes = yyvsp[-3].Number; yySeconds = yyvsp[-1].Number; yyTimezone = yyvsp[0].Number; yyMeridian = MER24; yyDSTmode = DSToff; } break; case 13: #line 181 "parsedate.y" { yyval.Number = yyvsp[0].Number; yyDSTmode = DSToff; } break; case 14: #line 185 "parsedate.y" { yyval.Number = yyvsp[0].Number; yyDSTmode = DSTon; } break; case 15: #line 189 "parsedate.y" { /* Only allow "GMT+300" and "GMT-0800" */ if (yyvsp[-1].Number != 0) { YYABORT; } yyval.Number = yyvsp[0].Number; yyDSTmode = DSToff; } break; case 16: #line 197 "parsedate.y" { yyval.Number = yyvsp[0].Number; yyDSTmode = DSToff; } break; case 17: #line 203 "parsedate.y" { int i; /* Unix and GMT and numeric timezones -- a little confusing. */ if (yyvsp[0].Number < 0) { /* Don't work with negative modulus. */ yyvsp[0].Number = -yyvsp[0].Number; if (yyvsp[0].Number > 9999 || (i = yyvsp[0].Number % 100) >= 60) { YYABORT; } yyval.Number = (yyvsp[0].Number / 100) * 60 + i; } else { if (yyvsp[0].Number > 9999 || (i = yyvsp[0].Number % 100) >= 60) { YYABORT; } yyval.Number = -((yyvsp[0].Number / 100) * 60 + i); } } break; case 18: #line 224 "parsedate.y" { yyMonth = yyvsp[-2].Number; yyDay = yyvsp[0].Number; } break; case 19: #line 228 "parsedate.y" { if (yyvsp[-4].Number > 100) { yyYear = yyvsp[-4].Number; yyMonth = yyvsp[-2].Number; yyDay = yyvsp[0].Number; } else { yyMonth = yyvsp[-4].Number; yyDay = yyvsp[-2].Number; yyYear = yyvsp[0].Number; } } break; case 20: #line 240 "parsedate.y" { yyMonth = yyvsp[-1].Number; yyDay = yyvsp[0].Number; } break; case 21: #line 244 "parsedate.y" { yyMonth = yyvsp[-3].Number; yyDay = yyvsp[-2].Number; yyYear = yyvsp[0].Number; } break; case 22: #line 249 "parsedate.y" { yyDay = yyvsp[-1].Number; yyMonth = yyvsp[0].Number; } break; case 23: #line 253 "parsedate.y" { yyDay = yyvsp[-2].Number; yyMonth = yyvsp[-1].Number; yyYear = yyvsp[0].Number; } break; case 24: #line 258 "parsedate.y" { yyDay = yyvsp[-2].Number; yyMonth = yyvsp[-1].Number; yyYear = yyvsp[0].Number; } break; case 25: #line 265 "parsedate.y" { yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number; } break; case 26: #line 268 "parsedate.y" { yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number; } break; case 27: #line 271 "parsedate.y" { yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number; } break; case 28: #line 274 "parsedate.y" { yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number; } break; case 29: #line 279 "parsedate.y" { yyval.Meridian = MER24; } break; case 30: #line 282 "parsedate.y" { yyval.Meridian = yyvsp[0].Meridian; } break; } /* Line 1010 of yacc.c. */ #line 1391 "parsedate.c" yyvsp -= yylen; yyssp -= yylen; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* 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 - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if YYERROR_VERBOSE yyn = yypact[yystate]; if (YYPACT_NINF < yyn && yyn < YYLAST) { YYSIZE_T yysize = 0; int yytype = YYTRANSLATE (yychar); const char* yyprefix; char *yymsg; int yyx; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 0; yyprefix = ", expecting "; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); yycount += 1; if (yycount == 5) { yysize = 0; break; } } yysize += (sizeof ("syntax error, unexpected ") + yystrlen (yytname[yytype])); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) { yyprefix = ", expecting "; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { yyp = yystpcpy (yyp, yyprefix); yyp = yystpcpy (yyp, yytname[yyx]); yyprefix = " or "; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("syntax error; also virtual memory exhausted"); } else #endif /* YYERROR_VERBOSE */ yyerror ("syntax error"); } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* If at end of input, pop the error token, then the rest of the stack, then return failure. */ if (yychar == YYEOF) for (;;) { YYPOPSTACK; if (yyssp == yyss) YYABORT; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[*yyssp], yyvsp); } } else { YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); yydestruct (yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: #ifdef __GNUC__ /* Pacify GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) goto yyerrorlab; #endif yyvsp -= yylen; yyssp -= yylen; yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[yystate], yyvsp); YYPOPSTACK; yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*----------------------------------------------. | yyoverflowlab -- parser overflow comes here. | `----------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ #endif yyreturn: #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 287 "parsedate.y" /* Month and day table. */ static TABLE MonthDayTable[] = { { "january", tMONTH, 1 }, { "february", tMONTH, 2 }, { "march", tMONTH, 3 }, { "april", tMONTH, 4 }, { "may", tMONTH, 5 }, { "june", tMONTH, 6 }, { "july", tMONTH, 7 }, { "august", tMONTH, 8 }, { "september", tMONTH, 9 }, { "october", tMONTH, 10 }, { "november", tMONTH, 11 }, { "december", tMONTH, 12 }, /* The value of the day isn't used... */ { "sunday", tDAY, 0 }, { "monday", tDAY, 0 }, { "tuesday", tDAY, 0 }, { "wednesday", tDAY, 0 }, { "thursday", tDAY, 0 }, { "friday", tDAY, 0 }, { "saturday", tDAY, 0 }, }; /* Time units table. */ static TABLE UnitsTable[] = { { "year", tMONTH_UNIT, 12 }, { "month", tMONTH_UNIT, 1 }, { "week", tSEC_UNIT, 7L * 24 * 60 * 60 }, { "day", tSEC_UNIT, 1L * 24 * 60 * 60 }, { "hour", tSEC_UNIT, 60 * 60 }, { "minute", tSEC_UNIT, 60 }, { "min", tSEC_UNIT, 60 }, { "second", tSEC_UNIT, 1 }, { "sec", tSEC_UNIT, 1 }, }; /* Timezone table. */ static TABLE TimezoneTable[] = { { "gmt", tZONE, HOUR( 0) }, /* Greenwich Mean */ { "ut", tZONE, HOUR( 0) }, /* Universal */ { "utc", tZONE, HOUR( 0) }, /* Universal Coordinated */ { "cut", tZONE, HOUR( 0) }, /* Coordinated Universal */ { "z", tZONE, HOUR( 0) }, /* Greenwich Mean */ { "wet", tZONE, HOUR( 0) }, /* Western European */ { "bst", tDAYZONE, HOUR( 0) }, /* British Summer */ { "nst", tZONE, HOUR(3)+30 }, /* Newfoundland Standard */ { "ndt", tDAYZONE, HOUR(3)+30 }, /* Newfoundland Daylight */ { "ast", tZONE, HOUR( 4) }, /* Atlantic Standard */ { "adt", tDAYZONE, HOUR( 4) }, /* Atlantic Daylight */ { "est", tZONE, HOUR( 5) }, /* Eastern Standard */ { "edt", tDAYZONE, HOUR( 5) }, /* Eastern Daylight */ { "cst", tZONE, HOUR( 6) }, /* Central Standard */ { "cdt", tDAYZONE, HOUR( 6) }, /* Central Daylight */ { "mst", tZONE, HOUR( 7) }, /* Mountain Standard */ { "mdt", tDAYZONE, HOUR( 7) }, /* Mountain Daylight */ { "pst", tZONE, HOUR( 8) }, /* Pacific Standard */ { "pdt", tDAYZONE, HOUR( 8) }, /* Pacific Daylight */ { "yst", tZONE, HOUR( 9) }, /* Yukon Standard */ { "ydt", tDAYZONE, HOUR( 9) }, /* Yukon Daylight */ { "akst", tZONE, HOUR( 9) }, /* Alaska Standard */ { "akdt", tDAYZONE, HOUR( 9) }, /* Alaska Daylight */ { "hst", tZONE, HOUR(10) }, /* Hawaii Standard */ { "hast", tZONE, HOUR(10) }, /* Hawaii-Aleutian Standard */ { "hadt", tDAYZONE, HOUR(10) }, /* Hawaii-Aleutian Daylight */ { "ces", tDAYZONE, -HOUR(1) }, /* Central European Summer */ { "cest", tDAYZONE, -HOUR(1) }, /* Central European Summer */ { "mez", tZONE, -HOUR(1) }, /* Middle European */ { "mezt", tDAYZONE, -HOUR(1) }, /* Middle European Summer */ { "cet", tZONE, -HOUR(1) }, /* Central European */ { "met", tZONE, -HOUR(1) }, /* Middle European */ { "eet", tZONE, -HOUR(2) }, /* Eastern Europe */ { "msk", tZONE, -HOUR(3) }, /* Moscow Winter */ { "msd", tDAYZONE, -HOUR(3) }, /* Moscow Summer */ { "wast", tZONE, -HOUR(8) }, /* West Australian Standard */ { "wadt", tDAYZONE, -HOUR(8) }, /* West Australian Daylight */ { "hkt", tZONE, -HOUR(8) }, /* Hong Kong */ { "cct", tZONE, -HOUR(8) }, /* China Coast */ { "jst", tZONE, -HOUR(9) }, /* Japan Standard */ { "kst", tZONE, -HOUR(9) }, /* Korean Standard */ { "kdt", tZONE, -HOUR(9) }, /* Korean Daylight */ { "cast", tZONE, -(HOUR(9)+30) }, /* Central Australian Standard */ { "cadt", tDAYZONE, -(HOUR(9)+30) }, /* Central Australian Daylight */ { "east", tZONE, -HOUR(10) }, /* Eastern Australian Standard */ { "eadt", tDAYZONE, -HOUR(10) }, /* Eastern Australian Daylight */ { "nzst", tZONE, -HOUR(12) }, /* New Zealand Standard */ { "nzdt", tDAYZONE, -HOUR(12) }, /* New Zealand Daylight */ /* For completeness we include the following entries. */ #if 0 /* Duplicate names. Either they conflict with a zone listed above * (which is either more likely to be seen or just been in circulation * longer), or they conflict with another zone in this section and * we could not reasonably choose one over the other. */ { "fst", tZONE, HOUR( 2) }, /* Fernando De Noronha Standard */ { "fdt", tDAYZONE, HOUR( 2) }, /* Fernando De Noronha Daylight */ { "bst", tZONE, HOUR( 3) }, /* Brazil Standard */ { "est", tZONE, HOUR( 3) }, /* Eastern Standard (Brazil) */ { "edt", tDAYZONE, HOUR( 3) }, /* Eastern Daylight (Brazil) */ { "wst", tZONE, HOUR( 4) }, /* Western Standard (Brazil) */ { "wdt", tDAYZONE, HOUR( 4) }, /* Western Daylight (Brazil) */ { "cst", tZONE, HOUR( 5) }, /* Chile Standard */ { "cdt", tDAYZONE, HOUR( 5) }, /* Chile Daylight */ { "ast", tZONE, HOUR( 5) }, /* Acre Standard */ { "adt", tDAYZONE, HOUR( 5) }, /* Acre Daylight */ { "cst", tZONE, HOUR( 5) }, /* Cuba Standard */ { "cdt", tDAYZONE, HOUR( 5) }, /* Cuba Daylight */ { "est", tZONE, HOUR( 6) }, /* Easter Island Standard */ { "edt", tDAYZONE, HOUR( 6) }, /* Easter Island Daylight */ { "sst", tZONE, HOUR(11) }, /* Samoa Standard */ { "ist", tZONE, -HOUR(2) }, /* Israel Standard */ { "idt", tDAYZONE, -HOUR(2) }, /* Israel Daylight */ { "idt", tDAYZONE, -(HOUR(3)+30) }, /* Iran Daylight */ { "ist", tZONE, -(HOUR(3)+30) }, /* Iran Standard */ { "cst", tZONE, -HOUR(8) }, /* China Standard */ { "cdt", tDAYZONE, -HOUR(8) }, /* China Daylight */ { "sst", tZONE, -HOUR(8) }, /* Singapore Standard */ /* Dubious (e.g., not in Olson's TIMEZONE package) or obsolete. */ { "gst", tZONE, HOUR( 3) }, /* Greenland Standard */ { "wat", tZONE, -HOUR(1) }, /* West Africa */ { "at", tZONE, HOUR( 2) }, /* Azores */ { "gst", tZONE, -HOUR(10) }, /* Guam Standard */ { "nft", tZONE, HOUR(3)+30 }, /* Newfoundland */ { "idlw", tZONE, HOUR(12) }, /* International Date Line West */ { "mewt", tZONE, -HOUR(1) }, /* Middle European Winter */ { "mest", tDAYZONE, -HOUR(1) }, /* Middle European Summer */ { "swt", tZONE, -HOUR(1) }, /* Swedish Winter */ { "sst", tDAYZONE, -HOUR(1) }, /* Swedish Summer */ { "fwt", tZONE, -HOUR(1) }, /* French Winter */ { "fst", tDAYZONE, -HOUR(1) }, /* French Summer */ { "bt", tZONE, -HOUR(3) }, /* Baghdad */ { "it", tZONE, -(HOUR(3)+30) }, /* Iran */ { "zp4", tZONE, -HOUR(4) }, /* USSR Zone 3 */ { "zp5", tZONE, -HOUR(5) }, /* USSR Zone 4 */ { "ist", tZONE, -(HOUR(5)+30) }, /* Indian Standard */ { "zp6", tZONE, -HOUR(6) }, /* USSR Zone 5 */ { "nst", tZONE, -HOUR(7) }, /* North Sumatra */ { "sst", tZONE, -HOUR(7) }, /* South Sumatra */ { "jt", tZONE, -(HOUR(7)+30) }, /* Java (3pm in Cronusland!) */ { "nzt", tZONE, -HOUR(12) }, /* New Zealand */ { "idle", tZONE, -HOUR(12) }, /* International Date Line East */ { "cat", tZONE, HOUR(10) }, /* -- expired 1967 */ { "nt", tZONE, HOUR(11) }, /* -- expired 1967 */ { "ahst", tZONE, HOUR(10) }, /* -- expired 1983 */ { "hdt", tDAYZONE, HOUR(10) }, /* -- expired 1986 */ #endif /* 0 */ }; /* ARGSUSED */ static void date_error(s) char *s; { /* NOTREACHED */ } static time_t ToSeconds(Hours, Minutes, Seconds, Meridian) time_t Hours; time_t Minutes; time_t Seconds; MERIDIAN Meridian; { if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 61) return -1; if (Meridian == MER24) { if (Hours < 0 || Hours > 23) return -1; } else { if (Hours < 1 || Hours > 12) return -1; if (Hours == 12) Hours = 0; if (Meridian == MERpm) Hours += 12; } return (Hours * 60L + Minutes) * 60L + Seconds; } static time_t Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, dst) time_t Month; time_t Day; time_t Year; time_t Hours; time_t Minutes; time_t Seconds; MERIDIAN Meridian; DSTMODE dst; { static int DaysNormal[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static int DaysLeap[13] = { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static int LeapYears[] = { 1972, 1976, 1980, 1984, 1988, 1992, 1996, 2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028, 2032, 2036 }; register int *yp; register int *mp; register time_t Julian; register int i; time_t tod; if (Year < 0) Year = -Year; if (Year < 100) Year += 1900; if (Year < EPOCH) Year += 100; for (mp = DaysNormal, yp = LeapYears; yp < ENDOF(LeapYears); yp++) if (Year == *yp) { mp = DaysLeap; break; } if (Year < EPOCH || Year > END_OF_TIME || Month < 1 || Month > 12 /* NOSTRICT *//* conversion from long may lose accuracy */ || Day < 1 || Day > mp[(int)Month]) return -1; Julian = Day - 1 + (Year - EPOCH) * 365; for (yp = LeapYears; yp < ENDOF(LeapYears); yp++, Julian++) if (Year <= *yp) break; for (i = 1; i < Month; i++) Julian += *++mp; Julian *= SECSPERDAY; Julian += yyTimezone * 60L; if ((tod = ToSeconds(Hours, Minutes, Seconds, Meridian)) < 0) return -1; Julian += tod; tod = Julian; if (dst == DSTon || (dst == DSTmaybe && localtime(&tod)->tm_isdst)) Julian -= DST_OFFSET * 60L * 60L; return Julian; } static time_t DSTcorrect(Start, Future) time_t Start; time_t Future; { time_t StartDay; time_t FutureDay; StartDay = (localtime(&Start)->tm_hour + 1) % 24; FutureDay = (localtime(&Future)->tm_hour + 1) % 24; return (Future - Start) + (StartDay - FutureDay) * DST_OFFSET * 60L * 60L; } static time_t RelativeMonth(Start, RelMonth) time_t Start; time_t RelMonth; { struct tm *tm; time_t Month; time_t Year; tm = localtime(&Start); Month = 12 * tm->tm_year + tm->tm_mon + RelMonth; Year = Month / 12; Month = Month % 12 + 1; return DSTcorrect(Start, Convert(Month, (time_t)tm->tm_mday, Year, (time_t)tm->tm_hour, (time_t)tm->tm_min, (time_t)tm->tm_sec, MER24, DSTmaybe)); } static int LookupWord(buff, length) char *buff; register int length; { register char *p; register char *q; register TABLE *tp; register int c; p = buff; c = p[0]; /* See if we have an abbreviation for a month. */ if (length == 3 || (length == 4 && p[3] == '.')) for (tp = MonthDayTable; tp < ENDOF(MonthDayTable); tp++) { q = tp->name; if (c == q[0] && p[1] == q[1] && p[2] == q[2]) { yylval.Number = tp->value; return tp->type; } } else for (tp = MonthDayTable; tp < ENDOF(MonthDayTable); tp++) if (c == tp->name[0] && strcmp(p, tp->name) == 0) { yylval.Number = tp->value; return tp->type; } /* Try for a timezone. */ for (tp = TimezoneTable; tp < ENDOF(TimezoneTable); tp++) if (c == tp->name[0] && p[1] == tp->name[1] && strcmp(p, tp->name) == 0) { yylval.Number = tp->value; return tp->type; } /* Try the units table. */ for (tp = UnitsTable; tp < ENDOF(UnitsTable); tp++) if (c == tp->name[0] && strcmp(p, tp->name) == 0) { yylval.Number = tp->value; return tp->type; } /* Strip off any plural and try the units table again. */ if (--length > 0 && p[length] == 's') { p[length] = '\0'; for (tp = UnitsTable; tp < ENDOF(UnitsTable); tp++) if (c == tp->name[0] && strcmp(p, tp->name) == 0) { p[length] = 's'; yylval.Number = tp->value; return tp->type; } p[length] = 's'; } length++; /* Drop out any periods. */ for (p = buff, q = (char*)buff; *q; q++) if (*q != '.') *p++ = *q; *p = '\0'; /* Try the meridians. */ if (buff[1] == 'm' && buff[2] == '\0') { if (buff[0] == 'a') { yylval.Meridian = MERam; return tMERIDIAN; } if (buff[0] == 'p') { yylval.Meridian = MERpm; return tMERIDIAN; } } /* If we saw any periods, try the timezones again. */ if (p - buff != length) { c = buff[0]; for (p = buff, tp = TimezoneTable; tp < ENDOF(TimezoneTable); tp++) if (c == tp->name[0] && p[1] == tp->name[1] && strcmp(p, tp->name) == 0) { yylval.Number = tp->value; return tp->type; } } /* Unknown word -- assume GMT timezone. */ yylval.Number = 0; return tZONE; } int date_lex() { register char c; register char *p; char buff[20]; register int sign; register int i; register int nesting; for ( ; ; ) { /* Get first character after the whitespace. */ for ( ; ; ) { while (isspace(*yyInput)) yyInput++; c = *yyInput; /* Ignore RFC 822 comments, typically time zone names. */ if (c != LPAREN) break; for (nesting = 1; (c = *++yyInput) != RPAREN || --nesting; ) if (c == LPAREN) nesting++; else if (!IS7BIT(c) || c == '\0' || c == '\r' || (c == '\\' && ((c = *++yyInput) == '\0' || !IS7BIT(c)))) /* Lexical error: bad comment. */ return '?'; yyInput++; } /* A number? */ if (isdigit(c) || c == '-' || c == '+') { if (c == '-' || c == '+') { sign = c == '-' ? -1 : 1; yyInput++; if (!isdigit(*yyInput)) /* Skip the plus or minus sign. */ continue; } else sign = 0; for (i = 0; (c = *yyInput++) != '\0' && isdigit(c); ) i = 10 * i + c - '0'; yyInput--; yylval.Number = sign < 0 ? -i : i; return sign ? tSNUMBER : tUNUMBER; } /* A word? */ if (isalpha(c)) { for (p = buff; (c = *yyInput++) == '.' || isalpha(c); ) if (p < &buff[sizeof buff - 1]) *p++ = isupper(c) ? tolower(c) : c; *p = '\0'; yyInput--; return LookupWord(buff, p - buff); } return *yyInput++; } } time_t parsedate(p) char *p; { extern int date_parse(); time_t Start; yyInput = p; yyYear = 0; yyMonth = 0; yyDay = 0; yyTimezone = 0; yyDSTmode = DSTmaybe; yyHour = 0; yyMinutes = 0; yySeconds = 0; yyMeridian = MER24; yyRelSeconds = 0; yyRelMonth = 0; yyHaveDate = 0; yyHaveRel = 0; yyHaveTime = 0; if (date_parse() || yyHaveTime > 1 || yyHaveDate > 1) return -1; if (yyHaveDate || yyHaveTime) { Start = Convert(yyMonth, yyDay, yyYear, yyHour, yyMinutes, yySeconds, yyMeridian, yyDSTmode); if (Start < 0) return -1; } else return -1; Start += yyRelSeconds; if (yyRelMonth) Start += RelativeMonth(Start, yyRelMonth); /* Have to do *something* with a legitimate -1 so it's distinguishable * from the error return value. (Alternately could set errno on error.) */ return Start == -1 ? 0 : Start; } #ifdef TEST #if YYDEBUG extern int yydebug; #endif /* YYDEBUG */ /* ARGSUSED */ int main(ac, av) int ac; char *av[]; { char buff[128]; time_t d; #if YYDEBUG yydebug = 1; #endif /* YYDEBUG */ (void)printf("Enter date, or blank line to exit.\n\t> "); for ( ; ; ) { (void)printf("\t> "); (void)fflush(stdout); if (gets(buff) == NULL || buff[0] == '\n') break; #if YYDEBUG if (strcmp(buff, "yydebug") == 0) { yydebug = !yydebug; printf("yydebug = %s\n", yydebug ? "on" : "off"); continue; } #endif /* YYDEBUG */ d = parsedate(buff, (TIMEINFO *)NULL); if (d == -1) (void)printf("Bad format - couldn't convert.\n"); else (void)printf("%s", ctime(&d)); } exit(0); /* NOTREACHED */ } #endif /* TEST */ pilot-link-0.12.5-dfsg/src/pilot-install-hinote.c0000644000175000017500000001255011211745573022123 0ustar rousseaurousseau/* * $Id: pilot-install-hinote.c,v 1.42 2006/10/17 13:24:07 desrod Exp $ * * install-hinote.c: Palm Hi-Note note installer * * Copyright 1997 Bill Goodman * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include "pi-dlp.h" #include "pi-hinote.h" #include "pi-header.h" #include "pi-userland.h" /* Size of maximum buffer, containing 28k of note + a filename + \n + NUL at the end. */ #define HINOTE_BUFFER_SIZE (28 * 1024 + FILENAME_MAX + 2) int main(int argc, const char *argv[]) { int db, sd = -1, c, /* switch */ j, filenamelen, filelen, err, category = 0, note_size; const char *file_arg; char *file_text, *cat = NULL; pi_buffer_t *appblock; unsigned char note_buf[0x8000]; FILE *f; struct PilotUser User; struct stat info; struct HiNoteAppInfo mai; struct HiNoteNote note; poptContext pc; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"category", 'c', POPT_ARG_STRING, &cat, 0, "Write files to in the Hi-NOte application", "category"}, POPT_TABLEEND }; pc = poptGetContext("install-hinote", argc, argv, options, 0); poptSetOtherOptionHelp(pc," ...\n\n" " Install local files into your Hi-Notes database on your Palm device\n" " Please see http://www.cyclos.com/ for more information on Hi-Note.\n\n" " Example arguments:\n" " -p /dev/pilot -c 1 ~/Palm/Note1.txt ~/Note2.txt\n\n"); if (argc < 2) { poptPrintUsage(pc,stderr,0); return 1; } while ((c = poptGetNextOpt(pc)) >= 0) { fprintf(stderr," ERROR: Unhandled option %d.\n",c); return -1; } if (c < -1) { plu_badoption(pc,c); } if(poptPeekArg(pc) == NULL) { fprintf(stderr, " WARNING: No files to install\n"); return 0; } /* Allocate buffer for biggest possible file */ file_text = (char *) malloc(HINOTE_BUFFER_SIZE); if (file_text == NULL) { fprintf(stderr," ERROR: Cannot allocate memory for files.\n"); return 1; } sd = plu_connect(); if (sd < 0) goto error; if (dlp_ReadUserInfo(sd, &User) < 0) goto error_close; /* Open Hi-Note's database, store access handle in db */ if (dlp_OpenDB(sd, 0, 0x80 | 0x40, "Hi-NoteDB", &db) < 0) { fprintf(stderr," ERROR: Unable to open Hi-NoteDB on Palm.\n"); dlp_AddSyncLogEntry(sd, "Unable to open Hi-NoteDB.\n"); goto error_close; } appblock = pi_buffer_new(0xffff); j = dlp_ReadAppBlock(sd, db, 0, 0xffff, appblock); unpack_HiNoteAppInfo(&mai, appblock->data, j); /* should check result */ pi_buffer_free(appblock); if (cat != NULL) { category = plu_findcategory(&mai.category,cat, PLU_CAT_CASE_INSENSITIVE | PLU_CAT_MATCH_NUMBERS | PLU_CAT_DEFAULT_UNFILED); } while((file_arg = poptGetArg(pc)) != NULL) { /* Attempt to check the file size, stat() returns nonzero on error */ err = stat(file_arg, &info); if (err) { /* FIXME: use perror() */ fprintf(stderr," WARNING: Checking file '%s': %s\n", file_arg,strerror(errno)); continue; } /* If size is good, open the file. */ filelen = info.st_size; if (filelen > 28672) { fprintf(stderr," WARNING: This note (%i bytes) is larger than allowed size of 28k (28,672 bytes),\n" " please reduce into two or more pieces and sync each again.\n\n", filelen); continue; } else { f = fopen(file_arg, "r"); } if (f == NULL) { fprintf(stderr," WARNING: Opening file '%s': %s\n",file_arg,strerror(errno)); continue; } filenamelen = strlen(file_arg); memset(file_text,0,HINOTE_BUFFER_SIZE); strcpy(file_text, file_arg); file_text[filenamelen] = '\n'; fread(file_text + filenamelen + 1, filelen, 1, f); file_text[filenamelen + 1 + filelen] = '\0'; note.text = file_text; note.flags = 0x40; note.level = 0; note_size = pack_HiNoteNote(¬e, note_buf, sizeof(note_buf)); /* dlp_exec(sd, 0x26, 0x20, &db, 1, NULL, 0); */ if (!plu_quiet) { fprintf(stdout, " Installing %s to Hi-Note application...\n", file_arg); } dlp_WriteRecord(sd, db, 0, 0, category, note_buf, note_size, 0); } free(file_text); /* Close the database */ dlp_CloseDB(sd, db); /* Tell the user who it is, with a different PC id. */ User.lastSyncPC = 0x00010000; User.successfulSyncDate = time(NULL); User.lastSyncDate = User.successfulSyncDate; dlp_WriteUserInfo(sd, &User); dlp_AddSyncLogEntry(sd, "Successfully wrote Hi-Note notes to Palm.\n" "Thank you for using pilot-link.\n"); dlp_EndOfSync(sd, 0); pi_close(sd); return 0; error_close: pi_close(sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-memos.c0000644000175000017500000002636411211745573020321 0ustar rousseaurousseau/* * $Id: pilot-memos.c,v 1.68 2006/10/12 14:21:21 desrod Exp $ * * pilot-memos.c: Translate Palm Memos into e-mail format * * Copyright (c) 1996, Kenneth Albanowski * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include "pi-memo.h" #include "pi-file.h" #include "pi-header.h" #include "pi-userland.h" /* constants to determine how to produce memos */ #define MEMO_MBOX_STDOUT 0 #define MEMO_DIRECTORY 1 #define MAXDIRNAMELEN 1024 void write_memo_mbox(struct Memo m, struct MemoAppInfo mai, int category); void write_memo_in_directory(char *dirname, struct Memo m, struct MemoAppInfo mai, int category, int verbose, const char *progname); /*********************************************************************** * * Function: write_memo_mbox * * Summary: Write a memo entry to MailDB database * * Parameters: None * * Returns: Nothing * ***********************************************************************/ void write_memo_mbox(struct Memo m, struct MemoAppInfo mai, int category) { int j; time_t now; char *time_str; now = time( NULL ); /* FIXME: might be good to get the time stamp of the memo file for the "Received" line */ time_str = ctime(&now); printf("From Palm.Handheld %s" "From: pilot-link memos (MemoDB) \n" "Received: %s" "To: You\n" "Date: %s" "Subject: ", time_str, time_str, time_str); /* print category name in brackets in subject field */ printf("[%s] ", mai.category.name[category]); /* print (at least part of) first line as part of subject: */ for (j = 0; j < 40; j++) { if ((!m.text[j]) || (m.text[j] == '\n')) break; printf("%c", m.text[j]); } if (j == 40) printf("...\n"); else printf("\n"); printf("\n"); puts(m.text); } /*********************************************************************** * * Function: write_memo_in_directory * * Summary: Writes each memo into /$DIR/$CATEGORY/$FILENAME form * after the user specifies the -d /dir/name argument * * Parameters: None * * Returns: Nothing * ***********************************************************************/ void write_memo_in_directory(char *dirname, struct Memo m, struct MemoAppInfo mai, int category, int verbose, const char *progname) { int j; char pathbuffer[MAXDIRNAMELEN] = "", tmp[5] = ""; FILE *fd; /* Should check if dirname exists and is a directory */ mkdir(dirname, 0700); /* Create a directory for the category */ strncat(pathbuffer, dirname, MAXDIRNAMELEN); strncat(pathbuffer, "/", 1); /* Should make sure category doesn't have slashes in it */ strncat(pathbuffer, mai.category.name[category], 60); /* Should check if pathbuffer exists and is a directory */ mkdir(pathbuffer, 0700); /* Should check if there were problems creating directory */ /* open the actual file to write */ strncat(pathbuffer, "/", 1); for (j = 0; j < 40; j++) { if ((!m.text[j]) || (m.text[j] == '\n')) break; if (m.text[j] == '/') { strncat(pathbuffer, "=2F", 3); continue; } if (m.text[j] == '=') { strncat(pathbuffer, "=3D", 3); continue; } #ifdef OS2 if (m.text[j] == ':') { strncat(pathbuffer, "=3A", 3); continue; } #endif /* escape if it's an ISO8859 control chcter (note: some are printable on the Palm) */ if ((m.text[j] | 0x7f) < ' ') { tmp[0] = '\0'; sprintf(tmp, "=%2X", (unsigned char) m.text[j]); } else { tmp[0] = m.text[j]; tmp[1] = '\0'; } strcat(pathbuffer, tmp); } if (verbose) { printf("Writing %s\n", pathbuffer); } if (!(fd = fopen(pathbuffer, "w"))) { printf("%s: can't open file \"%s\" for writing\n", progname, pathbuffer); exit(EXIT_FAILURE); } fputs(m.text, fd); fclose(fd); } int main(int argc, const char *argv[]) { int attr, c, /* switch */ category, db, idx, ret, sd = -1, verbose = 0, delete = 0, mode = MEMO_MBOX_STDOUT, bufsize = 1024, match_category = -1, title_matching = 0; size_t len; pi_buffer_t *buffer, *appblock; const char *progname = argv[0]; char *buf = NULL, *dirname = NULL, *category_name = NULL, *filename = NULL, *regex = NULL, *ptr; struct MemoAppInfo mai; struct pi_file *pif = NULL; struct Memo m; regex_t title_pattern; recordid_t id; poptContext po; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"verbose", 'v', POPT_ARG_VAL, &verbose, 1, "Verbose, with -s, print each filename when written", NULL}, {"delete", 'd', POPT_ARG_VAL, &delete, 1, "Delete memo named by number ", ""}, {"file", 'f', POPT_ARG_STRING, &filename, 0, "Use as input file (instead of MemoDB.pdb)", ""}, {"save", 's', POPT_ARG_STRING, &dirname, 0, "Save memos in instead of writing to STDOUT", ""}, {"category", 'c', POPT_ARG_STRING, &category_name, 0, "Only upload memos in this category", ""}, {"regex", 'r', POPT_ARG_STRING, ®ex, 0, "Select memos saved by regular expression on title", ""}, POPT_AUTOHELP POPT_TABLEEND }; po = poptGetContext("memos", argc, argv, options, 0); poptSetOtherOptionHelp(po,"\n\n" " Manipulate Memo entries from a file or your Palm device\n\n" " By default, the contents of your Palm's memo database will be written to\n" " standard output as a standard UNIX mailbox (mbox-format) file, with each\n" " memo as a separate message. The subject of each message will be the\n" " category.\n\n" " If '-s' is specified, than instead of being written to standard output,\n" " will be saved in subdirectories of . Each subdirectory will be the\n" " name of a category on the Palm, and will contain the memos in that\n" " category. Each memo's filename will be the first line (up to the first 40\n" " characters) of the memo. Control chcters, slashes, and equal signs that\n" " would otherwise appear in filenames are converted after the fashion of\n" " MIME's quoted-printable encoding. Note that if you have two memos in the\n" " same category whose first lines are identical, one of them will be\n" " overwritten.\n\n" " If '-f' is specified, the specified file will be treated as a memo\n" " database from which to read memos, rather than HotSyncing from the Palm.\n"); if (argc < 2) { poptPrintUsage(po,stderr,0); return 1; } while ((c = poptGetNextOpt(po)) >= 0) { fprintf(stderr," ERROR: Unhandled option %d.\n",c); return -1; } if (dirname) mode = MEMO_DIRECTORY; if (c < -1) plu_badoption(po, c); if (regex) { ret = regcomp(&title_pattern, regex, REG_NOSUB); buf = (char *) malloc(bufsize); if (ret) { regerror(ret, &title_pattern, buf, bufsize); fprintf(stderr," ERROR: Regexp - %s\n", buf); return 1; } title_matching = 1; } /* FIXME - Need to add tests here for port/filename, clean this. -DD */ appblock = pi_buffer_new(0xffff); if (!filename) { sd = plu_connect(); if (sd < 0) goto error; if (dlp_OpenConduit(sd) < 0) goto error_close; /* Open the Memo Pad's database, store access handle in db */ if (dlp_OpenDB(sd, 0, 0x80 | 0x40, "MemoDB", &db) < 0) { fprintf(stderr," ERROR: Unable to open MemoDB on Palm.\n"); dlp_AddSyncLogEntry(sd, "Unable to open MemoDB.\n"); goto error_close; } dlp_ReadAppBlock(sd, db, 0, 0xffff, appblock); } else { pif = pi_file_open(filename); if (!pif) { fprintf(stderr," ERROR: pi_file_open: %s\n",strerror(errno)); return 1; } pi_file_get_app_info(pif, (void **) &ptr, &len); pi_buffer_append(appblock, ptr, len); } unpack_MemoAppInfo(&mai, appblock->data, appblock->used); pi_buffer_free(appblock); if (category_name && category_name[0] != '\0') { match_category = plu_findcategory(&mai.category,category_name, PLU_CAT_WARN_UNKNOWN); if (match_category < 0) { goto error_close; }; } buffer = pi_buffer_new (0xffff); for (idx = 0;; idx++) { if (!filename) { if (match_category >= 0) { ret = dlp_ReadNextRecInCategory(sd, db, match_category, buffer, &id, 0, &attr); category = match_category; } else { ret = dlp_ReadRecordByIndex(sd, db, idx, buffer, &id, &attr, &category); } if (ret < 0) break; len = (size_t)ret; } else { if (pi_file_read_record (pif, idx, (void **) &ptr, &len, &attr, &category, 0) < 0) break; memcpy(buffer->data, ptr, len); buffer->used = len; } /* Skip deleted records */ if ((attr & dlpRecAttrDeleted) || (attr & dlpRecAttrArchived)) continue; /* Skip memos whose category doesn't match */ if( match_category >= 0 ) { if( match_category != category ) continue; } unpack_Memo(&m, buffer, memo_v1); /* Skip memos whose title does not match with the query */ if (title_matching) { for (len = 0; m.text[len] && m.text[len] != '\n'; len++); if (bufsize < len + 1) buf = (char *) realloc(buf, len + 1); strncpy(buf, m.text, len); buf[len] = '\0'; if (regexec(&title_pattern, buf, 0, NULL, 0) == REG_NOMATCH) continue; } switch (mode) { case MEMO_MBOX_STDOUT: write_memo_mbox(m, mai, category); break; case MEMO_DIRECTORY: write_memo_in_directory(dirname, m, mai, category, verbose, progname); break; } } pi_buffer_free (buffer); if (delete && !filename) { if (verbose) printf("Deleting record %d.\n", (int) id); dlp_DeleteRecord(sd, db, 0, id); } if (title_matching) { regfree(&title_pattern); free(buf); } if (!filename) { /* Close the database */ dlp_CloseDB(sd, db); dlp_AddSyncLogEntry(sd, "Successfully read memos from Palm.\n" "Thank you for using pilot-link.\n"); pi_close(sd); } else { pi_file_close(pif); } return 0; error_close: if (pif) { pi_file_close(pif); } if (sd >= 0) { pi_close(sd); } error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-debugsh.c0000644000175000017500000001153111211745573020610 0ustar rousseaurousseau/* * $Id: pilot-debugsh.c,v 1.33 2006/10/12 14:21:21 desrod Exp $ * * pilot-debugsh.c: Simple debugging console * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include "pi-source.h" #include "pi-dlp.h" #include "pi-syspkt.h" #include "pi-header.h" #include "pi-debug.h" #ifdef HAVE_SYS_SELECT_H #include #endif /* Declare prototypes */ void read_user(int sd); void read_pilot(int sd); void sig(int signal); int done = 0; void read_user(int sd) { char line[256]; int l = read(fileno(stdin), line, 256); if (l > 0) line[l - 1] = 0; if (strcmp(line, "apps") == 0) { sys_RemoteEvent(sd, 1, 5, 170, 0, 0, 0, 0); /* Set the pen down */ sys_RemoteEvent(sd, 0, 5, 170, 0, 0, 0, 0); /* And then lift it up */ } else if (strcmp(line, "menu") == 0) { sys_RemoteEvent(sd, 1, 5, 200, 0, 0, 0, 0); /* Set the pen down */ sys_RemoteEvent(sd, 0, 5, 200, 0, 0, 0, 0); /* And then lift it up */ } else if (strcmp(line, "reboot") == 0) { RPC(sd, 1, 0xA08C, 2, RPC_End); } else if (strcmp(line, "coldboot") == 0) { RPC(sd, 1, 0xA08B, 2, RPC_Long(0), RPC_Long(0), RPC_Long(0), RPC_Long(0), RPC_End); } else if (strcmp(line, "numdb") == 0) { printf("Number of databases on card 0: %d\n", RPC(sd, 1, 0xA043, 0, RPC_Short(0), RPC_End) ); } else if (strcmp(line, "dbinfo") == 0) { long creator, type, appInfo, sortInfo, modnum, backdate, moddate, crdate, version, attr; char name[32]; int id_ = RPC(sd, 1, 0xA044, 0, RPC_Short(0), RPC_Short(0), RPC_End); RPC(sd, 1, 0xA046, 0, RPC_Short(0), RPC_Long(id_), RPC_Ptr(name, 32), RPC_ShortRef(attr), RPC_ShortRef(version), RPC_LongRef(crdate), RPC_LongRef(moddate), RPC_LongRef(backdate), RPC_LongRef(modnum), RPC_LongRef(appInfo), RPC_LongRef(sortInfo), RPC_LongRef(type), RPC_LongRef(creator), RPC_End); printf("The name of db 0 (LocalID %x) is %s\n", id_, name); } else if (strcmp(line, "quit") == 0) { done = 1; } else if (l > 1) { printf ("unknown command '%s' (try 'apps', 'menu', 'coldboot', 'reboot', 'dbinfo', or 'quit')\n", line); } if (!done) { printf("debugsh>"); fflush(stdout); } if (l == 0) done = 1; } void read_pilot(int sd) { pi_buffer_t *buf = pi_buffer_new (4096); int l = pi_read(sd, buf, 4096); printf("From Palm %d:", l); if (l < 0) exit(EXIT_FAILURE); pi_dumpdata(buf->data, l); if (buf->data[2] == 0) { /* SysPkt command */ if (buf->data[0] == 1) { /* Console */ if (buf->data[4] == 0x7f) { /* Message from Palm */ int i; for (i = 6; i < l; i++) if (buf->data[i] == '\r') buf->data[i] = '\n'; printf("%s", buf->data + 6); } } } pi_buffer_free (buf); if (!done) { printf("debugsh>"); fflush(stdout); } } void sig(int signal) { done = 1; } int main(int argc, char *argv[]) { int max, sd = -1; fd_set r, rin; if (argc < 2) { fprintf(stderr, " Usage: %s %s\n\n", argv[0], TTYPrompt); exit(2); } sd = pi_socket(PI_AF_PILOT, PI_SOCK_STREAM, PI_PF_SYS); if (sd < 0) { fprintf(stderr, "Unable to create socket\n"); return -1; } if (pi_connect(sd, argv[1]) < 0) { fprintf(stderr, "Unable to connect\n"); return -1; } /* Now we can read and write packets: to get the Palm to send a packet, write a ".2" shortcut, which starts the debugging mode. (Make sure to reset your Palm after finishing this example!) */ FD_ZERO(&r); FD_SET(sd, &r); FD_SET(fileno(stdin), &r); max = sd; if (fileno(stdin) > max) max = fileno(stdin); printf("debugsh>"); fflush(stdout); signal(SIGINT, sig); while (!done) { rin = r; if (select(max + 1, &rin, 0, 0, 0) >= 0) { if (FD_ISSET(fileno(stdin), &rin)) { read_user(sd); } else if (FD_ISSET(sd, &rin)) { read_pilot(sd); } } else { break; } } printf("\n Exiting...\n"); pi_close(sd); return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-csd.c0000644000175000017500000002477511211746357017757 0ustar rousseaurousseau/* * $Id: pilot-csd.c,v 1.44 2009/06/04 13:32:31 desrod Exp $ * * pilot-csd.c: Connection Service Daemon, required for accepting logons via * NetSync(tm) * * Copyright (c) 1997, Kenneth Albanowski * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include "pi-source.h" #include "pi-dlp.h" #include "pi-serial.h" #include "pi-slp.h" #include "pi-header.h" #include "pi-userland.h" #include "pi-debug.h" static char hostname_[130]; /* buffer fetch_host() can write to. */ static char *hostname = hostname_; /* pointer poptGetNextOpt() can change. */ struct in_addr address, netmask; #ifdef HAVE_SA_LEN #ifndef max #define max(a,b) ((a) > (b) ? (a) : (b)) #endif #define ifreq_size(i) max(sizeof(struct ifreq),\ sizeof((i).ifr_name)+(i).ifr_addr.sa_len) #else #define ifreq_size(i) sizeof(struct ifreq) #endif /* HAVE_SA_LEN */ /* What, me worry? */ #ifndef IFF_POINTOPOINT # ifdef IFF_POINTTOPOINT # define IFF_POINTOPOINT IFF_POINTTOPOINT # endif #endif /*********************************************************************** * * Function: fetch_host * * Summary: Retrieve the networking information from the host * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void fetch_host(char *hostname, size_t hostlen, struct in_addr *address, struct in_addr *mask) { int i, n, s; struct ifconf ifc; struct ifreq *ifr, ifreqaddr, ifreqmask; struct hostent *hent; #ifdef HAVE_GETHOSTNAME /* Get host name the easy way */ gethostname(hostname, hostlen); #else #ifdef HAVE_UNAME struct utsname uts; if (uname(&uts) == 0) { strncpy(hostname, uts.nodename, hostlen - 1); hostname[hostlen - 1] = '\0'; } #endif /* def HAVE_UNAME */ #endif /* def HAVE_GETHOSTNAME */ /* Get host address through DNS */ hent = gethostbyname(hostname); if (hent) { while (*hent->h_addr_list) { struct in_addr haddr; memcpy(&haddr, *(hent->h_addr_list++), sizeof(haddr)); if (haddr.s_addr != inet_addr("127.0.0.1")) memcpy(address, &haddr, sizeof(haddr)); } } #if defined(SIOCGIFCONF) && defined(SIOCGIFFLAGS) s = socket(AF_INET, SOCK_DGRAM, 0); if (s < 0) return; ifc.ifc_buf = calloc(1024, 1); ifc.ifc_len = 1024; if (ioctl(s, SIOCGIFCONF, (char *) &ifc) < 0) goto done; n = ifc.ifc_len; for (i = 0; i < n; i += ifreq_size(*ifr)) { struct sockaddr_in *a; struct sockaddr_in *b; ifr = (struct ifreq *) ((caddr_t) ifc.ifc_buf + i); a = (struct sockaddr_in *) &ifr->ifr_addr; strncpy(ifreqaddr.ifr_name, ifr->ifr_name, sizeof(ifreqaddr.ifr_name)); strncpy(ifreqmask.ifr_name, ifr->ifr_name, sizeof(ifreqmask.ifr_name)); if (ioctl(s, SIOCGIFFLAGS, (char *) &ifreqaddr) < 0) continue; /* Reject loopback device */ #ifdef IFF_LOOPBACK if (ifreqaddr.ifr_flags & IFF_LOOPBACK) continue; #endif /* def IFF_LOOPBACK */ #ifdef IFF_UP /* Reject down devices */ if (!(ifreqaddr.ifr_flags & IFF_UP)) continue; #endif /* def IFF_UP */ if (ifr->ifr_addr.sa_family != AF_INET) continue; /* If it is a point-to-point device, use the dest address */ #if defined(IFF_POINTOPOINT) && defined(SIOCGIFDSTADDR) if (ifreqaddr.ifr_flags & IFF_POINTOPOINT) { if (ioctl(s, SIOCGIFDSTADDR, (char *) &ifreqaddr) < 0) break; a = (struct sockaddr_in *) &ifreqaddr.ifr_dstaddr; if (address->s_addr == 0) { memcpy(address, &a->sin_addr, sizeof(struct in_addr)); } } else #endif /* defined(IFF_POINTOPOINT) && defined(SIOCGIFDSTADDR) */ /* If it isn't a point-to-point device, use the address */ #ifdef SIOCGIFADDR { if (ioctl(s, SIOCGIFADDR, (char *) &ifreqaddr) < 0) break; a = (struct sockaddr_in *) &ifreqaddr.ifr_addr; if (address->s_addr == 0) { memcpy(address, &a->sin_addr, sizeof(struct in_addr)); } } #endif /* def SIOCGIFADDR */ /* OK, we've got an address */ /* Compare netmask against the current address and see if it seems to match. */ #ifdef SIOCGIFNETMASK if (ioctl(s, SIOCGIFNETMASK, (char *) &ifreqmask) < 0) break; /* Is there any system where we need to use ifr_netmask? */ #if 1 b = (struct sockaddr_in *) &ifreqmask.ifr_addr; #else b = (struct sockaddr_in *) &ifreqmask.ifr_netmask; #endif if ((mask->s_addr == 0) && (address->s_addr != 0)) { if ((b->sin_addr.s_addr & a->sin_addr.s_addr) == (b->sin_addr.s_addr & address->s_addr)) { memcpy(mask, &b->sin_addr, sizeof(struct in_addr)); /* OK, we've got a netmask */ break; } } #endif /* def SIOCGIFNETMASK */ } done: free(ifc.ifc_buf); close(s); #endif /* defined(SIOCGIFCONF) && defined(SIOCGIFFLAGS) */ } int main(int argc, const char *argv[]) { const char *progname = "pi-csd"; int c, /* switch */ n, sockfd; int quiet = 0; struct hostent *hent; struct in_addr raddress; struct sockaddr_in serv_addr, cli_addr; char *addrarg = NULL, *nmarg = NULL; fd_set rset; unsigned char mesg[1026]; unsigned int clilen; poptContext po; struct poptOption options[] = { /* Don't use USERLAND_RESERVED_OPTIONS, because this thing doesn't connect to the Palm at all. */ { "version", 0 , POPT_ARG_NONE, NULL, 'v', "Display version information", NULL}, { "quiet", 'q', POPT_ARG_NONE, &quiet, 0 , "Suppress messages", NULL}, {"hostname", 'H', POPT_ARG_STRING, &hostname, 0, "The hostname used for verification"}, {"address", 'a', POPT_ARG_STRING, &addrarg, 0, "IP address of the host","name-or-IP"}, {"netmask", 'n', POPT_ARG_STRING, &nmarg, 0, "The subnet mask of the address","dotted-quad"}, POPT_AUTOHELP POPT_TABLEEND }; memset(&address, 0, sizeof(address)); memset(&netmask, 0, sizeof(netmask)); hostname[0] = 0; fetch_host(hostname, 128, &address, &netmask); po = poptGetContext(progname, argc, argv, options, 0); poptSetOtherOptionHelp(po,"\n\n" " Connection Service Daemon for Palm Devices\n\n" " Example arguments:\n" " -H \"localhost\" -a 127.0.0.1 -n 255.255.255.0\n\n"); if (argc < 2) { poptPrintUsage(po,stderr,0); return 1; } while ((c = poptGetNextOpt(po)) >= 0) { switch (c) { case 'v': print_splash(progname); return 0; default: fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } } if (!addrarg) { fprintf(stderr," ERROR: Must give an address with -a.\n"); return 1; } if (!inet_pton(AF_INET, addrarg, &address)) { if ((hent = gethostbyname(addrarg))) { memcpy(&address.s_addr, hent->h_addr, sizeof(address)); } else { fprintf(stderr," ERROR: Invalid address '%s'\n\n",addrarg); return 1; } } if (nmarg) { if (!inet_pton(AF_INET, nmarg, &netmask)) { fprintf(stderr," ERROR: Invalid netmask '%s'\n\n",nmarg); return 1; } } /* cannot execute without address and hostname */ if ((address.s_addr == 0) || (strlen(hostname) == 0)) { fprintf(stderr," ERROR: Must give an address and a hostname.\n"); return -1; } sockfd = socket(AF_INET, SOCK_DGRAM, 0); if (sockfd < 0) { fprintf(stderr," ERROR: Unable to get socket: %s\n",strerror(errno)); return 1; } memset(&serv_addr, 0, sizeof(serv_addr)); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); serv_addr.sin_port = htons(14237); if (bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { fprintf(stderr," ERROR: Unable to bind socket: %s\n",strerror(errno)); return 1; } if (!quiet) { fprintf(stdout, "%s(%d): Connection Service Daemon for Palm Computing(tm) device active.\n", progname, getpid()); fprintf(stdout, "%s(%d): Accepting connection requests for '%s' at %s", progname, getpid(), hostname, inet_ntoa(address)); fprintf(stdout, " with mask %s.\n", inet_ntoa(netmask)); } for (;;) { fflush(stdout); clilen = sizeof(cli_addr); FD_ZERO(&rset); FD_SET(sockfd, &rset); if (select(sockfd + 1, &rset, 0, 0, 0) < 0) { fprintf(stderr," ERROR: Select failure: %s\n",strerror(errno)); close(sockfd); return 1; } n = recvfrom(sockfd, mesg, 1024, 0, (struct sockaddr *) &cli_addr, &clilen); if (n < 0) { continue; } mesg[n] = 0; if (!quiet) { hent = gethostbyaddr((char *) &cli_addr.sin_addr. s_addr, 4, AF_INET); memcpy(&raddress, &cli_addr.sin_addr.s_addr, 4); fprintf(stdout, "%s(%d): Connection from %s[%s], ", progname, getpid(), hent ? hent->h_name : "", inet_ntoa(raddress)); } if (get_short(mesg) != 0xFADE) goto invalid; if ((get_byte(mesg + 2) == 0x01) && (n > 12)) { struct in_addr ip, mask; char *name = mesg + 12; memcpy(&ip, mesg + 4, 4); memcpy(&mask, mesg + 8, 4); if (!quiet) { fprintf(stdout, "req '%s', %s", name, inet_ntoa(ip)); fprintf(stdout, ", %s", inet_ntoa(mask)); } if (strcmp(hostname, name) == 0) { if (!quiet) fprintf(stdout, " = accept.\n"); set_byte(mesg + 2, 0x02); memcpy(mesg + 4, &address, 4); /* address is already in Motorola byte order */ n = sendto(sockfd, mesg, n, 0, (struct sockaddr *) &cli_addr, clilen); if (n < 0) { fprintf(stderr," ERROR: sendto() error: %s\n", strerror(errno)); } continue; } if (!quiet) { fprintf(stdout, " = reject.\n"); } continue; } invalid: if (!quiet) fprintf(stdout, "invalid packet of %d bytes:\n", n); pi_dumpdata(mesg, n); } return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/ccexample.cc0000644000175000017500000002700110474703566020153 0ustar rousseaurousseau#include #include using namespace std; #include "pi-source.h" #include "pi-file.h" #include "pi-todo.h" #include "pi-memo.h" #include "pi-datebook.h" #include "pi-address.h" #define bool int #define false 0 #define true 1 static char *days[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; static char *months[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; // All app info classes subclass from appInfo_t. You could pass any of // them to this function to print out the category names. Mainly it's here // to show the inheritance, as this has an appInfo_t as it's arguement, but // can take any of the default app info classes. void printCategoryNames(appInfo_t & ai) { char *ptr; for (short int i = 0; i < 16; i++) { // This is sort of dangerous. You are getting a pointer back to // the real data. That means if you modify what ptr points to, you // are changing the value in the class itself. Don't do that! // I can't find a way to keep this from happening. Even if I do // something anal like return a const char *const all you // have to do is cast it to char * and then it's modifiable. ptr = ai.category(i); // The first character will be non-null for an existing category if (*ptr) cout << "Category " << (i + 1) << " is " << ptr << endl; } } void memos(pi_file * pf) { void *app_info; size_t app_info_size; if (pi_file_get_app_info(pf, &app_info, &app_info_size) < 0) { cerr << "Unable to get app info" << endl; return; } // Create mai as an unpacked structure with the memo app info memoAppInfo_t mai(app_info); // packed is now a pointer to an area of memory that is MEMO_APP_INFO_SIZE // bytes long. You are responsible for release of this memory via delete unsigned char* packed = (unsigned char*)mai.pack(); delete[]packed; int nentries; pi_file_get_entries(pf, &nentries); unsigned char *buf, packedBuf[0xffff]; int size, attrs, cat; recordid_t uid; memo_t memo; for (int entnum = 0; entnum < nentries; entnum++) { if (pi_file_read_record(pf, entnum, (void **) &buf, &size, &attrs, &cat, &uid) < 0) { cout << "Error reading record number " << entnum << endl; return; } /* Skip deleted records */ if ((attrs & dlpRecAttrDeleted) || (attrs & dlpRecAttrArchived)) continue; memo.unpack(buf); cout << "Memo number " << (entnum + 1) << endl; cout << memo.text() << endl << endl; // Option 1 for getting a packed memo. Just give an int to be // filled in with the size of the memo. You must free the space // returned via delete unsigned char* packed = (unsigned char*)memo.pack(&size); delete[] packed; // Option 2 for getting a packed memo. Give a buffer, and an int // telling how big it is. If the buffer is too small to hold the // packed data, NULL is returned. Otherwise, the buffer is filled // in with the packed data, a pointer to it is returned, and the // integer passed in is reset to be the size of the packed data if (memo.pack(packedBuf, &size) == NULL) cerr << "Record number " << (entnum + 1) << " too big for " << "the buffer you passed in." << endl; } } void todos(pi_file * pf) { void *app_info; int app_info_size; if (pi_file_get_app_info(pf, &app_info, &app_info_size) < 0) { cerr << "Unable to get app info" << endl; return; } todoAppInfo_t tai(app_info); // packed is now a pointer to an area of memory that is TODO_APP_INFO_SIZE // bytes long. You are responsible for release this memory via delete unsigned char* packed = (unsigned char*)tai.pack(); delete[] packed; int nentries; pi_file_get_entries(pf, &nentries); unsigned char *buf, packedBuf[0xffff]; int size, attrs, cat; recordid_t uid; tm *due; todo_t todo; for (int entnum = 0; entnum < nentries; entnum++) { if (pi_file_read_record(pf, entnum, (void **) &buf, &size, &attrs, &cat, &uid) < 0) { cout << "Error reading record number " << entnum << endl; return; } /* Skip deleted records */ if ((attrs & dlpRecAttrDeleted) || (attrs & dlpRecAttrArchived)) continue; todo.unpack(buf); cout << "Category: " << tai.category(cat) << endl; if (todo.description()) cout << "Description: " << todo. description() << endl; cout << "Priority: " << todo.priority() << endl; cout << "Completed: " << (todo. complete()? "Yes" : "No") << endl; if ((due = todo.due())) cout << "Due: " << asctime(due); else cout << "Due: No Date" << endl; if (todo.note()) cout << "Note: " << todo.note() << endl; cout << endl; // Just like the memo app, you can pack it like this... unsigned char* packed = (unsigned char*)todo.pack(&size); delete[] packed; // ... or like this size = sizeof(packedBuf); if (todo.pack(packedBuf, &size) == NULL) cerr << "Record number " << (entnum + 1) << " too big for " << "the buffer you passed in." << endl; } } // Only works for up to i == 31. Beyond that, results are undefined char *freqToStr(const int i) { static char buf[7]; if (i == 1) buf[0] = '\0'; else if (i == 3 || i == 23) (void) sprintf(buf, "%drd ", i); else if ((i > 3 && i < 21) || (i > 23 && i < 31)) (void) sprintf(buf, "%dth ", i); else if (i == 21 || i == 31) (void) sprintf(buf, "%dst ", i); else if (i == 2 || i == 22) (void) sprintf(buf, "%dnd ", i); return buf; } void prettyPrintRepeat(appointment_t * appt) { tm *timePtr; if ((timePtr = appt->repeatEnd())) cout << "This event repeats until " << asctime(timePtr); else cout << "This event repeats forever" << endl; int freq = appt->repeatFreq(); int on = appt->repeatOn(); bool found = false; switch (appt->repeatType()) { case appointment_t::daily: cout << "It repeats every " << freqToStr(freq) << "day"; break; case appointment_t::weekly: { cout << "It repeats every " << freqToStr(freq) << "week on "; for (int i = 0; i < 7; i++) { if (on & (1 << i)) { if (found) cout << " and "; else found = true; cout << days[i]; } } cout << endl; break; } case appointment_t::monthlyByDay: cout << "It repeats on the "; switch (on / 7) { case 0: cout << "first "; break; case 1: cout << "second "; break; case 2: cout << "third "; break; case 3: cout << "fourth "; break; default: cout << "last "; } cout << days[on % 7] << " of every month"; break; case appointment_t::monthlyByDate: cout << "It repeats every " << freqToStr(freq); timePtr = appt->beginTime(); cout << "month on the " << freqToStr(timePtr-> tm_mday) << endl; cout << endl; break; case appointment_t::yearly: cout << "It repeats every " << freqToStr(freq) << "year on "; timePtr = appt->beginTime(); cout << months[timePtr->tm_mon] << " " << timePtr-> tm_mday; cout << endl; break; default: cerr << "Internal error" << endl; } } void datebook(pi_file * pf) { void *app_info; int app_info_size; if (pi_file_get_app_info(pf, &app_info, &app_info_size) < 0) { cerr << "Unable to get app info" << endl; return; } appointmentAppInfo_t aai(app_info); // packed is now a pointer to an area of memory that is // APPOINTMENT_APP_INFO_SIZE bytes long. You are responsible for // release this memory via delete unsigned char* packed = (unsigned char*)aai.pack(); delete[] packed; int nentries; pi_file_get_entries(pf, &nentries); unsigned char *buf; int size, attrs, cat; recordid_t uid; tm *timePtr; appointment_t appt; for (int entnum = 0; entnum < nentries; entnum++) { if (pi_file_read_record(pf, entnum, (void **) &buf, &size, &attrs, &cat, &uid) < 0) { cout << "Error reading record number " << entnum << endl; return; } /* Skip deleted records */ if ((attrs & dlpRecAttrDeleted) || (attrs & dlpRecAttrArchived)) continue; appt.unpack(buf); if (appt.untimed() == false) { cout << "Begin Time: " << asctime(appt. beginTime()); cout << "End Time: " << asctime(appt.endTime()); } else cout << "Untimed event" << endl; if (appt.hasAlarm()) { cout << "The alarm is set to go off " << appt. advance() << " "; switch (appt.advanceUnits()) { case appointment_t::minutes: cout << "minutes"; break; case appointment_t::hours: cout << "hours"; break; case appointment_t::days: cout << "days"; default: cout << "(internal error)"; } cout << " before the event" << endl; } else cout << "There is not an alarm set for this event" << endl; if (appt.repeatType() != appointment_t::none) prettyPrintRepeat(&appt); else cout << "Event does not repeat" << endl; if ((timePtr = appt.exceptions())) { size = appt.numExceptions(); cout << "I seem to have " << size << " exceptions:" << endl; for (int i = 0; i < size; i++) cout << "\t" << asctime(&timePtr[i]); } cout << "Description: " << appt.description() << endl; if (appt.note()) cout << "Note: " << appt.note() << endl; cout << endl; } } void addresses(pi_file * pf) { void *app_info; int app_info_size; if (pi_file_get_app_info(pf, &app_info, &app_info_size) < 0) { cerr << "Unable to get app info" << endl; return; } addressAppInfo_t aai(app_info); printCategoryNames(aai); // packed is now a pointer to an area of memory that is // ADDRESS_APP_INFO_SIZE bytes long. You are responsible for release this // memory via delete unsigned char* packed = (unsigned char*)aai.pack(); delete[] packed; int nentries; pi_file_get_entries(pf, &nentries); unsigned char *buf, packedBuf[0xffff]; int size, attrs, cat; recordid_t uid; address_t address; char *phonePtr; for (int entnum = 0; entnum < nentries; entnum++) { if (pi_file_read_record(pf, entnum, (void **) &buf, &size, &attrs, &cat, &uid) < 0) { cout << "Error reading record number " << entnum << endl; return; } /* Skip deleted records */ if ((attrs & dlpRecAttrDeleted) || (attrs & dlpRecAttrArchived)) continue; address.unpack(buf); cout << "Category: " << aai.category(cat) << endl; phonePtr = address.entry(address_t::lastName); if (phonePtr) cout << "Last Name: " << phonePtr << endl; for (cat = address_t::phone1; cat <= address_t::phone5; cat++) if ((phonePtr = address.entry((address_t::labelTypes_t) cat))) cout << "Phone: " << phonePtr << endl; // Just like the memo app, you can pack it like this... unsigned char* packed = (unsigned char*)address.pack(&size); delete[] packed; // ... or like this size = sizeof(packedBuf); if (address.pack(packedBuf, &size) == NULL) cerr << "Record number " << (entnum + 1) << " too big for " << "the buffer you passed in." << endl; } } int main(int argc, char **argv) { if (argc != 2) { cerr << "Usage: " << *argv << " [.pdb file]" << endl; return 1; } pi_file *pf; if ((pf = pi_file_open(*(argv + 1))) == NULL) { perror("pi_file_open"); return 1; } char *slash = strrchr(*(argv + 1), '/'); if (slash) slash++; else slash = *(argv + 1); if (!strcmp(slash, "ToDoDB.pdb")) todos(pf); else if (!strcmp(slash, "DatebookDB.pdb")) datebook(pf); else if (!strcmp(slash, "AddressDB.pdb")) addresses(pf); else if (!strcmp(slash, "MemoDB.pdb")) memos(pf); else cerr << "Unknown database: " << slash << endl; pi_file_close(pf); return 0; } pilot-link-0.12.5-dfsg/src/pilot-install-expenses0000755000175000017500000001344011333433276022247 0ustar rousseaurousseau#! /bin/bash # pilot-install-expenses - temporary wrapper script for .libs/pilot-install-expenses # Generated by ltmain.sh (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1 # # The pilot-install-expenses program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='/bin/sed -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Be Bourne compatible 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 BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command="(cd /Source/cvs/palm/pilot-link/HEAD/src; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=/usr/NX/bin:/usr/local/jdk1.6.0_13/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/opt/cxoffice/bin; export PATH; gcc -g -ansi -Wshadow -Wall -W -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wpointer-arith -Wundef -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wconversion -Winline -pedantic -O0 -std=gnu99 -g -Wshadow -Wall -W -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wpointer-arith -Wundef -Winline -Wbad-function-cast -pedantic -O0 -o \$progdir/\$file pilot-install-expenses.o ./.libs/libpiuserland.a ../popt/.libs/libpopt.a ../libpisock/.libs/libpisock.so -pthread -Wl,-rpath -Wl,/Source/cvs/palm/pilot-link/HEAD/libpisock/.libs)" # This environment variable determines our operation mode. if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then # install mode needs the following variables: generated_by_libtool_version='2.2.6b' notinst_deplibs=' ../libpisock/libpisock.la' else # When we are sourced in execute mode, $file and $ECHO are already set. if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then ECHO="echo" file="$0" # Make sure echo works. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then # Yippee, $ECHO works! : else # Restart under the correct shell, and then maybe $ECHO will work. exec /bin/bash "$0" --no-reexec ${1+"$@"} fi fi # Find the directory that this script lives in. thisdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'` test "x$thisdir" = "x$file" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'` while test -n "$file"; do destdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'` # If there was a directory component, then change thisdir. if test "x$destdir" != "x$file"; then case "$destdir" in [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; *) thisdir="$thisdir/$destdir" ;; esac fi file=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'` file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then # special case for '.' if test "$thisdir" = "."; then thisdir=`pwd` fi # remove .libs from thisdir case "$thisdir" in *[\\/].libs ) thisdir=`$ECHO "X$thisdir" | $Xsed -e 's%[\\/][^\\/]*$%%'` ;; .libs ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=`cd "$thisdir" && pwd` test -n "$absdir" && thisdir="$absdir" program=lt-'pilot-install-expenses' progdir="$thisdir/.libs" if test ! -f "$progdir/$program" || { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /bin/sed 1q`; \ test "X$file" != "X$progdir/$program"; }; then file="$$-$program" if test ! -d "$progdir"; then mkdir "$progdir" else rm -f "$progdir/$file" fi # relink executable if necessary if test -n "$relink_command"; then if relink_command_output=`eval $relink_command 2>&1`; then : else echo "$relink_command_output" >&2 rm -f "$progdir/$file" exit 1 fi fi mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null || { rm -f "$progdir/$program"; mv -f "$progdir/$file" "$progdir/$program"; } rm -f "$progdir/$file" fi if test -f "$progdir/$program"; then if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then # Run the actual program with our arguments. exec "$progdir/$program" ${1+"$@"} $ECHO "$0: cannot exec $program $*" 1>&2 exit 1 fi else # The program doesn't exist. $ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2 $ECHO "This script is just a wrapper for $program." 1>&2 echo "See the libtool documentation for more information." 1>&2 exit 1 fi fi pilot-link-0.12.5-dfsg/src/userland.c0000644000175000017500000001255311211745573017664 0ustar rousseaurousseau/* * $Id: userland.c,v 1.19 2006/10/12 14:21:22 desrod Exp $ * * userland.c: General definitions for userland conduits. * * Copyright (C) 2004 by Adriaan de Groot * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "pi-userland.h" #include #include #include #include #include "pi-header.h" #include "pi-socket.h" #include "pi-dlp.h" #include "pi-source.h" static const char *env_pilotport = "PILOTPORT"; int plu_connect() { int sd = -1; int result; struct SysInfo sys_info; /* Determine here for better user feedback on unset port */ if (plu_port == NULL) plu_port = getenv(env_pilotport); if (plu_port == NULL) { fprintf(stderr, "\n Unable to determine port to bind\n" " Please use --help for more information\n\n"); return -1; } if ((sd = pi_socket(PI_AF_PILOT, PI_SOCK_STREAM, PI_PF_DLP)) < 0) { fprintf(stderr, "\n Unable to create socket '%s'\n", plu_port); return -1; } result = pi_bind(sd, plu_port); if (result < 0) { fprintf(stderr, " Unable to bind to port: %s\n" " Please use --help for more information\n\n", plu_port); return result; } if (!plu_quiet && isatty(fileno(stdout))) { printf("\n Listening for incoming connection on %s... ", plu_port); fflush(stdout); } if (pi_listen(sd, 1) < 0) { fprintf(stderr, "\n Error listening on %s\n", plu_port); pi_close(sd); return -1; } sd = pi_accept_to(sd, 0, 0, plu_timeout); if (sd < 0) { fprintf(stderr, "\n Error accepting data on %s\n", plu_port); pi_close(sd); return -1; } if (!plu_quiet && isatty(fileno(stdout))) { printf("connected!\n\n"); } if (dlp_ReadSysInfo(sd, &sys_info) < 0) { fprintf(stderr, "\n Error read system info on %s\n", plu_port); pi_close(sd); return -1; } dlp_OpenConduit(sd); return sd; } int plu_findcategory(const struct CategoryAppInfo *info, const char *name, int flags) { int cat_index, match_category; match_category = -1; for (cat_index = 0; cat_index < 16; cat_index += 1) { if (info->name[cat_index][0]) { if (flags & PLU_CAT_CASE_INSENSITIVE) { if (strncasecmp(info->name[cat_index], name, 15) == 0) { match_category = cat_index; break; } } else { if (strncmp(info->name[cat_index],name,15) == 0) { match_category = cat_index; break; } } } } if ((match_category == -1) && (flags & PLU_CAT_MATCH_NUMBERS)) { while (isspace(*name)) { name++; } if (isdigit(*name)) { match_category = atoi(name); } if ((match_category < 0) || (match_category > 15)) { match_category = -1; } } if (flags & PLU_CAT_WARN_UNKNOWN) { if (match_category == -1) { fprintf(stderr," WARNING: Unknown category '%s'%s.\n", name, (flags & PLU_CAT_DEFAULT_UNFILED) ? ", using 'Unfiled'" : ""); } } if (flags & PLU_CAT_DEFAULT_UNFILED) { if (match_category == -1) { match_category = 0; } } return match_category; } int plu_protect_files(char *name, const char *extension, const size_t namelength) { char *save_name; char c=1; save_name = strdup( name ); if (NULL == save_name) { fprintf(stderr," ERROR: No memory for filename %s%s\n",name,extension); return -1; } /* 4 byes = _%02d and terminating NUL */ if (strlen(save_name) + strlen(extension) + 4 > namelength) { fprintf(stderr," ERROR: Buffer for filename too small.\n"); free(save_name); return -1; } snprintf(name,namelength,"%s%s",save_name,extension); while ( access( name, F_OK ) == 0) { snprintf( name, namelength, "%s_%02d%s", save_name, c, extension); c++; if (c >= 100) { fprintf(stderr," ERROR: Could not generate filename (tried 100 times).\n"); free(save_name); return 0; } } free(save_name); return 1; } int plu_getromversion(int sd, plu_romversion_t *d) { unsigned long ROMversion; if ((sd < 0) || !d) { return -1; } if (dlp_ReadFeature(sd, makelong("psys"), 1, &ROMversion) < 0) { return -1; } d->major = (((ROMversion >> 28) & 0xf) * 10) + ((ROMversion >> 24) & 0xf); d->minor = ((ROMversion >> 20) & 0xf); d->bugfix = ((ROMversion >> 16) & 0xf); d->state = ((ROMversion >> 12) & 0xf); d->build = (((ROMversion >> 8) & 0xf) * 100) + (((ROMversion >> 4) & 0xf) * 10) + (ROMversion & 0xf); memset(d->name,0,sizeof(d->name)); snprintf(d->name, sizeof(d->name),"%d.%d.%d", d->major, d->minor, d->bugfix); if (d->state != 3) { int len = strlen(d->name); snprintf(d->name + len, sizeof(d->name) - len,"-%s%d", ( (d->state == 0) ? "d" : (d->state == 1) ? "a" : (d->state == 2) ? "b" : "u"), d->build); } return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-undelete.pl0000644000175000017500000000235307141140344021157 0ustar rousseaurousseauuse Config; print $Config{startperl}, "\n"; print ; __DATA__; use PDA::Pilot; use Getopt::Std; $opts{p} = $ENV{PILOTPORT} if length $ENV{PILOTPORT}; if (not getopts('p:d:',\%opts) or not exists $opts{p} or not exists $opts{d}) { print "Usage: $0 -p port -d dbname\n"; print "\n $0 will scan through dbname on your Pilot and turn all archived\n"; print " records into normal records, thus \"undeleting\" them.\n"; exit; } $socket = PDA::Pilot::openPort($opts{p}); print "Please start HotSync on port $opts{p} now.\n"; $dlp = PDA::Pilot::accept($socket); if (defined $dlp) { print "\nConnection established. Opening $opts{d}...\n"; $dlp->getStatus; $db = $dlp->open($opts{d}, "rwsx"); if (defined $db) { print "\nDatabase opened.\n"; $i = 0; $c = 0; for(;;) { $r = $db->getRecord($i); last if not defined($r); #no more records if ($r->{archived}) { print "Record $i is archived, un-archiving.\n"; $r->{archived} = 0; $r->{deleted} = 0; $db->setRecord($r); # Re-store record $c++; } $i++; } $db->close; print "Done. $c record", ($c == 1 ? "" : "s"), " unarchived.\n"; } else { print "Unable to open database\n"; } $dlp->close; } PDA::Pilot::close($socket); exit(0); pilot-link-0.12.5-dfsg/src/pilot-install-datebook.c0000644000175000017500000001446111211745573022430 0ustar rousseaurousseau/* * $Id: pilot-install-datebook.c,v 1.37 2007/03/17 19:15:16 desrod Exp $ * * install-datebook.c: Palm datebook installer * * Copyright 1997, Tero Kivinen * Copyright 1996, Robert A. Kaplan (original install-todos.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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include "pi-source.h" #include "pi-dlp.h" #include "pi-datebook.h" #include "pi-userland.h" extern time_t parsedate(char *p); int main(int argc, const char *argv[]) { int c, /* switch */ db, fieldno, filelen, sd = -1; char *cPtr = NULL, *filename = NULL, *file_text = NULL, *fields[4]; pi_buffer_t *Appointment_buf; Appointment_buf = pi_buffer_new (0xffff); FILE *f = NULL; struct PilotUser User; struct Appointment appointment; poptContext pc; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"read", 'r', POPT_ARG_STRING, &filename, 0, "Read entries from ", "file"}, POPT_TABLEEND }; pc = poptGetContext("install-datebook", argc, argv, options, 0); poptSetOtherOptionHelp(pc,"\n Installs new Datebook entries onto your Palm handheld device.\n" " You must specify -r and a single filename.\n\n" " Example usage: \n" " -p /dev/pilot -r db.txt\n\n"); if (argc < 2) { poptPrintUsage(pc,stderr,0); return 1; } while ((c = poptGetNextOpt(pc)) >= 0) { fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } if (c < -1) plu_badoption(pc,c); if (filename == NULL) { fprintf(stderr," ERROR: No filename given.\n"); return 1; } f = fopen(filename, "r"); if (f == NULL) { perror("fopen"); return 1; } fseek(f, 0, SEEK_END); filelen = ftell(f); fseek(f, 0, SEEK_SET); file_text = (char *) malloc(filelen + 1); if (file_text == NULL) { perror("malloc()"); fclose(f); return 1; } fread(file_text, filelen, 1, f); fclose(f); f = NULL; sd = plu_connect(); if (sd < 0) goto error; if (dlp_OpenConduit(sd) < 0) goto error_close; dlp_ReadUserInfo(sd, &User); dlp_OpenConduit(sd); /* Open the Datebook's database, store access handle in db */ if (dlp_OpenDB(sd, 0, 0x80 | 0x40, "DatebookDB", &db) < 0) { fprintf(stderr," ERROR: Unable to open DatebookDB on Palm\n"); dlp_AddSyncLogEntry(sd, "Unable to open DatebookDB.\n"); goto error_close; } file_text[filelen] = '\0'; cPtr = file_text; fieldno = 0; fields[fieldno++] = cPtr; while (cPtr - file_text < filelen) { if (*cPtr == '\t') { cPtr++; if (fieldno < 4) { fields[fieldno] = cPtr; } fieldno++; } else if (*cPtr == '\n') { /* replace CR with terminator */ *cPtr++ = '\0'; /* ensure right number of fields */ if (fieldno != 4) { printf("Too "); printf(fieldno < 4 ? "few" : "many"); printf(" fields on the line : %s\n", fields[0]); fieldno = 0; fields[fieldno++] = cPtr; continue; } /* replace tabs with terminators */ for (fieldno = 1; fieldno < 4; fieldno++) { *(fields[fieldno]-1) = '\0'; } /* woo hoo! */ fieldno = 0; if (fields[0][0] == '\0' || fields[1][0] == '\0') { /* no start time */ appointment.event = 1; } else { appointment.event = 0; } if (fields[0][0] != '\0') { time_t t; t = parsedate(fields[0]); if (t == -1) { printf("Invalid start date or time : %s\n", fields[0]); continue; } appointment.begin = *localtime(&t); } if (fields[1][0] != '\0') { time_t t; t = parsedate(fields[1]); if (t == -1) { printf("Invalid end date or time : %s\n", fields[1]); continue; } appointment.end = *localtime(&t); } if (fields[2][0] != '\0') { appointment.alarm = 1; appointment.advance = atoi(fields[2]); if (strchr(fields[2], 'm')) appointment.advanceUnits = advMinutes; else if (strchr(fields[2], 'h')) appointment.advanceUnits = advHours; else if (strchr(fields[2], 'd')) appointment.advanceUnits = advDays; } else { appointment.alarm = 0; appointment.advance = 0; appointment.advanceUnits = 0; } appointment.repeatType = repeatNone; appointment.repeatForever = 0; appointment.repeatEnd.tm_mday = 0; appointment.repeatEnd.tm_mon = 0; appointment.repeatEnd.tm_wday = 0; appointment.repeatFrequency = 0; appointment.repeatWeekstart = 0; appointment.exceptions = 0; appointment.exception = NULL; appointment.description = fields[3]; appointment.note = NULL; pack_Appointment(&appointment, Appointment_buf, datebook_v1); printf("Description: %s, %s\n", appointment.description, appointment.note); printf("date: %d/%d/%d %d:%02d\n", appointment.begin.tm_mon + 1, appointment.begin.tm_mday, appointment.begin.tm_year + 1900, appointment.begin.tm_hour, appointment.begin.tm_min); dlp_WriteRecord(sd, db, 0, 0, 0, Appointment_buf->data, Appointment_buf->used, 0); fields[fieldno++] = cPtr; } else { cPtr++; } } /* Close the database */ dlp_CloseDB(sd, db); /* Tell the user who it is, with a different PC id. */ User.lastSyncPC = 0x00010000; User.successfulSyncDate = time(NULL); User.lastSyncDate = User.successfulSyncDate; dlp_WriteUserInfo(sd, &User); if (dlp_AddSyncLogEntry(sd, "Successfully wrote Appointment to Palm.\n" "Thank you for using pilot-link.\n") < 0); goto error_close; if(dlp_EndOfSync(sd, 0) < 0); goto error_close; if(pi_close(sd) < 0) goto error; error_close: pi_close(sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-getram.c0000644000175000017500000000165211211745573020451 0ustar rousseaurousseau/* * $Id: pilot-getram.c,v 1.37 2006/10/12 14:21:21 desrod Exp $ * * pi-getram: Fetch RAM image from Palm * * Copyright (C) 1997, Kenneth Albanowski * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #define DEFAULT_MODE mode_getram #include "pilot-getrom.c" pilot-link-0.12.5-dfsg/src/pilot-read-veo.c0000644000175000017500000005717211211745573020704 0ustar rousseaurousseau/* * $Id: pilot-read-veo.c,v 1.21 2007/02/04 23:06:03 desrod Exp $ * * pilot-read-veo.c * * Copyright (c) 2003-2004, Angus Ainslie * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #ifdef HAVE_STDINT_H #include #endif #include "pi-source.h" #include "pi-veo.h" #include "pi-file.h" #include "pi-header.h" #include "pi-userland.h" #ifdef HAVE_PNG # include "png.h" # if (PNG_LIBPNG_VER < 10201) # define png_voidp_NULL (png_voidp)NULL # define png_error_ptr_NULL (png_error_ptr)NULL # endif #endif #define pi_mktag(c1,c2,c3,c4) (((c1)<<24)|((c2)<<16)|((c3)<<8)|(c4)) #define VEO_COLOUR_CORRECT 0x01 #define VEO_BIAS 0x12 uint8_t redLUT[256], greenLUT[256], blueLUT[256]; double bias_factor = 0.50; /*********************************************************************** * * Function: fmt_date * * Summary: Format the output date on the images * * Parameters: * * Returns: * ***********************************************************************/ static const char *fmt_date (struct Veo *v) { static char buf[24]; sprintf (buf, "%d-%02d-%02d", v->year, v->month, v->day); return buf; } /*********************************************************************** * * Function: Decode * * Summary: Decode one record from the Veo database. * * Parameters: inP - the compressed record * outP - the uncompressed record * w - the width of the picture * Returns: 1 always * ***********************************************************************/ int Decode (unsigned char *inP, unsigned char *outP, short w) { short shifter = 7, index = 0; unsigned short tmp0, tmp3, tmp4, i, j; /* d3 */ unsigned char *origOutP = outP; shifter = 7; for (j = 0; j < 2; j++) { if (j == 1) origOutP += w * 2; for (i = 0; i < 2; i++) { switch (i) { case 0: outP = (unsigned char *) (origOutP + 1); break; case 1: outP = (unsigned char *) (origOutP + w); break; } if (shifter != 7) { shifter = 7; inP++; } *outP = *inP++; outP += 2; /* a3 */ index = 2; while (index < w) { /* Top of decompress loop */ tmp3 = 1 << shifter; tmp3 &= *inP; if ((shifter & 0xFF) <= 0) { shifter = 7; inP++; } else { shifter--; } if ((tmp3 & 0xFF) != 0) { *outP = *(outP - 2); } else { tmp0 = inP[1]; tmp4 = inP[0] << 8; tmp4 |= tmp0; tmp4 = tmp4 << (7 - shifter); if (shifter >= 5) { shifter -= 5; } else { inP++; shifter += 3; } tmp4 = tmp4 >> 11; /* if((char)tmp4 <= 0) */ if ((char) tmp4 == 0) { tmp3 = inP[0] << 8 | inP[1]; tmp3 = tmp3 << (7 - shifter); if (shifter >= 8) { shifter -= 8; } else { inP++; shifter &= 0xf; } *outP = tmp3 >> 8; } else { if (tmp4 & 0x10) { tmp4 &= 0xf; *outP = *(outP - 2) - tmp4; } else { tmp4 &= 0xf; *outP = *(outP - 2) + tmp4; } } } outP += 2; index += 2; } /* End 'while (index < w)' */ } outP = origOutP; if (shifter != 7) { shifter = 7; inP++; } *outP = *inP++; if (shifter != 7) { shifter = 7; inP++; } outP[w + 1] = *inP++; outP += 2; /* a3 */ index = 2; while (index < w) { /* Top of decompress loop */ tmp3 = 1 << shifter; tmp3 &= *inP; if ((shifter & 0xFF) <= 0) { shifter = 7; inP++; } else { shifter--; } if ((tmp3 & 0xFF) != 0) { *outP = outP[w - 1]; } else { tmp0 = inP[1]; tmp4 = inP[0] << 8; tmp4 |= tmp0; tmp4 = tmp4 << (7 - shifter); if (shifter >= 5) { shifter -= 5; } else { inP++; shifter += 3; } tmp4 = tmp4 >> 11; if ((char) tmp4 == 0) { tmp3 = inP[0] << 8 | inP[1]; tmp3 = tmp3 << (7 - shifter); if (shifter >= 8) { shifter -= 8; } else { inP++; shifter &= 0xf; } *outP = tmp3 >> 8; } else { if (tmp4 & 0x10) { tmp4 &= 0xf; *outP = outP[w - 1] - tmp4; } else { tmp4 &= 0xf; *outP = outP[w - 1] + tmp4; } } } tmp3 = 1 << shifter; tmp3 &= *inP; if ((shifter & 0xFF) <= 0) { shifter = 7; inP++; } else { shifter--; } if ((tmp3 & 0xFF) != 0) { outP[w + 1] = *outP; } else { tmp0 = inP[1]; tmp4 = inP[0] << 8; tmp4 |= tmp0; tmp4 = tmp4 << (7 - shifter); if (shifter >= 5) { shifter -= 5; } else { inP++; shifter += 3; } tmp4 = tmp4 >> 11; /* if((char)tmp4 <= 0) */ if ((char) tmp4 == 0) { tmp3 = inP[0] << 8 | inP[1]; tmp3 = tmp3 << (7 - shifter); if (shifter >= 8) { shifter -= 8; } else { inP++; shifter &= 0xf; } outP[w + 1] = tmp3 >> 8; } else { if (tmp4 & 0x10) { tmp4 &= 0xf; outP[w + 1] = *outP - tmp4; } else { tmp4 &= 0xf; outP[w + 1] = *outP + tmp4; } } } outP += 2; index += 2; } /* End 'while (index < w)' */ } /* End 'for (j = 0; j < 2; j++)' */ return (1); } /*********************************************************************** * * Function: GetPicData * * Summary: Requests one record of bayer data from the palm * and then decodes it. * * Parameters: r - the row we are looking for * v - veo record * row - the bayer data containg our row * * Returns: the size of the encoded record * ***********************************************************************/ static int GetPicData (uint32_t flags, int r, struct Veo *v, unsigned char *row) { int attr, category, len; pi_buffer_t *tmpRow; if (!v->sd) return (-1); /* Each record contains four rows of bayer data */ /* The compressed record can be upto twice as large as the * uncompressed record ??? */ tmpRow = pi_buffer_new (5120); len = dlp_ReadRecordByIndex (v->sd, v->db, 1 + r / 4, tmpRow, 0, &attr, &category); if (len < 0) return 0; Decode (tmpRow->data, row, v->width); pi_buffer_free(tmpRow); return (len); } #define max(a,b) (( a > b ) ? a : b ) #define min(a,b) (( a < b ) ? a : b ) /*********************************************************************** * * Function: Bias * * Bias is based on the Fast Alternative to Perlin's Bias * algorithm in Graphics Gems IV by * Christophe Schlick schlick@labri.u-bordeuax.fr * * Summary: Lighten or darken the image * * Parameters: * * Returns: * ***********************************************************************/ static void Bias( double bias, int width, int height, uint8_t *data ) { int i; double num, denom, t; for( i=0; iwidth; uint16_t height = v->height; int i; float redCeiling = 254; float greenCeiling = 252; float blueCeiling = 255; memset( red, 0, 256 * sizeof( uint8_t )); memset( green, 0, 256 * sizeof( uint8_t )); memset( blue, 0, 256 * sizeof( uint8_t )); gMin = rMin = bMin = 255; gMax = rMax = bMax = 0; tmpRow = malloc( 2560 ); GetPicData( 0, 0, v, tmpRow ); for( i=0; iwidth / 2; rawH = v->height / 2; if (r == 0) { if (-1 == GetPicData (flags, r, v, rowB)) return (-1); rAP = rBP = rowB; rCP = rowB + v->width; } else if (r == (v->height - 1)) { if (-1 == GetPicData (flags, r, v, rowA)) return (-1); rAP = rowA + v->width * 2; rCP = rBP = rowA + v->width * 3; } else if (modR == 0) { if (-1 == GetPicData (flags, r - 1, v, rowA)) return (-1); rAP = rowA + v->width * 3; if (-1 == GetPicData (flags, r, v, rowB)) return (-1); rBP = rowB; rCP = rowB + v->width; } else if (modR == 3) { if (-1 == GetPicData (flags, r, v, rowA)) return (-1); rAP = rowA + v->width * 2; rBP = rowA + v->width * 3; if (-1 == GetPicData (flags, r + 1, v, rowB)) return (-1); rCP = rowB; } else { if (-1 == GetPicData (flags, r, v, rowA)) return (-1); rAP = rowA + v->width * (modR - 1); rBP = rowA + v->width * modR; rCP = rowA + v->width * (modR + 1); } /* Bayer Pattern * GBGB * RGRG * GBGB * RGRG */ if (r % 2 == 0) { /* green blue center */ row[0] = (rAP[0] + rCP[0]) >> 1; row[1] = rBP[0]; row[2] = rBP[1]; /* blue center */ row[3] = (rAP[0] + rCP[0] + rAP[2] + rCP[2]) >> 2; row[4] = (rAP[1] + rBP[0] + rBP[2] + rCP[1]) >> 2; row[5] = rBP[1]; for (i = 1; i < rawW - 1; i++) { /* green blue center */ row[i * 6] = (rAP[i * 2] + rCP[i * 2]) >> 1; row[i * 6 + 1] = rBP[i * 2]; row[i * 6 + 2] = (rBP[i * 2 - 1] + rBP[i * 2 + 1]) >> 1; /* blue center */ row[i * 6 + 3] = (rAP[i * 2] + rCP[i * 2] + rAP[i * 2 + 2] + rCP[i * 2 + 2]) >> 2; row[i * 6 + 4] = (rAP[i * 2 + 1] + rBP[i * 2] + rBP[i * 2 + 2] + rCP[i * 2 + 1]) >> 2; row[i * 6 + 5] = rBP[i * 2 + 1]; } i = rawW - 1; /* green blue center */ row[i * 6] = (rAP[i * 2] + rCP[i * 2]) >> 1; row[i * 6 + 1] = rBP[i * 2]; row[i * 6 + 2] = (rBP[i * 2 - 1] + rBP[i * 2 + 1]) >> 1; /* blue center */ row[i * 6 + 3] = (rAP[i * 2] + rCP[i * 2]) >> 1; row[i * 6 + 4] = (rAP[i * 2 + 1] + rBP[i * 2] + rCP[i * 2 + 1]) / 3; row[i * 6 + 5] = rBP[i * 2 + 1]; } else { /* red center */ row[0] = rBP[0]; row[1] = (rAP[0] + rBP[1] + rCP[0]) / 3; row[2] = (rAP[1] + rCP[1]) >> 1; /* green red center */ row[3] = (rBP[0] + rBP[2]) >> 1; row[4] = rBP[1]; row[5] = (rAP[1] + rCP[1]) >> 1; for (i = 1; i < rawW - 1; i++) { /* red center */ row[i * 6] = rBP[i * 2]; row[i * 6 + 1] = (rAP[i * 2] + rBP[i * 2 - 1] + rBP[i * 2 + 1] + rCP[i * 2]) >> 2; row[i * 6 + 2] = (rAP[i * 2 - 1] + rAP[i * 2 + 1] + rCP[i * 2 - 1] + rCP[i * 2 + 1]) >> 2; /* green red center */ row[i * 6 + 3] = (rBP[i * 2] + rBP[i * 2 + 2]) >> 1; row[i * 6 + 4] = rBP[i * 2 + 1]; row[i * 6 + 5] = (rAP[i * 2 + 1] + rCP[i * 2 + 1]) >> 1; } i = rawW - 1; /* red center */ row[i * 6] = rBP[i * 2]; row[i * 6 + 1] = (rAP[i * 2] + rBP[i * 2 - 1] + rBP[i * 2 + 1] + rCP[i * 2]) >> 2; row[i * 6 + 2] = (rAP[i * 2 - 1] + rAP[i * 2 + 1] + rCP[i * 2 - 1] + rCP[i * 2 + 1]) >> 2; /* green red center */ row[i * 6 + 3] = rBP[i * 2]; row[i * 6 + 4] = rBP[i * 2 + 1]; row[i * 6 + 5] = (rAP[i * 2 + 1] + rCP[i * 2 + 1]) >> 1; } if (flags & VEO_COLOUR_CORRECT) { for (i = 0; i < v->width * 3; i += 3) { row[i] = redLUT[row[i]]; row[i + 1] = greenLUT[row[i + 1]]; row[i + 2] = blueLUT[row[i + 2]]; } } if (flags & VEO_BIAS) Bias( bias_factor, v->width*3, 1, row ); return (1); } /*********************************************************************** * * Function: write_png * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ #ifdef HAVE_PNG void write_png (FILE * f, struct Veo *v, long flags) { unsigned char outBuf[2560]; int i; png_structp png_ptr; png_infop info_ptr; png_ptr = png_create_write_struct (PNG_LIBPNG_VER_STRING, png_voidp_NULL, png_error_ptr_NULL, png_error_ptr_NULL); if (!png_ptr) return; info_ptr = png_create_info_struct (png_ptr); if (!info_ptr) { png_destroy_write_struct (&png_ptr, (png_infopp) NULL); return; } if (setjmp (png_jmpbuf (png_ptr))) { png_destroy_write_struct (&png_ptr, &info_ptr); fclose (f); return; } png_init_io (png_ptr, f); png_set_IHDR (png_ptr, info_ptr, v->width, v->height, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); png_write_info (png_ptr, info_ptr); for (i = 0; i < v->height; i++) { Gen24bitRow (flags, i, v, outBuf); png_write_row (png_ptr, outBuf); png_write_flush (png_ptr); } png_write_end (png_ptr, info_ptr); png_destroy_write_struct (&png_ptr, &info_ptr); } #endif /*********************************************************************** * * Function: write_ppm * * Summary: * * Parameters: None * * Returns: Nothing * ***********************************************************************/ void write_ppm (FILE * f, struct Veo *v, long flags) { unsigned char outBuf[2560]; int i; fprintf (f, "P6\n# "); if (v->name != NULL) fprintf (f, "%s (created on %s)\n", v->name, fmt_date (v)); fprintf (f, "%d %d\n255\n", v->width, v->height); for (i = 0; i < v->height; i++) { Gen24bitRow (flags, i, v, outBuf); fwrite (outBuf, v->width * 3, 1, f); } } /*********************************************************************** * * Function: WritePicture * * Summary: FIXME * * Parameters: * * Returns: * ***********************************************************************/ void WritePicture (int sd, int db, int type, char *name, const char *progname, long flags) { char fname[FILENAME_MAX]; FILE *f; char extension[8]; static int len; struct Veo v; pi_buffer_t *inBuf; int attr, category; if (type == VEO_OUT_PNG) sprintf (extension, ".png"); else if (type == VEO_OUT_PPM) sprintf (extension, ".ppm"); sprintf (fname, "%s", name); strcpy (v.name, name); if (plu_protect_files (fname, extension, sizeof(fname) ) < 1) { /* no suitable filename could be found. */ return; } printf ("Generating %s...\n", fname); f = fopen (fname, "wb"); if (f) { if (sd) { inBuf = pi_buffer_new (2560); len = dlp_ReadRecordByIndex (sd, db, 0, inBuf, 0, &attr, &category); unpack_Veo (&v, inBuf->data, inBuf->used); pi_buffer_free (inBuf); v.sd = sd; v.db = db; } else return; ColourCorrect (&v, redLUT, greenLUT, blueLUT, flags); if (type == VEO_OUT_PPM) write_ppm (f, &v, flags); #ifdef HAVE_PNG else if (type == VEO_OUT_PNG) write_png (f, &v, flags); #endif fclose (f); } else { fprintf (stderr, "%s: can't write to %s\n", progname, fname); } } int main (int argc, const char *argv[]) { int c, /* switch */ db, i = 0, sd = -1, action = VEO_ACTION_OUTPUT, dbcount = 0, type = VEO_OUT_PPM, bias = 50; long flags = 0; struct DBInfo info; pi_buffer_t *buf; const char *picname = NULL; char *imgtype = NULL; struct PilotUser User; poptContext po; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"name", 'n', POPT_ARG_STRING, &picname, 'n', "Specify output picture by name", "name"}, {"list", 'l', POPT_ARG_VAL, &action, VEO_ACTION_LIST, "List Photos on device", NULL}, {"bias", 'b', POPT_ARG_INT, &bias, 'b', "lighten or darken the image (0..50 darken, 50..100 lighten)", "bias"}, {"colour", 'c', POPT_ARG_VAL | POPT_ARGFLAG_OR, &flags, VEO_COLOUR_CORRECT, "colour correct the output colours", NULL}, {"type", 't', POPT_ARG_STRING, &imgtype, 't', "Specify picture output type (ppm or png)", "[ppm|png]"}, POPT_TABLEEND }; po = poptGetContext("read-veo", argc, argv, options, 0); poptSetOtherOptionHelp(po,"\n\n" " Synchronize your Veo Traveler databases with your desktop machine.\n" " Output defaults to ppm.\n\n"); if (argc<2) { poptPrintUsage(po,stderr,0); return 1; } while ((c = poptGetNextOpt(po)) >= 0) { switch (c) { case 'n': action = VEO_ACTION_OUTPUT_ONE; break; case 'b': if( bias > 100 || bias < 0 ) { fprintf (stderr, " ERROR: Bad bias value %d, using 50.\n",bias); bias = 50; } bias_factor = (double)bias / 100.0; flags |= VEO_BIAS; break; case 't': if (!strncmp ("png", imgtype, 3)) { #ifdef HAVE_PNG type = VEO_OUT_PNG; #else fprintf (stderr, " ERROR: read-veo was built without png support\n"); type = VEO_OUT_PPM; #endif } else if (!strncmp ("ppm", imgtype, 3)) { type = VEO_OUT_PPM; } else { fprintf (stderr, " ERROR: Unknown output type, defaulting to ppm\n"); type = VEO_OUT_PPM; } break; } } if (c < -1) { plu_badoption(po,c); } sd = plu_connect (); if (sd < 0) goto error; if (dlp_ReadUserInfo (sd, &User) < 0) goto error_close; buf = pi_buffer_new (sizeof (struct DBInfo)); for (;;) { if (dlp_ReadDBList (sd, 0, 0x80, i, buf) < 0) break; memcpy (&info, buf->data, sizeof(struct DBInfo)); i = info.index + 1; if (info.type == pi_mktag ('E', 'Z', 'V', 'I') && info.creator == pi_mktag ('O', 'D', 'I', '2')) { dbcount++; switch (action) { case VEO_ACTION_LIST: printf ("%s\n", info.name); break; case VEO_ACTION_OUTPUT_ONE: if (strcmp (info.name, picname)) break; case VEO_ACTION_OUTPUT: if (dlp_OpenDB (sd, 0, 0x80 | 0x40, info.name, &db) < 0) { fprintf (stderr," ERROR:Unable to open Veo database on Palm.\n"); dlp_AddSyncLogEntry (sd, "Unable to open Veo database.\n"); goto error_close; } WritePicture(sd, db, type, info.name, "read-veo", flags); if (sd) { /* Close the database */ dlp_CloseDB (sd, db); } break; } } } pi_buffer_free(buf); if (sd) { dlp_AddSyncLogEntry (sd, "Successfully read Veo photos from Palm.\n" "Thank you for using pilot-link."); dlp_EndOfSync (sd, 0); pi_close (sd); } if (!plu_quiet) { printf ("\nList complete. %d files found.\n", dbcount); } return 0; error_close: pi_close (sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-read-expenses.c0000644000175000017500000001443711211745573021742 0ustar rousseaurousseau/* * $Id: pilot-read-expenses.c,v 1.47 2007/02/04 23:06:02 desrod Exp $ * * pilot-read-expenses.c: Sample code to translate Palm Expense database * into generic format * * Copyright (c) 1997, Kenneth Albanowski * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include "pi-source.h" #include "pi-expense.h" #include "pi-dlp.h" #include "pi-header.h" #include "pi-userland.h" int main(int argc, const char *argv[]) { int db, i, ret, c = -1, sd = -1; enum { mode_none, mode_write = 257 } run_mode = mode_none; char buffer[0xffff]; char buffer2[0xffff]; pi_buffer_t *recbuf, *appblock; struct PilotUser User; struct ExpenseAppInfo tai; struct ExpensePref tp; poptContext po; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"write",'w', POPT_ARG_NONE,NULL,mode_write,"Write data"}, POPT_TABLEEND }; po = poptGetContext("read-expenses", argc, argv, options, 0); poptSetOtherOptionHelp(po,"\n\n" " Export Palm Expense application database data into text format\n\n"); if ((argc < 2)) { poptPrintUsage(po,stderr,0); return 1; } while ((c = poptGetNextOpt(po)) >= 0) { switch(c) { case mode_write : if (run_mode == mode_none) { run_mode = c; } else { if (c != run_mode) { fprintf(stderr," ERROR: Specify exactly one of -w.\n"); return 1; } } break; default: fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } } if (c < -1) { plu_badoption(po,c); } if (mode_none == run_mode) { fprintf(stderr," ERROR: Specify --write (-w) to output data.\n"); return 1; } sd = plu_connect(); if (sd < 0) goto error; if (dlp_ReadUserInfo(sd, &User) < 0) { goto error_close; } /* Note that under PalmOS 1.x, you can only read preferences before the DB is opened */ ret = dlp_ReadAppPreference(sd, Expense_Creator, Expense_Pref, 1, 0xffff, buffer, 0, 0); /* Open the Expense database, store access handle in db */ if (dlp_OpenDB(sd, 0, 0x80 | 0x40, "ExpenseDB", &db) < 0) { fprintf(stderr," ERROR: Unable to open ExpenseDB on Palm.\n"); dlp_AddSyncLogEntry(sd, "Unable to open ExpenseDB.\n"); goto error_close; } if (ret >= 0) { unpack_ExpensePref(&tp, buffer, 0xffff); i = pack_ExpensePref(&tp, buffer2, 0xffff); #ifdef DEBUG fprintf(stderr, "Orig prefs, %d bytes:\n", ret); pi_dumpdata(buffer, ret); fprintf(stderr, "New prefs, %d bytes:\n", i); pi_dumpdata(buffer2, i); #endif printf("Expense prefs, current category %d, default currency %d\n", tp.currentCategory, tp.defaultCurrency); printf(" Attendee font %d, Note font %d, Show all categories %d, Show currency %d, Save backup %d\n", tp.attendeeFont, tp.noteFont, tp.showAllCategories, tp.showCurrency, tp.saveBackup); printf(" Allow quickfill %d, Distance unit %d\n\n", tp.allowQuickFill, tp.unitOfDistance); printf("Currencies:\n"); for (i = 0; i < 5; i++) { fprintf(stderr, " %d", tp.currencies[i]); } printf("\n\n"); } appblock = pi_buffer_new(0xffff); ret = dlp_ReadAppBlock(sd, db, 0, 0xffff, appblock); unpack_ExpenseAppInfo(&tai, appblock->data, appblock->used); pi_buffer_free(appblock); #ifdef DEBUG i = pack_ExpenseAppInfo(&tai, buffer2, 0xffff); printf("Orig length %d, new length %d, orig data:\n", ret, i); pi_dumpdata(buffer, ret); printf("New data:\n"); pi_dumpdata(buffer2, i); #endif printf("Expense app info, sort order %d\n", tai.sortOrder); printf(" Currency 1, name '%s', symbol '%s', rate '%s'\n", tai.currencies[0].name, tai.currencies[0].symbol, tai.currencies[0].rate); printf(" Currency 2, name '%s', symbol '%s', rate '%s'\n", tai.currencies[1].name, tai.currencies[1].symbol, tai.currencies[1].rate); printf(" Currency 3, name '%s', symbol '%s', rate '%s'\n", tai.currencies[2].name, tai.currencies[2].symbol, tai.currencies[2].rate); printf(" Currency 4, name '%s', symbol '%s', rate '%s'\n\n", tai.currencies[3].name, tai.currencies[3].symbol, tai.currencies[3].rate); recbuf = pi_buffer_new (0xffff); for (i = 0;; i++) { int attr, category; struct Expense t; int len = dlp_ReadRecordByIndex(sd, db, i, recbuf, 0, &attr, &category); if (len < 0) break; /* Skip deleted records */ if ((attr & dlpRecAttrDeleted) || (attr & dlpRecAttrArchived)) continue; unpack_Expense(&t, recbuf->data, recbuf->used); ret = pack_Expense(&t, buffer2, 0xffff); #ifdef DEBUG fprintf(stderr, "Orig length %d, data:\n", len); pi_dumpdata(buffer, len); fprintf(stderr, "New length %d, data:\n", ret); pi_dumpdata(buffer2, ret); #endif printf("Category: %s\n", tai.category.name[category]); printf(" Type: %s (%3d)\n Payment: %s (%3d)\n Currency: %3d\n", ExpenseTypeNames[t.type],t.type, ExpensePaymentNames[t.payment],t.payment, t.currency); printf(" Amount: %s\n Vendor: %s\n City: %s\n", t.amount ? t.amount : "", t.vendor ? t.vendor : "", t.city ? t.city : ""); printf(" Attendees: %s\n Note: %s\n", t.attendees ? t.attendees : "", t.note ? t.note : ""); printf(" Date: %s", asctime(&t.date)); printf("\n"); free_Expense(&t); } pi_buffer_free(recbuf); /* Close the database */ dlp_CloseDB(sd, db); dlp_AddSyncLogEntry(sd, "Successfully read Expenses from Palm.\n" "Thank you for using pilot-link\n"); pi_close(sd); return 0; error_close: pi_close(sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-read-ical.c0000644000175000017500000002370111211745573021012 0ustar rousseaurousseau/* * $Id: pilot-read-ical.c,v 1.59 2007/02/04 23:06:02 desrod Exp $ * * pilot-read-ical.c: Translate Palm ToDo and Datebook databases into ical * 2.0 format * * Copyright (c) 1996, Kenneth Albanowski * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include "pi-source.h" #include "pi-todo.h" #include "pi-datebook.h" #include "pi-dlp.h" #include "pi-header.h" #include "pi-userland.h" char *tclquote(char *in) { int len; char *out, *pos; static char *buffer = 0; if (in == NULL) { return buffer; } /* Skip leading bullet (and any whitespace after) */ if (in[0] == '\x95') { ++in; while (in[0] == ' ' || in[0] == '\t') { ++in; } } len = 3; pos = in; while (*pos) { if ((*pos == '\\') || (*pos == '"') || (*pos == '[') || (*pos == '{') || (*pos == '$')) len++; len++; pos++; } if (buffer) free(buffer); buffer = (char *) malloc(len); out = buffer; pos = in; *out++ = '"'; while (*pos) { if ((*pos == '\\') || (*pos == '"') || (*pos == '[') || (*pos == '{') || (*pos == '$')) *out++ = '\\'; *out++ = *pos++; } *out++ = '"'; *out++ = '\0'; return buffer; } int main(int argc, const char *argv[]) { int c, /* switch */ db, sd = -1, i, read_todos = -1; FILE *ical = NULL; char cmd[255], *ptext = NULL, *icalfile = NULL, *pubtext = NULL; struct ToDoAppInfo tai; pi_buffer_t *recbuf, *appblock; poptContext pc; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"datebook", 'd', POPT_ARG_VAL, &read_todos, 0, "Datebook only, no ToDos", NULL}, {"pubtext", 't', POPT_ARG_STRING, &ptext, 0, "Replace text of items not started with a bullet with ", "pubtext"}, {"file", 'f', POPT_ARG_STRING, &icalfile, 0, "Write the ical formatted data to (overwrites existing )", "file"}, POPT_TABLEEND }; pc = poptGetContext("read-ical", argc, argv, options, 0); poptSetOtherOptionHelp(pc,"\n\n" " Dumps the DatebookDB and/or ToDo applications to ical format.\n" " Requires the program 'ical'.\n\n"); if (argc < 2) { poptPrintUsage(pc,stderr,0); return 1; } while ((c = poptGetNextOpt(pc)) >= 0) { fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } if (c < -1) { plu_badoption(pc,c); return 1; } if (icalfile == NULL) { fprintf(stderr, " ERROR: ical filename not specified. Please use the -f option.\n"); return 1; } sd = plu_connect(); if (sd < 0) goto error; unlink(icalfile); sprintf(cmd, "ical -list -f - -calendar %s", icalfile); ical = popen(cmd, "w"); if (ical == NULL) { int e = errno; fprintf(stderr," ERROR: cannot start communication with ical.\n" " %s\n",strerror(e)); return 1; } fprintf(ical, "calendar cal $ical(calendar)\n"); if (dlp_OpenConduit(sd) < 0) goto error_close; if (read_todos) { /* Open the ToDo database, store access handle in db */ if (dlp_OpenDB (sd, 0, 0x80 | 0x40, "ToDoDB", &db) < 0) { fprintf(stderr," ERROR: Unable to open ToDoDB on Palm.\n"); dlp_AddSyncLogEntry(sd, "Unable to open ToDoDB.\n"); goto error_close; } appblock = pi_buffer_new(0xffff); dlp_ReadAppBlock(sd, db, 0, 0xffff, appblock); unpack_ToDoAppInfo(&tai, appblock->data, appblock->used); pi_buffer_free(appblock); recbuf = pi_buffer_new (0xffff); for (i = 0;; i++) { int attr, category; char id_buf[255]; struct ToDo t; recordid_t id_; int len = dlp_ReadRecordByIndex(sd, db, i, recbuf, &id_, &attr, &category); if (len < 0) break; /* Skip deleted records */ if ((attr & dlpRecAttrDeleted) || (attr & dlpRecAttrArchived)) continue; unpack_ToDo(&t, recbuf, todo_v1); fprintf(ical, "set n [notice]\n"); /* '\x95' is the "bullet" chcter */ fprintf(ical, "$n text %s\n", tclquote((pubtext && t.description[0] != '\x95') ? pubtext : t.description)); fprintf(ical, "$n date [date today]\n"); fprintf(ical, "$n todo 1\n"); fprintf(ical, "$n option Priority %d\n", t.priority); sprintf(id_buf, "%lx", id_); fprintf(ical, "$n option PilotRecordId %s\n", id_buf); fprintf(ical, "$n done %d\n", t.complete ? 1 : 0); fprintf(ical, "cal add $n\n"); free_ToDo(&t); } pi_buffer_free(recbuf); /* Close the database */ dlp_CloseDB(sd, db); dlp_AddSyncLogEntry(sd, "Successfully read todos from Palm.\nThank you for using pilot-link.\n"); } /* Open the Datebook's database, store access handle in db */ if (dlp_OpenDB (sd, 0, 0x80 | 0x40, "DatebookDB", &db) < 0) { fprintf(stderr," ERROR: Unable to open DatebookDB on Palm.\n"); dlp_AddSyncLogEntry(sd, "Unable to open DatebookDB.\n"); goto error_close; } recbuf = pi_buffer_new (0xffff); for (i = 0;; i++) { int j, attr; char id_buf[255]; struct Appointment a; recordid_t id_; int len = dlp_ReadRecordByIndex(sd, db, i, recbuf, &id_, &attr, 0); if (len < 0) break; /* Skip deleted records */ if ((attr & dlpRecAttrDeleted) || (attr & dlpRecAttrArchived)) continue; unpack_Appointment(&a, recbuf, datebook_v1); if (a.event) { fprintf(ical, "set i [notice]\n"); } else { int start, end; fprintf(ical, "set i [appointment]\n"); start = a.begin.tm_hour * 60 + a.begin.tm_min; end = a.end.tm_hour * 60 + a.end.tm_min; fprintf(ical, "$i starttime %d\n", start); fprintf(ical, "$i length %d\n", end - start); } /* Don't hilight private (secret) records */ if (attr & dlpRecAttrSecret) { fprintf(ical, "$i hilite never\n"); } /* Handle alarms */ if (a.alarm) { if (a.event) { if (a.advanceUnits == 2) { fprintf(ical, "$i earlywarning %d\n", a.advance); } else { printf("Minute or hour alarm on untimed event ignored: %s\n", a.description); } } else { switch (a.advanceUnits) { case 0: fprintf(ical, "$i alarms { %d }\n", a.advance); break; case 1: fprintf(ical, "$i alarms { %d }\n", a.advance * 60); break; case 2: fprintf(ical, "$i earlywarning %d\n", a.advance); break; } } } /* '\x95' is the "bullet" chcter */ fprintf(ical, "$i text %s\n", tclquote((pubtext && a.description[0] != '\x95') ? pubtext : a. description)); fprintf(ical, "set begin [date make %d %d %d]\n", a.begin.tm_mday, a.begin.tm_mon + 1, a.begin.tm_year + 1900); if (a.repeatFrequency) { if (a.repeatType == repeatDaily) { fprintf(ical, "$i dayrepeat %d $begin\n", a.repeatFrequency); } else if (a.repeatType == repeatMonthlyByDate) { fprintf(ical, "$i month_day %d $begin %d\n", a.begin.tm_mon + 1, a.repeatFrequency); } else if (a.repeatType == repeatMonthlyByDay) { if (a.repeatDay >= domLastSun) { fprintf(ical, "$i month_last_week_day %d 1 $begin %d\n", a.repeatDay % 7 + 1, a.repeatFrequency); } else { fprintf(ical, "$i month_week_day %d %d $begin %d\n", a.repeatDay % 7 + 1, a.repeatDay / 7 + 1, a.repeatFrequency); } } else if (a.repeatType == repeatWeekly) { /* * Handle the case where the user said weekly repeat, but * really meant daily repeat every n*7 days. Note: We can't * do days of the week and a repeat-frequency > 1, so do the * best we can and go on. */ if (a.repeatFrequency > 1) { int ii, found; for (ii = 0, found = 0; ii < 7; ii++) { if (a.repeatDays [ii]) found++; } if (found > 1) { fprintf(stderr," WARNING: Incomplete translation of %s\n", a.description); } fprintf(ical, "$i dayrepeat %d $begin\n", a.repeatFrequency * 7); } else { int ii; fprintf(ical, "$i weekdays "); for (ii = 0; ii < 7; ii++) if (a.repeatDays [ii]) fprintf(ical, "%d ", ii + 1); fprintf(ical, "\n"); } } else if (a.repeatType == repeatYearly) { fprintf(ical, "$i monthrepeat %d $begin\n", 12 * a.repeatFrequency); } fprintf(ical, "$i start $begin\n"); if (!a.repeatForever) fprintf(ical, "$i finish [date make %d %d %d]\n", a.repeatEnd.tm_mday, a.repeatEnd.tm_mon + 1, a.repeatEnd.tm_year + 1900); if (a.exceptions) for (j = 0; j < a.exceptions; j++) fprintf(ical, "$i deletion [date make %d %d %d]\n", a.exception[j].tm_mday, a.exception[j].tm_mon + 1, a.exception[j].tm_year + 1900); } else fprintf(ical, "$i date $begin\n"); sprintf(id_buf, "%lx", id_); fprintf(ical, "$i option PilotRecordId %s\n", id_buf); fprintf(ical, "cal add $i\n"); free_Appointment(&a); } pi_buffer_free (recbuf); fprintf(ical, "cal save [cal main]\n"); fprintf(ical, "exit\n"); pclose(ical); /* Close the database */ dlp_CloseDB(sd, db); dlp_AddSyncLogEntry(sd, "read-ical successfully read Datebook from Palm.\n" "Thank you for using pilot-link.\n"); dlp_EndOfSync(sd, 0); pi_close(sd); return 0; error_close: if (ical) { /* explicitly do NOT save on failure. since we've already unlinked the original ical file, we've still destroyed something. */ fprintf(ical, "exit\n"); pclose(ical); } pi_close(sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-dlpsh.c0000644000175000017500000004736011211745573020312 0ustar rousseaurousseau/* * $Id: pilot-dlpsh.c,v 1.92 2007/02/02 11:35:44 desrod Exp $ * * pilot-dlpsh.c: DLP Command Shell * * (c) 1996, 2000, The pilot-link Team * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #include "pi-source.h" #include "pi-dlp.h" #include "pi-header.h" #include "pi-error.h" #include "pi-userland.h" #ifdef HAVE_LIBREADLINE #include #include #endif #define TICKLE_INTERVAL 7 struct pi_socket *ticklish_pi_socket; /* FIXME: This isn't really ideal, passing a struct in is probably better. Something like this: typedef struct { int sd; int argc; char **argv; } cmd_struct_t; int df_fn(cmd_struct_t *cmd_struct); int exit_fn(cmd_struct_t *cmd_struct); int ls_fn(cmd_struct_t *cmd_struct); int help_fn(cmd_struct_t *cmd_struct); int rm_fn(cmd_struct_t *cmd_struct); int time_fn(cmd_struct_t *cmd_struct); int user_fn(cmd_struct_t *cmd_struct); typedef int (*cmd_func_t)(cmd_struct_t *); struct Command { char *name; cmd_func_t func; }; Knghtbrd: In the meantime, let's fix the warnings... */ int df_fn(int sd, int argc, const char *argv[]), reopen_fn(int sd, int argc, const char *argv[]), exit_fn(int sd, int argc, const char *argv[]), ls_fn(int sd, int argc, const char *argv[]), help_fn(int sd, int argc, const char *argv[]), rm_fn(int sd, int argc, const char *argv[]), time_fn(int sd, int argc, const char *argv[]), user_fn(int sd, int argc, const char *argv[]); char *strtoke(char *str, const char *ws, const char *delim), *timestr(time_t t); static jmp_buf main_jmp; void exit_func(void); void handle_user_commands(int sd); typedef int (*cmd_fn_t) (int, int, const char **); struct Command { char *name; cmd_fn_t func; }; struct Command command_list[] = { {"df", df_fn}, {"help", help_fn}, {"ls", ls_fn}, {"reopen", reopen_fn}, {"exit", exit_fn}, {"quit", exit_fn}, {"q", exit_fn}, {"bye", exit_fn}, {"rm", rm_fn}, {"del", rm_fn}, {"ntp", time_fn}, {"time", time_fn}, {"dtp", time_fn}, {"user", user_fn}, {"u", user_fn}, {NULL, NULL} }; /*********************************************************************** * * Function: df_fn * * Summary: Simple dump of CardInfo, which includes the RAM/ROM * amounts free and used. * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int df_fn(int sd, int argc, const char *argv[]) { struct CardInfo Card; Card.card = -1; Card.more = 1; while (Card.more) { if (dlp_ReadStorageInfo(sd, Card.card + 1, &Card) < 0) break; printf("Filesystem 1k-blocks Used Available Used Total\n"); printf("Card0: ROM %9lu", Card.romSize); printf(" n/a %9lu n/a %4luk\n", Card.romSize, Card.romSize/1024); printf("Card0: RAM %9lu", Card.ramSize); printf(" %8lu %8lu %3ld%% %4luk\n", (Card.ramSize - Card.ramFree), Card.ramFree, ((Card.ramSize - Card.ramFree) * 100) / Card.ramSize, Card.ramSize/1024); printf("Total (ROM + RAM) %8lu %8lu n/a n/a %5luk\n\n", (Card.romSize + Card.ramSize), (Card.romSize + Card.ramSize)-Card.ramFree, (Card.romSize + Card.ramSize)/1024); } return 0; } /*********************************************************************** * * Function: help_fn * * Summary: Handle the parsing of -h inside 'dlpsh>' * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int help_fn(int sd, int argc, const char *argv[]) { printf("The current built-in commands are:\n\n"); printf(" user,u print the currently set User information\n"); printf(" ls used with -l and -r to provide long and ROM file lists\n"); printf(" df display how much RAM and ROM is free on your device\n"); printf(" ntp,time,dtp Desktop-to-Palm, set the time on the Palm from the desktop\n"); printf(" rm,del remove a file, delete it entirely from the Palm device\n"); printf(" help You Are Here\n"); printf(" quit,q, exit,bye exit the DLP Protocol Shell\n\n"); printf("Use ' -help' for more detailed syntax and other switches\n\n"); return 0; } /*********************************************************************** * * Function: ls_fn * * Summary: Similar to unix ls, lists files with -l and -r * * Parameters: -l for long and -r for ram * * Returns: Nothing * ***********************************************************************/ int ls_fn(int sd, int argc, const char *argv[]) { poptContext po; struct poptOption ls_options[] = { {"long", 'l', POPT_ARG_NONE, NULL, 'l', "List all RAM databases using \"expanded\" format"}, {"rom", 'r', POPT_ARG_NONE, NULL, 'r', "List all ROM databases and applications"}, {"help", 'h', POPT_ARG_NONE, NULL, 'h', "Display this information"}, POPT_TABLEEND } ; int c, /* switch */ cardno, flags, ret, start = 0, lflag = 0, rom_flag = 0, i; pi_buffer_t *buf; optind = 0; po = poptGetContext("dlpsh", argc, argv, ls_options, 0); while ((c = poptGetNextOpt(po)) >= 0) { switch (c) { case 'r': rom_flag = 1; break; case 'l': lflag = 1; break; case 'h': poptPrintHelp(po,stdout,0); return 0; } } if (c < -1) { /* an error occurred during option processing */ fprintf(stderr, "%s: %s\n", poptBadOption(po, POPT_BADOPTION_NOALIAS), poptStrerror(c)); return 1; } cardno = 0; if (rom_flag == 0) flags = 0x80; /* dlpReadDBListFlagRAM */ else flags = 0x40; /* dlpReadDBListFlagROM */ buf = pi_buffer_new (32 * sizeof (struct DBInfo)); for (;;) { struct DBInfo info; long tag; char *a = (char *)&tag; /* The databases are numbered starting at 0. The first 12 are in ROM, and the rest are in RAM. The high two bits of the flags byte control wheter you see the ROM entries, RAM entries or both. start is the lowest index you want. So, we start with 0, but usually we want to see ram entries, so it will return database number 12. Then, we'll ask for 13, etc, until we get the NotFound error return. */ ret = dlp_ReadDBList(sd, cardno, flags | dlpDBListMultiple, start, buf); if (ret == PI_ERR_DLP_PALMOS && pi_palmos_error(sd) == dlpErrNotFound) break; if (ret < 0) { if (ret == PI_ERR_DLP_PALMOS) printf("dlp_ReadDBList: PalmOS err 0x%04x\n", pi_palmos_error(sd)); else printf("dlp_ReadDBList: err %d\n", ret); pi_buffer_free (buf); return -1; } for (i = 0; i < (buf->used / sizeof(struct DBInfo)); i++) { memcpy (&info, buf->data + (i * sizeof(struct DBInfo)), sizeof (struct DBInfo)); printf("%s\n", info.name); if (lflag == 1) { tag = htonl(info.type); printf(" More: 0x%x Flags: 0x%-4x Type: %.4s\n", info.more, info.flags, (char *) &tag); tag = htonl(info.creator); printf(" Creator: %c%c%c%c Modification Number: %-4ld Version: %-2d\n", a[0], a[1], a[2], a[3], info.modnum, info.version); printf(" Created: %19s\n", timestr(info.createDate)); printf(" Backup : %19s\n", timestr(info.backupDate)); printf(" Modify : %19s\n\n", timestr(info.modifyDate)); } if (info.index < start) { /* avoid looping forever if we get confused */ printf("error: index backs up\n"); break; } } if (info.index < start) break; start = info.index + 1; } pi_buffer_free (buf); return 0; } /*********************************************************************** * * Function: rm_fn * * Summary: Similar to unix rm, deletes a database from the Palm * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int rm_fn(int sd, int argc, const char *argv[]) { int cardno, ret; const char *name; if (argc != 2) { printf(" Delete a application or database from your Palm device\n\n" " Usage: rm \n" " Please note that no extension is required on 'dbname'\n\n" " Example: rm Address\n\n"); return (0); } name = argv[1]; cardno = 0; if ((ret = dlp_DeleteDB(sd, cardno, name)) < 0) { if (ret == PI_ERR_DLP_PALMOS && pi_palmos_error(sd) == dlpErrNotFound) { printf("%s: not found\n", name); return (0); } printf("%s: remove error %d\n", name, ret); return (0); } printf("File %s successfully removed\n", name); return 0; } /*********************************************************************** * * Function: time_fn * * Summary: ntpdate-style function for setting Palm time from * desktop clock * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int time_fn(int sd, int argc, const char *argv[]) { int s; time_t ltime; struct tm *tm_ptr; struct timeval tv; char timebuf[80]; time(<ime); tm_ptr = localtime(<ime); strftime(timebuf, 80, "Now setting Palm time from desktop to: " "%a %b %d %H:%M:%S %Z %Y\n", tm_ptr); printf(timebuf); gettimeofday(&tv, 0); ltime = tv.tv_sec + 1; usleep(1000000 - tv.tv_usec); s = dlp_SetSysDateTime(sd, ltime); return 0; } /*********************************************************************** * * Function: user_fn * * Summary: Set the username, UserID and PCID on the device, * similar to install-user, but interactive * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int user_fn(int sd, int argc, const char *argv[]) { int c, /* switch */ ret; struct PilotUser User; char *userName = NULL; char *userID = NULL, *viewerID = NULL, *lastSyncPC = NULL; poptContext po; struct poptOption user_options[] = { {"user", 'u', POPT_ARG_STRING, &userName, 'u', "Set Username on the Palm device (use double-quotes)"}, {"id", 'i', POPT_ARG_STRING, &userID, 'i', "Set the numeric UserID on the Palm device"}, {"viewid", 'v', POPT_ARG_STRING, &viewerID, 'v', "Set the numeric ViewerID on the Palm device"}, {"pcid", 'p', POPT_ARG_STRING, &lastSyncPC, 'p', "Set the numeric PCID on the Palm device"}, {"help", 'h', POPT_ARG_NONE, NULL, 'h', "Display this information"}, POPT_TABLEEND } ; optind = 0; po = poptGetContext("dlpsh", argc, argv, user_options, 0); while ((c = poptGetNextOpt(po)) >= 0) { switch (c) { case 'u': /* FALLTHRU */ case 'i': /* FALLTHRU */ case 'v': /* FALLTHRU */ case 'p': break; case 'h': poptPrintHelp(po,stdout,0); return 0; break; default : fprintf(stderr,"Bad option %d (%c)\n",c,c); return 0; } } if (c < -1) { /* an error occurred during option processing */ fprintf(stderr, "%s: %s\n", poptBadOption(po, POPT_BADOPTION_NOALIAS), poptStrerror(c)); return 1; } ret = dlp_ReadUserInfo(sd, &User); if (ret < 0) { printf("dlp_ReadUserInfo: err %d\n", ret); return -1; } if (!userName && !userID && !viewerID && !lastSyncPC) { printf(" Username = \"%s\"\n" " UserID = %08lx (%i)\n" " ViewerID = %08lx (%i)\n" " PCid = %08lx (%i)\n", User.username, User.userID, (int) User.userID, User.viewerID, (int) User.viewerID, User.lastSyncPC, (int) User.lastSyncPC); return 0; } if (userName) { strncpy(User.username, userName, sizeof(User.username)); printf(" Username = \"%s\"\n", User.username); } if (userID) { User.userID = strtoul(userID, NULL, 16);; printf(" UserID = %08lx (%i)\n", User.userID, (int) User.userID); } if (viewerID) { User.viewerID = strtoul(viewerID, NULL, 16);; printf(" ViewerID = %08lx (%i)\n", User.viewerID, (int) User.viewerID); } if (lastSyncPC) { User.lastSyncPC = strtoul(lastSyncPC, NULL, 16); printf(" PCid = %08lx (%i)\n", User.lastSyncPC, (int) User.lastSyncPC); } User.successfulSyncDate = time(NULL); User.lastSyncDate = User.successfulSyncDate; ret = dlp_WriteUserInfo(sd, &User); if (ret < 0) { printf("dlp_WriteUserInfo: err %d\n", ret); return -1; } return 0; } /*********************************************************************** * * Function: timestr * * Summary: Build an ISO-compliant time string for use later * * Parameters: None * * Returns: String containing the proper time * ***********************************************************************/ char *timestr(time_t t) { struct tm tm; static char buf[50]; tm = *localtime(&t); sprintf(buf, "%04d-%02d-%02d %02d:%02d:%02d", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); return (buf); } /*********************************************************************** * * Function: parse_command * * Summary: Parses and executes a command * * Parameters: None * * Returns: Nothing * ***********************************************************************/ void parse_command(int sd, const char *cmd) { char *argv[32]; int argc, inc; char *cmd_dup = strdup(cmd); argc = 0; /* Changing input? BAD BAD BAD... -DD */ argv[0] = strtoke(cmd_dup, " \t\n", "\"'"); while (argv[argc] != NULL) { argc++; /* Tsk, tsk. Changing the input again! -DD */ argv[argc] = strtoke(NULL, " \t\n", "\"'"); } if (argc == 0) { free(cmd_dup); return; } for (inc = 0; command_list[inc].name != NULL; inc++) { if (strcasecmp(argv[0], command_list[inc].name) == 0) { command_list[inc].func(sd, argc, (const char **)argv); } } free(cmd_dup); return; } /*********************************************************************** * * Function: handle_single_command * * Summary: Dispatch a command from the cmdline and exit * * Parameters: None * * Returns: Nothing * ***********************************************************************/ void handle_single_command(int sd, char *cmd) { parse_command(sd, cmd); /* FIXME: knghtbrd: log something or not? */ dlp_EndOfSync(sd, 0); pi_close(sd); exit(0); } /*********************************************************************** * * Function: handle_user_commands * * Summary: Read user commands interactively * * Parameters: None * * Returns: Nothing * ***********************************************************************/ void handle_user_commands(int sd) { #ifdef HAVE_LIBREADLINE /* A safer alternative char *line = (char *)malloc(256*sizeof(char)), */ char *line, *prompt = "dlpsh> "; #else char buf[256]; #endif printf("\nWelcome to the DLP Shell\n" "Type 'help' for additional information\n\n"); pi_watchdog(sd, TICKLE_INTERVAL); for (;;) { fflush(stdout); #ifdef HAVE_LIBREADLINE line = readline(prompt); if (line == NULL) /* user pressed ^d or so */ break; if (*line) /* skip blanks */ add_history(line); parse_command(sd, line); free(line); #else printf("dlpsh> "); if (fgets(buf, 256, stdin) == NULL) break; parse_command(sd, buf); #endif } printf("\n"); /* User must have pressed ^d or something */ parse_command(sd, "exit"); } /*********************************************************************** * * Function: exit_fn * * Summary: Exit the DLP shell and write a log entry on the Palm * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int exit_fn(int sd, int argc, const char *argv[]) { printf("Exiting.\n"); dlp_AddSyncLogEntry(sd, "dlpsh, the DLP Protocol Shell ended.\n\n" "Thank you for using pilot-link.\n"); dlp_EndOfSync(sd, 0); pi_close(sd); exit(0); } /*********************************************************************** * * Function: reopen_fn * * Summary: Reopen the connection. * * Parameters: None * * Returns: Nothing * ***********************************************************************/ int reopen_fn(int sd, int argc, const char *argv[]) { printf("Reopening.\n"); dlp_AddSyncLogEntry(sd, "dlpsh, the DLP Protocol Shell ended.\n\n" "Thank you for using pilot-link.\n"); dlp_EndOfSync(sd, 0); pi_close(sd); sleep (2); longjmp (main_jmp, 1); } /*********************************************************************** * * Function: strtoke * * Summary: Strip out path delimiters in arguments and filenames * * Parameters: None * * Returns: Input string minus path delimiters (ala basepath) * ***********************************************************************/ char *strtoke(char *str, const char *ws, const char *delim) { int inc; static char *s = NULL, *start; if (str != NULL) { s = str; } inc = strspn(s, ws); s += inc; start = s; if (*s == '\0') { return NULL; } else if (strchr(delim, *s) != NULL) { start++; s = strchr(s + 1, *s); *s = '\0'; s++; } else { inc = strcspn(s, ws); if (s[inc] == '\0') { s += inc; } else { s[inc] = '\0'; s += inc + 1; } } return start; } int main(int argc, const char *argv[]) { int c = -1, sd = -1; char *cmd = NULL; poptContext po; enum { mode_none=0, mode_interactive=257, mode_command } run_mode = mode_none; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"command", 'c', POPT_ARG_STRING, &cmd, mode_command, "Execute and exit immediately"}, {"interactive", 'i', POPT_ARG_NONE, NULL, mode_interactive, "Enter interactive mode."}, POPT_TABLEEND } ; po = poptGetContext("dlpsh", argc, argv, options, 0); poptSetOtherOptionHelp(po,"\n\n" " An interactive Desktop Link Protocol (DLP) Shell for your Palm device.\n" " dlpsh can query many different types of information from your Palm\n" " device, such as username, memory capacity, set the time, as well as\n" " other useful functions.\n\n" " While inside the dlpsh shell, type 'help' for more options.\n\n"); if (argc < 2) { poptPrintUsage(po,stderr,0); return 1; } while ((c = poptGetNextOpt(po)) >= 0) { switch(c) { case mode_command: case mode_interactive: if (run_mode == mode_none) { run_mode = c; } else { if (c != run_mode) { fprintf(stderr," ERROR: Specify exactly one of -c or -i\n"); return 1; } } break; default: fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } } if ( c < -1) { plu_badoption(po,c); } if (mode_none == run_mode) { fprintf(stderr," ERROR: Specify exactly one of -c or -i\n"); return 1; } setjmp (main_jmp); sd = plu_connect(); if (sd < 0) goto error; if (dlp_OpenConduit(sd) < 0) goto error_close; if (cmd != NULL) handle_single_command(sd, cmd); else handle_user_commands(sd); return 0; error_close: pi_close(sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-foto.c0000644000175000017500000012714611211745573020150 0ustar rousseaurousseau/* * $Id: pilot-foto.c,v 1.24 2006/10/12 14:21:21 desrod Exp $ * * pilot-foto.c: Palm 'Foto' Image Fetcher/Converter * * This is a palm conduit to fetch Foto files from a Palm. It can also * convert *.jpg.pdb files that have already been fetched from the Palm. * * Copyright (C) 2003 - 2004 by Judd Montgomery * * 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. * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include "popt.h" #include #include #include #include #include #include "pi-file.h" #include "pi-socket.h" #include "pi-foto.h" #include "pi-userland.h" /* Declare prototypes */ int get_jpg_info(FILE * in, char *type, unsigned short *version, int *height, int *width); int memcpy_tux_record(unsigned char *dest); int install_tux_with_name(int sd, char *name, int width, int height, long pdb_size, long mod_time, long file_time); #define SIZE_OF_TUX 3335 #ifndef TRUE # define TRUE 1 #endif #ifndef FALSE # define FALSE 0 #endif /*********************************************************************** * * Function: get_jpg_info * * Summary: gets information about a jpeg file * * Parameters: in - an open file that should be a jpeg * type - at least 5 chars that will get written the * 4 digit jpeg type and a null * version - high byte gets written version major, * low byte gets written version minor * height - height of jpeg * width - width of jpeg * * Returns: 0 on success, -1 if file is not a jpeg/exif file * ***********************************************************************/ int get_jpg_info(FILE * in, char *type, unsigned short *version, int *height, int *width) { unsigned short word; unsigned short word1, word2; char str[65536]; size_t len; unsigned char m1, m2; rewind(in); /* marker identifier, application use marker */ fread(&word, 2, 1, in); word1 = htons(word); fread(&word, 2, 1, in); word2 = htons(word); /* printf("start of image 0x%02x 0x%02x\n", str[0], str[1]); */ /* printf("application use marker 0x%02x 0x%02x\n", str[2], str[3]); */ if ((word1 != 0xFFD8) && (word2 != 0xFFE0)) { /* fprintf(stderr, "Not a jpeg file 1\n"); */ /* debug_fprintf(stderr, "%x\n", word1); */ rewind(in); return -1; /* ff1e */ } *height = *width = -1; /* length of application block */ fread(&word, 2, 1, in); len = htons(word); /* printf("len %d\n", len); */ if (len > 65535) { /* fprintf(stderr, "Not a jpeg file 2\n"); */ rewind(in); return -1; } fread(str, 5, 1, in); str[6] = '\0'; /* printf("%s\n", str); */ if (strncmp(str, "JFIF", 4) && strncmp(str, "Exif", 4) ) { /* fprintf(stderr, "Not a jpeg file 3\n"); */ rewind(in); return -1; } strncpy(type, str, 4); type[4] = '\0'; /* Version */ fread(&word, 2, 1, in); *version = htons(word); /* printf("version %d.%02d\n", ((*version)&0xFF00)>>8, (*version)&0xFF); */ fread(str, len - 9, 1, in); /* Units 1 byte * X and Y density, 1 byte each * X and Y thumbnail size, 2 bytes each */ while (!feof(in)) { /* marker identifier */ fread(&word, 2, 1, in); word1 = htons(word); m1 = (word1 & 0xFF00) >> 8; m2 = word1 & 0xFF; /* printf("marker 0x%02x 0x%02x\n", m1, m2); */ if ((m1 == 0xFF) && (m2 == 0xC0)) { /* The SOF0 marker (Start of Frame 0) */ /* length(2 bytes) and data precision(1 byte) */ fread(str, 3, 1, in); /* Height */ fread(&word, 2, 1, in); *height = htons(word); /* printf("height %d\n", *height); */ /* Width */ fread(&word, 2, 1, in); *width = htons(word); /* printf("width %d\n", *width); */ break; } fread(&word, 2, 1, in); len = htons(word); /* printf("len %d\n", len); */ if (len > 65535) { /* fprintf(stderr, "Not a jpeg file\n"); */ rewind(in); return -1; } fread(str, len - 2, 1, in); } rewind(in); return 0; } /*********************************************************************** * * Function: do_list * * Summary: lists jpeg files and thumbnails found on the handheld * * Parameters: sd - open connection to the handheld * * Returns: 0 on success, -1 if can't open PhotosDB-Foto * ***********************************************************************/ int do_list(int sd) { int ret; char jpg_name[255]; size_t jpg_name_size; size_t offset; int db; int index; recordid_t id_; int attr; int category; int start; struct DBInfo info; char creator[5]; char type[5]; struct pi_buffer_t *buffer; printf("Searching for photos\n"); start = 0; buffer = pi_buffer_new(0xffff); while (dlp_ReadDBList(sd, 0, dlpOpenRead, start, buffer) > 0) { memcpy(&info, buffer->data, sizeof(struct DBInfo)); start = info.index + 1; creator[0] = (info.creator & 0xFF000000) >> 24; creator[1] = (info.creator & 0x00FF0000) >> 16; creator[2] = (info.creator & 0x0000FF00) >> 8; creator[3] = (info.creator & 0x000000FF); creator[4] = '\0'; type[0] = (info.type & 0xFF000000) >> 24; type[1] = (info.type & 0x00FF0000) >> 16; type[2] = (info.type & 0x0000FF00) >> 8; type[3] = (info.type & 0x000000FF); type[4] = '\0'; if ((!strcmp(creator, "Foto")) && (!strcmp(type, "Foto")) && (info.flags & dlpDBFlagStream)) { printf("Photo '%s' (Creator ID '%s')\n", info.name, creator); } } printf("\nSearching for thumbnails\n"); ret = dlp_OpenDB(sd, 0, dlpOpenReadWrite, "PhotosDB-Foto", &db); if (ret < 0) { fprintf(stderr, "Unable to open PhotosDB-Foto\n"); pi_buffer_free(buffer); return -1; } for (index = 0; index < 65535; index++) { ret = dlp_ReadRecordByIndex(sd, db, index, buffer, &id_, &attr, &category); if (ret < 0) break; if (buffer->used < 40) continue; offset = ((buffer->data[38] << 8) | buffer->data[39]) + 40; jpg_name_size = buffer->used - offset; if (jpg_name_size >= sizeof(jpg_name)) jpg_name_size = sizeof(jpg_name) - 1; memcpy(jpg_name, buffer->data + offset, jpg_name_size); jpg_name[jpg_name_size] = '\0'; fprintf(stderr, "Thumbnail %s\n", jpg_name); } pi_buffer_free(buffer); dlp_CloseDB(sd, db); return 0; } /*********************************************************************** * * Function: do_delete * * Summary: deletes jpeg files and thumbnails found on the handheld * * Parameters: sd - open connection to the handheld * delete_files - an array of filenames to find and delete * all - if true then delete all images and thumbnails * * Returns: 0 on success, -1 if can't open PhotosDB-Foto * ***********************************************************************/ int do_delete(int sd, const char **delete_files, int all) { int i; int ret; char jpg_name[255]; int jpg_name_size; size_t offset; int db; int index; recordid_t id_; int attr; int category; char log_text[256]; struct pi_buffer_t *buffer; if ((!all) && (!delete_files)) return -1; /* printf("Searching photos\n"); */ ret = dlp_OpenDB(sd, 0, dlpOpenReadWrite, "PhotosDB-Foto", &db); if (ret < 0) { fprintf(stderr, "Unable to open PhotosDB-Foto\n"); return -1; } for (i = 0; delete_files[i]; i++) { ret = dlp_DeleteDB(sd, 0, delete_files[i]); if (ret < 0) { fprintf(stderr, "Unable to delete photo %s\n", delete_files[i]); } else { fprintf(stderr, "Deleted photo %s\n", delete_files[i]); sprintf(log_text, "Deleted %s\n", delete_files[i]); dlp_AddSyncLogEntry(sd, log_text); } } /* printf("Searching thumbnails\n"); */ if (all) { dlp_DeleteRecord(sd, db, 1, 0); printf("Deleted all thumbnails\n"); dlp_AddSyncLogEntry(sd, "Deleted all thumbnails\n"); } else { buffer = pi_buffer_new(0xffff); for (index = 0; index < 65535; index++) { ret = dlp_ReadRecordByIndex(sd, db, index, buffer, &id_, &attr, &category); if (ret < 0) break; if (buffer->used < 40) continue; offset = ((buffer->data[38] << 8) | buffer->data[39]) + 40; /* printf("offset = 0x%x\n", offset); */ jpg_name_size = buffer->used - offset; if (jpg_name_size > 255) jpg_name_size = 255; memcpy(jpg_name, buffer->data + offset, jpg_name_size); jpg_name[jpg_name_size] = '\0'; /* printf("found jpg named = %s\n", jpg_name); */ for (i = 0; delete_files[i]; i++) { if (!strcmp(jpg_name, delete_files[i])) { ret = dlp_DeleteRecord(sd, db, 0, id_); if (ret < 0) { fprintf(stderr, "Unable to delete thumbnail %s\n", delete_files[i]); } else { fprintf(stderr, "Deleted thumbnail %s\n", delete_files[i]); sprintf(log_text, "Deleted thumbnail %s\n", delete_files[i]); dlp_AddSyncLogEntry(sd, log_text); } /* need to decrement index because we just deleted one record */ index--; break; } } } pi_buffer_free(buffer); } dlp_ResetSyncFlags(sd, db); dlp_CleanUpDatabase(sd, db); dlp_CloseDB(sd, db); return 0; } /*********************************************************************** * * Function: do_fetch * * Summary: Fetch the files given, or all foto files * * Parameters: sd - open connection to the handheld * fetch_files - an array of filenames to find and fetch * all - if true then fetch all images and thumbnails * * Returns: 0 on success * ***********************************************************************/ int do_fetch(int sd, const char **fetch_files, int all) { FILE *out; recordid_t id_; int i; int found; int index, db, attr, category, ret, start; struct DBInfo info; char creator[5]; char type[5]; pi_buffer_t *buffer; if ((!all) && (!fetch_files)) return -1; start = 0; buffer = pi_buffer_new(65536); while (dlp_ReadDBList(sd, 0, dlpOpenRead, start, buffer) > 0) { memcpy(&info, buffer->data, sizeof(struct DBInfo)); start = info.index + 1; creator[0] = (info.creator & 0xFF000000) >> 24; creator[1] = (info.creator & 0x00FF0000) >> 16; creator[2] = (info.creator & 0x0000FF00) >> 8; creator[3] = (info.creator & 0x000000FF); creator[4] = '\0'; type[0] = (info.type & 0xFF000000) >> 24; type[1] = (info.type & 0x00FF0000) >> 16; type[2] = (info.type & 0x0000FF00) >> 8; type[3] = (info.type & 0x000000FF); type[4] = '\0'; if ((!strcmp(creator, "Foto")) && (!strcmp(type, "Foto")) && (info.flags & dlpDBFlagStream)) { if (!all) { /* Need to see if this is in the list */ found = 0; for (i = 0; fetch_files[i]; i++) { if (!strcmp(fetch_files[i], info.name)) { found = 1; break; } } if (!found) continue; } printf("Fetching '%s' (Creator ID '%s')...", info.name, creator); ret = dlp_OpenDB(sd, 0, dlpOpenRead, info.name, &db); if (ret < 0) { fprintf(stderr, "Unable to open %s\n", info.name); continue; } out = fopen(info.name, "wb"); if (!out) { fprintf(stderr, "Failed, unable to create file %s\n", info.name); dlp_CloseDB(sd, db); continue; } index = 0; do { ret = dlp_ReadRecordByIndex(sd, db, index, buffer, &id_, &attr, &category); index++; if (ret > 0 && buffer->used > 8) fwrite(buffer->data + 8, buffer->used - 8, 1, out); } while (ret > 0); dlp_CloseDB(sd, db); fclose(out); printf("OK\n"); } } pi_buffer_free(buffer); return 0; } /*********************************************************************** * * Function: install_tux_with_name * * Summary: Installs a generic thumbnail with the given name embedded * * Parameters: sd - open connection to the handheld * name - name of jpeg being installed * * Returns: 0 on sucess, -1 on failure * ***********************************************************************/ int install_tux_with_name(int sd, char *name, int width, int height, long pdb_size, long mod_time, long file_time) { int ret; int db; unsigned char *record; unsigned long new_id; int rec_len; /* unsigned int thumb_size; */ rec_len = SIZE_OF_TUX + strlen(name); record = malloc(rec_len + 4); memcpy_tux_record(record); memcpy(&record[SIZE_OF_TUX], name, strlen(name)); /* Length of filename needs to be here */ record[22] = (unsigned char) strlen(name); /* printf("rec_len = %d\n", rec_len); printf("tux = %d\n", SIZE_OF_TUX); printf("str = %d\n", strlen(name)); */ /* Here is where the image size is. */ set_short(record + FOTO_IMAGE_WIDTH, width); set_short(record + FOTO_IMAGE_HEIGHT, height); set_long(record + FOTO_IMAGE_SIZE, pdb_size); /* Dates */ set_long(record + FOTO_MODIFY_DATE, mod_time); set_long(record + FOTO_IMAGE_DATE, file_time); /* Name length */ set_byte(record + FOTO_NAME_LEN, strlen(name)); /* Here is where the thumbnail size is. We won't need to change that. thumb_size=SIZE_OF_TUX-40; record[38]=(unsigned char)((thumb_size & 0xFF00) >> 8); record[39]=(unsigned char)(thumb_size & 0x00FF); */ ret = dlp_OpenDB(sd, 0, dlpOpenReadWrite, "PhotosDB-Foto", &db); if (ret < 0) { fprintf(stderr, "Unable to open PhotosDB-Foto\n"); free(record); return -1; } ret = dlp_WriteRecord(sd, db, 0x00, 0, 0x00, record, rec_len, &new_id); free(record); if (ret < 0) { fprintf(stderr, "Could not write to Photos-DB-Foto\n"); fprintf(stderr, "WriteRecord returned %d\n", ret); return -1; } dlp_ResetSyncFlags(sd, db); dlp_CleanUpDatabase(sd, db); dlp_CloseDB(sd, db); return 0; } /*********************************************************************** * * Function: do_install * * Summary: Does some validation to determine if file is a jpeg * installs the image and then the thumbnail * * Parameters: sd - open connection to the handheld * install_files - an array of filenames to install * * Returns: 0 on sucess, -1 on failure * ***********************************************************************/ int do_install(int sd, const char **install_files) { int n, ret, i; const int max_photo_namelen = 30; struct pi_file *pf; struct DBInfo info; FILE *in; recordid_t uid; time_t ltime; unsigned char buf[0x1010]; char pdb_file[256]; char log_text[256]; char installed_name[max_photo_namelen]; struct stat sbuf; int width, height; char type[5]; unsigned short version; long pdb_size = 0; long mod_time; long file_time; time(<ime); info.more = 0x80; info.flags = dlpDBFlagStream; info.miscFlags = 0x40; info.version = 0; info.type = char4('F', 'o', 't', 'o'); info.creator = char4('F', 'o', 't', 'o'); info.modnum = 0; info.index = 0; info.createDate = ltime; info.modifyDate = ltime; info.backupDate = -2082816000; for (i = 0; install_files[i]; i++) { strncpy(installed_name, install_files[i], max_photo_namelen); installed_name[max_photo_namelen - 1] = '\0'; /* todo check maximum file name length */ if (strlen(install_files[i]) > max_photo_namelen - 5) { strcpy(&installed_name[max_photo_namelen - 5], ".jpg"); printf("%s being truncated to %s: ", install_files[i], installed_name); } strcpy(info.name, installed_name); printf(" Installing file %s\n", installed_name); fflush(stdout); /* Open jpg file */ in = fopen(install_files[i], "r"); if (!in) { fprintf(stderr, "Could not open %s for read\n", install_files[i]); continue; } /* See if its a jpeg file */ ret = get_jpg_info(in, type, &version, &height, &width); rewind(in); if (!ret) { /* printf("%s: ", install_files[i]); */ printf(" File format: %s, ", type); printf("version %d.%02d\n", (version & 0xFF00) >> 8, version & 0xFF); printf(" Image dimensions (width x height): %d x %d", width, height); } else { printf("%s does not appear to be a jpeg file\n", install_files[i]); continue; } strncpy(pdb_file, installed_name, 255); /* pdb_file[255 - 5]='\0'; */ strcat(pdb_file, ".pdb"); pf = pi_file_create(pdb_file, &info); if (!pf) { fprintf(stderr, "Could not open %s for write\n", pdb_file); dlp_EndOfSync(sd, dlpEndCodeNormal); return -1; } uid = 0x883001; memcpy(buf, "DBLK\0\0", 6); while (!feof(in)) { n = fread(buf + 8, 1, 0x1000, in); buf[6] = (n & 0xFF00) >> 8; buf[7] = n & 0xFF; pi_file_append_record(pf, buf, n + 8, 0x40, 0, uid); uid++; } pi_file_close(pf); fclose(in); pf = pi_file_open(pdb_file); if (!pf) { fprintf(stderr, "Could not open %s\n", pdb_file); exit(-1); } ret = pi_file_install(pf, sd, 0, NULL); if (stat(pdb_file, &sbuf) == 0) { pdb_size = sbuf.st_size; } printf(" Installed size: %ld bytes...", pdb_size); pi_file_close(pf); fflush(stdout); if (ret < 0) { fprintf(stderr, "Could not install %s\n", pdb_file); return -1; } mod_time = unix_time_to_pilot_time(ltime); file_time = mod_time; /* XXX just use current time for now */ ret = install_tux_with_name(sd, installed_name, width, height, pdb_size, mod_time, file_time); if (ret < 0) { fprintf(stderr, "Could not install thumbnail for %s\n", pdb_file); /* FIXME remove the pdb file; */ return -1; } printf(" Ok.\n"); sprintf(log_text, "Photo %s installed on Palm\n", installed_name); dlp_AddSyncLogEntry(sd, log_text); } return 0; } /*********************************************************************** * * Function: pdb_to_jpg * * Summary: Converts a jpg.pdb file (palm stream format) to a jpg * * Parameters: filename - filename to be converted * * Returns: 0 on sucess, -1 on failure * ***********************************************************************/ int pdb_to_jpg(const char *filename) { struct pi_file *pi_fp; struct DBInfo info; FILE *out; int index; int ret; void *Pbuf; size_t size; int total_size; int attr; int cat; recordid_t uid; printf("converting %s...", filename); pi_fp = pi_file_open(filename); if (!pi_fp) { printf("FAILED: could not open %s\n", filename); return -1; } pi_file_get_info(pi_fp, &info); out = fopen(info.name, "w"); if (!out) { printf("FAILED: could not open %s to write\n", info.name); return -1; } index = 0; total_size = 0; ret = 1; while (ret >= 0) { ret = pi_file_read_record(pi_fp, index, &Pbuf, &size, &attr, &cat, &uid); index++; if ((ret >= 0) && (size > 8)) { fwrite(((char *) Pbuf) + 8, size - 8, 1, out); total_size += size - 8; } } fclose(out); printf("OK, wrote %d bytes to %s\n", total_size, info.name); return 0; } /*********************************************************************** * * Function: main * * Summary: Entry point to program * * Parameters: argc, argv * * Returns: Exit 0 on sucess, -1 on failure * ***********************************************************************/ int main(int argc, const char *argv[]) { int c; int sd = 0; poptContext po; const char **args = NULL; enum { mode_none, mode_delete = 'd', mode_delete_all = 'D', mode_install = 'i', mode_list = 'l', mode_fetch = 'f', mode_fetch_all = 'F', mode_convert = 'c' } mode = mode_none; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"delete", 'd', POPT_ARG_NONE, NULL, 'd', "Delete a jpg file on the handheld"}, {"delete-all", 0, POPT_ARG_NONE, NULL, 'D', "Delete ALL jpg files on the handheld"}, {"install", 'i', POPT_ARG_NONE, NULL, 'i', "Install a jpg file"}, {"list", 'l', POPT_ARG_NONE, NULL, 'l', "List all photos and thumbnails"}, {"fetch", 'f', POPT_ARG_NONE, NULL, 'f', "Fetch files from the Palm"}, {"fetch-all", 'F', POPT_ARG_NONE, NULL, 'F', "Fetch ALL jpg files from the Palm"}, {"convert", 'c', POPT_ARG_NONE, NULL, 'c', "convert [file].jpg.pdb files to jpg"}, POPT_TABLEEND }; po = poptGetContext("pilot-foto", argc, argv, options, 0); poptSetOtherOptionHelp(po, "\n\n" " Installs and Fetches Palm 'Foto' Image files\n" " Converts Palm 'Foto' (*.jpg.pdb) Image files to jpg\n\n" " Example arguments: \n" " -p /dev/pilot -f\n" " -i MyImage.jpg\n" " -i *.jpg\n" " -f MyImage\n" " -c MyImage.jpg.pdb\n\n"); if (argc < 2) { poptPrintUsage(po, stderr, 0); return 1; } while ((c = poptGetNextOpt(po)) >= 0) { switch (c) { case 'd': case 'D': case 'i': case 'l': case 'f': case 'F': case 'c': if (mode != mode_none) { fprintf(stderr, " ERROR: Specify only one mode (delete, install, list, fetch, convert).\n"); return 1; } mode = c; break; default: fprintf(stderr, " ERROR: Unhandled option %d.\n", c); return 1; } } if (c < -1) { plu_badoption(po, c); } args = poptGetArgs(po); switch (mode) { case mode_none: fprintf(stderr, " ERROR: Specify a mode (delete, install, list, fetch, convert).\n"); return 1; case mode_convert: while (args != NULL && *args) { pdb_to_jpg(*args++); } return 0; default: /* The rest all need a connect to the pilot */ break; } sd = plu_connect(); if (sd < 0) { return 1; } switch (mode) { case mode_none: case mode_convert: /* impossible */ break; case mode_delete_all: if (args != NULL && *args) { /* It's an error here to protect users from an accidental --delete vs. * --delete-all confusion. The other -all actions don't destroy data. */ fprintf(stderr, " ERROR: With --delete-all, do not specify files.\n"); pi_close(sd); return 1; } do_delete(sd, NULL, 1); break; case mode_list: if (args != NULL && *args) { fprintf(stderr, " WARNING: With --list, do not specify files.\n"); } do_list(sd); break; case mode_fetch_all: if (args != NULL && *args) { fprintf(stderr, " WARNING: With --fetch-all, do not specify files.\n"); } do_fetch(sd, NULL, 1); break; case mode_delete: do_delete(sd, args, 0); break; case mode_fetch: do_fetch(sd, args, 0); break; case mode_install: do_install(sd, args); break; } if (sd) { dlp_EndOfSync(sd, dlpEndCodeNormal); pi_close(sd); } return 0; } /* A thumbnail image formatted to be installed * The first 40 bytes are header info * The 39th and 40th bytes of the header are the length (n) of the thumbnail * to follow. * The following n bytes are a standard jpg formatted picture * After that is the name of the image. The number of characters can be * determined from the palm record size - (n + 40 byte header) * i.e. thumbnail image is 1000 bytes and palm record is 1050. That would * mean the filename is 10 bytes long. */ int memcpy_tux_record(unsigned char *dest) { unsigned char tux[] = { 0x00, 0x00, 0x00, 0x05, 0x00, 0x64, 0x00, 0x84, 0xbc, 0x1e, 0x3b, 0xcc, 0x00, 0x00, 0x1a, 0xe6, 0x3f, 0x54, 0x10, 0x01, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x1e, 0x30, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xdf, 0xff, 0xd8, 0xff, 0xdb, 0x00, 0x43, 0x00, 0x05, 0x03, 0x04, 0x04, 0x04, 0x03, 0x05, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x06, 0x07, 0x0c, 0x08, 0x07, 0x07, 0x07, 0x07, 0x0f, 0x0b, 0x0b, 0x09, 0x0c, 0x11, 0x0f, 0x12, 0x12, 0x11, 0x0f, 0x11, 0x11, 0x13, 0x16, 0x1c, 0x17, 0x13, 0x14, 0x1a, 0x15, 0x11, 0x11, 0x18, 0x21, 0x18, 0x1a, 0x1d, 0x1d, 0x1f, 0x1f, 0x1f, 0x13, 0x17, 0x22, 0x24, 0x22, 0x1e, 0x24, 0x1c, 0x1e, 0x1f, 0x1e, 0xff, 0xdb, 0x00, 0x43, 0x01, 0x05, 0x05, 0x05, 0x07, 0x06, 0x07, 0x0e, 0x08, 0x08, 0x0e, 0x1e, 0x14, 0x11, 0x14, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0xff, 0xc0, 0x00, 0x11, 0x08, 0x00, 0x54, 0x00, 0x3f, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xff, 0xc4, 0x00, 0x1f, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0xff, 0xc4, 0x00, 0xb5, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7d, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xff, 0xc4, 0x00, 0x1f, 0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0xff, 0xc4, 0x00, 0xb5, 0x11, 0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00, 0xf9, 0xe6, 0x8a, 0x28, 0xaf, 0x9d, 0x35, 0x11, 0x8e, 0x14, 0x9f, 0x6a, 0xe9, 0xf4, 0x6f, 0x0e, 0x46, 0x60, 0x2f, 0xa9, 0xa3, 0x33, 0xb8, 0x2a, 0x21, 0x56, 0x23, 0x67, 0xcc, 0x79, 0xdc, 0xa7, 0x27, 0x20, 0x02, 0x31, 0x8c, 0x64, 0xfd, 0x6b, 0x1f, 0x41, 0xb3, 0x92, 0xf3, 0x56, 0xb7, 0x54, 0x6d, 0xa9, 0x13, 0x89, 0x64, 0x39, 0xc1, 0xc2, 0x9c, 0x8f, 0xcd, 0xb6, 0x8f, 0xa1, 0x35, 0xea, 0x5e, 0x0b, 0xf0, 0xdd, 0xe7, 0x8b, 0xfc, 0x5b, 0xa4, 0xf8, 0x6e, 0xcc, 0x3a, 0x2d, 0xed, 0xc0, 0x4b, 0xa9, 0x91, 0x82, 0xb4, 0x16, 0xe0, 0x16, 0x96, 0x45, 0x24, 0x1f, 0x9c, 0x22, 0x90, 0xb9, 0x04, 0x6f, 0x65, 0xcf, 0x19, 0xaf, 0x4b, 0x05, 0x46, 0x2e, 0x3c, 0xf2, 0x33, 0x93, 0xd6, 0xc7, 0x03, 0x7f, 0xa3, 0xe8, 0x51, 0xc1, 0x22, 0xdb, 0xea, 0x16, 0xf6, 0x52, 0x40, 0xe0, 0xca, 0x66, 0xba, 0xde, 0x06, 0x7f, 0x85, 0x83, 0xb6, 0x46, 0x7b, 0x60, 0x8e, 0x4f, 0x7e, 0x95, 0xce, 0xb2, 0xb2, 0xbb, 0xc6, 0xea, 0x55, 0xe3, 0x62, 0x8e, 0xa4, 0x82, 0x55, 0x81, 0xc1, 0x04, 0x8c, 0x82, 0x41, 0x04, 0x71, 0xe9, 0x5f, 0xa6, 0x7a, 0x17, 0x84, 0xfc, 0x37, 0xa1, 0xf8, 0x5d, 0x3c, 0x35, 0xa7, 0xe8, 0xf6, 0x89, 0xa5, 0x79, 0x7e, 0x5c, 0xb6, 0xef, 0x12, 0xba, 0xcf, 0x95, 0x0a, 0xcd, 0x2e, 0x47, 0xef, 0x19, 0xb1, 0xf3, 0x33, 0x64, 0xb7, 0x24, 0x93, 0x9a, 0xf9, 0x17, 0xe3, 0xaf, 0xc3, 0x7f, 0x04, 0x68, 0x1f, 0x05, 0xfc, 0x19, 0xe3, 0x2f, 0x0c, 0xc7, 0x71, 0x0d, 0xd5, 0xf2, 0xc1, 0x1b, 0x13, 0x33, 0x32, 0xdd, 0x45, 0x3c, 0x4f, 0x3f, 0x9a, 0xe1, 0xb2, 0x7c, 0xc0, 0x40, 0x1b, 0x81, 0x1c, 0x36, 0x0e, 0x70, 0xb8, 0xbc, 0x5d, 0x18, 0xca, 0x3c, 0xeb, 0x74, 0x11, 0x67, 0x83, 0x51, 0x45, 0x15, 0xe5, 0x1a, 0x05, 0x14, 0x52, 0x12, 0x00, 0x24, 0x90, 0x00, 0xea, 0x4f, 0x6a, 0x00, 0xdb, 0xf0, 0x82, 0xbc, 0x57, 0x57, 0x57, 0xf3, 0x31, 0x8a, 0xd2, 0x08, 0x08, 0x76, 0x23, 0x86, 0x24, 0xe4, 0x9f, 0xf8, 0x08, 0x5f, 0xfc, 0x7a, 0xbe, 0x9d, 0xf8, 0x33, 0xe1, 0x3f, 0x15, 0xf8, 0x17, 0xc5, 0xb0, 0xf8, 0x83, 0x52, 0xd3, 0xad, 0x2e, 0xd2, 0x6b, 0x36, 0x81, 0xec, 0xed, 0x2f, 0x94, 0xdd, 0x22, 0xbb, 0x29, 0x24, 0x89, 0x15, 0x23, 0x3b, 0x4a, 0xa6, 0xec, 0x49, 0x81, 0x93, 0x8d, 0xd8, 0x1b, 0xbe, 0x7b, 0xd1, 0x74, 0xf1, 0x69, 0xa1, 0x98, 0x2e, 0xd3, 0x06, 0x60, 0xcd, 0x3a, 0x16, 0xdc, 0x06, 0xe1, 0x8c, 0x7a, 0x7d, 0xdc, 0x74, 0xef, 0x9e, 0x4d, 0x7d, 0x47, 0x67, 0x63, 0x2f, 0x88, 0xae, 0x94, 0x6b, 0x52, 0xea, 0x7e, 0x19, 0xf1, 0xae, 0x93, 0x14, 0x5f, 0xda, 0x09, 0x61, 0x78, 0x5b, 0xcb, 0x57, 0xdc, 0x53, 0x96, 0x53, 0x0c, 0xb1, 0x49, 0xb0, 0xb7, 0xdd, 0x38, 0x20, 0x83, 0x86, 0x56, 0xae, 0x3e, 0x22, 0xcc, 0x71, 0x99, 0x56, 0x1e, 0x95, 0x4a, 0x16, 0x51, 0xd7, 0x99, 0xb5, 0x7b, 0x6d, 0x6b, 0xf5, 0xb3, 0xee, 0x8d, 0x70, 0xb4, 0xa1, 0x5a, 0x4d, 0x4b, 0x7e, 0x85, 0x8f, 0x1b, 0x78, 0xbb, 0xc7, 0xbe, 0x2d, 0x9a, 0xf3, 0x40, 0xf0, 0x9e, 0x93, 0x7d, 0xa0, 0x9b, 0x77, 0x2c, 0x9a, 0xb4, 0x97, 0x12, 0x5b, 0xa3, 0xa9, 0x57, 0x43, 0x1c, 0x82, 0x5b, 0x6c, 0xee, 0xc1, 0xdc, 0xad, 0x0f, 0x9a, 0xa1, 0xd5, 0x49, 0x25, 0x46, 0x1b, 0xc4, 0x7f, 0x68, 0x4d, 0x3b, 0xe2, 0x1f, 0x88, 0xb5, 0xad, 0x07, 0x4b, 0x7f, 0x0b, 0xf8, 0x86, 0xea, 0xcf, 0x43, 0xd3, 0x63, 0xb0, 0x82, 0x68, 0x62, 0x17, 0x31, 0xdd, 0x48, 0x36, 0x89, 0x2e, 0x4f, 0x92, 0xbb, 0x63, 0x2e, 0x42, 0x8d, 0xad, 0xd0, 0x20, 0x38, 0x5c, 0x91, 0x5e, 0x8f, 0xf1, 0x8b, 0xe2, 0x4d, 0xe7, 0xc3, 0xcb, 0x58, 0x74, 0xeb, 0x6d, 0x56, 0xcf, 0x51, 0xd6, 0xee, 0x21, 0x32, 0xc1, 0x15, 0xd6, 0x9f, 0x95, 0x09, 0xb8, 0x8d, 0xf2, 0xb4, 0x72, 0x26, 0xd0, 0x4a, 0xb0, 0x1b, 0x57, 0xaa, 0x9e, 0x31, 0x55, 0x3c, 0x09, 0xfb, 0x40, 0xf8, 0x5f, 0x55, 0x8e, 0x48, 0xbc, 0x4e, 0x87, 0xc3, 0xf7, 0x08, 0x06, 0xd9, 0x4b, 0x34, 0xb0, 0x49, 0xc0, 0xcf, 0xcc, 0x17, 0x28, 0x73, 0x9e, 0x08, 0xc0, 0x00, 0x1d, 0xdd, 0x87, 0xce, 0xac, 0xff, 0x00, 0x3c, 0xa9, 0x47, 0xeb, 0x10, 0xa4, 0xa7, 0x4d, 0xf6, 0xbd, 0xfd, 0x7a, 0x36, 0xbd, 0x17, 0xf9, 0x9d, 0x2f, 0x0f, 0x87, 0x52, 0xe5, 0x6e, 0xcc, 0xf1, 0x8d, 0x4f, 0xe0, 0x9f, 0xc4, 0x8b, 0x0d, 0x18, 0xea, 0x52, 0x68, 0x3e, 0x76, 0xd3, 0xf3, 0xdb, 0xdb, 0xdc, 0x47, 0x2c, 0xca, 0x39, 0xe7, 0x6a, 0x93, 0xbb, 0xa0, 0xe1, 0x49, 0x3c, 0x8e, 0x3a, 0xe3, 0xce, 0xd8, 0x15, 0x62, 0xac, 0x08, 0x65, 0x38, 0x60, 0x46, 0x08, 0x3e, 0x86, 0xbf, 0x42, 0xb4, 0xeb, 0xdb, 0x3d, 0x4a, 0xca, 0x2b, 0xfd, 0x3e, 0xf2, 0x0b, 0xcb, 0x59, 0x46, 0x63, 0x9e, 0xde, 0x55, 0x91, 0x18, 0x7b, 0x32, 0x92, 0x0f, 0x4f, 0xd2, 0xbc, 0x03, 0xf6, 0x9d, 0xf8, 0x67, 0x68, 0xb6, 0x72, 0x78, 0xe3, 0x43, 0x86, 0x2b, 0x69, 0x56, 0x50, 0x35, 0x58, 0x14, 0x6d, 0x59, 0x77, 0xb0, 0x02, 0x75, 0x1d, 0x37, 0xee, 0x20, 0x30, 0x03, 0xe6, 0xdd, 0xbb, 0x82, 0x09, 0x6e, 0x7c, 0x9f, 0x8a, 0xa7, 0x88, 0xc4, 0x7d, 0x5f, 0x17, 0x15, 0x16, 0xf6, 0xdd, 0x6b, 0xd9, 0xa7, 0xf8, 0x0e, 0xbe, 0x0d, 0x46, 0x3c, 0xd0, 0x77, 0x3e, 0x72, 0x3c, 0x0a, 0xd9, 0xf0, 0xae, 0x9f, 0x1d, 0xed, 0xdb, 0x5c, 0x4c, 0xbb, 0xa2, 0xb6, 0x70, 0x54, 0x60, 0x10, 0xef, 0xd4, 0x67, 0xfd, 0xde, 0x0e, 0x38, 0xea, 0xbd, 0xb2, 0x0e, 0x4c, 0x31, 0xb4, 0xd3, 0x24, 0x29, 0x8d, 0xf2, 0x30, 0x45, 0xcf, 0xa9, 0x38, 0x1f, 0x85, 0x7a, 0x0d, 0x85, 0xb4, 0x76, 0x76, 0x71, 0x5b, 0x45, 0x82, 0xa8, 0xa0, 0x16, 0x0a, 0x06, 0xe3, 0xdd, 0xb0, 0x3b, 0x9a, 0xfd, 0x13, 0x05, 0x47, 0x9a, 0x5c, 0xef, 0xa1, 0xe6, 0xcd, 0x8b, 0x79, 0x69, 0x3d, 0xf5, 0xa4, 0xd6, 0x56, 0x89, 0xbe, 0xe2, 0xe2, 0x36, 0x8a, 0x25, 0xfe, 0xf3, 0x30, 0x20, 0x0f, 0xcc, 0xd7, 0xdd, 0x1e, 0x31, 0xf0, 0xdc, 0xfa, 0xc0, 0x82, 0xff, 0x00, 0x4c, 0xbf, 0x16, 0x1a, 0xbd, 0xa4, 0x72, 0x25, 0xb4, 0xb2, 0xc6, 0x65, 0x81, 0xd5, 0xf6, 0x96, 0x49, 0x62, 0x0c, 0xbb, 0x97, 0x28, 0x84, 0x15, 0x65, 0x70, 0x57, 0x86, 0x01, 0x9d, 0x5b, 0xe4, 0x0f, 0x84, 0x1a, 0x2e, 0xa5, 0xaf, 0xfc, 0x4a, 0xd0, 0x6c, 0xac, 0x14, 0x30, 0xb5, 0xd5, 0x63, 0xbc, 0xbb, 0x73, 0x83, 0xe5, 0xdb, 0xc5, 0x28, 0x98, 0xe4, 0x1e, 0xb9, 0x01, 0x63, 0xe3, 0xfb, 0xe3, 0xad, 0x7d, 0xaa, 0xfa, 0xbe, 0x94, 0xba, 0xda, 0x68, 0x2d, 0x7d, 0x07, 0xf6, 0x9c, 0x96, 0xcf, 0x74, 0xb6, 0x9b, 0xb3, 0x27, 0x92, 0xac, 0xa8, 0xce, 0x47, 0x65, 0xdc, 0xea, 0x32, 0x7a, 0x93, 0xc7, 0x43, 0x5d, 0xf8, 0x8a, 0x14, 0xf1, 0x14, 0xdd, 0x2a, 0xb1, 0x4e, 0x2f, 0x74, 0xc9, 0x84, 0x9c, 0x5d, 0xd1, 0xf0, 0xef, 0xed, 0x71, 0xa4, 0x41, 0xa3, 0xfc, 0x54, 0x8a, 0x24, 0x9e, 0x6b, 0x9b, 0xa9, 0xb4, 0xd8, 0xa6, 0xbc, 0x9e, 0x46, 0x3f, 0xbc, 0x94, 0xbc, 0x9f, 0x75, 0x72, 0x44, 0x68, 0x14, 0x22, 0xaa, 0x8e, 0x81, 0x41, 0x25, 0x98, 0xb3, 0x1f, 0x1e, 0x3d, 0x2b, 0xdf, 0x3f, 0x6e, 0x3b, 0x4b, 0xcf, 0xf8, 0x5b, 0x76, 0x77, 0x91, 0x5a, 0x16, 0xb4, 0x4d, 0x0a, 0xdc, 0xcb, 0x22, 0x0e, 0x77, 0x19, 0xee, 0x46, 0x70, 0x39, 0x61, 0x85, 0x50, 0x7d, 0x38, 0xed, 0x9c, 0x79, 0xa7, 0xc1, 0xcf, 0x0e, 0x41, 0xe2, 0x6f, 0x1e, 0x59, 0x59, 0xdf, 0x5b, 0xc9, 0x75, 0xa7, 0xdb, 0x83, 0x73, 0x79, 0x14, 0x7c, 0x79, 0x88, 0xb8, 0xdb, 0x19, 0x23, 0x95, 0x0f, 0x23, 0x47, 0x1e, 0xee, 0xde, 0x66, 0x6b, 0xc9, 0xa9, 0x86, 0x54, 0xe6, 0xa1, 0x05, 0x65, 0xd0, 0xa9, 0x4e, 0xd1, 0x72, 0x93, 0x38, 0xe0, 0x17, 0xcc, 0x49, 0x31, 0xb9, 0xa3, 0x60, 0xcb, 0x90, 0x0e, 0xd2, 0x3b, 0x8f, 0x7f, 0x7a, 0xde, 0x9f, 0xc6, 0x5e, 0x2b, 0x9f, 0xc3, 0x37, 0x9e, 0x1c, 0x9b, 0x5f, 0xbe, 0xb8, 0xd2, 0xee, 0xf6, 0x79, 0x90, 0x5c, 0xb0, 0x9d, 0x57, 0x63, 0x87, 0x50, 0x82, 0x40, 0xdb, 0x00, 0x20, 0x70, 0xb8, 0x1c, 0x0f, 0x6a, 0xfb, 0x2a, 0x5f, 0x03, 0x68, 0x4d, 0x6f, 0xba, 0xe6, 0x3d, 0x5b, 0x52, 0x9d, 0x53, 0x3b, 0x5b, 0x57, 0xb9, 0x5f, 0x39, 0xc7, 0x60, 0x82, 0x40, 0x8b, 0x93, 0xd1, 0x54, 0x05, 0x19, 0xc0, 0x00, 0x71, 0x5f, 0x35, 0x7e, 0xd2, 0x56, 0xde, 0x1f, 0xd2, 0xfc, 0x61, 0x6b, 0xa1, 0x68, 0xda, 0x55, 0x96, 0x9f, 0x75, 0xa7, 0x59, 0xc5, 0x15, 0xf2, 0x5a, 0x5b, 0x79, 0x29, 0xe6, 0x15, 0x07, 0x07, 0x8c, 0xc8, 0xd9, 0x2c, 0xde, 0x69, 0x24, 0xb0, 0x75, 0x07, 0x95, 0x24, 0x95, 0xb0, 0x90, 0x71, 0xe6, 0x96, 0xb6, 0x6b, 0x75, 0xd4, 0xe2, 0xc1, 0x66, 0x51, 0xc5, 0x36, 0xa0, 0x9a, 0xb1, 0xc4, 0x78, 0x3a, 0xd1, 0x66, 0xd4, 0x5e, 0xe4, 0xbb, 0x03, 0x6e, 0x38, 0x41, 0xdc, 0xb0, 0x20, 0x7e, 0x18, 0xdd, 0xf8, 0xe2, 0xba, 0xa9, 0x2e, 0x21, 0x8e, 0xdb, 0xed, 0x32, 0x49, 0x1a, 0xc3, 0x80, 0x7c, 0xc6, 0x7c, 0x2e, 0x0f, 0x4e, 0x4d, 0x66, 0xf8, 0x4a, 0x00, 0xba, 0x4c, 0x22, 0x15, 0x92, 0x69, 0x6e, 0x24, 0x38, 0x48, 0xc1, 0x76, 0x67, 0x2d, 0xb1, 0x51, 0x54, 0x64, 0x92, 0x48, 0x00, 0x01, 0xc9, 0x27, 0x18, 0xc9, 0xaf, 0x62, 0xfd, 0x9e, 0x7c, 0x13, 0xa9, 0x43, 0xe2, 0xab, 0xaf, 0x11, 0xea, 0xba, 0x7e, 0xa7, 0x65, 0x6f, 0x64, 0x24, 0x36, 0x09, 0x7f, 0x6d, 0x25, 0xb3, 0x89, 0xe6, 0x18, 0x90, 0xaa, 0x3a, 0xab, 0x10, 0xaa, 0x5f, 0x07, 0x18, 0xcc, 0xc4, 0x03, 0xf2, 0xf1, 0x58, 0xfc, 0xca, 0x8e, 0x51, 0x81, 0x75, 0xaa, 0x5a, 0xe9, 0x5d, 0x2b, 0xd9, 0xb6, 0xfa, 0x1d, 0xf4, 0xe9, 0x3a, 0xb5, 0x39, 0x51, 0x9f, 0xf0, 0x07, 0xc5, 0x7e, 0x0e, 0xf8, 0x7b, 0xe2, 0x5f, 0x10, 0xf8, 0x87, 0x5e, 0xb4, 0xd7, 0x26, 0xbf, 0xbb, 0xb0, 0xc5, 0xac, 0xd6, 0xd0, 0x99, 0xe2, 0x65, 0x52, 0xbb, 0xa0, 0x44, 0x5e, 0x52, 0x47, 0x2b, 0x11, 0xdc, 0xdf, 0x21, 0x08, 0x32, 0xcb, 0x8f, 0x99, 0xff, 0x00, 0x10, 0x7e, 0x2c, 0xeb, 0xbe, 0x21, 0xf1, 0x59, 0xd6, 0xad, 0x2d, 0xec, 0x74, 0x4b, 0x5b, 0x17, 0x49, 0x2c, 0x19, 0x63, 0xcd, 0xd0, 0xf2, 0xd9, 0x59, 0x5e, 0x69, 0x09, 0x2a, 0x58, 0x62, 0x45, 0x01, 0x46, 0x15, 0x27, 0x99, 0x32, 0xe1, 0xd8, 0x9b, 0x7e, 0x3b, 0xf8, 0x59, 0xaf, 0x0f, 0x1c, 0x4c, 0xbe, 0x14, 0xd0, 0xe2, 0x7d, 0x1a, 0xf5, 0xd6, 0x65, 0x71, 0x3c, 0x71, 0x43, 0x66, 0xec, 0x7f, 0x7a, 0x18, 0x33, 0xef, 0x23, 0x76, 0x64, 0xf9, 0x10, 0x8c, 0x38, 0x50, 0x3e, 0x5a, 0xd8, 0xf8, 0x55, 0xf0, 0x7f, 0x50, 0xbe, 0xf8, 0x95, 0x71, 0x26, 0xa9, 0x30, 0x5d, 0x1b, 0xc3, 0x5a, 0x85, 0xbc, 0x9e, 0x6c, 0x78, 0x1f, 0xda, 0x13, 0x88, 0x92, 0x74, 0x8c, 0x2e, 0x72, 0xa8, 0x85, 0xe3, 0x2c, 0x4f, 0xde, 0x23, 0x68, 0xc8, 0x2c, 0x45, 0xe5, 0xb9, 0xe6, 0x0b, 0x30, 0x51, 0x54, 0x66, 0x9c, 0x9a, 0xe6, 0xe5, 0xea, 0xbb, 0xdf, 0xd1, 0xb0, 0xa9, 0x42, 0x74, 0xfe, 0x24, 0x72, 0x5f, 0x11, 0x3c, 0x63, 0xad, 0xfc, 0x43, 0xf0, 0xe6, 0x87, 0xe2, 0x0b, 0xdb, 0x5d, 0x34, 0x4d, 0xa6, 0x5e, 0xdc, 0xe9, 0xf7, 0xe6, 0xc5, 0x8b, 0x6f, 0x8a, 0x64, 0x49, 0x6d, 0x67, 0x60, 0x7e, 0xea, 0x93, 0x0d, 0xc4, 0x64, 0x64, 0x8d, 0xf9, 0xc7, 0xde, 0xc0, 0xe8, 0xbe, 0x06, 0xf8, 0x5b, 0x43, 0x3e, 0x14, 0xd5, 0xbc, 0x47, 0xe7, 0x45, 0xa4, 0xdf, 0xc9, 0x78, 0x63, 0x92, 0x7f, 0xb7, 0x7d, 0x8d, 0xa4, 0xb7, 0x44, 0x2d, 0xc1, 0x05, 0x49, 0x0d, 0x27, 0x99, 0xb8, 0x96, 0x00, 0x9b, 0x71, 0xfd, 0xc3, 0x8e, 0xbb, 0xe3, 0x1f, 0x83, 0xfc, 0x5b, 0x6d, 0xe1, 0xfd, 0x77, 0xc3, 0x5e, 0x1b, 0xd3, 0xc5, 0xed, 0xa6, 0xa9, 0x6c, 0x92, 0xd9, 0xcd, 0x6f, 0x6a, 0x54, 0xdb, 0x2d, 0x9e, 0xfb, 0x88, 0x6d, 0x8a, 0xc6, 0x36, 0x90, 0x0c, 0x29, 0x00, 0x66, 0x2a, 0xce, 0xb7, 0x31, 0x81, 0x93, 0x03, 0x17, 0xf2, 0x6f, 0x80, 0xfe, 0x3f, 0xf1, 0x8e, 0xaa, 0xcb, 0xf0, 0xf6, 0x1d, 0x07, 0x49, 0xd7, 0x34, 0x29, 0x83, 0xcb, 0x3c, 0x17, 0x9b, 0x90, 0x5b, 0xa3, 0x3e, 0xf7, 0x7f, 0x31, 0x7f, 0x83, 0x79, 0xc8, 0x52, 0x18, 0x96, 0x20, 0x06, 0xc6, 0x00, 0xee, 0xc4, 0xe2, 0x68, 0xe1, 0xe0, 0xe5, 0x5a, 0x56, 0x8a, 0xea, 0x73, 0x4e, 0x8b, 0xad, 0x1e, 0x45, 0xd4, 0xea, 0xfe, 0x23, 0x78, 0x8f, 0xc5, 0x1e, 0x17, 0xd4, 0xec, 0x2d, 0xa0, 0x87, 0x59, 0xb5, 0xb9, 0x8a, 0x7f, 0xb4, 0xf9, 0x3a, 0xb4, 0xd1, 0x5c, 0x5b, 0xba, 0x85, 0x65, 0x47, 0x06, 0x19, 0x19, 0x98, 0x89, 0x08, 0x60, 0x0b, 0x80, 0x0c, 0x5c, 0xaf, 0xdd, 0xaf, 0x9b, 0xfc, 0x4b, 0x79, 0x79, 0xa8, 0x78, 0x82, 0xfa, 0xf2, 0xfe, 0x61, 0x2d, 0xc4, 0x93, 0xb1, 0x91, 0x94, 0xb1, 0x5c, 0xe4, 0xf0, 0xbb, 0x89, 0x21, 0x47, 0x40, 0x09, 0x38, 0x03, 0x15, 0xf6, 0x97, 0xc5, 0x2f, 0x06, 0xaf, 0x8f, 0x56, 0xd3, 0x31, 0x69, 0x9a, 0x1d, 0xc5, 0xbc, 0xbf, 0x35, 0xf5, 0xb5, 0xbf, 0x9f, 0x73, 0x2c, 0x44, 0xb1, 0x78, 0xd5, 0x8e, 0xc1, 0x1e, 0x59, 0x8b, 0x64, 0xf9, 0x83, 0x76, 0x0e, 0x3d, 0x7e, 0x6a, 0xf8, 0xe1, 0x07, 0xc2, 0xed, 0x39, 0xad, 0xb4, 0xaf, 0x00, 0xda, 0x34, 0x97, 0x90, 0xc8, 0x45, 0xdd, 0xca, 0x5d, 0xc9, 0x24, 0x4a, 0x14, 0x60, 0x27, 0xcf, 0x9f, 0x30, 0x9c, 0xee, 0x2c, 0xac, 0x00, 0xc7, 0x7c, 0x9c, 0x7c, 0xe7, 0xfa, 0xc1, 0x80, 0xc6, 0xd4, 0x8d, 0x0c, 0x23, 0x73, 0xea, 0xda, 0x4e, 0xcb, 0xd5, 0xb4, 0x8d, 0x70, 0xf9, 0x73, 0xc2, 0x53, 0xda, 0xdf, 0x9b, 0x33, 0x7c, 0x07, 0x73, 0x15, 0x8c, 0x1a, 0x36, 0xa2, 0xe9, 0x34, 0x91, 0xd8, 0x5f, 0xc5, 0x78, 0xc9, 0x0e, 0x3c, 0xc7, 0xf2, 0x6e, 0x44, 0x85, 0x57, 0x3d, 0xce, 0xcc, 0x7e, 0x35, 0xf6, 0x76, 0x91, 0x7f, 0x69, 0xa9, 0xe9, 0x96, 0xba, 0xad, 0x84, 0xde, 0x75, 0xa5, 0xe4, 0x09, 0x3c, 0x12, 0x60, 0x8d, 0xf1, 0xba, 0x86, 0x53, 0x83, 0xcf, 0x20, 0x8a, 0xf8, 0x73, 0xc1, 0xfa, 0x8d, 0xb0, 0xb6, 0x1a, 0x73, 0x14, 0x89, 0xd5, 0x9b, 0xca, 0x39, 0xe2, 0x4d, 0xcd, 0xb8, 0xf6, 0xe0, 0xe5, 0xba, 0x67, 0x9c, 0x8c, 0x77, 0xc7, 0xd0, 0x5f, 0xb3, 0xff, 0x00, 0x8c, 0x8a, 0xcc, 0x7c, 0x1d, 0xa8, 0xcb, 0x33, 0x3c, 0x8c, 0xf3, 0xe9, 0x92, 0x3f, 0x20, 0x2e, 0xdd, 0xd2, 0x41, 0x90, 0xa3, 0x18, 0xc3, 0x48, 0xb9, 0x24, 0x90, 0x5c, 0x70, 0x11, 0x73, 0xe4, 0x71, 0xce, 0x53, 0x2c, 0x6e, 0x0e, 0x18, 0xca, 0x5a, 0xba, 0x7b, 0xaf, 0x2e, 0xbf, 0x77, 0xe5, 0x73, 0xd0, 0xcb, 0xeb, 0x28, 0x4d, 0xc2, 0x5d, 0x4f, 0x69, 0x62, 0x02, 0x92, 0x58, 0x01, 0xdf, 0x26, 0xb4, 0xfe, 0x13, 0xb5, 0xf5, 0xc7, 0x82, 0xad, 0x75, 0x5d, 0x4a, 0xc9, 0x6c, 0xef, 0x35, 0x39, 0x25, 0xbe, 0x78, 0xf6, 0x80, 0xe2, 0x39, 0x1c, 0x98, 0x04, 0x98, 0xcf, 0xef, 0x04, 0x1e, 0x4a, 0xb7, 0x27, 0x05, 0x71, 0xd0, 0x0a, 0xe6, 0xbc, 0x59, 0x68, 0x75, 0x2f, 0x0b, 0xea, 0xba, 0x6a, 0xb9, 0x47, 0xbd, 0xb3, 0x96, 0xd6, 0x32, 0x1b, 0x07, 0x7c, 0xaa, 0x63, 0x5c, 0x1f, 0x5d, 0xcc, 0x00, 0xf7, 0xc5, 0x77, 0x1e, 0x26, 0xf1, 0x47, 0x87, 0x3c, 0x31, 0x69, 0x1d, 0xcf, 0x88, 0xf5, 0xdd, 0x3b, 0x48, 0x8a, 0x62, 0xcb, 0x11, 0xbc, 0xb9, 0x48, 0x8c, 0xac, 0x06, 0x4a, 0xa0, 0x62, 0x0b, 0x36, 0x3b, 0x2e, 0x4d, 0x79, 0xfe, 0x1c, 0x61, 0x23, 0xcb, 0x5b, 0x12, 0xf7, 0xd2, 0x2b, 0xf3, 0x7f, 0xa1, 0xa6, 0x67, 0x3d, 0x63, 0x12, 0xf6, 0xb3, 0x7f, 0x69, 0xa5, 0x69, 0x37, 0x7a, 0xa6, 0xa1, 0x30, 0x86, 0xce, 0xce, 0x07, 0xb8, 0xb8, 0x90, 0x82, 0x76, 0x46, 0x8a, 0x59, 0x9b, 0x8e, 0x78, 0x00, 0x9a, 0xf1, 0x7f, 0x83, 0x7e, 0x09, 0xb4, 0xf0, 0x47, 0x83, 0x2d, 0xed, 0x16, 0x3f, 0xf8, 0x99, 0xdd, 0xc7, 0x1d, 0xc6, 0xa5, 0x21, 0x60, 0xc5, 0xa7, 0x28, 0x03, 0x28, 0x38, 0x1f, 0x22, 0x92, 0x42, 0x8f, 0x72, 0x7a, 0xb1, 0x26, 0xc5, 0xe7, 0x8a, 0xf4, 0xff, 0x00, 0x8c, 0xba, 0x34, 0xda, 0x6e, 0x96, 0x10, 0x78, 0x45, 0xa5, 0x68, 0xb5, 0x11, 0x2c, 0x9b, 0x6e, 0xaf, 0xd5, 0x58, 0xed, 0x55, 0x58, 0xdf, 0x74, 0x11, 0x31, 0x50, 0xdb, 0x9f, 0x0e, 0xca, 0x19, 0x76, 0x20, 0x3b, 0x8f, 0x8e, 0x7c, 0x78, 0xf8, 0xd3, 0x78, 0xd7, 0xb7, 0x9e, 0x15, 0xf0, 0x9c, 0xd7, 0x76, 0x46, 0xda, 0x63, 0x15, 0xe6, 0xa7, 0x1c, 0x81, 0x5a, 0x56, 0x1b, 0x95, 0xe2, 0x8c, 0x63, 0x2a, 0xa0, 0x95, 0xfd, 0xe0, 0x2a, 0xc4, 0x82, 0x06, 0x07, 0x2d, 0xd5, 0xc5, 0x55, 0x67, 0x9c, 0x57, 0x8e, 0x5b, 0x83, 0x7f, 0x0e, 0xb3, 0x7d, 0x17, 0x65, 0xe7, 0xe8, 0xbc, 0xbc, 0xed, 0x18, 0x54, 0xa8, 0x45, 0xd5, 0x9f, 0xc8, 0xf5, 0x9f, 0x89, 0x3f, 0x12, 0xfc, 0x25, 0xe0, 0xa4, 0xfb, 0x1e, 0xb3, 0x70, 0xd7, 0x57, 0x92, 0x26, 0x7f, 0xb3, 0xe0, 0x41, 0x24, 0xa5, 0x0f, 0x77, 0x04, 0x80, 0xaa, 0x73, 0xfc, 0x44, 0x67, 0x9c, 0x67, 0x06, 0xbe, 0x2a, 0xbf, 0x92, 0x09, 0x6f, 0xae, 0x25, 0xb5, 0xb4, 0x4b, 0x2b, 0x79, 0x25, 0x67, 0x8a, 0xdd, 0x1c, 0xba, 0xc4, 0xa4, 0xe4, 0x20, 0x63, 0xcb, 0x00, 0x0e, 0x32, 0x79, 0x35, 0x00, 0x00, 0x74, 0x00, 0x0e, 0xc0, 0x0e, 0xd4, 0xb5, 0xdb, 0x93, 0x64, 0x94, 0x72, 0xaa, 0x6e, 0x30, 0x93, 0x6e, 0x56, 0xbb, 0xf4, 0xf2, 0x32, 0xaf, 0x88, 0x95, 0x67, 0xae, 0x82, 0x11, 0x92, 0x09, 0xe4, 0x82, 0x08, 0xf6, 0x20, 0xe4, 0x7e, 0x46, 0xaf, 0x58, 0x6a, 0xfa, 0xbd, 0x85, 0xd2, 0x5d, 0xd9, 0x6a, 0xfa, 0x8d, 0xbd, 0xc4, 0x6f, 0xbd, 0x24, 0x8e, 0xee, 0x40, 0xca, 0x7d, 0x8e, 0x78, 0xff, 0x00, 0x0e, 0x3a, 0x51, 0x45, 0x7b, 0x77, 0x7c, 0xae, 0x3d, 0x19, 0xcf, 0xd4, 0xf4, 0xcf, 0x14, 0xfc, 0x65, 0xf1, 0x9f, 0x88, 0xbc, 0x25, 0x04, 0x32, 0xcd, 0x6d, 0xa7, 0x49, 0x16, 0xa0, 0xad, 0xf6, 0x8b, 0x01, 0x24, 0x52, 0xb1, 0x85, 0x51, 0xd0, 0x93, 0xbc, 0xff, 0x00, 0x19, 0x0c, 0x70, 0x07, 0x2a, 0x3a, 0x73, 0x9f, 0x35, 0xf1, 0x06, 0xb7, 0xac, 0x78, 0x87, 0x50, 0xfe, 0xd0, 0xd7, 0x75, 0x3b, 0xcd, 0x4e, 0xec, 0x2e, 0xc1, 0x35, 0xd4, 0xcd, 0x23, 0x85, 0xe3, 0x80, 0x4f, 0x41, 0xc0, 0xe9, 0x45, 0x15, 0xe4, 0x64, 0xb0, 0x8d, 0x2c, 0x3c, 0xa3, 0x05, 0x65, 0xcc, 0xf4, 0x5a, 0x1b, 0xe2, 0x5b, 0x73, 0x4d, 0x8e, 0xd1, 0x75, 0xed, 0x73, 0x43, 0x79, 0xdf, 0x45, 0xd6, 0x75, 0x1d, 0x31, 0xae, 0x02, 0x89, 0x8d, 0x9d, 0xcb, 0xc2, 0x64, 0x0b, 0x9d, 0xbb, 0xb6, 0x91, 0x9c, 0x6e, 0x6c, 0x67, 0xa6, 0x4f, 0xad, 0x66, 0x9e, 0x4e, 0x4f, 0x5a, 0x28, 0xaf, 0x53, 0x95, 0x5d, 0xbb, 0x6a, 0xcc, 0x6e, 0x2d, 0x14, 0x51, 0x4c, 0x0f, 0xff, 0xd9 }; /* printf("size of tux = %d\n", sizeof(tux)); */ memcpy(dest, tux, SIZE_OF_TUX); return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-install-expenses.c0000644000175000017500000001477611211745573022503 0ustar rousseaurousseau/* * $Id: pilot-install-expenses.c,v 1.36 2006/10/12 14:21:21 desrod Exp $ * * pilot-install-expense.c: Palm expense installer * * Copyright (C) Boisy G. Pitre, year unknown - 2001 probably. * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include "pi-source.h" #include "pi-dlp.h" #include "pi-expense.h" #include "pi-userland.h" int main(int argc, const char *argv[]) { int db, sd = -1, i, l, category, po_err = -1, replace_category = 0; char *category_name = NULL, *expenseType = NULL, *paymentType = NULL; size_t size; int found; unsigned char buf[0xffff]; unsigned char *b; pi_buffer_t *appblock; struct PilotUser User; struct ExpenseAppInfo eai; struct Expense theExpense; poptContext po; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"ptype", 't', POPT_ARG_STRING, &paymentType, 0,"Payment type (Cash, Check, etc.)"}, {"etype", 'e', POPT_ARG_STRING, &expenseType, 0, "Expense type (Airfare, Hotel, etc.)"}, {"amount", 'a', POPT_ARG_STRING, &theExpense.amount, 0, "Payment amount"}, {"vendor", 'V', POPT_ARG_STRING, &theExpense.vendor, 0, "Expense vendor name (Joe's Restaurant)"}, {"city", 'i', POPT_ARG_STRING, &theExpense.city, 0, "Location/city for this expense entry"}, {"guests", 'g', POPT_ARG_STRING, &theExpense.attendees, 0, "Number of guests for this expense entry","NUMBER"}, {"note", 'n', POPT_ARG_STRING, &theExpense.note, 0, "Notes for this expense entry"}, {"category", 'c', POPT_ARG_STRING, &category_name, 0, "Install entry into this category", "CATEGORY" }, {"replace", 0, POPT_ARG_VAL, &replace_category, 1, "Replace all entries in category by this one"}, POPT_TABLEEND }; /* Zero 'em out to be sure. */ theExpense.amount=theExpense.vendor=theExpense.city= theExpense.attendees=theExpense.note = NULL ; po = poptGetContext("pilot-install-expenses", argc, argv, options, 0); poptSetOtherOptionHelp(po,"\n\n" " Install Expense application entries to your Palm device\n\n" " Example arguments:\n" " %s -p /dev/pilot -c Unfiled -t Cash -e Meals -a 10.00 -V McDonalds \n" " -g 21 -l \"San Francisco\" -N \"This is a note\"\n\n"); if (argc < 2) { poptPrintUsage(po,stderr,0); return 1; } while ((po_err = poptGetNextOpt(po)) >= 0) { fprintf(stderr," ERROR: Unhandled option %d.\n",po_err); return 1; } theExpense.type = etBus; found = 0; for (i = 0; expenseType && ExpenseTypeNames[i] != NULL; i++) { if (strcasecmp(expenseType, ExpenseTypeNames[i]) == 0) { theExpense.type = i; found = 1; break; } } if (!found) { fprintf(stderr," WARNING: Expense type '%s' not recognized, using 'Bus Fare'.\n",expenseType); } theExpense.payment = epCash; found = 0; for (i = 0; paymentType && ExpensePaymentNames[i] != NULL; i++) { if (strcasecmp(paymentType, ExpensePaymentNames[i]) == 0) { theExpense.payment = i; found = 1; break; } } if (!found) { fprintf(stderr," WARNING: Payment type '%s' not recognized, using 'Cash'.\n", paymentType); } if (replace_category && (!category_name)) { fprintf(stderr, " ERROR: category required when specifying replace\n"); return 1; } if (!(theExpense.amount || theExpense.vendor || theExpense.city || theExpense.attendees ||theExpense.note)) { fprintf(stderr," ERROR: Must specify at least one of amount, vendor, city, attendees or note.\n"); return 1; } sd = plu_connect(); if (sd < 0) goto error; if (dlp_OpenConduit(sd) < 0) goto error_close; dlp_ReadUserInfo(sd, &User); dlp_OpenConduit(sd); /* Open the Expense's database, store access handle in db */ if (dlp_OpenDB(sd, 0, 0x80 | 0x40, Expense_DB, &db) < 0) { fprintf(stderr," ERROR: Unable to open ExpenseDB on Palm."); dlp_AddSyncLogEntry(sd, "Unable to open ExpenseDB.\n"); goto error_close; } appblock = pi_buffer_new(0xffff); l = dlp_ReadAppBlock(sd, db, 0, 0xffff, appblock); unpack_ExpenseAppInfo(&eai, appblock->data, l); pi_buffer_free(appblock); category = 0; /* unfiled */ if (category_name) { category = plu_findcategory(&eai.category,category_name, PLU_CAT_CASE_INSENSITIVE | PLU_CAT_WARN_UNKNOWN); if (category < 0) { goto error_close; } if (replace_category) { dlp_DeleteCategory(sd, db, category); } } theExpense.currency = 0; if (!theExpense.amount) { theExpense.amount = ""; } if (!theExpense.vendor) { theExpense.vendor = ""; } if (!theExpense.city) { theExpense.city = ""; } if (!theExpense.attendees) { theExpense.attendees = ""; } if (!theExpense.note) { theExpense.note = ""; } b = buf; /* Date */ *(b++) = 0xc3; *(b++) = 0x45; *(b++) = theExpense.type; *(b++) = theExpense.payment; *(b++) = theExpense.currency; *(b++) = 0x00; strcpy(b, theExpense.amount); b += strlen(theExpense.amount) + 1; strcpy(b, theExpense.vendor); b += strlen(theExpense.vendor) + 1; strcpy(b, theExpense.city); b += strlen(theExpense.city) + 1; strcpy(b, theExpense.attendees); b += strlen(theExpense.attendees) + 1; strcpy(b, theExpense.note); b += strlen(theExpense.note) + 1; size = b - buf; dlp_WriteRecord(sd, (unsigned char)db, 0, 0, category, (unsigned char *)buf, size, 0); /* Close the database */ dlp_CloseDB(sd, db); /* Tell the user who it is, with a different PC id. */ User.lastSyncPC = 0x00010000; User.successfulSyncDate = time(NULL); User.lastSyncDate = User.successfulSyncDate; dlp_WriteUserInfo(sd, &User); dlp_AddSyncLogEntry(sd, "Wrote expense entry to Palm.\n"); dlp_EndOfSync(sd, 0); pi_close(sd); poptFreeContext(po); return 0; error_close: pi_close(sd); error: return -1; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-foto-treo650.c0000644000175000017500000002055711211746356021350 0ustar rousseaurousseau/* * $Id: pilot-foto-treo650.c,v 1.3 2009/06/04 13:32:30 desrod Exp $ * * pilot-650foto.c: Grab photos and video off a Treo 650 camera phone. * * (c) 2004, Matthew Allum * (c) 2006, Angus Ainslie * * 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 "pi-file.h" #include "pi-header.h" #include "pi-dlp.h" #include "pi-socket.h" #include "pi-userland.h" #define MEDIA_PATH "/Photos & Videos" #define MEDIA_VOLUME 1 static int pi_file_retrieve_VFS(const int fd, const int socket, FileRef file, const char *rpath ) { int rpathlen = vfsMAXFILENAME; long attributes; pi_buffer_t *buffer; ssize_t readsize,writesize; int filesize; int original_filesize; int written_so_far; pi_progress_t progress; enum { bad_parameters=-1, cancel=-2, bad_vfs_path=-3, bad_local_file=-4, insufficient_space=-5, internal_=-6 }; rpathlen=strlen(rpath); if (dlp_VFSFileGetAttributes(socket,file,&attributes) < 0) { fprintf(stderr," Could not get attributes of VFS file.\n"); (void) dlp_VFSFileClose(socket,file); return bad_vfs_path; } if (attributes & vfsFileAttrDirectory) { /* Clear case for later feature. */ fprintf(stderr," Cannot retrieve a directory.\n"); dlp_VFSFileClose(socket,file); return bad_vfs_path; } dlp_VFSFileSize(socket,file,&filesize); original_filesize = filesize; memset(&progress, 0, sizeof(progress)); progress.type = PI_PROGRESS_RECEIVE_VFS; progress.data.vfs.path = (char *)rpath; progress.data.vfs.total_bytes = filesize; #define FBUFSIZ 65536 buffer = pi_buffer_new(FBUFSIZ); readsize = 0; written_so_far = 0; while ((filesize > 0) && (readsize >= 0)) { int offset; pi_buffer_clear(buffer); readsize = dlp_VFSFileRead(socket,file,buffer, ( filesize > FBUFSIZ ? FBUFSIZ : filesize)); /*f printf(stderr,"* Read %ld bytes.\n",readsize); */ if (readsize <= 0) break; filesize -= readsize; offset = 0; while (readsize > 0) { writesize = write(fd,buffer->data+offset,readsize); /* fprintf(stderr,"* Wrote %ld bytes.\n",writesize); */ if (writesize < 0) { fprintf(stderr,"Error while writing file.\n"); goto cleanup; } written_so_far += writesize; progress.transferred_bytes += writesize; if ((filesize > 0) || (readsize > 0)) { /* if (f && (f(socket,&progress) == PI_TRANSFER_STOP)) { written_so_far = cancel; pi_set_error(socket,PI_ERR_FILE_ABORTED); goto cleanup; }*/ } readsize -= writesize; offset += writesize; } } cleanup: pi_buffer_free(buffer); #undef FBUFSIZ dlp_VFSFileClose(socket,file); return written_so_far; } /*********************************************************************** * * Function: print_fileinfo * * Summary: Show information about the given @p file (which is * assumed to have VFS path @p path). * * Parameters: path --> path to file in VFS volume. * file --> FileRef for already opened file. * * Returns: Nothing * ***********************************************************************/ static void print_fileinfo(int sd, const char *path, FileRef file) { int size; time_t date; char *s; (void) dlp_VFSFileSize(sd,file,&size); (void) dlp_VFSFileGetDate(sd,file,vfsFileDateModified,&date); s = ctime(&date); s[24]=0; printf(" %8d %s %s\n",size,s,path); } /*********************************************************************** * * Function: print_dir * * Summary: Output all the files in the MEDIA_DIR * * Parameters: volume --> volume ref number. * path --> path to directory. * dir --> file ref to already opened dir. * * Returns: Nothing * ***********************************************************************/ static void dump_dir(int sd, long volume, const char *path, FileRef dir) { unsigned long it = 0; int max = 64; struct VFSDirInfo infos[64]; int i; FileRef file; char buf[vfsMAXFILENAME]; int pathlen = strlen(path); int fd; char *index; /* Set up buf so it contains path with trailing / and buflen points to the terminating NUL. */ if (pathlen<1) { printf(" NULL path.\n"); return; } memset(buf,0,vfsMAXFILENAME); strncpy(buf,path,vfsMAXFILENAME-1); if (buf[pathlen-1] != '/') { buf[pathlen]='/'; pathlen++; } if (pathlen>vfsMAXFILENAME-2) { printf(" Path too long.\n"); return; } while (dlp_VFSDirEntryEnumerate(sd,dir,&it,&max,infos) >= 0) { if (max<1) break; for (i = 0; i= 0) { switch(c) { case mode_write : if (run_mode == mode_none) { run_mode = c; } else { if (c != run_mode) { fprintf(stderr," ERROR: Specify exactly one of -w.\n"); return 1; } } break; default: fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } } if (c < -1) { plu_badoption(po,c); } if (mode_none == run_mode) { fprintf(stderr," ERROR: Specify --write (-w) to output data.\n"); return 1; } if ((sd = plu_connect()) < 0) { return 1; } if (dlp_VFSFileOpen(sd,MEDIA_VOLUME,MEDIA_PATH,dlpVFSOpenRead,&file) < 0) { printf(" %s: No such file or directory.\n",MEDIA_PATH); goto cleanup; } if (dlp_VFSFileGetAttributes(sd,file,&attributes) < 0) { printf(" %s: Cannot get attributes.\n",MEDIA_PATH); goto cleanup; } if (vfsFileAttrDirectory == (attributes & vfsFileAttrDirectory)) { /* directory */ dump_dir(sd,MEDIA_VOLUME,MEDIA_PATH,file); } ret=0; cleanup: if( file >= 0 ) (void) dlp_VFSFileClose(sd,file); if (sd >= 0) { dlp_EndOfSync(sd, 0); pi_close(sd); } return ret; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/pilot-getrom.c0000644000175000017500000003225411211746357020472 0ustar rousseaurousseau/* * $Id: pilot-getrom.c,v 1.47 2009/06/04 13:32:31 desrod Exp $ * * pilot-getrom: Fetch ROM image from Palm, without using getrom.prc. * Contains all functional code from getram and getromtoken, * too, with additional copyrights. * * Copyright (C) 2002, Owen Stenseth * Copyright (C) 1997, Kenneth Albanowski * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "popt.h" #include #include #include #include #include #include #include #include #include #include #include "pi-header.h" #include "pi-source.h" #include "pi-syspkt.h" #include "pi-dlp.h" #include "pi-header.h" #include "pi-userland.h" #ifndef DEFAULT_MODE #define DEFAULT_MODE mode_getrom #endif /* Cancel code, common to all the get* */ int cancel = 0; static void sighandler(int signo) { cancel = 1; } /* Per-action code. */ /* Check ROM version, return < 0 if the ROM doesn't support RPC. * Otherwise, fill buffer with filename + romversion string. */ static int check_romversion(int sd, plu_romversion_t *version) { if (plu_getromversion(sd,version) < 0) { fprintf(stderr," ERROR: Could not retrieve ROM version.\n"); return -1; } /* OS5 devices no longer support RPC, and will crash if we try to call it */ if ((version->major >= 5)) { printf(" Unfortunately, Palm changed the underlying protocol used to fetch ROM\n" " images from the handheld in a fatal way, and accessing them with these\n" " tools will cause the Palm to crash.\n\n" " Future versions of these tools may be updated to work around these\n" " problems. For now, we'd like to avoid crashing your device.\n\n"); return -2; } return 0; } int do_get_rom(int sd,const char *filename) { int i, file = -1, timespent = 0; struct RPC_params p; plu_romversion_t version; unsigned long ROMstart; unsigned long ROMlength; unsigned long offset; unsigned long left; char name[256], print[256]; time_t start = time(NULL), end; /* Tell user (via Palm) that we are starting things up */ dlp_OpenConduit(sd); if (check_romversion(sd,&version) < 0) { return -1; } PackRPC(&p, 0xA23E, RPC_IntReply, RPC_Long(0xFFFFFFFF), RPC_End); /* err = */ dlp_RPC(sd, &p, &ROMstart); PackRPC(&p, 0xA23E, RPC_IntReply, RPC_Long(ROMstart), RPC_End); /* err = */ dlp_RPC(sd, &p, &ROMlength); /* As Steve said, "Bummer." */ if ((version.major == 3) && (version.minor == 0) && (ROMlength == 0x100000)) { ROMlength = 0x200000; } snprintf(name, sizeof(name),"%s%s.rom", (filename ? filename : "pilot-"), version.name); if (!plu_quiet) { printf(" Generating %s\n", name); } file = open(name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); offset = lseek(file, 0, SEEK_END); offset &= ~255; lseek(file, offset, SEEK_SET); PackRPC(&p, 0xA164, RPC_IntReply, RPC_Byte(1), RPC_End); /* err = */ dlp_RPC(sd, &p, 0); sprintf(print, "Downloading byte %ld", offset); PackRPC(&p, 0xA220, RPC_IntReply, RPC_Ptr(print, strlen(print)), RPC_Short(strlen(print)), RPC_Short(0), RPC_Short(28), RPC_End); /* err = */ dlp_RPC(sd, &p, 0); signal(SIGINT, sighandler); left = ROMlength - offset; i = offset; while (left > 0) { int len = left, j; char buffer[256]; double perc = ((double) offset / ROMlength) * 100.0; if (len > 256) len = 256; if (!plu_quiet) { printf("\r %ld of %ld bytes (%.2f%%)", offset, ROMlength, perc); } fflush(stdout); PackRPC(&p, 0xA026, RPC_IntReply, RPC_Ptr(buffer, len), RPC_Long(offset + ROMstart), RPC_Long(len), RPC_End); /* err = */ dlp_RPC(sd, &p, 0); left -= len; /* If the buffer only contains zeros, skip instead of writing, so that the file will be holey. */ for (j = 0; j < len; j++) if (buffer[j]) break; if (j == len) lseek(file, len, SEEK_CUR); else write(file, buffer, len); offset += len; if (cancel || !(i++ % 8)) if (cancel || (dlp_OpenConduit(sd) < 0)) { printf("\n Operation cancelled!\n"); dlp_AddSyncLogEntry(sd, "\npilot-getrom ended unexpectedly.\n" "Entire ROM was not fetched.\n"); goto cancel; } if (!(i % 16)) { sprintf(print, "%ld", offset); PackRPC(&p, 0xA220, RPC_IntReply, RPC_Ptr(print, strlen(print)), RPC_Short(strlen(print)), RPC_Short(92), RPC_Short(28), RPC_End); /* err = */ dlp_RPC(sd, &p, 0); } } end = time(NULL); timespent = (end-start); if (!plu_quiet) { printf("\n ROM fetch complete\n"); printf(" ROM fetched in: %d:%02d:%02d\n",timespent/3600, (timespent/60)%60, timespent%60); } cancel: if (file>=0) { close(file); } return 0; } int do_get_ram(int sd, const char *filename) { char name[256], print[256]; time_t start = time(NULL), end; struct RPC_params p; plu_romversion_t version; unsigned long SRAMstart, SRAMlength, offset, left; int i, file = -1, j, timespent = 0; /* Tell user (via Palm) that we are starting things up */ dlp_OpenConduit(sd); if (check_romversion(sd, &version) < 0) { return 1; } PackRPC(&p, 0xA23D, RPC_IntReply, RPC_Long(0xFFFFFFFE), RPC_End); /* err = */ dlp_RPC(sd, &p, &SRAMstart); PackRPC(&p, 0xA23D, RPC_IntReply, RPC_Long(SRAMstart), RPC_End); /* err = */ dlp_RPC(sd, &p, &SRAMlength); snprintf(name, sizeof(name),"%s%s.ram", (filename ? filename : "pilot-"), version.name); if (!plu_quiet) { printf(" Generating %s\n", name); } file = open(name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); offset = lseek(file, 0, SEEK_END); offset &= ~255; lseek(file, offset, SEEK_SET); PackRPC(&p, 0xA164, RPC_IntReply, RPC_Byte(1), RPC_End); /* err = */ dlp_RPC(sd, &p, 0); sprintf(print, "Downloading byte %ld", offset); PackRPC(&p, 0xA220, RPC_IntReply, RPC_Ptr(print, strlen(print)), RPC_Short(strlen(print)), RPC_Short(0), RPC_Short(28), RPC_End); /* err = */ dlp_RPC(sd, &p, 0); #if 0 PackRPC(&p, 0xA026, RPC_IntReply, RPC_LongPtr(&penPtr), RPC_Long(364), RPC_Long(4), RPC_End); /* err = */ dlp_RPC(sd, &p, 0); printf("penPtr = %lu (%8.8lX)\n", penPtr, penPtr); PackRPC(&p, 0xA026, RPC_IntReply, RPC_Ptr(print, 8), RPC_Long(penPtr), RPC_Long(8), RPC_End); /* err = */ dlp_RPC(sd, &p, 0); pi_dumpdata(print, 8); #endif signal(SIGINT, sighandler); left = SRAMlength - offset; i = offset; while (left > 0) { int len = left; char buffer[256]; double perc = ((double) offset / SRAMlength) * 100.0; if (len > 256) len = 256; if (!plu_quiet) { printf("\r %ld of %ld bytes (%.2f%%)", offset, SRAMlength, perc); } fflush(stdout); PackRPC(&p, 0xA026, RPC_IntReply, RPC_Ptr(buffer, len), RPC_Long(offset + SRAMstart), RPC_Long(len), RPC_End); /* err = */ dlp_RPC(sd, &p, 0); left -= len; /* If the buffer only contains zeros, skip instead of writing, so that the file will be holey. */ for (j = 0; j < len; j++) if (buffer[j]) break; if (j == len) lseek(file, len, SEEK_CUR); else write(file, buffer, len); offset += len; if (cancel || !(i++ % 4)) if (cancel || (dlp_OpenConduit(sd) < 0)) { printf("\n Operation cancelled!\n"); dlp_AddSyncLogEntry(sd, "\npilot-getrom ended unexpectedly.\n" "Entire RAM was not fetched.\n"); goto cancel; } if (!(i % 8)) { sprintf(print, "%ld", offset); PackRPC(&p, 0xA220, RPC_IntReply, RPC_Ptr(print, strlen(print)), RPC_Short(strlen(print)), RPC_Short(92), RPC_Short(28), RPC_End); /* err = */ dlp_RPC(sd, &p, 0); } } end = time(NULL); timespent = (end-start); if (!plu_quiet) { printf(" RAM fetch complete\n"); printf(" RAM fetched in: %d:%02d:%02d\n",timespent/3600, (timespent/60)%60, timespent%60); } cancel: if (file >=0) { close(file); } return 0; } int do_get_token(int sd, const char *token) { unsigned long t = 0; size_t size; char buffer[50]; if (!token) { return -1; } /* asking for trouble on aligned architectures */ set_long(&t,*((long *)token)); size = sizeof(buffer); if (dlp_GetROMToken(sd, t, buffer, &size) < 0) { return -1; } fprintf(stdout, "Token for '%s' was: %s\n", token, buffer); return 0; } int do_sysinfo(int sd) { struct SysInfo info; char buf[256]; if (dlp_ReadSysInfo(sd,&info) < 0) { fprintf(stderr," ERROR: Could not read Palm System Information.\n"); return -1; } memset(buf,0,sizeof(buf)); strncpy(buf,info.prodID,info.prodIDLength < sizeof(buf)-1 ? info.prodIDLength : sizeof(buf)-1); fprintf(stdout,"ProdId..:%s\n", buf); fprintf(stdout,"ROM.....:%ld\n", info.romVersion); fprintf(stdout,"DLP.....:%d.%d\n", info.dlpMajorVersion,info.dlpMinorVersion); fprintf(stdout,"Compat..:%d.%d\n", info.compatMajorVersion,info.compatMinorVersion); fprintf(stdout,"Locale..:%ld\n", info.locale); fprintf(stdout,"MaxRec..:%ld\n", info.maxRecSize); return 0; } int main(int argc, const char *argv[]) { int c, /* switch */ sd = -1; const char **args = NULL; const char *filename = NULL; char *token = NULL; enum { mode_none, mode_getrom = 'R', mode_getram = 'r', mode_gettoken = 't', mode_sysinfo='s' } mode = mode_none; poptContext po; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"token", 't', POPT_ARG_STRING, &token, 't', "A ROM token to read (i.e. snum)", "token"}, {"sysinfo",'s',POPT_ARG_NONE, NULL, 's', "Print SysInfo", NULL}, {"ram", 0 , POPT_ARG_NONE, NULL, 'r', "Read RAM", NULL}, {"rom", 0 , POPT_ARG_NONE, NULL, 'R', "Read ROM", NULL}, POPT_TABLEEND }; const char *progname = NULL; const char *opthelp = NULL; /* These are optimized away compile-time */ if (DEFAULT_MODE == mode_getrom) { progname = "pilot-getrom"; opthelp= "[filename]\n\n" " Retrieves the ROM image from your Palm device.\n\n"; } else if (DEFAULT_MODE == mode_gettoken) { progname="pilot-getromtoken"; opthelp= "\n\n" " Reads a ROM token from a Palm Handheld device.\n" " Tokens you may currently extract are:\n" " adcc: Entropy for internal A->D convertor calibration\n" " irda: Present only on memory card w/IrDA support\n" " snum: Device serial number (from Memory Card Flash ID)\n\n" " Example arguments:\n" " -p /dev/pilot -t snum\n\n"; } else if (DEFAULT_MODE == mode_getram) { progname="pilot-getram"; opthelp= "[filename]\n\n" " Retrieves the RAM image from your Palm device\n\n"; } if (!progname) { fprintf(stderr," ERROR: Compile-time error.\n"); return -1; } po = poptGetContext(progname, argc, argv, options, 0); poptSetOtherOptionHelp(po,opthelp); if (argc < 2) { poptPrintUsage(po,stderr,0); return 1; } while ((c = poptGetNextOpt(po)) >= 0) { switch(c) { case 's' : case 't' : case 'r' : case 'R' : if (mode != mode_none) { fprintf(stderr," ERROR: Use only one of --ram, --rom, and --token.\n"); return 1; } mode =c; break; default: fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } } if ( c < -1) { plu_badoption(po,c); } if (mode == mode_none) { mode = DEFAULT_MODE; } switch(mode) { case mode_getrom: case mode_getram: args = poptGetArgs(po); if (args && args[0] && args[1]) { fprintf(stderr," ERROR: Specify at most one filename.\n"); return 1; } if (args && args[0]) { filename = args[0]; } break; case mode_gettoken: if (!token) { fprintf(stderr," ERROR: Must specify a token.\n"); return 1; } break; case mode_sysinfo: break; case mode_none: /* impossible */ return 1; } switch(mode) { case mode_getrom: printf( " NOTICE: Use of this program may place you in violation\n" " of your license agreement with Palm Computing.\n\n" " Please read your Palm Computing handbook (\"Software\n" " License Agreement\") before running this program.\n\n"); /* FALLTHRU */ case mode_getram: printf( " WARNING: Please completely back up your Palm (with pilot-xfer -b)\n" " before using this program!\n\n"); break; case mode_sysinfo: case mode_none: case mode_gettoken: /* nothing to do */ break; } sd = plu_connect(); if (sd < 0) { return -1; } switch(mode) { case mode_getrom: c = do_get_rom(sd,filename); break; case mode_gettoken: c = do_get_token(sd,token); break; case mode_getram: c = do_get_ram(sd,filename); break; case mode_sysinfo: c = do_sysinfo(sd); break; case mode_none: /* impossible */ break; } dlp_EndOfSync(sd,0); pi_close(sd); return c; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/prc/0000755000175000017500000000000011333433323016451 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/src/prc/Makefile.in0000644000175000017500000003265011333433244020526 0ustar rousseaurousseau# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ target_triplet = @target@ subdir = src/prc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/bluez.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/tcl.m4 \ $(top_srcdir)/m4/threads.m4 \ $(top_srcdir)/m4/vl_lib_readline.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/include/pi-md5.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(prcdir)" DATA = $(prc_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLUEZ_CFLAGS = @BLUEZ_CFLAGS@ BLUEZ_LIBS = @BLUEZ_LIBS@ CAT_ENTRY_END = @CAT_ENTRY_END@ CAT_ENTRY_START = @CAT_ENTRY_START@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOCBOOK_ROOT = @DOCBOOK_ROOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVA = @JAVA@ JAVABASE = @JAVABASE@ JAVAC = @JAVAC@ JAVA_VERSION = @JAVA_VERSION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PIC_LIBS = @PIC_LIBS@ PILOT_LINK_MAJOR = @PILOT_LINK_MAJOR@ PILOT_LINK_MINOR = @PILOT_LINK_MINOR@ PILOT_LINK_PATCH = @PILOT_LINK_PATCH@ PILOT_LINK_VERS = @PILOT_LINK_VERS@ PISOCK_AGE = @PISOCK_AGE@ PISOCK_CURRENT = @PISOCK_CURRENT@ PISOCK_REVISION = @PISOCK_REVISION@ PISYNC_AGE = @PISYNC_AGE@ PISYNC_CURRENT = @PISYNC_CURRENT@ PISYNC_REVISION = @PISYNC_REVISION@ PKG_CONFIG = @PKG_CONFIG@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ POPT_INCLUDES = @POPT_INCLUDES@ POPT_LIBS = @POPT_LIBS@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_H = @PYTHON_H@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RL_LIBS = @RL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ XML_CATALOG = @XML_CATALOG@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ builddir = @builddir@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ usb_libs = @usb_libs@ PRCS = getrom.prc getrom2.prc @ENABLE_CONDUITS_TRUE@prc_DATA = $(PRCS) @ENABLE_CONDUITS_TRUE@prcdir = $(datadir)/pilot-link/prc EXTRA_DIST = $(PRCS) all: all-am .SUFFIXES: $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/prc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/prc/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-prcDATA: $(prc_DATA) @$(NORMAL_INSTALL) test -z "$(prcdir)" || $(MKDIR_P) "$(DESTDIR)$(prcdir)" @list='$(prc_DATA)'; test -n "$(prcdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(prcdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(prcdir)" || exit $$?; \ done uninstall-prcDATA: @$(NORMAL_UNINSTALL) @list='$(prc_DATA)'; test -n "$(prcdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(prcdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(prcdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(DATA) installdirs: for dir in "$(DESTDIR)$(prcdir)"; 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-prcDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-prcDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-prcDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-prcDATA # 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: pilot-link-0.12.5-dfsg/src/prc/getrom.prc0000644000175000017500000000143107141131156020454 0ustar rousseaurousseauGetRomPila­À ­À applgetr(code–code`datahTaltèTstrétver prefOï˙ôHoHoHoNO Oï J@g<NO˘4Tp˙`* W?(/(?Nş^Oï//////NO Oï pOï NuSerial LibraryTransmitting ROM (Reset to exit)–èNVHçà Jnf?<èNOĦ’T°|f?<?<Hz˙§NO ÇX?Hz˙›NO˘ Oï HmHz˙|NO şP°|fÒ/<–?<?-NO¨P°|fĥHz˙~?-NO¨\$|À|*/<Hm?-NO¨ Oï /</ ?-NO¨ Oï 2<˙<˙µQÉ˙ĝ@/<Hm?-NO¨ Oï /<˙˙˙˙?-NO¨ \/<˙˙˙˙/<Hm?-NO¨ OïNOĦ0µüÈm˙l?-NO¨TLßN^Nu‚éGetRomPress the Start button to begin ROM transfer.StartThis program transfers a copy of the Pilot ROM to getrom.exe on the PC.1.0pilot-link-0.12.5-dfsg/src/prc/Makefile.am0000644000175000017500000000020410473612622020506 0ustar rousseaurousseauPRCS = getrom.prc getrom2.prc if ENABLE_CONDUITS prc_DATA = $(PRCS) prcdir = $(datadir)/pilot-link/prc endif EXTRA_DIST = $(PRCS) pilot-link-0.12.5-dfsg/src/prc/getrom2.prc0000644000175000017500000000143107141134345020541 0ustar rousseaurousseauGetRom2Pila­À ­À applgetr(codeŒcodePdataXTaltè‡TstréÌtverNV˙ôHn˙ôHn˙ĝHn˙üNO Oï J@g<NO˘4Tp˙`* n˙ü?(/(?NşZP/.˙ô/.˙ĝ/.˙üNO Oï pN^NuSerial LibraryTransmitting ROM (Reset to exit)–èNVHçà Jnf?<èNOĦ’T°|f?<?<Hz˙§NO ÇX?Hz˙›NO˘ Oï HmHz˙|NO şP°|fÒ/<–?<?-NO¨P°|fĥHz˙~?-NO¨\$|À|*/<Hm?-NO¨ Oï /</ ?-NO¨ Oï 2<˙<˙µQÉ˙ĝ@/<Hm?-NO¨ Oï /<˙˙˙˙?-NO¨ \/<˙˙˙˙/<Hm?-NO¨ OïNOĦ0µüm˙l?-NO¨TLßN^Nu‚éGetRom2Press the Start button to begin ROM transfer.StartThis program transfers a copy of the Pilot ROM to getrom2.exe on the PC.1.0pilot-link-0.12.5-dfsg/src/pilot-wav.c0000644000175000017500000002670611211745573017776 0ustar rousseaurousseau/* * $Id: pilot-wav.c,v 1.19 2006/10/12 14:21:21 desrod Exp $ * * pilot-wav.c: Palm Voice Memo Wav Fetcher/Converter * * This is a palm conduit to fetch Memo Wav files from a Palm. It can also * convert *.wav.pdb files that have already been fetched from the Palm. * * Copyright (C) 2003 by David Turner * Based on pilot-foto Copyright (C) 2003 by Judd Montgomery * * 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. * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "pi-file.h" #include "pi-source.h" #include "pi-userland.h" /* Declare prototypes */ long write_header(FILE *out); long write_data(char *buffer, int index, int size, long dataChunkSize, FILE *out); int pdb_to_wav(char *filename); int fetch_wavs(int sd, char *dbname); int do_fetch(char *dbname); #ifndef TRUE # define TRUE 1 #endif #ifndef FALSE # define FALSE 0 #endif /*********************************************************************** * * Function: write_header * * Summary: Writes out header of wave file with correct parameters * * Parameters: File out - output file pointer * * Returns: long - size of format chunk * ***********************************************************************/ long write_header(FILE * out) { const char formatChunkID[4] = "fmt "; long formatChunkSize; short wFormatTag; unsigned short wChannels; unsigned long dwSamplesPerSec; unsigned long dwAvgBytesPerSec; unsigned short wBlockAlign; unsigned short wBitsPerSample; unsigned short cbSize; unsigned short wSamplesPerBlock; const char dataChunkID[4] = "data"; long dataChunkSize; long wWaveLength; /* In bytes, not including formatChunkID and formatChunkSize itself */ formatChunkSize = 20; /* 17 = Intel IMA (DVI) ADPCM */ wFormatTag = 17; /* Mono */ wChannels = 1; dwSamplesPerSec = 8000; /* This value varies with file - need formula */ dwAvgBytesPerSec = 4425; wBlockAlign = 256; wBitsPerSample = 4; /* Extended format block size including(it appears) cbSize itself */ cbSize = 2; wSamplesPerBlock = 505; /* fill in at end of file with seek */ dataChunkSize = 0; /* fill in at end of file with seek */ wWaveLength = 0; /* RIFF Header */ fwrite("RIFF", 4, 1, out); fwrite(&wWaveLength, 4, 1, out); fwrite("WAVE", 4, 1, out); /* Format Chunk */ fwrite(formatChunkID, 4, 1, out); /* Length of Format Chunk - 4 (fmt ) - 4 (length value itself) */ fwrite(&formatChunkSize, 4, 1, out); fwrite(&wFormatTag, 2, 1, out); fwrite(&wChannels, 2, 1, out); fwrite(&dwSamplesPerSec, 4, 1, out); fwrite(&dwAvgBytesPerSec, 4, 1, out); fwrite(&wBlockAlign, 2, 1, out); fwrite(&wBitsPerSample, 2, 1, out); /* Extended Format Chunk Fields */ /* Extended format block size including(it appears) cbSize itself */ fwrite(&cbSize, 2, 1, out); fwrite(&wSamplesPerBlock, 2, 1, out); /* Data Chunk */ fwrite(dataChunkID, 4, 1, out); fwrite(&dataChunkSize, 4, 1, out); return formatChunkSize; } /*********************************************************************** * * Function: write_data * * Summary: Writes out data from record buffer updating dataChunkSize * * Parameters: char pointer buffer - self explanatory * int size - size of data to be written * FILE *out - pointer to output file * long dataChunkSize - present data chunk size * * Returns: long - updated dataChunkSize * ***********************************************************************/ long write_data(char *buffer, int index, int size, long dataChunkSize, FILE *out) { if (index == 0) { fwrite(buffer + 122, size - 122, 1, out); dataChunkSize += size - 122; } else { fwrite(buffer + 8, size - 8, 1, out); dataChunkSize += size - 8; } return dataChunkSize; } /*********************************************************************** * * Function: fetch_wavs * * Summary: Grab the voice memos matching 'Vpad' on the device * * Parameters: None * * Returns: 0 * ***********************************************************************/ int fetch_wavs(int sd, char *dbname) { FILE *out; recordid_t id_; int index, db, attr, category, ret, start; struct DBInfo info; char creator[5]; char type[5]; pi_buffer_t *buffer; int booldb = TRUE; long wWaveLength; long formatChunkSize; long dataChunkSize; start = 0; buffer = pi_buffer_new (65536); while (dlp_ReadDBList(sd, 0, dlpOpenRead, start, buffer) > 0) { memcpy(&info, buffer->data, sizeof(struct DBInfo)); start = info.index + 1; creator[0] = (info.creator & 0xFF000000) >> 24; creator[1] = (info.creator & 0x00FF0000) >> 16; creator[2] = (info.creator & 0x0000FF00) >> 8; creator[3] = (info.creator & 0x000000FF); creator[4] = '\0'; type[0] = (info.type & 0xFF000000) >> 24; type[1] = (info.type & 0x00FF0000) >> 16; type[2] = (info.type & 0x0000FF00) >> 8; type[3] = (info.type & 0x000000FF); type[4] = '\0'; if (!strcmp(dbname, "all")) { booldb = FALSE; } else { booldb = strcmp(info.name, dbname); } if (!(strcmp(creator, "Vpad") || strcmp(type, "strm") || booldb)) { memset (buffer->data, 0, buffer->allocated); if (!plu_quiet) { printf("Fetching '%s' (Creator ID '%s')... ", info.name, creator); } ret = dlp_OpenDB(sd, 0, dlpOpenRead, info.name, &db); if (ret < 0) { fprintf(stderr, " WARNING: Unable to open %s\n", info.name); continue; } out = fopen(info.name, "w"); if (!out) { fprintf(stderr, " WARNING: Failed, unable to create file %s\n", info.name); dlp_CloseDB(sd,db); continue; } formatChunkSize = write_header(out); index = 0; dataChunkSize = 0; ret = 1; while (ret > 0) { ret = dlp_ReadRecordByIndex PI_ARGS((sd, db, index, buffer, &id_, &attr, &category)); if (ret > 0) { dataChunkSize = write_data(buffer->data, index, buffer->used, dataChunkSize, out); } index++; } wWaveLength = 4 + 4 + 4 + formatChunkSize + 4 + 4 + dataChunkSize; fseek(out, 44, SEEK_SET); fwrite(&dataChunkSize, 4, 1, out); fseek(out, 4, SEEK_SET); fwrite(&wWaveLength, 4, 1, out); dlp_CloseDB(sd, db); fclose(out); if (!plu_quiet) { printf("OK\n"); } } } pi_buffer_free(buffer); return 0; } /*********************************************************************** * * Function: do_fetch * * Summary: Connect and fetch the file * * Parameters: None * * Returns: 0 * ***********************************************************************/ int do_fetch(char *dbname) { int sd = -1, ret; sd = plu_connect(); ret = fetch_wavs(sd, dbname); dlp_EndOfSync(sd, dlpEndCodeNormal); pi_close(sd); return 0; } /*********************************************************************** * * Function: pdb_to_wav * * Summary: Do the bulk of the conversion here * * Parameters: None * * Returns: 0 - Success, -1 - Failure * ***********************************************************************/ int pdb_to_wav(char *filename) { struct pi_file *pi_fp; struct DBInfo info; FILE *out; int index, ret, attr, cat; void *buffer; recordid_t uid; size_t size; long wWaveLength; long formatChunkSize; long dataChunkSize; if (!plu_quiet) { printf("Converting %s... ", filename); } pi_fp = pi_file_open(filename); if (!pi_fp) { fprintf(stderr," FAILED: could not open %s\n", filename); return -1; } pi_file_get_info(pi_fp, &info); out = fopen(info.name, "w"); if (!out) { pi_file_close(pi_fp); fprintf(stderr," FAILED: could not open %s to write\n", info.name); return -1; } formatChunkSize = write_header(out); index = 0; dataChunkSize = 0; ret = 1; while (ret >= 0) { ret = pi_file_read_record(pi_fp, index, &buffer, &size, &attr, &cat, &uid); if (ret >= 0) { dataChunkSize = write_data(buffer, index, size, dataChunkSize, out); } index++; } wWaveLength = 4 + 4 + 4 + formatChunkSize + 4 + 4 + dataChunkSize; fseek(out, 44, SEEK_SET); fwrite(&dataChunkSize, 4, 1, out); fseek(out, 4, SEEK_SET); fwrite(&wWaveLength, 4, 1, out); fclose(out); pi_file_close(pi_fp); if (!plu_quiet) { printf("OK, wrote %ld bytes to %s\n", dataChunkSize, info.name); } return 0; } int main(int argc, const char *argv[]) { int c; char *fetch = NULL, *convert = NULL; poptContext pc; struct poptOption options[] = { USERLAND_RESERVED_OPTIONS {"fetch", 'f', POPT_ARG_STRING, &fetch, 0, "Fetch all wav files or specified wav file from the Palm", "[file|all]"}, {"convert", 'c', POPT_ARG_STRING, &convert, 0, "Convert .wav.pdb file to wav", "file"}, POPT_TABLEEND }; pc = poptGetContext("pilot-wav", argc, argv, options, 0); poptSetOtherOptionHelp(pc,"\n\n" " Decodes Palm Voice Memo files to wav files you can read\n\n" " Example arguments: \n" " pilot-wav -p /dev/pilot -f MyVoiceMemo.wav.pdb\n" " pilot-wav -c MyVoiceMemo.wav.pdb\n\n"); if (argc < 2 ) { poptPrintUsage(pc,stderr,0); return 1; } while ((c = poptGetNextOpt(pc)) >= 0) { fprintf(stderr," ERROR: Unhandled option %d.\n",c); return 1; } if (c < -1) { plu_badoption(pc,c); } if(convert != NULL) pdb_to_wav(convert); if(fetch != NULL) do_fetch(fetch); return 0; } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/src/parsedate.y0000644000175000017500000005146107323401103020031 0ustar rousseaurousseau%{ /* $Revision: 1.16 $ ** ** Originally written by Steven M. Bellovin while ** at the University of North Carolina at Chapel Hill. Later tweaked by ** a couple of people on Usenet. Completely overhauled by Rich $alz ** and Jim Berets in August, 1990. ** Further revised (removed obsolete constructs and cleaned up timezone ** names) in August, 1991, by Rich. Paul Eggert ** helped in September, 1992. ** ** This grammar has six shift/reduce conflicts. ** ** This code is in the public domain and has no copyright. */ /* SUPPRESS 530 *//* Empty body for statement */ /* SUPPRESS 593 on yyerrlab *//* Label was not used */ /* SUPPRESS 593 on yynewstate *//* Label was not used */ /* SUPPRESS 595 on yypvt *//* Automatic variable may be used before set */ #include #include #include #include #include #include int date_lex(); #define yyparse date_parse #define yylex date_lex #define yyerror date_error /* See the LeapYears table in Convert. */ #define EPOCH 1970 #define END_OF_TIME 2038 /* Constants for general time calculations. */ #define DST_OFFSET 1 #define SECSPERDAY (24L * 60L * 60L) /* Readability for TABLE stuff. */ #define HOUR(x) (x * 60) #define LPAREN '(' #define RPAREN ')' #define IS7BIT(x) ((unsigned int)(x) < 0200) #define SIZEOF(array) ((int)(sizeof array / sizeof array[0])) #define ENDOF(array) (&array[SIZEOF(array)]) /* ** An entry in the lexical lookup table. */ typedef struct _TABLE { char *name; int type; time_t value; } TABLE; /* ** Daylight-savings mode: on, off, or not yet known. */ typedef enum _DSTMODE { DSTon, DSToff, DSTmaybe } DSTMODE; /* ** Meridian: am, pm, or 24-hour style. */ typedef enum _MERIDIAN { MERam, MERpm, MER24 } MERIDIAN; /* ** Global variables. We could get rid of most of them by using a yacc ** union, but this is more efficient. (This routine predates the ** yacc %union construct.) */ static char *yyInput; static DSTMODE yyDSTmode; static int yyHaveDate; static int yyHaveRel; static int yyHaveTime; static time_t yyTimezone; static time_t yyDay; static time_t yyHour; static time_t yyMinutes; static time_t yyMonth; static time_t yySeconds; static time_t yyYear; static MERIDIAN yyMeridian; static time_t yyRelMonth; static time_t yyRelSeconds; extern struct tm *localtime(); static void date_error(); %} %union { time_t Number; enum _MERIDIAN Meridian; } %token tDAY tDAYZONE tMERIDIAN tMONTH tMONTH_UNIT tSEC_UNIT tSNUMBER %token tUNUMBER tZONE %type tDAYZONE tMONTH tMONTH_UNIT tSEC_UNIT %type tSNUMBER tUNUMBER tZONE numzone zone %type tMERIDIAN o_merid %% spec : /* NULL */ | spec item ; item : time { yyHaveTime++; #ifdef lint /* I am compulsive about lint natterings... */ if (yyHaveTime == -1) { YYERROR; } #endif /* lint */ } | time zone { yyHaveTime++; yyTimezone = $2; } | date { yyHaveDate++; } | rel { yyHaveRel = 1; } ; time : tUNUMBER o_merid { if ($1 < 100) { yyHour = $1; yyMinutes = 0; } else { yyHour = $1 / 100; yyMinutes = $1 % 100; } yySeconds = 0; yyMeridian = $2; } | tUNUMBER ':' tUNUMBER o_merid { yyHour = $1; yyMinutes = $3; yySeconds = 0; yyMeridian = $4; } | tUNUMBER ':' tUNUMBER numzone { yyHour = $1; yyMinutes = $3; yyTimezone = $4; yyMeridian = MER24; yyDSTmode = DSToff; } | tUNUMBER ':' tUNUMBER ':' tUNUMBER o_merid { yyHour = $1; yyMinutes = $3; yySeconds = $5; yyMeridian = $6; } | tUNUMBER ':' tUNUMBER ':' tUNUMBER numzone { yyHour = $1; yyMinutes = $3; yySeconds = $5; yyTimezone = $6; yyMeridian = MER24; yyDSTmode = DSToff; } ; zone : tZONE { $$ = $1; yyDSTmode = DSToff; } | tDAYZONE { $$ = $1; yyDSTmode = DSTon; } | tZONE numzone { /* Only allow "GMT+300" and "GMT-0800" */ if ($1 != 0) { YYABORT; } $$ = $2; yyDSTmode = DSToff; } | numzone { $$ = $1; yyDSTmode = DSToff; } ; numzone : tSNUMBER { int i; /* Unix and GMT and numeric timezones -- a little confusing. */ if ($1 < 0) { /* Don't work with negative modulus. */ $1 = -$1; if ($1 > 9999 || (i = $1 % 100) >= 60) { YYABORT; } $$ = ($1 / 100) * 60 + i; } else { if ($1 > 9999 || (i = $1 % 100) >= 60) { YYABORT; } $$ = -(($1 / 100) * 60 + i); } } ; date : tUNUMBER '/' tUNUMBER { yyMonth = $1; yyDay = $3; } | tUNUMBER '/' tUNUMBER '/' tUNUMBER { if ($1 > 100) { yyYear = $1; yyMonth = $3; yyDay = $5; } else { yyMonth = $1; yyDay = $3; yyYear = $5; } } | tMONTH tUNUMBER { yyMonth = $1; yyDay = $2; } | tMONTH tUNUMBER ',' tUNUMBER { yyMonth = $1; yyDay = $2; yyYear = $4; } | tUNUMBER tMONTH { yyDay = $1; yyMonth = $2; } | tUNUMBER tMONTH tUNUMBER { yyDay = $1; yyMonth = $2; yyYear = $3; } | tDAY ',' tUNUMBER tMONTH tUNUMBER { yyDay = $3; yyMonth = $4; yyYear = $5; } ; rel : tSNUMBER tSEC_UNIT { yyRelSeconds += $1 * $2; } | tUNUMBER tSEC_UNIT { yyRelSeconds += $1 * $2; } | tSNUMBER tMONTH_UNIT { yyRelMonth += $1 * $2; } | tUNUMBER tMONTH_UNIT { yyRelMonth += $1 * $2; } ; o_merid : /* NULL */ { $$ = MER24; } | tMERIDIAN { $$ = $1; } ; %% /* Month and day table. */ static TABLE MonthDayTable[] = { { "january", tMONTH, 1 }, { "february", tMONTH, 2 }, { "march", tMONTH, 3 }, { "april", tMONTH, 4 }, { "may", tMONTH, 5 }, { "june", tMONTH, 6 }, { "july", tMONTH, 7 }, { "august", tMONTH, 8 }, { "september", tMONTH, 9 }, { "october", tMONTH, 10 }, { "november", tMONTH, 11 }, { "december", tMONTH, 12 }, /* The value of the day isn't used... */ { "sunday", tDAY, 0 }, { "monday", tDAY, 0 }, { "tuesday", tDAY, 0 }, { "wednesday", tDAY, 0 }, { "thursday", tDAY, 0 }, { "friday", tDAY, 0 }, { "saturday", tDAY, 0 }, }; /* Time units table. */ static TABLE UnitsTable[] = { { "year", tMONTH_UNIT, 12 }, { "month", tMONTH_UNIT, 1 }, { "week", tSEC_UNIT, 7L * 24 * 60 * 60 }, { "day", tSEC_UNIT, 1L * 24 * 60 * 60 }, { "hour", tSEC_UNIT, 60 * 60 }, { "minute", tSEC_UNIT, 60 }, { "min", tSEC_UNIT, 60 }, { "second", tSEC_UNIT, 1 }, { "sec", tSEC_UNIT, 1 }, }; /* Timezone table. */ static TABLE TimezoneTable[] = { { "gmt", tZONE, HOUR( 0) }, /* Greenwich Mean */ { "ut", tZONE, HOUR( 0) }, /* Universal */ { "utc", tZONE, HOUR( 0) }, /* Universal Coordinated */ { "cut", tZONE, HOUR( 0) }, /* Coordinated Universal */ { "z", tZONE, HOUR( 0) }, /* Greenwich Mean */ { "wet", tZONE, HOUR( 0) }, /* Western European */ { "bst", tDAYZONE, HOUR( 0) }, /* British Summer */ { "nst", tZONE, HOUR(3)+30 }, /* Newfoundland Standard */ { "ndt", tDAYZONE, HOUR(3)+30 }, /* Newfoundland Daylight */ { "ast", tZONE, HOUR( 4) }, /* Atlantic Standard */ { "adt", tDAYZONE, HOUR( 4) }, /* Atlantic Daylight */ { "est", tZONE, HOUR( 5) }, /* Eastern Standard */ { "edt", tDAYZONE, HOUR( 5) }, /* Eastern Daylight */ { "cst", tZONE, HOUR( 6) }, /* Central Standard */ { "cdt", tDAYZONE, HOUR( 6) }, /* Central Daylight */ { "mst", tZONE, HOUR( 7) }, /* Mountain Standard */ { "mdt", tDAYZONE, HOUR( 7) }, /* Mountain Daylight */ { "pst", tZONE, HOUR( 8) }, /* Pacific Standard */ { "pdt", tDAYZONE, HOUR( 8) }, /* Pacific Daylight */ { "yst", tZONE, HOUR( 9) }, /* Yukon Standard */ { "ydt", tDAYZONE, HOUR( 9) }, /* Yukon Daylight */ { "akst", tZONE, HOUR( 9) }, /* Alaska Standard */ { "akdt", tDAYZONE, HOUR( 9) }, /* Alaska Daylight */ { "hst", tZONE, HOUR(10) }, /* Hawaii Standard */ { "hast", tZONE, HOUR(10) }, /* Hawaii-Aleutian Standard */ { "hadt", tDAYZONE, HOUR(10) }, /* Hawaii-Aleutian Daylight */ { "ces", tDAYZONE, -HOUR(1) }, /* Central European Summer */ { "cest", tDAYZONE, -HOUR(1) }, /* Central European Summer */ { "mez", tZONE, -HOUR(1) }, /* Middle European */ { "mezt", tDAYZONE, -HOUR(1) }, /* Middle European Summer */ { "cet", tZONE, -HOUR(1) }, /* Central European */ { "met", tZONE, -HOUR(1) }, /* Middle European */ { "eet", tZONE, -HOUR(2) }, /* Eastern Europe */ { "msk", tZONE, -HOUR(3) }, /* Moscow Winter */ { "msd", tDAYZONE, -HOUR(3) }, /* Moscow Summer */ { "wast", tZONE, -HOUR(8) }, /* West Australian Standard */ { "wadt", tDAYZONE, -HOUR(8) }, /* West Australian Daylight */ { "hkt", tZONE, -HOUR(8) }, /* Hong Kong */ { "cct", tZONE, -HOUR(8) }, /* China Coast */ { "jst", tZONE, -HOUR(9) }, /* Japan Standard */ { "kst", tZONE, -HOUR(9) }, /* Korean Standard */ { "kdt", tZONE, -HOUR(9) }, /* Korean Daylight */ { "cast", tZONE, -(HOUR(9)+30) }, /* Central Australian Standard */ { "cadt", tDAYZONE, -(HOUR(9)+30) }, /* Central Australian Daylight */ { "east", tZONE, -HOUR(10) }, /* Eastern Australian Standard */ { "eadt", tDAYZONE, -HOUR(10) }, /* Eastern Australian Daylight */ { "nzst", tZONE, -HOUR(12) }, /* New Zealand Standard */ { "nzdt", tDAYZONE, -HOUR(12) }, /* New Zealand Daylight */ /* For completeness we include the following entries. */ #if 0 /* Duplicate names. Either they conflict with a zone listed above * (which is either more likely to be seen or just been in circulation * longer), or they conflict with another zone in this section and * we could not reasonably choose one over the other. */ { "fst", tZONE, HOUR( 2) }, /* Fernando De Noronha Standard */ { "fdt", tDAYZONE, HOUR( 2) }, /* Fernando De Noronha Daylight */ { "bst", tZONE, HOUR( 3) }, /* Brazil Standard */ { "est", tZONE, HOUR( 3) }, /* Eastern Standard (Brazil) */ { "edt", tDAYZONE, HOUR( 3) }, /* Eastern Daylight (Brazil) */ { "wst", tZONE, HOUR( 4) }, /* Western Standard (Brazil) */ { "wdt", tDAYZONE, HOUR( 4) }, /* Western Daylight (Brazil) */ { "cst", tZONE, HOUR( 5) }, /* Chile Standard */ { "cdt", tDAYZONE, HOUR( 5) }, /* Chile Daylight */ { "ast", tZONE, HOUR( 5) }, /* Acre Standard */ { "adt", tDAYZONE, HOUR( 5) }, /* Acre Daylight */ { "cst", tZONE, HOUR( 5) }, /* Cuba Standard */ { "cdt", tDAYZONE, HOUR( 5) }, /* Cuba Daylight */ { "est", tZONE, HOUR( 6) }, /* Easter Island Standard */ { "edt", tDAYZONE, HOUR( 6) }, /* Easter Island Daylight */ { "sst", tZONE, HOUR(11) }, /* Samoa Standard */ { "ist", tZONE, -HOUR(2) }, /* Israel Standard */ { "idt", tDAYZONE, -HOUR(2) }, /* Israel Daylight */ { "idt", tDAYZONE, -(HOUR(3)+30) }, /* Iran Daylight */ { "ist", tZONE, -(HOUR(3)+30) }, /* Iran Standard */ { "cst", tZONE, -HOUR(8) }, /* China Standard */ { "cdt", tDAYZONE, -HOUR(8) }, /* China Daylight */ { "sst", tZONE, -HOUR(8) }, /* Singapore Standard */ /* Dubious (e.g., not in Olson's TIMEZONE package) or obsolete. */ { "gst", tZONE, HOUR( 3) }, /* Greenland Standard */ { "wat", tZONE, -HOUR(1) }, /* West Africa */ { "at", tZONE, HOUR( 2) }, /* Azores */ { "gst", tZONE, -HOUR(10) }, /* Guam Standard */ { "nft", tZONE, HOUR(3)+30 }, /* Newfoundland */ { "idlw", tZONE, HOUR(12) }, /* International Date Line West */ { "mewt", tZONE, -HOUR(1) }, /* Middle European Winter */ { "mest", tDAYZONE, -HOUR(1) }, /* Middle European Summer */ { "swt", tZONE, -HOUR(1) }, /* Swedish Winter */ { "sst", tDAYZONE, -HOUR(1) }, /* Swedish Summer */ { "fwt", tZONE, -HOUR(1) }, /* French Winter */ { "fst", tDAYZONE, -HOUR(1) }, /* French Summer */ { "bt", tZONE, -HOUR(3) }, /* Baghdad */ { "it", tZONE, -(HOUR(3)+30) }, /* Iran */ { "zp4", tZONE, -HOUR(4) }, /* USSR Zone 3 */ { "zp5", tZONE, -HOUR(5) }, /* USSR Zone 4 */ { "ist", tZONE, -(HOUR(5)+30) }, /* Indian Standard */ { "zp6", tZONE, -HOUR(6) }, /* USSR Zone 5 */ { "nst", tZONE, -HOUR(7) }, /* North Sumatra */ { "sst", tZONE, -HOUR(7) }, /* South Sumatra */ { "jt", tZONE, -(HOUR(7)+30) }, /* Java (3pm in Cronusland!) */ { "nzt", tZONE, -HOUR(12) }, /* New Zealand */ { "idle", tZONE, -HOUR(12) }, /* International Date Line East */ { "cat", tZONE, HOUR(10) }, /* -- expired 1967 */ { "nt", tZONE, HOUR(11) }, /* -- expired 1967 */ { "ahst", tZONE, HOUR(10) }, /* -- expired 1983 */ { "hdt", tDAYZONE, HOUR(10) }, /* -- expired 1986 */ #endif /* 0 */ }; /* ARGSUSED */ static void date_error(s) char *s; { /* NOTREACHED */ } static time_t ToSeconds(Hours, Minutes, Seconds, Meridian) time_t Hours; time_t Minutes; time_t Seconds; MERIDIAN Meridian; { if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 61) return -1; if (Meridian == MER24) { if (Hours < 0 || Hours > 23) return -1; } else { if (Hours < 1 || Hours > 12) return -1; if (Hours == 12) Hours = 0; if (Meridian == MERpm) Hours += 12; } return (Hours * 60L + Minutes) * 60L + Seconds; } static time_t Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, dst) time_t Month; time_t Day; time_t Year; time_t Hours; time_t Minutes; time_t Seconds; MERIDIAN Meridian; DSTMODE dst; { static int DaysNormal[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static int DaysLeap[13] = { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static int LeapYears[] = { 1972, 1976, 1980, 1984, 1988, 1992, 1996, 2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028, 2032, 2036 }; register int *yp; register int *mp; register time_t Julian; register int i; time_t tod; if (Year < 0) Year = -Year; if (Year < 100) Year += 1900; if (Year < EPOCH) Year += 100; for (mp = DaysNormal, yp = LeapYears; yp < ENDOF(LeapYears); yp++) if (Year == *yp) { mp = DaysLeap; break; } if (Year < EPOCH || Year > END_OF_TIME || Month < 1 || Month > 12 /* NOSTRICT *//* conversion from long may lose accuracy */ || Day < 1 || Day > mp[(int)Month]) return -1; Julian = Day - 1 + (Year - EPOCH) * 365; for (yp = LeapYears; yp < ENDOF(LeapYears); yp++, Julian++) if (Year <= *yp) break; for (i = 1; i < Month; i++) Julian += *++mp; Julian *= SECSPERDAY; Julian += yyTimezone * 60L; if ((tod = ToSeconds(Hours, Minutes, Seconds, Meridian)) < 0) return -1; Julian += tod; tod = Julian; if (dst == DSTon || (dst == DSTmaybe && localtime(&tod)->tm_isdst)) Julian -= DST_OFFSET * 60L * 60L; return Julian; } static time_t DSTcorrect(Start, Future) time_t Start; time_t Future; { time_t StartDay; time_t FutureDay; StartDay = (localtime(&Start)->tm_hour + 1) % 24; FutureDay = (localtime(&Future)->tm_hour + 1) % 24; return (Future - Start) + (StartDay - FutureDay) * DST_OFFSET * 60L * 60L; } static time_t RelativeMonth(Start, RelMonth) time_t Start; time_t RelMonth; { struct tm *tm; time_t Month; time_t Year; tm = localtime(&Start); Month = 12 * tm->tm_year + tm->tm_mon + RelMonth; Year = Month / 12; Month = Month % 12 + 1; return DSTcorrect(Start, Convert(Month, (time_t)tm->tm_mday, Year, (time_t)tm->tm_hour, (time_t)tm->tm_min, (time_t)tm->tm_sec, MER24, DSTmaybe)); } static int LookupWord(buff, length) char *buff; register int length; { register char *p; register char *q; register TABLE *tp; register int c; p = buff; c = p[0]; /* See if we have an abbreviation for a month. */ if (length == 3 || (length == 4 && p[3] == '.')) for (tp = MonthDayTable; tp < ENDOF(MonthDayTable); tp++) { q = tp->name; if (c == q[0] && p[1] == q[1] && p[2] == q[2]) { yylval.Number = tp->value; return tp->type; } } else for (tp = MonthDayTable; tp < ENDOF(MonthDayTable); tp++) if (c == tp->name[0] && strcmp(p, tp->name) == 0) { yylval.Number = tp->value; return tp->type; } /* Try for a timezone. */ for (tp = TimezoneTable; tp < ENDOF(TimezoneTable); tp++) if (c == tp->name[0] && p[1] == tp->name[1] && strcmp(p, tp->name) == 0) { yylval.Number = tp->value; return tp->type; } /* Try the units table. */ for (tp = UnitsTable; tp < ENDOF(UnitsTable); tp++) if (c == tp->name[0] && strcmp(p, tp->name) == 0) { yylval.Number = tp->value; return tp->type; } /* Strip off any plural and try the units table again. */ if (--length > 0 && p[length] == 's') { p[length] = '\0'; for (tp = UnitsTable; tp < ENDOF(UnitsTable); tp++) if (c == tp->name[0] && strcmp(p, tp->name) == 0) { p[length] = 's'; yylval.Number = tp->value; return tp->type; } p[length] = 's'; } length++; /* Drop out any periods. */ for (p = buff, q = (char*)buff; *q; q++) if (*q != '.') *p++ = *q; *p = '\0'; /* Try the meridians. */ if (buff[1] == 'm' && buff[2] == '\0') { if (buff[0] == 'a') { yylval.Meridian = MERam; return tMERIDIAN; } if (buff[0] == 'p') { yylval.Meridian = MERpm; return tMERIDIAN; } } /* If we saw any periods, try the timezones again. */ if (p - buff != length) { c = buff[0]; for (p = buff, tp = TimezoneTable; tp < ENDOF(TimezoneTable); tp++) if (c == tp->name[0] && p[1] == tp->name[1] && strcmp(p, tp->name) == 0) { yylval.Number = tp->value; return tp->type; } } /* Unknown word -- assume GMT timezone. */ yylval.Number = 0; return tZONE; } int date_lex() { register char c; register char *p; char buff[20]; register int sign; register int i; register int nesting; for ( ; ; ) { /* Get first character after the whitespace. */ for ( ; ; ) { while (isspace(*yyInput)) yyInput++; c = *yyInput; /* Ignore RFC 822 comments, typically time zone names. */ if (c != LPAREN) break; for (nesting = 1; (c = *++yyInput) != RPAREN || --nesting; ) if (c == LPAREN) nesting++; else if (!IS7BIT(c) || c == '\0' || c == '\r' || (c == '\\' && ((c = *++yyInput) == '\0' || !IS7BIT(c)))) /* Lexical error: bad comment. */ return '?'; yyInput++; } /* A number? */ if (isdigit(c) || c == '-' || c == '+') { if (c == '-' || c == '+') { sign = c == '-' ? -1 : 1; yyInput++; if (!isdigit(*yyInput)) /* Skip the plus or minus sign. */ continue; } else sign = 0; for (i = 0; (c = *yyInput++) != '\0' && isdigit(c); ) i = 10 * i + c - '0'; yyInput--; yylval.Number = sign < 0 ? -i : i; return sign ? tSNUMBER : tUNUMBER; } /* A word? */ if (isalpha(c)) { for (p = buff; (c = *yyInput++) == '.' || isalpha(c); ) if (p < &buff[sizeof buff - 1]) *p++ = isupper(c) ? tolower(c) : c; *p = '\0'; yyInput--; return LookupWord(buff, p - buff); } return *yyInput++; } } time_t parsedate(p) char *p; { extern int date_parse(); time_t Start; yyInput = p; yyYear = 0; yyMonth = 0; yyDay = 0; yyTimezone = 0; yyDSTmode = DSTmaybe; yyHour = 0; yyMinutes = 0; yySeconds = 0; yyMeridian = MER24; yyRelSeconds = 0; yyRelMonth = 0; yyHaveDate = 0; yyHaveRel = 0; yyHaveTime = 0; if (date_parse() || yyHaveTime > 1 || yyHaveDate > 1) return -1; if (yyHaveDate || yyHaveTime) { Start = Convert(yyMonth, yyDay, yyYear, yyHour, yyMinutes, yySeconds, yyMeridian, yyDSTmode); if (Start < 0) return -1; } else return -1; Start += yyRelSeconds; if (yyRelMonth) Start += RelativeMonth(Start, yyRelMonth); /* Have to do *something* with a legitimate -1 so it's distinguishable * from the error return value. (Alternately could set errno on error.) */ return Start == -1 ? 0 : Start; } #ifdef TEST #if YYDEBUG extern int yydebug; #endif /* YYDEBUG */ /* ARGSUSED */ int main(ac, av) int ac; char *av[]; { char buff[128]; time_t d; #if YYDEBUG yydebug = 1; #endif /* YYDEBUG */ (void)printf("Enter date, or blank line to exit.\n\t> "); for ( ; ; ) { (void)printf("\t> "); (void)fflush(stdout); if (gets(buff) == NULL || buff[0] == '\n') break; #if YYDEBUG if (strcmp(buff, "yydebug") == 0) { yydebug = !yydebug; printf("yydebug = %s\n", yydebug ? "on" : "off"); continue; } #endif /* YYDEBUG */ d = parsedate(buff, (TIMEINFO *)NULL); if (d == -1) (void)printf("Bad format - couldn't convert.\n"); else (void)printf("%s", ctime(&d)); } exit(0); /* NOTREACHED */ } #endif /* TEST */ pilot-link-0.12.5-dfsg/pilot-link.m4.in0000644000175000017500000000222010567074774020046 0ustar rousseaurousseauAC_DEFUN([AC_PILOT_LINK_HOOK], [ PILOT_LINK_VERS=@PILOT_LINK_VERS@ PILOT_LINK_MAJOR=@PILOT_LINK_MAJOR@ PILOT_LINK_MINOR=@PILOT_LINK_MINOR@ PILOT_LINK_PATCH=@PILOT_LINK_PATCH@ AC_MSG_CHECKING(for pilot-link version >= $1) vers=$PILOT_LINK_VERS.$PILOT_LINK_MAJOR.$PILOT_LINK_MINOR$PILOT_LINK_PATCH pl_ve=`echo $1|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` pl_ma=`echo $1|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` pl_mi=`echo $1|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test $PILOT_LINK_VERS -gt $pl_ve; then AC_MSG_RESULT(yes ($vers)) elif test $PILOT_LINK_VERS -eq $pl_ve; then if test $PILOT_LINK_MAJOR -gt $pl_ma; then AC_MSG_RESULT(yes ($vers)) elif test $PILOT_LINK_MAJOR -eq $pl_ma; then if test $PILOT_LINK_MINOR -gt $pl_mi; then AC_MSG_RESULT(yes ($vers)) elif test $PILOT_LINK_MINOR -eq $pl_mi; then AC_MSG_RESULT(yes ($vers)) else AC_MSG_ERROR(no) fi else AC_MSG_ERROR(no) fi else AC_MSG_ERROR(no) fi ]) AC_DEFUN([AC_PILOT_LINK],[ if test x$1 = x; then plv=$PILOT_LINK_VERS.$PILOT_LINK_MAJOR.$PILOT_LINK_MINOR else plv=$1 fi AC_PILOT_LINK_HOOK($plv) ]) pilot-link-0.12.5-dfsg/doc/0000755000175000017500000000000011333433324015644 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/doc/man/0000755000175000017500000000000011333433324016417 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/doc/man/pilot-read-palmpix.10000644000175000017500000001445011333433317022217 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-read-palmpix" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-read-palmpix \- Convert all pictures in the files given or found on a Palm handheld. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-read\-palmpix\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-s\fR|\fB\-\-stretch\fR] [\fB\-c\fR|\fB\-\-colour\fR] [\fB\-t\fR|\fB\-\-type\fR [\fBppm|png\fR]] [\fB\-b\fR|\fB\-\-bias\fR \fBbias\fR] [\fB\-l\fR|\fB\-\-list\fR] [\fB\-n\fR|\fB\-\-name\fR \fBname\fR] [\fIfile\fR] \&.\&.\&. .PP \fIpilot\-read\-palmpix\fR Image1\&.pdb Image2\&.pdb Image3\&.pdb .SH "DESCRIPTION" .PP \fIpilot\-read\-palmpix\fR allows a Kodak PalmPix camera user to extract the images from their Palm handheld and convert them to Portable Network Graphic (\&.png) or Portable Pixmap (\&.ppm) files on their system\&. The default output type is Portable Pixmap (\&.ppm)\&. .PP \fIpilot\-read\-palmpix\fR converts all pictures in the files given, or if no files are given, on a Palm handheld, to Portable Pixmap files\&. .SH "OPTIONS" .SS "pilot-read-palmpix options" \fB\-b\fR, \fB\-\-bias\fR \fBbias\fR .PP lighten or darken the image (0\&.\&.49 darken, 51\&.\&.100 lighten) \fB\-c\fR, \fB\-\-colour\fR .PP Do a simple colour correction\&. The colour correction code makes a histogram from the image\&. Using the histogram it then makes up a couple of colour tables to try and balance the colours\&. It also clips the top and bottom colours to produce better perceived contrast\&. \fB\-l\fR, \fB\-\-list\fR .PP List picture information found on the Palm handheld instead of converting the entries found to image files\&. \fB\-n\fR, \fB\-\-name\fR <\fIpixname\fR> .PP Convert only \fIpixname\fR to STDOUT, and output as \fBtype\fR: \&.ppm or \&.png\&. \fB\-s\fR, \fB\-\-stretch\fR .PP Do a histogram stretch on the colour planes \fB\-t\fR, \fB\-\-type\fR \fB[ppm|png]\fR .PP Specify the output picture type\&. Can be either "png" or "ppm"\&. .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR \fIport\fR .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-read\-palmpix\fR will look for the \fI $PILOTPORT \fR environment variable\&. If neither are found or supplied, \fIpilot\-read\-palmpix\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-read\-palmpix\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-read\-palmpix\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "USAGE" .PP If a filelist is not given, connects to the target Palm handheld, and reads the images found in the Kodak PalmPix image database (\fIArchImage\&.pdb\fR), and allows the user to view the list of images and image details, or to select one or all of them, and convert them to Portable Network Graphic (\&.png) or Portable Pixmap (\&.ppm) files to be viewed or printed at the desktop\&. .PP If no options are specified, all of the images on the device will be converted to ppm files by default\&. .PP If a filelist is given, convert all listed files previously fetched via pilot\-xfer\&. See \fIBUGS\fR \- a single file argument is ignored, a list will work\&. .SH "AUTHOR" .PP \fIpilot\-read\-palmpix \fR was originally written by Angus Ainslie ,and updated by John Marshall to include core pilot\-link functionality\&. .PP This manual page was converted to XML by Neil Williams .SH "BUGS" .SS "Known Bugs" .PP \fIpilot\-read\-palmpix\fR's colour correction is nearly as good as Kodak's own, but Kodak has deprecated the PalmPix device, so it is not likely that there will be any updates to their software in the future, so this may be as good as it gets\&. A simple method to improve the look of colours is to do a histogram equalization in your favourite image editor\&. .PP \fIpilot\-read\-palmpix\fR command DOES read from a file, but only if you specify a LIST of files\&. If only one file is given, the command tries reading from \fI$PILOTPORT\fR\&. .SS "Reporting Bugs" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-link\fR(7) pilot-link-0.12.5-dfsg/doc/man/Makefile.in0000644000175000017500000004251311333433243020471 0ustar rousseaurousseau# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ target_triplet = @target@ subdir = doc/man DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/bluez.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/tcl.m4 \ $(top_srcdir)/m4/threads.m4 \ $(top_srcdir)/m4/vl_lib_readline.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/include/pi-md5.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man7dir)" man7dir = $(mandir)/man7 NROFF = nroff MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLUEZ_CFLAGS = @BLUEZ_CFLAGS@ BLUEZ_LIBS = @BLUEZ_LIBS@ CAT_ENTRY_END = @CAT_ENTRY_END@ CAT_ENTRY_START = @CAT_ENTRY_START@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOCBOOK_ROOT = @DOCBOOK_ROOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVA = @JAVA@ JAVABASE = @JAVABASE@ JAVAC = @JAVAC@ JAVA_VERSION = @JAVA_VERSION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PIC_LIBS = @PIC_LIBS@ PILOT_LINK_MAJOR = @PILOT_LINK_MAJOR@ PILOT_LINK_MINOR = @PILOT_LINK_MINOR@ PILOT_LINK_PATCH = @PILOT_LINK_PATCH@ PILOT_LINK_VERS = @PILOT_LINK_VERS@ PISOCK_AGE = @PISOCK_AGE@ PISOCK_CURRENT = @PISOCK_CURRENT@ PISOCK_REVISION = @PISOCK_REVISION@ PISYNC_AGE = @PISYNC_AGE@ PISYNC_CURRENT = @PISYNC_CURRENT@ PISYNC_REVISION = @PISYNC_REVISION@ PKG_CONFIG = @PKG_CONFIG@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ POPT_INCLUDES = @POPT_INCLUDES@ POPT_LIBS = @POPT_LIBS@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_H = @PYTHON_H@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RL_LIBS = @RL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ XML_CATALOG = @XML_CATALOG@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ builddir = @builddir@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ usb_libs = @usb_libs@ man_MANS = \ ietf2datebook.1 \ pilot-addresses.1 \ pilot-clip.1 \ pilot-csd.1 \ pilot-debugsh.1 \ pilot-dedupe.1 \ pilot-dlpsh.1 \ pilot-file.1 \ pilot-foto.1 \ pilot-getram.1 \ pilot-getrom.1 \ pilot-getromtoken.1 \ pilot-hinotes.1 \ pilot-install-datebook.1 \ pilot-install-expenses.1 \ pilot-install-hinote.1 \ pilot-install-memo.1 \ pilot-install-netsync.1 \ pilot-install-todo.1 \ pilot-install-todos.1 \ pilot-install-user.1 \ pilot-link.7 \ pilot-memos.1 \ pilot-nredir.1 \ pilot-read-expenses.1 \ pilot-read-ical.1 \ pilot-read-notepad.1 \ pilot-read-palmpix.1 \ pilot-read-screenshot.1 \ pilot-read-todos.1 \ pilot-read-veo.1 \ pilot-reminders.1 \ pilot-schlep.1 \ pilot-foto-treo600.1 \ pilot-foto-treo650.1 \ pilot-wav.1 \ pilot-xfer.1 EXTRA_DIST = $(man_MANS) all: all-am .SUFFIXES: $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/man/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } install-man7: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man7dir)" || $(MKDIR_P) "$(DESTDIR)$(man7dir)" @list=''; test -n "$(man7dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.7[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man7dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man7dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man7dir)" || exit $$?; }; \ done; } uninstall-man7: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man7dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.7[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man7dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man7dir)" && rm -f $$files; } tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man7dir)"; 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-man7 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 uninstall-man7 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-man7 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am uninstall uninstall-am uninstall-man uninstall-man1 \ uninstall-man7 # 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: pilot-link-0.12.5-dfsg/doc/man/pilot-dlpsh.10000644000175000017500000001246311333433316020747 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-dlpsh" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-dlpsh \- An interactive Desktop Link Protocol (DLP) Shell for your Palm device. .SH "SECTION" .PP pilot\-link: Tools .SH "SYNOPSIS" .PP \fIpilot\-dlpsh\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-c\fR|\fB\-\-command\fR \fBSTRING\fR] [\fB\-i\fR|\fB\-\-interactive\fR] [\fB\-\-version\fR] .SH "OPTIONS" .SS "pilot-dlpsh options" \fB\-c\fR, \fB\-\-command STRING\fR .PP Execute \fBcmd\fR and exit immediately\&. \fB\-i\fR, \fB\-\-interactive\fR .PP Enter interactive mode .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR < \fBport\fR> .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-dlpsh\fR will look for the \fI$PILOTPORT\fR environment variable\&. If the port is missing and \fI$PILOTPORT\fR is not set, \fIpilot\-dlpsh\fR will print the usage information\&. \fB\-\-version\fR .PP Display the copyright information, version number, license details and build details and exit without connecting\&. .SH "DESCRIPTION" .PP \fIpilot\-dlpsh\fR allows the user to connect to a Palm handheld and execute arbitrary DLP commands\&. .PP pilot\-dlpsh can query many different types of information from your Palm device, such as username, memory capacity, set the time, as well as other useful functions\&. .PP Once connected, the user may execute most of the built\-in \fIDLP\fR commands\&. (See \fIBUILT\-IN COMMANDS \fR below for more detail on currently supported options)\&. .PP The connection to the Pilot is kept alive by sending a \fIPadTickle\fR packet to the Pilot after a small period of non\-activity\&. (7 seconds by default) .SH "BUILT-IN COMMANDS" .PP There are many options available while connected to your Palm handheld via \fIpilot\-dlpsh\fR, including the following: .PP \fBuser, u\fR .PP Print the currently set User information, including Username, UserID, PCid, and ViewerID\&. You may also set these values from this command as well\&. To set these values, simply pass the value to the option, such as 'user John Q\&. Public' for example\&. .PP \fBls\fR .PP Used with \fB\-l\fR and \fB\-r\fR to provide long and RAM and ROM file lists, similar to (but slightly different from) the Unix 'ls' command\&. This does not yet allow you to narrow your listing to a certain range of files\&. It will simply list them all\&. .PP \fBdf\fR .PP Display how much RAM and ROM is free on your device, again similar to the Unix 'df' command\&. This does not accept arguments at this time\&. .PP \fBntp, time, dtp\fR .PP Set the time on the Palm from the currently\-set desktop time\&. This does not work on OS version 3\&.3, due to a bug in PalmOS at that time\&. .PP \fBrm, del\fR .PP Remove a file and delete it entirely from the Palm device\&. This is an irrevokable process, and you cannot "undelete" a file, once it has been deleted with this command\&. .PP \fBquit, q, exit, bye\fR .PP Exit the DLP Protocol Shell .SH "OPTIONS" .PP Passing commandline options to \fBpilot\-dlpsh\fR will allow you to interact with it in unattended mode, for example: '\fBpilot\-dlpsh\fR \-p usb: \-c user' will connect and display the user information, just as if you had connected interactively and typed 'user' at the DLP shell prompt\&. .SH "USAGE" .PP The program will connect to your Palm handheld and give the user an interactive prompt (a "shell") for executing commands across the DLP \fIHotSync\fR protocol\&. .SH "AUTHOR" .PP \fBpilot\-dlpsh\fR was originally written by Chris Stevens and Damien Neil .PP This manual page was updated to XML by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-link\fR(7) pilot-link-0.12.5-dfsg/doc/man/pilot-debugsh.10000644000175000017500000000537711333433316021264 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-debugsh" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-debugsh \- Simple debugging console for a Palm Handheld device [deprecated]. .SH "SECTION" .PP pilot\-link: Tools .SH "SYNOPSIS" .PP \fBpilot\-debugsh\fR \fB/dev/tty<0\&.\&.n>\fR .SH "DESCRIPTION" .PP \fIpilot\-debugsh\fR is a commandline interface to the Palm debug monitor\&. Use device file \fI /dev/tty<0\&.\&.n> \fR to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-debugsh\fR will output a simple usage help message\&. .SH "SHELL COMMANDS" \fBcoldboot\fR .PP Restart your Palm \fBreboot\fR .PP Restart your Palm \fBnumdb\fR .PP Returns the number of databases on the PDA card\&. \fBdbinfo\fR .PP Returns the names of databases on the Palm\&. \fBquit\fR .PP Quits the debug shell\&. .SH "USAGE" .PP The program will connect to your Palm handheld and give the user an interactive prompt (a "shell") for executing debugging commands\&. .SH "AUTHOR" .PP This manual page was written by Ludovic Rousseau for the Debian GNU/Linux system\&. .PP Updated for pilot\-link 0\&.12 by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-link\fR(7) pilot-link-0.12.5-dfsg/doc/man/pilot-foto-treo600.10000644000175000017500000000702711333433320021774 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-foto-treo600" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-foto-treo600 \- Copies Treo "foto" databases to current directory and extracts image files from within them. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-foto\-treo600\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-\-usage\fR] [\fB\-w\fR|\fB\-\-write\fR] .SH "DESCRIPTION" .PP Copies Treo "foto" databases to current directory and extracts the \&.jpg image files within them\&. .SH "OPTIONS" .SS "pilot-foto-treo600 options" \fB\-w\fR, \fB\-\-write\fR .PP Write the database data to disk .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR \fIport\fR .PP Use device file \fIport\fR to communicate with the Palm handheld\&. If this is not specified, will look for the \fI$PILOTPORT\fR environment variable\&.If neither are found or supplied, \fIpilot\-foto\-treo600\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-foto\-treo600\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-foto\-treo600\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "EXAMPLE" .PP # connect to the Palm device and fetch all photos found in the Treo "foto" database, convert them to \&.jpg files and write them to disk on your local machine in the current working directory\&. .PP .nf \fIpilot\-foto\-treo600\fR \fB\-p\fR \fI/dev/pilot\fR \fB\-w\fR .fi .SH "AUTHOR" .PP This manual page was written by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-foto\fR (1), \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-install-todos.10000644000175000017500000000757411333433317022441 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-install-todos" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-install-todos \- Updates the Palm ToDo list with entries from a local file. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-install\-todos\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-f\fR|\fB\-\-filename\fR \fBSTRING\fR] .SH "DESCRIPTION" .PP \fIpilot\-install\-todos\fR allows the user to update the Palm ToDo list with entries from a local file\&. .PP The format of this file is a simple line\-by\-line ToDo task entry\&. For each new line in the local file, a new task is created in the ToDo database on the Palm\&. .SH "OPTIONS" .SS "pilot-install-todos options" \fB\-f\fR, \fB\-\-filename\fR \fIfilename\fR .PP A local filename containing the ToDo entry text\&. .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR <\fBport\fR> .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-install\-todos\fR will look for the \fI $PILOTPORT \fR environment variable\&. If neither are found or supplied, \fIpilot\-install\-todos\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-install\-todo\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-install\-todos\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "USAGE" .PP The program will connect to a target Palm handheld, and creates the ToDo entry to the Palm ToDo application, using the specified file\&. .SH "EXAMPLE" .PP \fB\-p\fR \fI/dev/pilot\fR \fB\-f\fR \fI$HOME/MyTodoList\&.txt\fR .SH "AUTHOR" .PP \fIpilot\-install\-todo\fR was originally written by Martin Fick, based on code in \fIpilot\-install\-todos\fR by Robert A\&. Kaplan\&. .PP This manual page was written by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-install\-todo\fR(1), \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-dedupe.10000644000175000017500000000615111333433316021100 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-dedupe" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-dedupe \- Removes duplicate records from any Palm database. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-dedupe\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] \fIdatabase\fR \&.\&.\&. .SH "DESCRIPTION" .PP \fIpilot\-dedupe\fR is used to remove duplicate records from any Palm database\&. .SH "OPTIONS" .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR lt;\fBport\fR> .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-dedupe\fR will look for the \fI $PILOTPORT \fR environment variable\&. If neither are found or supplied, \fIpilot\-dedupe\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-dedupe\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-dedupe\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "EXAMPLE" .PP To remove duplicates from the Address and Todo databases: .PP \fIpilot\-dedupe\fR \-p /dev/pilot AddressDB ToDoDB .SH "AUTHOR" .PP This manual page was written by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-foto.10000644000175000017500000001314711333433316020604 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-foto" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-foto \- Palm 'Foto' Image Installer/Remover/Fetcher/Converter .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-foto\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-\-usage\fR] [\fB\-d\fR|\fB\-\-delete\fR] [\fB\-\-delete\-all\fR] [\fB\-i\fR|\fB\-\-install\fR] [\fB\-l\fR|\fB\-\-list\fR] [\fB\-f\fR|\fB\-\-fetch\fR] [\fB\-F\fR|\fB\-\-fetch\-all\fR] [\fB\-c\fR|\fB\-\-convert\fR] .SH "DESCRIPTION" .PP This is a palm conduit to fetch, install, or remove, Foto files from a Palm\&. It can also convert *\&.jpg\&.pdb files that have already been fetched from the Palm to jpeg files\&. .PP Delete all, or named fotos from handheld\&. .PP Install one, or many jpeg images to handheld\&. .PP List all jpeg files and thumbnails on handheld\&. .PP Fetch all jpeg files, or certain ones by name\&. .PP Tries to detect if a file really is a jpeg and refuses to install it, if it is not\&. .PP pilot\-foto allows you to do multiple operations in one sync\&. For instance, delete test\&.jpg and install test\&.jpg\&. .SH "USAGE" .PP pilot\-foto \-p [options] \fIfile\fR .SH "OPTIONS" .SS "pilot-foto options" \fB\-d\fR, \fB\-\-delete\fR .PP Delete a jpg file on the handheld \fB\-\-delete\-all\fR .PP Delete ALL jpg files on the handheld \fB\-i\fR, \fB\-\-install\fR .PP Install a jpg file \fB\-l\fR, \fB\-\-list\fR .PP List all photos and thumbnails \fB\-f\fR, \fB\-\-fetch\fR .PP Fetch files from the Palm \fB\-F\fR, \fB\-\-fetch\-all\fR .PP Fetch ALL jpg files from the Palm \fB\-c\fR, \fB\-\-convert\fR .PP convert \fI[file]\&.jpg\&.pdb\fR files to jpg .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR \fIport\fR .PP Use device file \fIport\fR to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-foto\fR will look for the \fI$PILOTPORT\fR environment variable\&. If neither are found or supplied, \fI pilot\-foto \fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-foto\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-foto\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "EXAMPLES" .nf Examples: pilot\-foto \-p \fB/dev/pilot\fR \-f pilot\-foto \-d \fBMyImage\&.jpg\fR pilot\-foto \-i \fBMyImage\&.jpg\fR pilot\-foto \-i \fB*\&.jpg\fR pilot\-foto \-f \fBMyImage\fR pilot\-foto \-c \fBMyImage\&.jpg\&.pdb\fR .fi .SH "PROBLEMS" .PP Palm has not published their database format for the thumbnails\&. So, pilot\-foto puts a generic penguin thumbnail for every image uploaded\&. Fotos can be accessed by a named list on the handheld as well as the thumbnails\&. This has been tried on a couple of handhelds\&. It is possible that a foreign palm or different model will not like it\&. .PP To get a thumbnail image you can copy the jpegs to the memory card\&. If you copy them back to the handheld they will have a new thumbnail that matches the jpeg\&. .SH "AUTHOR" .PP This manual page was converted to XML by Neil Williams .SH "BUGS" .PP If a jpeg is installed with the same name as one already on the palm you will have 2 thumbnails pointing to the same jpeg\&. The new jpeg will overwrite the old jpeg\&. .PP If the thumbnail fails to install then the jpeg should be removed\&. It is not\&. .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-link\fR(7) pilot-link-0.12.5-dfsg/doc/man/pilot-getram.10000644000175000017500000001116711333433316021114 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-getram" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-getram \- Retrieves the RAM image from your Palm device for use in debugging. .SH "SECTION" .PP pilot\-link: Tools .SH "SYNOPSIS" .PP \fIpilot\-getram\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-t\fR|\fB\-\-token\fR \fBtoken\fR] [\fB\-s\fR|\fB\-\-sysinfo\fR] [\fB\-\-ram\fR] [\fB\-\-rom\fR] [\fIfilename\fR] .SH "DESCRIPTION" .PP \fIpilot\-getram\fR is used to fetch the current RAM image from your Palm handheld for use in debugging\&. .PP \fIpilot\-getromtoken\fR, \fIpilot\-getrom\fR and \fIpilot\-getram\fR are inter\-related\&. All relevant code is implemented in \fIpilot\-getrom\fR, and you can do \fIpilot\-getromtoken\fR \fB\-\-ram\fR \fIfilename\fR to get the RAM dump if you like\&. .PP Note, because \fIpilot\-getrom\fR uses the low\-level RPC protocol to fetch the ROM image, and the new OS5 devices do not use this protocol, you currently cannot fetch an OS5 ROM image using this utility\&. This will be updated in a future release to handle fetching OS5 ROM images, using the debugger protocol\&. .SH "OPTIONS" .SS "pilot-getram options" \fB\-t\fR, \fB\-\-token\fR \fBtoken\fR .PP A ROM token to read (i\&.e\&. snum) \fB\-s\fR, \fB\-\-sysinfo\fR .PP Print SysInfo \fB\-\-ram\fR .PP Read RAM \fB\-\-rom\fR .PP Read ROM <\fBfilename\fR> .PP Write the RAM image to the file named by <\fIfilename\fR>\&. If this is omitted, the filename will be written out as the RAM version name as follows: '\fI pilot\-$VERSION\&.ram \fR ', where an OS 3\&.5 image would be written as the filename of '\fIpilot\-3\&.5\&.0\&.ram\fR'\&. .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR <\fBport\fR> .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-getram\fR will look for the \fI$PILOTPORT\fR environment variable\&. If neither are found or supplied, \fI pilot\-getram \fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-getram\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-getram\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "USAGE" .PP Connect to a target Palm handheld and fetch the RAM from the device\&. .SH "AUTHOR" .PP \fIpilot\-getram\fR was originally written by Kenneth Albanowski\&. .PP This manual page was converted to XML by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-getrom\fR (1), \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-foto-treo650.10000644000175000017500000000677211333433320022007 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-foto-treo650" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-foto-treo650 \- Copies Treo "foto" databases and videos to the current directory .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-foto\-treo650\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-\-usage\fR] [\fB\-w\fR|\fB\-\-write\fR] .SH "DESCRIPTION" .PP Copies Treo "foto" databases to current directory and extracts the \&.jpg image files within them\&. .SH "OPTIONS" .SS "pilot-foto-treo650 option" \fB\-w\fR, \fB\-\-write\fR .PP Write the database data to disk .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR \fIport\fR .PP Use device file \fIport\fR to communicate with the Palm handheld\&. If this is not specified, will look for the \fI$PILOTPORT\fR environment variable\&.If neither are found or supplied, \fIpilot\-foto\-treo650\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-foto\-treo650\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-foto\-treo650\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "EXAMPLE" .PP # connect to the Palm device and fetch all photos found in the Treo "foto" database, convert them to \&.jpg files and write them to disk on your local machine in the current working directory\&. .PP .nf \fIpilot\-foto\-treo650\fR \fB\-p\fR \fI/dev/pilot\fR \fB\-w\fR .fi .SH "AUTHOR" .PP This manual page was written by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-foto\fR (1), \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-install-todo.10000644000175000017500000001227611333433317022251 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-install-todo" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-install-todo \- Updates the Palm ToDo list with one new entry. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-install\-todo\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-P\fR|\fB\-\-priority\fR [\fB1|2|3|4|5\fR]] [\fB\-d\fR|\fB\-\-due\fR \fBmm/dd/yyyy\fR] [\fB\-c\fR|\fB\-\-completed\fR] [\fB\-D\fR|\fB\-\-description\fR [\fBtitle\fR]] [\fB\-n\fR|\fB\-\-note\fR \fBnote\fR] [\fB\-f\fR|\fB\-\-file\fR \fIfilename\fR] .SH "DESCRIPTION" .PP \fIpilot\-install\-todo\fR allows the user to install one new ToDo list entry with specified paramters passed to \fIpilot\-install\-todo\fR and add a Note entry using text found in a filename <\fIfilename\fR> passed to \fIpilot\-install\-todo\fR\&. .SH "OPTIONS" .SS "pilot-install-todo options" \fB\-P\fR, \fB\-\-priority\fR \fBpriority\fR .PP Specify the priority of the ToDo entry \- 1|2|3|4|5 (defaults to a priority of 1)\&. .PP \fINOTE:\fR this value has changed from the default of 4 to the default of 1, just as a new ToDo entry on the Palm would set it\&. \fB\-d\fR, \fB\-\-due\fR \fBduedate\fR .PP The due Date MM/DD/YYYY (defaults to blank, no due date if this is not specified)\&. \fB\-c\fR, \fB\-\-completed\fR .PP Mark the item complete (the default is to mark the item as incomplete, as the Palm would do it)\&. \fB\-D\fR, \fB\-\-description\fR \fBtitle\fR .PP The title of the ToDo entry \fB\-n\fR, \fB\-\-note\fR \fBnote\fR .PP The Note text you wish to add to this ToDo entry, if any\&. \fB\-f\fR, \fB\-\-file\fR \fIfilename\fR .PP A local filename containing the Note text\&. .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR <\fBport\fR> .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-install\-todo\fR will look for the \fI $PILOTPORT \fR environment variable\&. If neither are found or supplied, \fIpilot\-install\-todo\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-install\-todo\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-install\-todo\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "USAGE" .PP The program will connect to a target Palm handheld, and creates the ToDo entry to the Palm ToDo application, using the specified parameters and input from the supplied file passed as arguments on the commandline\&. .SH "EXAMPLE" .PP \fIpilot\-install\-todo\fR \fB\-p\fR \fI/dev/pilot\fR \fB\-n\fR \fB'Buy Milk'\fR \fB\-D\fR \fB'Go shopping, see note for items'\fR .SH "AUTHOR" .PP \fIpilot\-install\-todo\fR was originally written by Martin Fick, based on code in \fIpilot\-install\-todos\fR by Robert A\&. Kaplan\&. .PP This manual page was converted to XML by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-install\-todos\fR(1), \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-wav.10000644000175000017500000000733611333433320020430 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-wav" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-wav \- Decodes Palm Voice Memo files to wav files you can read on your desktop .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-wav\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-\-usage\fR] [\fB\-f\fR|\fB\-\-fetch\fR [\fIfile\fR|\fBall\fR]] [\fB\-c\fR|\fB\-\-convert\fR \fIfile\fR] .SH "OPTIONS" .SS "pilot-wav options" \fB\-f\fR, \fB\-\-fetch\fR [\fIfile\fR|\fBall\fR] .PP Fetch all wav files or specified wav file from the Palm\&. \fB\-c\fR, \fB\-\-convert\fR \fIfile\&.wav\&.pdb\fR .PP Convert \fIfile\&.wav\&.pdb\fR file to wav .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR \fIport\fR .PP Use device file \fIport\fR to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-wav\fR will look for the \fI$PILOTPORT\fR environment variable\&. If neither are found or supplied, \fI pilot\-wav \fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-wav\fR\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-wav\fR\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "EXAMPLES" .PP # Fetch all of the voice memo files from your Palm and save them to \&.wav files on your desktop machine .PP .nf \fIpilot\-wav\fR \fB\-p\fR \fI/dev/pilot\fR \fB\-f\fR \fI MyVoiceMemo\&.wav\&.pdb \fR .fi .PP # Convert all voice memos found in MyVoiceMemo to \&.wav files on your desktop machine .PP .nf \fIpilot\-wav\fR \fB\-c\fR \fIMyVoiceMemo\&.wav\&.pdb\fR .fi .SH "AUTHOR" .PP This manual page was written by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-link\fR(7) pilot-link-0.12.5-dfsg/doc/man/pilot-install-netsync.10000644000175000017500000001265311333433317022766 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-install-nets" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-install-netsync \- reads or sets the Network Preferences information on a Palm Device. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-install\-netsync\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-e\fR|\fB\-\-enable\fR] [\fB\-d\fR|\fB\-\-disable\fR] [\fB\-n\fR|\fB\-\-name\fR \fBname\fR] [\fB\-a\fR|\fB\-\-address\fR \fBaddress\fR] [\fB\-m\fR|\fB\-\-mask\fR \fBnetmask\fR] .SH "DESCRIPTION" .PP \fIpilot\-install\-netsync\fR allows the user to read or change the Network Preferences stored on the Palm\&. .SH "OPTIONS" .SS "pilot-install-netsync options" \fB\-e\fR, \fB\-\-enable\fR .PP Enable the LanSync operation (Used for performing a "Network" HotSync (synchronize across the Internet for example) instead of "Local" HotSync)\&. \fB\-d\fR, \fB\-\-disable\fR .PP Disable the LANSync setting on the Palm \fB\-a\fR, \fB\-\-address\fR=\fBaddress\fR .PP Set the IP address of the remote machine you wish to connect to via "Network" HotSync\&. This is \fInot\fR the IP address of the Palm device itself\&. In most cases the Palm will be assigned an IP address automatically by your desktop or server\-side configuration\&. \fB\-n\fR, \fB\-\-name\fR \fBhostname\fR .PP Sets the hostname of the remote machine you wish to connect to via "Network" HotSync\&. This is \fInot\fR the hostname of the Palm device itself\&. \fB\-i\fR, \fB\-\-ip\fR \fBip\fR .PP This option is no longer supported in 0\&.12 \- see \-a, \-\-address\&. \fB\-m\fR, \fB\-\-mask\fR \fBnetmask\fR .PP Set the netmask of the remote machine you wish to connect to via "Network" HotSync\&. This is \fInot\fR the netmask address of the Palm device itself, it should be assigned a netmask value at connection time, based on your desktop or server\-side configuration\&. .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR lt;\fBport\fR> .PP Use device file <\fBport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-install\-netsync\fR will look for the \fI $PILOTPORT \fR environment variable\&. If neither are found or supplied, \fIpilot\-install\-netsync\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-install\-netsync\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-install\-netsync\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "USAGE" .PP The program will connect to a target Palm handheld, and read and display or set the Network Preferences information specified or display the Network Preferences stored on the Palm device\&. .SH "EXAMPLE" .PP \fB\-p\fR \fIusb:\fR \fB\-H\fR \fB"NEPTUNE"\fR \fB\-a\fR \fB10\&.0\&.1\&.10\fR \fB\-n\fR \fB255\&.255\&.255\&.0\fR .SH "AUTHOR" .PP \fIpilot\-install\-netsync\fR was created from the original \fIpilot\-install\-user\fR application originally written by D\&. Jeff Dionne , and was split into a separate conduit by JP Rosevear < jpr@ximian\&.com > \&. .PP This manual page was converted to XML by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-install\-user\fR(1), \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-read-expenses.10000644000175000017500000000767611333433317022413 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-read-expenses" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-read-expenses \- Export Palm Expense application data in a text format. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-read\-expenses\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-w\fR|\fB\-\-write\fR] .SH "DESCRIPTION" .PP \fIpilot\-read\-expenses\fR is used to output the Expense data in a simple text format, which can be used to import into any other application you wish, such as Excel or other application\&. .PP If you have expense entries saved on your Palm in the ExpenseDB\&.pdb file, you can export them to a simple text format, and redirect that to a file/pipe, or STDOUT (the default) using \fIpilot\-read\-expenses\fR\&. .PP The output data will resemble something like the following: .nf Category: Unfiled Type: 5 Payment: 7 Currency: 23 Amount: 400\&.00 Vendor: Super Salads City: Westerly Attendees: Joe, Mary, Bob Note: Some simple note text Date: Fri May 9 00:00:00 2004 .fi .SH "OPTIONS" .SS "pilot-read-expenses option" \fB\-w\fR, \fB\-\-write\fR .PP Write out the expense data .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR \fIport\fR .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-read\-expenses\fR will look for the \fI $PILOTPORT \fR environment variable\&. If neither are found or supplied, \fIpilot\-read\-expenses\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-read\-expenses\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-read\-expenses\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "AUTHOR" .PP \fIpilot\-read\-expenses\fR was originally written by Kenneth Albanowski\&. .PP This manual page was converted to XML by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "SEE ALSO" .PP \fIpilot\-link\fR(7) .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIinstall\-expenses\fR (1), \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-install-memo.10000644000175000017500000001206711333433317022237 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-install-memo" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-install-memo \- Installs a new Memo Pad entry onto your Palm handheld. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-install\-memo\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-c\fR|\fB\-\-category\fR \fBname\fR] [\fB\-r\fR|\fB\-\-replace\fR] [\fB\-t\fR|\fB\-\-title\fR] [\fB\-f\fR|\fB\-\-file\fR \fBSTRING\fR \&.\&.\&.] .SH "DESCRIPTION" .PP \fIpilot\-install\-memo\fR allows the user to write one or more files as a new memo or memos, respectively, onto the Palm handheld\&. .SH "OPTIONS" .SS "pilot-install-memo options" \fB\-c\fR, \fB\-\-category\fR \fBcategory\fR .PP Install memo(s) to category defined by \fBcategory\fR\&. \fIpilot\-install\-memo\fR uses the \fBUnfiled\fR category as the default category if no category is chosen or if the specified category does not already exist on the Palm\&. \fB\-f\fR, \fB\-\-file\fR \fISTRING\fR .PP File containing the target memo entry\&. Append other filenames to install one memo per file\&. \fB\-r\fR, \fB\-\-replace\fR .PP Replace all memos in the category specified by the \fB\-c\fR \fIcategory\fR option\&. \fB\-t\fR \fB\-\-title\fR .PP Use the filename as the title for the memo\&. (Normally, the first line of a memo is used as the title if one is not supplied with the \fB\-t\fR option)\&. .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR\fBport\fR .PP Use device file <\fBport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-install\-memo\fR will look for the \fI $PILOTPORT \fR environment variable\&. If neither are found or supplied, \fIpilot\-install\-memo\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-install\-memo\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-install\-memo\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "USAGE" .PP The program will connect to the Palm handheld, and create memo entries for each file(s) given on the commandline into the Memo Pad application on the Palm\&. .SH "AUTHOR" .PP \fIpilot\-install\-memo\fR was originally written by Damien P\&. Neil \&. .PP This manual page was converted to XML by Neil Williams .SH "BUGS" .SS "Known Bugs" .PP The Palm Device has a maximum length of 4,096 bytes (4k) on memopad entries, if you wish to retain the ability to edit the Memo (add/remove/change data within the memo) on the Palm itself\&. You can create a memo entry of 65,490 bytes in size (the absolute maximum) if you do not need to edit the memo entry any further on the Palm device itself\&. Any memo larger than 4,096 bytes and less than 65,490 bytes will not be editable on the Palm itself\&. Consider these memo entries "read\-only"\&. .PP This is not specifically a "bug", but a limitation in the PalmOS design itself\&. .SS "Reporting Bugs" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fImemos\fR(1), \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-read-notepad.10000644000175000017500000001032711333433317022176 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-read-notepad" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-read-notepad \- List the record information found in the Palm Notepad .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-read\-notepad\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-l\fR|\fB\-\-list\fR] [\fB\-t\fR|\fB\-\-type\fR \fBppm|png\fR] .SH "DESCRIPTION" .PP Connect to the Palm handheld and list the record information found in the Palm Notepad application (found on OS4 and newer devices)\&. If \fB\-\-type\fR is specified, each record's image will be converted to files, using Portable Network Graphic (\&.png) or Portable Pixmap (\&.ppm) format\&. .PP \fIpilot\-read\-notepad\fR allows a user running PalmOS 4\&.0 or later to read the data stored in the Palm Notepad application and extract the data into images and convert them to Portable Network Graphics (\&.png) or Portable Pixmap (\&.ppm) files\&. .SH "OPTIONS" .SS "pilot-read-notepad options" \fB\-l\fR, \fB\-\-list\fR .PP List picture information found on the device instead of converting them to image files\&. \fB\-t\fR, \fB\-\-type\fR \fBtype\fR .PP Specify the output picture type\&. Can be either "png" or "ppm"\&. .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR \fIport\fR .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-read\-notepad\fR will look for the \fI $PILOTPORT \fR environment variable\&. If neither are found or supplied, \fIpilot\-read\-notepad\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-read\-notepad\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-read\-notepad\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "USAGE" .PP The program will connect to the target Palm handheld, and list or convert the records and images found in the Palm Notepad application to Portable Network Graphic (\&.png) or Portable Pixmap (\&.ppm) files\&. .SH "AUTHOR" .PP \fIpilot\-read\-notepad\fR was originally written by Angus Ainslie \&. .PP This manual page was converted to XML by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-link\fR(7) pilot-link-0.12.5-dfsg/doc/man/Makefile.am0000644000175000017500000000153510716062164020463 0ustar rousseaurousseauman_MANS = \ ietf2datebook.1 \ pilot-addresses.1 \ pilot-clip.1 \ pilot-csd.1 \ pilot-debugsh.1 \ pilot-dedupe.1 \ pilot-dlpsh.1 \ pilot-file.1 \ pilot-foto.1 \ pilot-getram.1 \ pilot-getrom.1 \ pilot-getromtoken.1 \ pilot-hinotes.1 \ pilot-install-datebook.1 \ pilot-install-expenses.1 \ pilot-install-hinote.1 \ pilot-install-memo.1 \ pilot-install-netsync.1 \ pilot-install-todo.1 \ pilot-install-todos.1 \ pilot-install-user.1 \ pilot-link.7 \ pilot-memos.1 \ pilot-nredir.1 \ pilot-read-expenses.1 \ pilot-read-ical.1 \ pilot-read-notepad.1 \ pilot-read-palmpix.1 \ pilot-read-screenshot.1 \ pilot-read-todos.1 \ pilot-read-veo.1 \ pilot-reminders.1 \ pilot-schlep.1 \ pilot-foto-treo600.1 \ pilot-foto-treo650.1 \ pilot-wav.1 \ pilot-xfer.1 EXTRA_DIST=$(man_MANS) pilot-link-0.12.5-dfsg/doc/man/pilot-install-hinote.10000644000175000017500000000747011333433317022572 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-install-hino" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-install-hinote \- Install local files into your Hi-Note database on your Palm handheld. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-install\-hinote\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-c\fR \fB\-\-category\fR \fBcategory\fR] [\fIfilename\fR \&.\&.\&.] .SH "DESCRIPTION" .PP \fIpilot\-install\-hinote\fR allows the user to write one or more files as a new \fIHi\-Note\fR or into the Hi\-Notes Palm application itself, on the Palm handheld\&. .PP Please see \fIhttp://www\&.cyclos\&.com/\fR for more information on Hi\-Note\&. .SH "OPTIONS" .SS "pilot-install-hinote option" \fB\-c\fR, \fB\-\-category\fR <\fBcategory\fR> .PP Write files to <\fBcategory\fR> in the Hi\-Note application itself\&. .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR <\fBport\fR> .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-install\-hinote\fR will look for the \fI $PILOTPORT \fR environment variable\&. If neither are found or supplied, \fIpilot\-install\-hinote\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-install\-hinote\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-install\-hinote\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "USAGE" .PP The program will connect to a target Palm handheld, and write the file or files given on the commandline into the Hi\-Note application\&. .SH "AUTHOR" .PP \fIpilot\-install\-hinote\fR was originally written by Bill Goodman \&. .PP This manual page was converted to XML by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIhinotes\fR(1), \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-memos.10000644000175000017500000001216611333433317020756 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-memos" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-memos \- Manipulate Memo entries from a file or your Palm device. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-memos\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-v\fR|\fB\-\-verbose\fR] [\fB\-d\fR|\fB\-\-delete\fR] [\fB\-f\fR|\fB\-\-file\fR \fIfile\fR] [\fB\-s\fR|\fB\-\-save\fR \fIdir\fR] [\fB\-c\fR|\fB\-\-category\fR \fBSTRING\fR] [\fB\-r\fR|\fB\-\-regex\fR \fBSTRING\fR] .SH "DESCRIPTION" .PP By default, the contents of your Palm's memo database will be written to standard output as a standard UNIX mailbox (mbox\-format) file, with each memo as a separate message\&. The subject of each message will be the category\&. .PP If '\-s' is specified, then instead of being written to standard output, memos will be saved in subdirectories of \fIdir\fR\&. Each subdirectory will be the name of a category on the Palm, and will contain the memos in that category\&. Each filename will be the first line (up to the first 40 characters) of the memo\&. Control characters, slashes, and equal signs that would otherwise appear in filenames are converted after the fashion of MIME's quoted\-printable encoding\&. Note that if you have two memos in the same category whose first lines are identical, one of them will be overwritten\&. .PP If '\-f' is specified, the specified file will be treated as a memo database from which to read memos, rather than HotSyncing from the Palm\&. .SH "OPTIONS" .SS "pilot-memos options" \fB\-V\fR, \fB\-\-verbose\fR .PP Verbose, with \-s, print each filename when written to disk\&. \fB\-d\fR, \fB\-\-delete\fR \fBNUMBER\fR .PP Delete memo named by number \fBnum\fR\&. \fB\-f\fR, \fB\-\-file\fR \fIfile\fR\&. .PP Use <\fIfile\fR> as input file (instead of MemoDB\&.pdb)\&. \fB\-s\fR, \fB\-\-save\fR \fIdir\fR\&. .PP Save memos in \fIdir\fR instead of writing to STDOUT\&. \fB\-c\fR, \fB\-\-category\fR \fBcat\fR\&. .PP Only create memos in this category\&. \fB\-r\fR, \fB\-\-regex\fR \fBregex\fR\&. .PP Select memos saved by regular expression on the title\&. .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR <\fBport\fR> .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-memos\fR will look for the \fI$PILOTPORT\fR environment variable\&. If neither are found or supplied, \fI pilot\-memos \fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-memos\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-memos\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "AUTHOR" .PP \fIpilot\-memos\fR was originally written by Kenneth Albanowski\&. .PP This manual page was converted to XML by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIinstall\-memo\fR (1), \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-read-todos.10000644000175000017500000001075611333433317021702 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-read-todos" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-read-todos \- Syncronize your Palm ToDo application's database with your desktop machine. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-read\-todos\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-A\fR|\fB\-\-archived\fR] [\fB\-w\fR|\fB\-\-write\fR] .PP \fIpilot\-read\-todos\fR [\fB\-f\fR|\fB\-\-file\fR \fIfile\fR] [\fB\-A\fR|\fB\-\-archived\fR] [\fB\-w\fR|\fB\-\-write\fR] .PP \fIpilot\-read\-todos\fR [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] .SH "DESCRIPTION" .PP \fIpilot\-read\-todos\fR will read the ToDo database on the Palm handheld, or read the ToDoDB\&.pdb file directly from disk on your desktop machine, and print the contents to STDOUT (generally the screen)\&. .PP Use only one of \fB\-\-port\fR or \fB\-\-file\fR\&. .SH "OPTIONS" .SS "pilot-read-todos option" \fB\-f\fR, \fB\-\-file\fR \fIfile\fR .PP Read a local todo database file from disk for printing\&. Excludes \-\-port\&. \fB\-A\fR, \fB\-\-archived\fR .PP Write archived entries only, in human\-readable format \fB\-w\fR, \fB\-\-write\fR .PP Write output \- every operation must include a write command\&. .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR \fIport\fR .PP Use device file <\fIport\fR> to communicate with the Palm handheld device\&. If this is not specified, \fIpilot\-read\-todos\fR will look for the \fI $PILOTPORT \fR environment variable\&. If neither are found or supplied, \fIpilot\-read\-todos\fR will print the usage information\&. .PP Excludes \-\-file\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-read\-todos\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-read\-todos\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "USAGE" .PP Connect to a target Palm handheld and read the ToDo database, or read the ToDoDB\&.pdb file from disk and print the entries found to STDOUT\&. .SH "EXAMPLES" .PP Read the on\-Palm ToDo database, and dump to STDOUT\&. .PP \fIpilot\-read\-todos\fR \fB\-w\fR \fB\-p\fR \fI/dev/pilot\fR .PP Read the ToDoDB\&.pdb file on disk, and dump to STDOUT .PP \fIpilot\-read\-todos\fR \fB\-w\fR \fB\-f\fR \fIToDoDB\&.pdb\fR .SH "AUTHOR" .PP \fIpilot\-read\-todos\fR was originally written by Kenneth Albanowski .SH "BUGS" .SS "Known Bugs" .PP \fIpilot\-read\-todos\fR does not support Notes attached to ToDo items at this time\&. .SS "Reporting Bugs" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIinstall\-todo\fR (1), \fIinstall\-todos\fR (1), \fIpilot\-link\fR(7) pilot-link-0.12.5-dfsg/doc/man/pilot-clip.10000644000175000017500000000656111333433316020566 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-clip" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-clip \- Get or Set the Palm Clipboard contents from STDOUT/STDIN. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-clip\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-g\fR|\fB\-\-get\fR] [\fB\-s\fR|\fB\-\-set\fR] .SH "DESCRIPTION" .PP \fIpilot\-clip\fR is used to get or set the Palm Clipboard contents from STDOUT/STDIN\&. You must provide one of \-g or \-s\&. .SH "COMMANDS" .PP You must provide one of \fB\-g\fR or \fB\-s\fR\&. \fB\-g\fR, \fB\-\-get\fR .PP Get the contents of the clipboard and pass to STDOUT\&. \fB\-s\fR, \fB\-\-set\fR .PP Set the clipboard to STDIN\&. .SH "OPTIONS" .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR <\fBport\fR> .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-clip\fR will look for the \fI $PILOTPORT \fR environment variable\&. If neither are found or supplied, \fIpilot\-clip\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-clip\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-clip\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "AUTHOR" .PP This manual page was written by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-hinotes.10000644000175000017500000001236211333433317021305 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-hinotes" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-hinotes \- Syncronize your Hi-Notes database with your desktop machine. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-hinotes\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-d\fR|\fB\-\-dirname\fR \fIdir\fR] .SH "DESCRIPTION" .PP Hi\-Notes must be installed on your Palm handheld (and at least one entry must exist within Hi\-Notes)\&. .PP By default, the contents of your Palm's Hi\-Notes database (Hi\-NoteDB\&.pdb) will be written to STDOUT as a standard Unix mailbox (in mbox\-format) file, with each memo as a separate message\&. The subject of each message will be set as the category\&. .PP The memos will be written to STDOUT unless the \fB\-d\fR option is specified\&. Using \fB\-d\fR will be save the memos in subdirectories of \fIdir\fR\&. Each subdirectory will contain the name of a category on the Palm where the record was stored, and will contain the memos found in that category\&. .PP Each memo's filename will be the first line (up to the first 40 characters) of the memo\&. Control characters, slashes, and equal signs that would otherwise appear in filenames are converted using the correct MIME's quoted\-printable encoding\&. .PP Please see http://www\&.cyclos\&.com/ for more information on Hi\-Note\&. .SH "WARNING" .PP Note that if you have two memos in the same category whose first lines are identical, one of them will be OVERWRITTEN! This is unavoidable at the present time, but may be fixed in a future release\&. Also, please note that syncronizing Hi\-Note images is not supported at this time, only text\&. .SH "OPTIONS" .SS "pilot-hinotes option" \fB\-d\fR \fIdir\fR .PP Stores the Hi\-Note entries in subdirectories of \fIdir\fR\&. Each subdirectory will contain the name of a category on the Palm where the record was stored, and will contain the memos found in that category\&. .PP Each memo's filename will be the first line (up to the first 40 characters) of the memo\&. Control characters, slashes, and equal signs ('=') that would otherwise appear in filenames are converted using the correct MIME's quoted\\\-printable encoding methods\&. .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR <\fBport\fR> .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-hinotes\fR will look for the \fI$PILOTPORT\fR environment variable\&. If neither are found, \fIpilot\-hinotes\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-\-version\fR .PP Display the copyright information, version number, license details and build details and exit without connecting\&. .SS "Help options" \fB\-?\fR, \fB\-\-help\fR .PP Show the help message and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "USAGE" .PP The program will dump your MemoPad database (MemoDB\&.pdb) from the Palm and output format suitable for the \fIHi\-Notes\fR application to use\&. .PP Please see \fIhttp://www\&.cyclos\&.com/\fR for more information on Hi\-Note\&. .SH "AUTHOR" .PP \fIpilot\-hinotes\fR was originally written by Kenneth Albanowski, based on code by Bill Goodman and modified by Michael Bravo .PP This manual page was converted to XML by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-link\fR(7) pilot-link-0.12.5-dfsg/doc/man/pilot-read-ical.10000644000175000017500000001071411333433317021454 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-read-ical" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-read-ical \- Exports the DatebookDB and/or ToDo applications to ical format. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-read\-ical\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-\-usage\fR] [\fB\-d\fR|\fB\-\-datebook\fR] [\fB\-t\fR|\fB\-\-pubtext\fR \fBpubtext\fR] [\fB\-f\fR|\fB\-\-file\fR \fIfile\fR] .SH "DESCRIPTION" .PP Note, this is not the same as the iCal calendar format\&. .PP \fIpilot\-read\-ical\fR allows the user to retrieve the contents of the ToDo and Datebook databases on a Palm handheld, and convert their contents to an Ical calendar\&. .PP Note that the calendar file named by \fIfilename\fR will be deleted, so do not use your main calendar\&. Instead, use a separate one for this purpose, and include it in your main calendar\&. .PP As \fIpilot\-read\-ical\fR works by passing a script to ical, the ical application must be in your $PATH\&. .SH "OPTIONS" .SS "pilot-read-ical options" \fB\-d\fR, \fB\-\-datebook\fR .PP Datebook only, no ToDos \fB\-t\fR, \fB\-\-pubtext\fR \fBpubtext\fR .PP Replace text of items not started with a bullet with \fBpubtext\fR \fB\-f\fR, \fB\-\-file\fR \fIfile\fR .PP This is the file in which the ical\-formatted data should be saved\&. Note that this will be deleted, so do not use your primary calendar file\&. See \fIDESCRIPTION\fR for details\&. .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR \fIport\fR .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-read\-ical\fR will look for the \fI$PILOTPORT\fR environment variable\&. If neither are found, \fIpilot\-read\-ical\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-read\-ical\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR\&. .PP Display the help synopsis for \fIpilot\-read\-ical\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "USAGE" .PP The program will connect to a target device, retrieve the ToDo and Datebook databases (ToDoDB\&.pdb and DatebookDB\&.pdb respectively), then instruct \fIical\fR to write a calendar file based on the retrieved information\&. .SH "AUTHOR" .PP \fIpilot\-read\-ical\fR was originally written by Kenneth Albanowski\&. .PP This manual page was converted to XML by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-link\fR(7) pilot-link-0.12.5-dfsg/doc/man/pilot-file.10000644000175000017500000001047211333433316020552 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-file" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-file \- Dump application and header information from your local PRC/PDB files. .SH "SECTION" .PP pilot\-link: Tools .SH "SYNOPSIS" .PP \fIpilot\-file\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-H\fR|\fB\-\-header\fR] [\fB\-a\fR|\fB\-\-appinfo\fR] [\fB\-s\fR|\fB\-\-sortinfo\fR] [\fB\-l\fR|\fB\-\-list\fR] [\fB\-r\fR|\fB\-\-record\fR \fBSTRING\fR] [\fB\-f\fR|\fB\-\-to\-file\fR] [\fB\-d\fR|\fB\-\-dump\fR] \fIfilename\fR \&.\&.\&. .SH "DESCRIPTION" .PP \fIpilot\-file\fR is used to Dump application and header information from your local PRC/PDB files\&. .PP \fIpilot\-file\fR does not connect to your Palm\&. .SH "OPTIONS" .SS "pilot-file options" \fB\-H\fR, \fB\-\-header\fR .PP Dump the header of the database(s) \fB\-a\fR, \fB\-\-appinfo\fR .PP Dump app_info segment of the database(s) \fB\-s\fR, \fB\-\-sortinfo\fR .PP Dump sort_info block of database(s) \fB\-l\fR, \fB\-\-list\fR .PP List all records in the database(s) \fB\-r\fR, \fB\-\-record\fR \fBSTRING\fR .PP Dump a record by index ('code0') or uid ('1234') \fB\-f\fR, \fB\-\-to\-file\fR .PP Same as above but also dump records to files \fB\-d\fR, \fB\-\-dump\fR .PP Dump all data and all records, very verbose .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR lt;\fBport\fR> .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-file\fR will look for the \fI $PILOTPORT \fR environment variable\&. If neither are found or supplied, \fIpilot\-file\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-file\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-file\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "EXAMPLES" .PP To list all records in the Foo database: .PP \fIpilot\-file\fR \-l Foo\&.prc .PP To dump the header and appinfo segment of the Bar database: .PP \fIpilot\-file\fR \-H \-a Bar\&.pdb .SH "AUTHOR" .PP This manual page was written by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-csd.10000644000175000017500000000551311333433316020404 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-csd" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-csd \- Connection Service Daemon for Palm Devices .SH "SECTION" .PP pilot\-link: Tools .SH "SYNOPSIS" .PP Required for accepting logons via NetSync(tm) .PP \fIpilot\-csd\fR [\fB\-q\fR|\fB\-\-quiet\fR] \fB\-H\fR \fB"localhost"\fR \fB\-a\fR \fB127\&.0\&.0\&.1\fR \fB\-n\fR \fB255\&.255\&.255\&.0\fR .SH "OPTIONS" .SS "pilot-csd options" \fB\-\-version\fR .PP Display version of \fIpilot\-csd\fR and exit\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress messages\&. \fB\-H\fR, \fB\-\-hostname\fR .PP The hostname used for verification \fB\-a\fR, \fB\-\-address\fR .PP name or IP address of the host \fB\-n\fR, \fB\-\-netmask\fR .PP The subnet mask of the address\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-csd\fR and exit\&. \fB\-\-usage\fR .PP Display a brief usage message and exit\&. .SH "AUTHOR" .PP \fIpilot\-csd\fR was originally written by Kenneth Albanowski\&. .PP This manual page was written by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-addresses.10000644000175000017500000001667211333433316021620 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-addresses" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-addresses \- Read and write address book databases to and from a Palm handheld. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "LOCATION" .PP \&./src .SH "SYNOPSIS" .PP \fIpilot\-addresses\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-\-delete\-all\fR] [\fB\-t\fR|\fB\-\-delimiter\fR \fBINT\fR] [\fB\-d\fR|\fB\-\-delete\-category\fR \fB category \fR ] [\fB\-c\fR|\fB\-\-category\fR \fBcategory\fR] [\fB\-a\fR|\fB\-\-augment\fR] [\fB\-r\fR|\fB\-\-read\fR \fIfile\fR] [\fB\-w\fR|\fB\-\-write\fR \fI file \fR ] [\fB\-C\fR|\fB\-\-human\-readable\fR] .SH "DESCRIPTION" .PP \fIpilot\-addresses\fR allows the user to read all entries from a Palm handheld such as those made by \fIPalm\fR, \fIHandspring\fR, \fIHandera\fR, \fITRGPro\fR, \fISony\fR or other Palm handheld in the Palm Address Book application, write new entries into the database, and delete a category or delete all entries in the database\&. .SH "COMMANDS" .PP Provide exactly one of \-\-read or \-\-write\&. \fB\-r\fR, \fB\-\-read\fR=<\fIfile\fR> .PP Reads records from <\fIfile\fR> and install them to the Palm Address Book application\&. (Use the \fB\-w\fR <\fIfile\fR> option to get a sample "template file" for input records to see how the fields are laid out)\&. \fB\-w\fR, \-\-write=\fIfile\fR .PP Reads all address book records from the Palm Address Book application and writes them into \fI file \fR .SH "OPTIONS" .SS "pilot-addresses options" \fB\-a\fR, \fB\-\-augment\fR .PP Augments fields in address book records with additional information\&. The augmented information is placed before and separated from the field with a semi\-colon, (;)\&. .PP Augmented information can include any of the following below\&. .PP \fBcategory\fR # Placed in front of each record or\&.\&. .PP Placed in front of each phone number field: .PP ["Work"|"Home"|"Fax"|"Other"|"E\-mail"|"Main"|"Pager"|"Mobile"] .PP Empty fields are not augmented\&. \fB\-c\fR, \fB\-\-category\fR=\fBcategory\fR .PP Install records to category \fBcategory\fR by default\&. Normally \fIpilot\-addresses\fR uses the \fIUnfiled\fR category by default\&. This option is overridden by the category specified in the record with the \fB \-a \fR option\&. \fB\-d\fR, \fB\-\-delete\-category\fR .PP Delete all records in the specified category \fBcategory\fR before installing new records\&. .PP Note that the long name of this option has changed since 0\&.11\&.8 \fB\-D\fR, \fB\-\-delete\-all\fR .PP Delete all address book records in all categories\&. Obviously, be \fIvery\fR careful with this one\&. .PP Note that the long name of this option has changed since 0\&.11\&.8 \fB\-t\fR, \fB\-\-delimiter\fR \fBINT\fR .PP Include category in each record, use the delimiter specified to separate all fields of a record\&. Delimiters are specified as follows: 3=tab, 2=;, 1=,\&. This overrides the default delimiter of comma between fields and semi\-colon between a field's augmented information\&. (Please note that this may generate confusing results when used with the \fB\-a\fR option\&.) .PP Note that the long name of this option has changed since 0\&.11\&.8 \fB\-T\fR, \fB\-\-titles\fR .PP Obsolete\&. This option has been removed since 0\&.11\&.8 \fB\-C\fR|\fB\-\-human\-readable\fR .PP Write generic human\-readable output instead of CSV\&. .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR <\fIport\fR> .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-addresses\fR will look for the \fI $PILOTPORT \fR environment variable\&. If neither are found or supplied, \fIpilot\-addresses\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-addresses\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-addresses\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "USAGE" .PP The program will connect to the Palm handheld, and perform the requested read or write operation specified by the user\&. .SH "EXAMPLES" .PP To write all address records in a Palm to the file addrbook\&.csv: .PP \fIpilot\-addresses\fR \fB\-w\fR \fIaddrbook\&.csv\fR .PP or .PP \fIpilot\-addresses\fR \fB\-p\fR \fI/dev/pilot\fR \fB\-w\fR \fIaddrbook\&.csv\fR .PP To read the address book records in the file addrbook\&.csv and install them onto the Palm: .PP \fIpilot\-addresses\fR \fB\-r\fR \fIaddrbook\&.csv\fR .PP To read the address book records in the file addrbook\&.csv and place them into the Palm address book database category \fISpecial\fR after first deleting all current records in the \fI Special \fR category on the palm: .PP \fIpilot\-addresses\fR \fB\-c\fR \fBSpecial\fR \fB\-d\fR \fBSpecial\fR \fB\-r\fR \fIaddrbook\&.csv\fR .SH "AUTHOR" .PP \fIpilot\-addresses\fR originally written by Kenneth Albanowski, this manual page was originally written by Robert Wittig and later updated by David A\&. Desrosiers and Neil Williams \&. .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIaddresses\fR(1) \fIpilot\-link\fR(7) pilot-link-0.12.5-dfsg/doc/man/pilot-link.70000644000175000017500000002353011333433317020576 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-link" 7 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-link \- A suite of tools for communicating with Palm handhelds, such as those made by Palm, Handspring, Handera, TRGPro, Sony or other Palm Compatible Handheld PDA device. .SH "SECTION" .PP Pilot\-link: Overview .SH "DESCRIPTION" .PP The pilot\-link suite of tools contains a series of conduits, libraries, and language bindings for moving information to and from your Palm device and your desktop or server/workstation system, as well as across the network\&. .SH "TARGET DEVICE" .PP The /dev/pilot fallback has been removed in v0\&.12\&. The environment variable \fB$PILOTPORT\fR can be set in your shell, to save specifying the port each time\&. A serial device specified on the command\-line will be used regardless of any \fB$PILOTPORT\fR setting\&. If \fB$PILOTPORT\fR is not set, and \fB\-p\fR is not supplied, all conduits in \fIpilot\-link\fR will print the usage information\&. The default connection rate is 9600 baud\&. You are welcome to try higher baud rates (19200, 38400, 57600 or higher) by setting the \fB$PILOTRATE\fR environment variable, but various machines have various limitations\&. (Be careful about values higher than 115200 on older Linux boxes if you've been using setserial to change the multiplier)\&. .SH "CONDUITS" .PP A complete list of conduits available from within the \fIpilot\-link\fR package as of the date of this manpage\&. If you invoke any of the conduits from \fIpilot\-link\fR with no command\-line arguments at all, the usage summary will be printed\&. .PP Note that there are widespread changes in this release \- some conduits have been merged, a lot have had new options added and some options have been renamed or removed\&. .SS "addresses" .PP DEPRECATED: Use pilot\-addresses \-\-write|\-\-human\-readable instead\&. .SS "pilot-hinotes" .PP Syncronize your Hi\-Notes database with your desktop machine\&. .SS "install-datebook" .PP installs a new datebook entry onto your Palm handheld\&. .SS "pilot-install-expenses" .PP Install an expense record from various parameters and arguments passed at connection time\&. .SS "install-hinote" .PP Install local files into your Hi\-Note database on your Palm handheld\&. .SS "install-memo" .PP Installs a new Memo Pad entry onto your Palm handheld\&. .SS "pilot-install-netsync" .PP reads or sets the Network Preferences information on a Palm Device\&. Modifies the "Network Preference" settings and reports additional intormation about the Palm, such as the IP, hostname, and other information as they are set on the Palm\&. .SS "install-todo" .PP Updates the Palm ToDo list with one new entry\&. .SS "install-todos" .PP Updates the Palm ToDo list with entries from a local file\&. .SS "install-user" .PP Reads or sets a Palm User and UserID on a Palm Device\&. Modifies the "User Preference" settings and reports additional intormation about the Palm, such as the Username and UserID as they are set on the Palm .SS "pilot-memos" .PP Manipulate Memo entries from a file or your Palm device\&. .SS "pilot-addresses" .PP Read and write address book databases to and from a Palm handheld\&. .PP Changes in 0\&.12: Incorporates functionality from the now deprecated \fIaddresses\fR conduit\&. .SS "pilot-archive" .PP DEPRECATED: Use pilot\-read\-todos \-w \-\-archived instead\&. .SS "pilot-clip" .PP Get or Set the Palm Clipboard contents from STDOUT/STDIN\&. .SS "pilot-dedupe" .PP Removes duplicate records from any Palm database\&. .SS "pilot-file" .PP Dump application and header information from your local PRC/PDB files\&. .SS "pilot-foto" .PP Palm 'Foto' Image Installer/Remover/Fetcher/Converter .SS "pilot-read-screenshot" .PP Read screenshots from Palm (ScreenShotDB)\&. .SS "pilot-schlep" .PP Package up any arbitrary file and sync it to your Palm device\&. .SS "pilot-foto-treo600" .PP Copies Treo 600 foto databases to current directory and extracts \&.jpg files from them\&. .SS "pilot-foto-treo650" .PP Copies Treo 600 images and videos to the current directory .SS "pilot-wav" .PP Decodes Palm Voice Memo files to wav files you can read .SS "pilot-xfer" .PP Backup, sync, and restore databases from a Palm handheld device\&. .SS "pilot-read-expenses" .PP Export Palm Expense application data in a text format\&. .SS "pilot-read-ical" .PP Exports the DatebookDB and/or ToDo applications (DatebookDB\&.pdb and ToDoDB\&.pdb respectively) to Ical format\&. (The ical application must be installed and working on your system first\&. This is NOT the same thing as the iCal Calendar format, however)\&. .SS "pilot-read-notepad" .PP List the record information found in the Palm Notepad (Palm OS4 and later) application\&. .SS "pilot-read-palmpix" .PP Convert all pictures in the files given or found on a Palm handheld\&. .SS "pilot-read-todos" .PP Syncronize your Palm ToDo application's database with your desktop machine\&. .SS "pilot-read-veo" .PP Synchronize your Veo Traveler databases .SS "pilot-reminders" .PP Exports your Palm Datebook database into a 'remind' data file format\&. .SH "TOOLS" .SS "pilot-debugsh" .PP Simple debugging console for a Palm Handheld device (deprecated)\&. .SS "pilot-dlpsh" .PP An interactive Desktop Link Protocol (DLP) Shell for your Palm device\&. This is very useful for debugging potential problems with your serial port\&. Query the RAM/ROM, list databases, change your UserID or Username, and many other useful functions\&. This is the "Swiss Army Knife" of any of pilot\-link's tools\&. .SS "pilot-csd" .PP Connection Service Daemon for Palm Devices .SS "pilot-getram" .PP Retrieves the RAM image from your Palm device for use in debugging\&. .SS "pilot-getrom" .PP Retrieves the ROM image from your Palm device for use in debugging\&. .SS "pilot-getromtoken" .PP Reads a ROM token from a Palm Handheld device\&. .SS "pilot-nredir" .PP Accept connection and redirect via Network Hotsync Protocol\&. .SH "PERL SCRIPTS" .PP (Available from the source code, not always installed from packages)\&. .SS "pilot-ietf2datebook.pl" .PP Converts IETF agenda format to install\-datebook format .SS "pilot-undelete.pl" .PP Turn previously archived records into normal (non\-archived) records by resetting the "dirty" bit\&. .SS "pilot-sync-plan.pl" .PP completely synchronize the Palm datebook with the "plan" calendar via netplan, including authenticating to the netplan server itself\&. .SH "ADVANCED PROGRAMS" .PP Some of these programs are not intended for general end\-users\&. More detailed documentation on their usage can be obtained by reading the source of the application itself\&. .SS "ccexample" .PP test program demonstrating C++ interface\&. .SS "iambicexample" .PP test program demonstrating C++ interface\&. .SS "validate" .PP experimental program to test C++ features\&. .SH "OBTAINING" .PP The most current version of the pilot\-link suite of tools can be found at the pilot link homepage: http://www\&.pilot\-link\&.org/ .SH "MAILING LIST" .PP The original pilot\-unix mailing list has been taken offline, and is now being hosted and maintained by David A\&. Desrosiers \&. The original pilot\-unix mailing list was maintained by Matthew Cravit\&. Its mandate was: .PP The pilot\-unix mailing list is for discussion and "idea\-sharing" for those interested in using your Palm handheld with UNIX systems\&. This includes people who are interested in helping to develop tools to allow the Palm to operate with UNIX and other POSIX systems, and possibly to develop an SDK (Software Develop\- ment Kit) for the Palm for Unix\&. .PP For more information, including how to subscribe to the pilot\-link mailing lists, please visit the pilot\-link mailing list subscription page: .PP http://lists\&.pilot\-link\&.org/ .PP pilot\-link specific mailing lists are also available for Development, General, and Announce topics, at the following: .PP http://lists\&.pilot\-link\&.org/mailman/listinfo/pilot\-link\-devel .PP http://lists\&.pilot\-link\&.org/mailman/listinfo/pilot\-link\-general .PP http://lists\&.pilot\-link\&.org/mailman/listinfo/pilot\-link\-announce .SH "AUTHOR" .PP Most of the pilot\-link tools were written by Kenneth Albanowski\&. This manual page was written by David H\&. Silber , and updated for version 0\&.12 of pilot\-link by Neil Williams < linux@codehelp\&.co\&.uk > \&. .PP Current maintainer of pilot\-link as of the authoring of this manpage is David A\&. Desrosiers \&. .PP Any questions or problems with \fIpilot\-link\fR should be directed at the various \fI pilot\-link \fR mailing lists or to the irc channel dedicated to supporting \fIpilot\-link\fR at \fI irc\&.pilot\-link\&.org \fR in your irc application (not a web browser)\&. .SH "PATCHES" .PP All patches you wish to submit should be sent to directly, with a brief explanation of what the patch adds or fixes\&. Please make sure to send your patched in unified diff format (diff \-u)\&. .SH "SEE ALSO" .PP \fIpilot\-addresses\fR(1), \fIpilot\-dlpsh\fR(1), \fIpilot\-hinotes\fR(1), \fIpilot\-ietf2datebook\fR(1), \fIpilot\-install\-datebook\fR(1), \fIpilot\-install\-expenses\fR(1), \fIpilot\-install\-hinote\fR(1), \fIpilot\-install\-memo\fR(1), \fIpilot\-install\-netsync\fR(1), \fIpilot\-install\-user\fR(1), \fIpilot\-getrom\fR(1), \fIpilot\-getram\fR(1), \fIpilot\-addresses\fR(1), \fIpilot\-xfer\fR(1), \fIpilot\-read\-ical\fR(1), \fIpilot\-read\-notepad\fR(1), \fIpilot\-read\-palmpix\fR(1) .PP David Silber has written a Pilot HOWTO, which you can find at http://www\&.sgmltools\&.org/HOWTO/Pilot\-HOWTO/t1\&.html pilot-link-0.12.5-dfsg/doc/man/pilot-install-expenses.10000644000175000017500000001577011333433317023140 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-install-exp" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-install-expenses \- Install an expense record entries onto your Palm handheld device. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-install\-expenses\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-t\fR|\fB\-\-ptype\fR \fBSTRING\fR] [\fB\-e\fR|\fB\-\-etype\fR \fBSTRING\fR] [\fB\-a\fR|\fB\-\-amount\fR \fBSTRING\fR] [\fB\-V\fR|\fB\-\-vendor\fR \fBSTRING\fR] [\fB\-i\fR|\fB\-\-city\fR \fBSTRING\fR] [\fB\-g\fR|\fB\-\-guests\fR \fBNUMBER\fR] [\fB\-n\fR|\fB\-\-note\fR \fBSTRING\fR] [\fB\-c\fR|\fB\-\-category\fR \fBSTRING\fR] [\fB\-\-replace\fR] .SH "DESCRIPTION" .PP \fIpilot\-install\-expenses\fR allows a Palm handheld with the Expense application to have expense records synchronized to it from the commandline\&. You can pass any of the fields (except categories, currently) to \fIpilot\-install\-expenses\fR and create new expense records on your Palm handheld\&. .SH "OPTIONS" .SS "pilot-install-expenses options" \fB\-t\fR, \fB\-\-ptype\fR \fBSTRING\fR .PP Add entries to the "Payment Type" field\&. These can be in the form of "Cash", "Cheque" and others\&. See the Expense application on your Palm device for full details on payment types\&. .PP Note that the long name for this option has been renamed since 0\&.11\&.8\&. \fB\-e\fR, \fB\-\-etype\fR \fBSTRING\fR .PP Add entries to the "Expense Type" field\&. These can be in the form of Airfare, Meals, and Others\&. See the Expense application on your Palm device for full details on expense types\&. \fB\-a\fR, \fB\-\-amount\fR \fBSTRING\fR .PP Add currency amount entries to the "Amount" field\&. These can be in the form of 1\&.00 or "$10\&.00" and so on\&. See the Expense application on your Palm device for full details on amount types\&. \fB\-V\fR, \fB\-\-vendor\fR \fBSTRING\fR .PP Add entries to the "Vendor" field\&. These are free\-form values, and can be the name of a restaurant, an airline, or any other text value you wish to use\&. \fB\-g\fR, \fB\-\-guests\fR \fBDIGIT\fR .PP Add the number of attendees to the expense record, identified by \fBDIGIT\fR\&. If you ate lunch with four (4) additional people, you would put five (5) here, a numeric value\&. \fB\-i\fR, \fB\-\-city\fR \fBSTRING\fR .PP Add entries to the "City" field in the expense record\&. These are free\-form values, and can be the name of the location, city, or town that the expense record occured in\&. \fB\-n\fR, \fB\-\-note\fR \fBSTRING\fR .PP Add a "Note" entry to the expense record\&. These are free\-form values, and can be some notes related to the expense entry\&. \fB\-c\fR, \fB\-\-category\fR \fBSTRING\fR .PP Install entries into the named category defined here\&. See the Expense application on your Palm device for full details on using these categories\&. \fB\-\-replace\fR .PP Replace the entry found in the named category identified by the \fB\-\-category\fR option .PP Note that the short name for this option has been removed since 0\&.11\&.8 .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR <\fBport\fR> .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-install\-expenses\fR will look for the \fI $PILOTPORT \fR environment variable\&. If neither are found or supplied, \fIpilot\-install\-expenses\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message\&. \fB\-\-version\fR .PP Display version information for \fIpilot\-install\-expenses\fR and exit without connecting\&. .SS "Help options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-install\-expenses\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "USAGE" .PP The program will connect to the Palm handheld, and install entries into the Expense application based on values passed to \fIpilot\-install\-expenses\fR arguments\&. .SH "EXAMPLE" .PP \fIpilot\-install\-expenses\fR \fI\-p\fR \fI/dev/pilot\fR \fI\-c\fR Unfiled \fI\-t\fR Cash \fI\-e\fR Meals \fI\-a\fR 10\&.00 \fI\-V\fR McDonalds \fI\-g\fR 21 \fI\-l\fR "San Francisco" \fI\-N\fR "This is a note" .PP Installs a new expense; you are recording having 21 guests at McDonalds in the city of San Francisco for a meal which cost 10\&.00 units of your default currency and you added a simple note\&. The expense will take the default date \- today\&. .SH "AUTHOR" .PP \fIpilot\-install\-expenses\fR was originally written by community authors, the original author is unknown\&. .PP This manual page was converted to XML by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIread\-expenses\fR (1), \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-xfer.10000644000175000017500000002350511333433321020574 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-xfer" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-xfer \- Backup, sync, and restore databases from a Palm handheld device. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-xfer\fR [\fB\-p\fR <\fBport\fR>] [\fB\-e\fR <\fIfile\fR>] [\fB\-b\fR] [\fB\-u\fR] [\fB\-s\fR] <\fIdirectory\fR> .PP or .PP \fIpilot\-xfer\fR [\fB\-p\fR <\fBport\fR>] [\fB\-r\fR <\fBdirectory\fR>] [\fB\-l\fR] [\fB\-L\fR] [\fB\-P\fR] [\fB\-f\fR <\fBdbname\fR>] [\fB\-d\fR <\fBdbname\fR>] [\fB\-i\fR <\fBdbname\fR>] [\fB\-m\fR <\fIfile\fR>] \&.\&.\&. .PP Use exactly one of \-brsudfimlI; mix in \-aexDPv, \-\-rom and with\-os\&. .SH "DESCRIPTION" .PP This is the swiss\-army\-knife of the entire pilot\-link suite\&. .PP \fIpilot\-xfer\fR allows the user to install databases contained in the standard \&.prc (Palm Resource Database), \&.pdb (Palm Record Database), and \&.pqa (Palm Query Application) formats onto a Palm, retrieve databases from the Palm, list the databases contained in a Palm, backup or restore all of the databases at once as well as many other powerful operations performed on a Palm handheld device\&. .SH "OPTIONS" .SS "pilot-xfer options" .PP Archive files which have been removed from the Palm to <\fIdir\fR> instead of just deleting (unlinking) them\&. .nf \fB\-a\fR, \fB\-\-archive\fR <\fIdir\fR> .fi .PP Back up the Palm into the specified directory (which will be created if it does not already exist)\&. .nf \fB\-b\fR, \fB\-\-backup\fR <\fIdir\fR> .fi .PP Show information on available cards .nf \fB\-C\fR, \fB\-\-cardinfo\fR .fi .PP Permanently delete the specified database(s) by name (without extension)\&. Obviously, be very careful with this one\&. .nf \-\-delete <\fBdbname\fR> .fi .PP Modify \fB\-l\fR, \fB\-i\fR or \fB\-f\fR to use VFS \fIdir\fR instead of internal storage (see examples section for usage) .nf \fB\-D\fR, \fB\-\-vfsdir\fR=\fIdir\fR .fi .PP Reads a list of databases from <\fIfile\fR> and prevents \fB\-\-backup\fR, \fB\-\-sync\fR, or \fB\-\-update\fR from operating on the listed database(s)\&. A maximum of 100 databases can be excluded\&. Databases should be specified by name without the extension, as displayed with \-\-list, in any order\&. .nf \fB\-e\fR, \-\-exclude= \fI<\fBfile\fR>\fR .fi .PP Fetch each specified database out of the Palm into the current directory\&. .PP Obsolete\&. Replaced by \fB\-\-rom\fR in v0\&.12\&. .nf \fB\-F\fR, \fB\-\-Flash\fR .fi .PP Install each specified file into the Palm\&. Wildcards are valid with this syntax and multiple files may be listed at once\&. .nf \fB\-i\fR, \-\-install <\fIfile\fR> [\&.\&.\&.] .fi .PP Note: the behavior of list has changed in version 0\&.12 and later .PP List all the databases in the Palm, including OS\-specific native databases\&. .nf \fB\-l\fR, \fB\-\-list\fR .fi .PP Unsupported in 0\&.12 \- see \fB\-l\fR .nf \fB\-L\fR, \fB\-\-Listall\fR .fi .PP Adds the records in each specified file into the corresponding Palm database\&. .nf \fB\-m\fR, \fB\-\-merge\fR <\fIfile1\fR> [\&.\&.\&.] .fi .PP Obsolete\&. Replaced by \fB\-\-with\-os\fR in v0\&.12 and later .nf \fB\-O\fR, \-\-\fBOsflash\fR .fi .PP Purge any deleted data that haven't been cleaned up by a full synchronization (this is a safe operation, and will prevent your Palm from accumulating unused data if you delete records but aren't syncing with a PIM\&.) The only information you can lose is archived but un\-synchronized records\&. .nf \fB\-P\fR, \fB\-\-Purge\fR .fi .PP Installs all files contained in the named directory to the Palm\&. (Use this to restore your Palm after a hard reset has cleared and wiped its memory, using your backup directory as a baseline)\&. .nf \fB\-r\fR, \fB\-\-restore\fR <\fIdir\fR> .fi .PP Modifies \fB\-b\fR, \fB\-u\fR, and \fB s \fR, to back up non\-OS dbs from the internal Flash ROM .nf \fB\-\-rom\fR .fi .PP Backs up the Palm into the specified directory (which will be created if it does not already exist)\&. Any Palm databases which have not been modified or created since the versions stored in the specified directory will not be backed up\&. .PP \fINOTE\fR: Any Palm databases which have been deleted will have their corresponding backup file removed\&. .nf \fB\-s\fR, \fB\-\-sync\fR <\fIdir\fR> .fi .PP Not supported in v0\&.12\&. No replacement\&. .nf \fB\-S\fR, \fB\-\-novsf\fR .fi .PP Modifies \fB\-b\fR, \fB\-u\fR, and \fB s \fR, to back up OS databases from internal Flash ROM\&. .nf \fB\-\-with\-os\fR .fi .PP Backs up the Palm into the specified directory (which will be created if it does not already exist)\&. Any Palm databases which have not been modified or created since the versions stored in the specified directory will not be backed up\&. .nf \fB\-u\fR, \fB\-\-update\fR .fi .PP This will back up the UnsavedPreferences\&.prc file from the Palm\&. Normally this file is not backed up by normal means (Palm recommends that you do not restore this file upon restoration of your device using \fB\-\-restore\fR\&. .PP This also modifies the behavior of \fB\-\-backup\fR, \fB\-\-sync\fR, and \fB\-\-update\fR\&. .nf \fB\-I\fR, \fB\-\-Illegal\fR .fi .PP Execute a shell command for intermediate processing\&. All commands will be done, from left to right on the command\-line, before the connection to the Palm device is made\&. .nf \fB\-x\fR, \fB\-\-exec=command\fR .fi .SS "Conduit Options" .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-xfer\fR will look for the \fI$PILOTPORT\fR environment variable\&. If neither are found, \fI pilot\-xfer \fR will print the usage information\&. .nf \fB\-p\fR, \fB\-\-port\fR <\fBport\fR> .fi .PP Display version of \fIpilot\-xfer\fR and exit without connecting\&. .nf \fB\-v\fR, \fB\-\-version\fR .fi .SS "Help Options" .PP Display the help synopsis for \fIpilot\-xfer\fR and exit without connecting\&. .nf \fB\-h\fR, \fB\-\-help\fR .fi .PP Display a brief usage message and exit without connecting\&. .nf \fB\-\-usage\fR .fi .SH "USAGE" .PP The program will attempt to connect to a target Palm handheld device and specified port and perform the requested options specified by the user on the commandline\&. .SH "EXAMPLES" .PP To perform a full backup of your Palm handheld: .PP # using long options .PP .nf \fIpilot\-xfer\fR \fB\-\-port\fR \fI/dev/pilot\fR \fB\-\-backup\fR \fI$HOME/pilot/Backup\fR .fi .PP # or over IrDA, using short options .PP .nf \fIpilot\-xfer\fR \fB\-p\fR \fI/dev/ircomm0\fR \fB\-b\fR \fI$HOME/pilot/Backup\fR .fi .PP To restore that backup to a non\-standard serial port (for example, to a xcopilot or POSE session, assuming you have xcopilot or POSE configured properly for this operation, see the appropriate man pages for details on configuring your emulator): .PP .nf \fIpilot\-xfer\fR \fB\-p\fR \fI/dev/ttyqe\fR \fB\-\-restore\fR \fI$HOME/pilot/Backup\fR .fi .PP To fetch a file that is on your Palm handheld, such as the Palm Address Book database, you could do the following\&. This will connect to /dev/pilot and retrieve the records found in AddressDB and place them in a local file called AddressDB\&.pdb (Palm Record Database)\&. .PP .nf \fIpilot\-xfer\fR \fB\-p\fR \fI/dev/pilot\fR \fB\-\-fetch\fR \fBAddressDB\fR .fi .PP This will connect to your Palm device and install the application Foo (in Foo\&.prc) to your external storage card (typically an SD or MMC card) in the directory /Palm/Launcher on that card, using VFS\&. .PP .nf \fIpilot\-xfer\fR \fB\-p\fR \fI/dev/pilot\fR \fB\-i Foo\&.prc \-D /Palm/Launcher\fR .fi .SH "AUTHOR" .PP \fIpilot\-xfer\fR written by Kenneth Albanowski\&. This manual page was originally written by Kenneth Albanowski and David H\&. Silber\&. Completely rewritten by David A\&. Desrosiers\&. Updated for 0\&.12 by Neil Williams < linux@codehelp\&.co\&.uk > \&. .SH "BUGS" .SS "Known Bugs" .PP \fB\-\-backup\fR will currently truncate/corrupt pdb/prc files if the communication to the device is interrupted during sync (such as removing the Palm from the cradle, or a temporary network hiccup during a NetSync)\&. Ideally, this should restore the original file, or delete the corrupted version and restore the original version back into place, but presently\&.\&. it does not\&. .SS "Reporting Bugs" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-link\fR(7) pilot-link-0.12.5-dfsg/doc/man/README0000644000175000017500000000033410437354633017310 0ustar rousseaurousseauThese manpages are generated automatically - do NOT edit them! Edit the XML in ../xml/ ONLY! Pilot-link uses XML and a customised XSL to convert to their proper man(1) format via docbook transformation using xsltproc. pilot-link-0.12.5-dfsg/doc/man/pilot-getrom.10000644000175000017500000001244511333433316021132 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-getrom" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-getrom \- Retrieves the ROM image from your Palm device for use in debugging. .SH "SECTION" .PP pilot\-link: Tools .SH "SYNOPSIS" .PP \fIpilot\-getrom\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-t\fR|\fB\-\-token\fR \fBtoken\fR] [\fB\-s\fR|\fB\-\-sysinfo\fR] [\fB\-\-ram\fR] [\fB\-\-rom\fR] [\fIfilename\fR] .SH "DESCRIPTION" .PP \fIpilot\-getrom\fR is used to fetch the ROM from your Palm handheld for use in debugging Palm applications through the use of POSE, the \fIPalm OS Emulator application\fR\&. .PP Note, because \fIpilot\-getrom\fR uses the low\-level RPC protocol to fetch the ROM image, and the new OS5 devices do not use this protocol, you currently cannot fetch an OS5 ROM image using this utility\&. This will be updated in a future release to handle fetching OS5 ROM images, using the debugger protocol\&. .SH "OPTIONS" .SS "pilot-getrom options" \fB\-t\fR, \fB\-\-token\fR \fBtoken\fR .PP A ROM token to read (i\&.e\&. snum) \fB\-s\fR, \fB\-\-sysinfo\fR .PP Print SysInfo \fB\-\-ram\fR .PP Read RAM \fB\-\-rom\fR .PP Read ROM <\fBfilename\fR> .PP Write the ROM image to the file named by <\fIfilename\fR>\&. If this is omitted, the filename will be written out as the rom version name as follows: '\fI pilot\-$VERSION\&.rom \fR ', where an OS 3\&.5 image would be written as the filename of '\fIpilot\-3\&.5\&.0\&.rom\fR'\&. .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR <\fBport\fR> .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-getrom\fR will look for the \fI$PILOTPORT\fR environment variable\&. If neither are found or supplied, \fI pilot\-getrom \fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-getrom\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-getrom\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "USAGE" .PP Connect to a target Palm handheld and fetch the ROM for use in debugging Palm applications through the use of POSE, the \fI Palm OS Emulator \fR or with the \fICoPilot\fR application (deprecated)\&. .SH "LICENSING" .PP \fIWarning\fR: Please completely back up your Palm before using this program! The developers of \fIpilot\-link\fR are not responsible for any data loss that may occur from the use of this application\&. .PP Use of this program MAY place you in violation of your license agreement with Palmsource, Inc\&. or other OEM partners\&. Please read your Palm documentation (specifically the "Software License Agreement") before running this program\&. .SH "AUTHOR" .PP \fIpilot\-getrom\fR was originally written by Kenneth Albanowski\&. .PP This manual page was converted to XML by Neil Williams .SH "BUGS" .SS "Known Bugs" .PP \fIpilot\-getrom\fR does not work with OS5 devices as yet, due to changes in the architecture and design of the Palm HotSync protocol and file type changes from m68k to ARM\&. Other than that, \fIpilot\-getrom\fR has no known bugs at this time\&. .SS "Reporting Bugs" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-getram\fR (1), \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-install-user.10000644000175000017500000001010011333433317022242 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-install-user" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-install-user \- Reads or sets a Palm User and UserID on a Palm Device. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-install\-user\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-u\fR|\fB\-\-user\fR \fBusername\fR] [\fB\-i\fR|\fB\-\-id\fR \fBuserid\fR] [\fB\-l\fR|\fB\-\-list\fR] .SH "DESCRIPTION" .PP \fIpilot\-install\-user\fR allows the user to read or change the User and UserID information on the Palm handheld\&. .SH "OPTIONS" .SS "pilot-install-user options" \fB\-u\fR, \fB\-\-user\fR \fBusername\fR .PP Set the username, use quotes for spaces in the username, as in "John Q\&. Public"\&. \fB\-i\fR, \fB\-\-id\fR \fBuserid\fR .PP Set the 5\-digit numeric UserID on the device (used for many Palm application registration methods)\&. \fB\-l\fR, \fB\-\-list\fR .PP List the current username and ID (default) .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR <\fBport\fR> .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-install\-user\fR will look for the \fI $PILOTPORT \fR environment variable\&. If neither are found or supplied, \fIpilot\-install\-user\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-install\-user\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-install\-user\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "USAGE" .PP The program will connect to a target Palm handheld, and read or set the Palm UserName specified or display the Palm username and UserID if none is specified\&. .SH "AUTHOR" .PP \fIpilot\-install\-user\fR was originally written by D\&. Jeff Dionne \&. .PP This manual page was converted to XML by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-install\-netsync\fR (1), \fIpilot\-dlpsh\fR (1), \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-schlep.10000644000175000017500000001006611333433320021103 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-schlep" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-schlep \- Pack an arbitrary file and install it on your Palm or unpack a file from your Palm. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-schlep\fR [\fB\-p\fR|\fB\-\-port\fR<\fBport\fR>] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-i\fR|\fB\-\-install\fR \fIfile\fR] [\fB\-f\fR|\fB\-\-fetch\fR \fIfile\fR] [\fB\-d\fR|\fB\-\-delete\fR] .SH "DESCRIPTION" .PP Currently the stored name and file type is not queried so you can potentially install a PDF file, and retrieve it as a ZIP file\&. .PP You must take care to remember what type of file you are installing and fetching\&. This will be updated in a later release to handle this type of capability, as well as handle multiple 'Schlep' files\&. .SH "OPTIONS" .SS "pilot-schlep options" \fB\-i\fR, \fB\-\-install\fR \fIfile\fR .PP Pack and install \fIfile\fR to your Palm \fB\-f\fR, \fB\-\-fetch\fR \fIfile\fR .PP Unpack the file from your Palm device \fB\-d\fR, \fB\-\-delete\fR .PP Delete the packaged file from your Palm device .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR \fIport\fR .PP Use device file \fIport\fR to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-schlep\fR will look for the \fI$PILOTPORT\fR environment variable\&. If neither are found or supplied, \fI pilot\-schlep \fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-schlep\fR\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-schlep\fR\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "EXAMPLES" .PP To package up and store a file for later retrieval on your Palm: .nf \fBpilot\-schlep\fR \-p /dev/pilot \-i InstallThis\&.zip .fi .PP To unpack a file that has been stored on your Palm with pilot\-schlep: .nf \fBpilot\-schlep\fR \-p /dev/pilot \-f RetrieveThis\&.pdfc .fi .PP Please notice that you must use redirection to Install or Fetch files using pilot\-schlep\&. .PP Currently the stored name and file type is not queried so you can potentially Install a PDF file, and retrieve it as a ZIP file\&. .PP You must take care to remember what type of file you are installing and fetching\&. This will be updated in a later release to handle this type of capability, as well as handle multiple 'Schlep' files\&. .SH "AUTHOR" .PP This manual page was written by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-link\fR(7) pilot-link-0.12.5-dfsg/doc/man/pilot-nredir.10000644000175000017500000000671511333433317021124 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-nredir" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-nredir \- Accept connection and redirect via Network Hotsync Protocol. .SH "SECTION" .PP pilot\-link: Tools .SH "SYNOPSIS" .PP \fIpilot\-nredir\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-n\fR|\fB\-\-net\fR] .SH "DESCRIPTION" .PP This will bind your locally connected device to a network port, and redirect them through the network device to a listening server as specified in the LANSync Preferences panel on your Palm\&. .SH "PILOT-NREDIR COMMAND" .PP \-n, \-\-net .PP Redirect to the network port set in the LANSync Preferences panel on the Palm\&. .SH "OPTIONS" \fB\-n\fR, \fB\-\-net\fR .PP Redirect to net: .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR \fIport\fR .PP Use device file \fIport\fR to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-nredir \fR will look for the \fI$PILOTPORT\fR environment variable\&. If neither are found or supplied, \fI pilot\-nredir \fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-nredir\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-nredir \fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "EXAMPLES" .PP \fIpilot\-nredir\fR \fB\-n\fR \fB\-p\fR \fI/dev/pilot\fR .SH "AUTHOR" .PP This manual page was written by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "SUPPORT" .PP pilot\-link Development List .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-link\fR(7) pilot-link-0.12.5-dfsg/doc/man/pilot-read-veo.10000644000175000017500000000762011333433317021337 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-read-veo" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-read-veo \- Synchronize your Veo Traveler databases .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-read\-veo\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-n\fR|\fB\-\-name\fR \fIfilename\fR] [\fB\-l\fR|\fB\-\-list\fR] [\fB\-b\fR|\fB\-\-bias\fR \fBbias\fR] [\fB\-c\fR|\fB\-\-colour\fR] [\fB\-t\fR|\fB\-\-type\fR [\fBppm|png\fR]] .SH "DESCRIPTION" .PP Synchronize your Veo Traveler databases with your desktop machine\&. Output defaults to ppm\&. .SH "OPTIONS" .SS "pilot-read-veo options" \fB\-n\fR, \fB\-\-name\fR \fIname\fR .PP Specify output picture by name \fB\-l\fR, \fB\-\-list\fR .PP List Photos on device \fB\-b\fR, \fB\-\-bias\fR \fBbias\fR .PP lighten or darken the image (0\&.\&.50 darken, 50\&.\&.100 lighten) \fB\-c\fR, \fB\-\-colour\fR .PP colour correct the output colours \fB\-t\fR, \fB\-\-type\fR [\fBppm\fR|\fBpng\fR] .PP Specify picture output type (ppm or png) .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR \fIport\fR .PP Use device file \fIport\fR to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-read\-veo \fR will look for the \fI$PILOTPORT\fR environment variable\&. If neither are found or supplied, \fI pilot\-read\-veo \fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-read\-veo\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-read\-veo\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "AUTHOR" .PP \fIpilot\-read\-veo \fR was originally written by Angus Ainslie .PP This manual page was written by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-link\fR(7) pilot-link-0.12.5-dfsg/doc/man/pilot-reminders.10000644000175000017500000000636211333433317021627 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-reminders" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-reminders \- Exports your Palm Datebook database into a remind(1) data file format. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS " .PP \fIpilot\-reminders\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-w\fR|\fB\-\-write\fR] .SH "DESCRIPTION" .PP Your Datebook database will be written to STDOUT as it is converted unless redirected to a file\&. .SH "OPTIONS" .SS "Reminders Options" \fB\-w\fR, \fB\-\-write\fR .PP Write out the Datebook (not Calendar) database\&. .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR \fIport\fR .PP Use device file \fIport\fR to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-reminders \fR will look for the \fI$PILOTPORT\fR environment variable\&. If neither are found or supplied, \fI pilot\-reminders \fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version information of \fIpilot\-reminders \fR\&. .SS "Help Options" .PP \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-reminders \fR and exit without connecting\&. .PP \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "AUTHOR" .PP This manual page was written by Neil Williams and David A\&. Desrosiers < desrod@gnu\-designs\&.com > .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIhttp://www\&.roaringpenguin\&.com/penguin/open_source_remind\&.php\fR .PP \fIpilot\-link\fR(7) .PP \fIremind\fR(1) pilot-link-0.12.5-dfsg/doc/man/pilot-getromtoken.10000644000175000017500000001274511333433316022176 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-getromtoken" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-getromtoken \- Reads a ROM token from a Palm Handheld device. .SH "SECTION" .PP pilot\-link: Tools .SH "SYNOPSIS" .PP \fIpilot\-getromtoken\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-t\fR|\fB\-\-token\fR \fBtoken\fR] [\fB\-s\fR|\fB\-\-sysinfo\fR] [\fB\-\-ram\fR] [\fB\-\-rom\fR] [\fIfilename\fR] .SH "DESCRIPTION" .PP Tokens you may currently extract are: .PP adcc: Entropy for internal A\->D convertor calibration .PP irda: Present only on memory card w/IrDA support .PP snum: Device serial number (from Memory Card Flash ID) .PP \fIpilot\-getromtoken\fR is used to fetch the ROM from your Palm handheld for use in debugging Palm applications through the use of POSE, the \fIPalm OS Emulator application\fR\&. .PP Note, because \fIpilot\-getrom\fR uses the low\-level RPC protocol to fetch the ROM image, and the new OS5 devices do not use this protocol, you currently cannot fetch an OS5 ROM image using this utility\&. This will be updated in a future release to handle fetching OS5 ROM images, using the debugger protocol\&. .SH "OPTIONS" .SS "pilot-getromtoken options" \fB\-t\fR, \fB\-\-token\fR \fBtoken\fR .PP A ROM token to read (i\&.e\&. snum) \fB\-s\fR, \fB\-\-sysinfo\fR .PP Print SysInfo \fB\-\-ram\fR .PP Read RAM \fB\-\-rom\fR .PP Read ROM <\fBfilename\fR> .PP Write the ROM image to the file named by <\fIfilename\fR>\&. If this is omitted, the filename will be written out as the rom version name as follows: \fI 'pilot\-$VERSION\&.rom' \fR ,where an OS 3\&.5 image would be written as the filename of \fI'pilot\-3\&.5\&.0\&.rom'\fR\&. .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR <\fBport\fR> .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-getrom\fR will look for the \fI$PILOTPORT\fR environment variable\&. If neither are found or supplied, \fI pilot\-getrom \fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-getrom\fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-getrom\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "USAGE" .PP Connect to a target Palm handheld and fetch the ROM for use in debugging Palm applications through the use of POSE, the \fIPalm OS Emulator\fR or with the \fICoPilot\fR application (deprecated)\&. .SH "LICENSING" .PP \fIWarning\fR: Please completely back up your Palm this program! The developers of \fI pilot\-link \fR are not responsible for any data loss that may occur from the use of this application\&. .PP Use of this program MAY place you in violation of your license agreement with Palmsource, Inc\&. or other OEM partners\&. Please read your Palm documentation (specifically the "Software License Agreement") before running this program\&. .SH "AUTHOR" .PP \fIpilot\-getrom\fR was originally written by Owen Stenseth\&. .PP This manual page was written by Neil Williams .SH "BUGS" .SS "Known Bugs" .PP \fIpilot\-getrom\fR does not work with OS5 devices as yet, due to changes in the architecture and design of the Palm HotSync protocol and file type changes from m68k to ARM\&. Other than that, \fIpilot\-getrom\fR has no known bugs at this time\&. .SS "Reporting Bugs" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-getram\fR(1), \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-read-screenshot.10000644000175000017500000000720211333433317022717 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-read-screens" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-read-screenshot \- Read screenshots from Palm (ScreenShotDB). .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-read\-screenshot\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-t\fR|\fB\-\-type\fR [\fBppm|png\fR]] .SH "DESCRIPTION" .PP ScreenShot is a Palm\-compatible application for OS4 and OS5\&. .PP ScreenShot captures the current screen of any application\&. All color and grayscale modes, as well as extended screen sizes and virtual Graffiti areas are supported\&. Also exports as JPG/GIF/BMP to card\&. .PP For more information on ScreenShot, go to http://linkesoft\&.com/screenshot/ .SH "OPTIONS" .SS "pilot-read-screenshot option" \fB\-t\fR, \fB\-\-type\fR [\fBppm\fR|\fBpng\fR] .PP Specify picture output type (ppm or png) .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR \fIport\fR .PP Use device file \fIport\fR to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-read\-screenshot\fR will look for the \fI$PILOTPORT\fR environment variable\&. If neither are found or supplied, \fI pilot\-read\-screenshot \fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-v\fR, \fB\-\-version\fR .PP Display version of \fIpilot\-read\-screenshot \fR and exit without connecting\&. .SS "Help Options" \fB\-h\fR, \fB\-\-help\fR .PP Display the help synopsis for \fIpilot\-read\-screenshot\fR and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "AUTHOR" .PP \fIpilot\-read\-screenshot\fR was originally written by Angus Ainslie .PP This manual page was written by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-link\fR(7) pilot-link-0.12.5-dfsg/doc/man/ietf2datebook.10000644000175000017500000000475411333433316021236 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "ietf2datebook" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME ietf2datebook \- Converts IETF agenda format to install-datebook format .SH "SECTION" .PP pilot\-link: Tools .SH "SYNOPSIS" .PP \fIietf2datebook\fR < ietf\-agenda > datebook\&.txt .SH "DESCRIPTION" .PP \fIietf2datebook\fR is a Perl script that converts IETF (\fIhttp://www\&.ietf\&.org\fR) agenda to format suitable for the \fIinstall\-datebook\fR program\&. The agenda file is given to it as standard input and the output file is sent to standard output\&. Please remove all headers and footers from the agenda file before giving it to \fIietf2datebook\fR\&. .SH "OPTIONS" .PP none .SH "USAGE" .PP The program will read IETF agenda from its stdin and output format suitable for the \fIinstall\-datebook\fR program to STDOUT\&. .SH "AUTHOR" .PP \fIietf2datebook\fR was originally written by Tero Kivinen .PP This manual page was converted to XML by Neil Williams .SH "REPORTING BUGS" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-read\-ical\fR(1), \fIpilot\-xfer\fR(1), \fIinstall\-datebook\fR(1), \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/man/pilot-install-datebook.10000644000175000017500000001203711333433317023067 0ustar rousseaurousseau.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "pilot-install-dat" 1 "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH NAME pilot-install-datebook \- Installs one or more new datebook entries onto your Palm handheld. .SH "SECTION" .PP pilot\-link: Userland conduits .SH "SYNOPSIS" .PP \fIpilot\-install\-datebook\fR [\fB\-p\fR|\fB\-\-port\fR <\fBport\fR>] [\fB\-\-version\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-\-usage\fR] [\fB\-r\fR|\fB\-\-read\fR \fIfile\fR] .SH "DESCRIPTION" .PP \fIpilot\-install\-datebook\fR allows the user to create one or more datebook entries from one or more source files\&. .PP The format of the source file contains one datebook entry per line, containing four tab separated fields\&. The fields are start date/time, end date/time, alarm settings, and the description of datebook entry\&. This program doesn't yet support repeated entries\&. The date and time must be in format understood by \fIparsedate\&.y\fR\&. At the very least, the following two formats are understood: .PP August 11, 1997 0800 GMT+300 .PP 1997/08/11 08:22:33 GMT+300 .PP If either one of the date and time fields is empty, the entry is installed without time\&. If the alarm field is empty, the entry is installed without setting any alarms\&. The alarm field can contain numbers followed by "m" (minutes), "h" (hours), or "d" (days)\&. .SH "OPTIONS" .SS "pilot-install-datebook options" \fB\-r\fR, \fB\-\-read\fR .PP Read entries from \fIfile\fR\&. .SS "Conduit Options" \fB\-p\fR, \fB\-\-port\fR <\fBport\fR> .PP Use device file <\fIport\fR> to communicate with the Palm handheld\&. If this is not specified, \fIpilot\-install\-datebook\fR will look for the \fI$PILOTPORT\fR environment variable\&. If neither are found, \fIpilot\-install\-datebook\fR will print the usage information\&. \fB\-q\fR, \fB\-\-quiet\fR .PP Suppress 'Hit HotSync button' message \fB\-\-version\fR .PP Display the copyright information, version number, license details and build details and exit without connecting\&. .SS "Help options" \fB\-?\fR, \fB\-\-help\fR .PP Show the help message and exit without connecting\&. \fB\-\-usage\fR .PP Display a brief usage message and exit without connecting\&. .SH "USAGE" .PP The program will connect to the target Palm device, and create Datebook entries based on the datebook\-formatted file given on the commandline onto the Palm handheld (into the DatebookDB\&.pdb file)\&. .SH "EXAMPLES" .PP ([__TAB__] = tab, [__NL__] = newline in these examples): .PP 1997/08/11 0800 GMT+300 [__TAB__] 1997/08/11 0900 GMT+300 [__TAB__] [__TAB__] IETF Registration [__NL__] .PP August 11, 1997 0900 GMT+300 [__TAB__] August 11, 1997 0930 GMT+300 [__TAB__] 2m [__TAB__] Introductions [__NL__] .SH "AUTHOR" .PP \fIpilot\-install\-datebook\fR was originally written by Tero Kivinen \&. This program was based on \fIpilot\-install\-todos\fR program written by Robert A\&. Kaplan \&. .PP This manual page was converted to XML by Neil Williams .SH "BUGS" .SS "Known Bugs" .PP If no timezone is given, \fIpilot\-install\-datebook\fR will assume the time is in GMT and it will convert it to localtime\&. If you don't want to create timezone entries for all begin and end times, set the TZ environment variable to GMT before running this program\&. .SS "Reporting Bugs" .PP We have an online bug tracker\&. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed\&. Reporting bugs via email, while easy, is not very useful in terms of accountability\&. Please point your browser to http://bugs\&.pilot\-link\&.org: \fIhttp://bugs.pilot-link.org\fR and report your bugs and issues there\&. .SH "COPYRIGHT" .PP 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\&. .PP 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\&. .PP 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 St, Fifth Floor, Boston, MA 02110\-1301, USA\&. .SH "SEE ALSO" .PP \fIpilot\-install\-todos\fR(1), \fIpilot\-link\fR(7)\&. pilot-link-0.12.5-dfsg/doc/Makefile.in0000644000175000017500000005163611333433243017724 0ustar rousseaurousseau# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ target_triplet = @target@ subdir = doc DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/doxygen.cfg.in TODO ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/bluez.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/tcl.m4 \ $(top_srcdir)/m4/threads.m4 \ $(top_srcdir)/m4/vl_lib_readline.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/include/pi-md5.h CONFIG_CLEAN_FILES = doxygen.cfg CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(udevdir)" DATA = $(udev_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = man xml DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLUEZ_CFLAGS = @BLUEZ_CFLAGS@ BLUEZ_LIBS = @BLUEZ_LIBS@ CAT_ENTRY_END = @CAT_ENTRY_END@ CAT_ENTRY_START = @CAT_ENTRY_START@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOCBOOK_ROOT = @DOCBOOK_ROOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVA = @JAVA@ JAVABASE = @JAVABASE@ JAVAC = @JAVAC@ JAVA_VERSION = @JAVA_VERSION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PIC_LIBS = @PIC_LIBS@ PILOT_LINK_MAJOR = @PILOT_LINK_MAJOR@ PILOT_LINK_MINOR = @PILOT_LINK_MINOR@ PILOT_LINK_PATCH = @PILOT_LINK_PATCH@ PILOT_LINK_VERS = @PILOT_LINK_VERS@ PISOCK_AGE = @PISOCK_AGE@ PISOCK_CURRENT = @PISOCK_CURRENT@ PISOCK_REVISION = @PISOCK_REVISION@ PISYNC_AGE = @PISYNC_AGE@ PISYNC_CURRENT = @PISYNC_CURRENT@ PISYNC_REVISION = @PISYNC_REVISION@ PKG_CONFIG = @PKG_CONFIG@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ POPT_INCLUDES = @POPT_INCLUDES@ POPT_LIBS = @POPT_LIBS@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_H = @PYTHON_H@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RL_LIBS = @RL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ XML_CATALOG = @XML_CATALOG@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ builddir = @builddir@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ usb_libs = @usb_libs@ @BUILD_XML_FALSE@SUBDIRS = man @BUILD_XML_TRUE@@ENABLE_XSLTPROC_TRUE@SUBDIRS = xml man EXTRA_DIST = \ CodingGuidelines \ README.debugging \ README.libusb \ README.usb \ TODO \ 60-libpisock.rules \ doxygen.cfg.in udevdir = $(datadir)/pilot-link/udev udev_DATA = 60-libpisock.rules DIST_CLEAN_FILES = doxygen.cfg all: all-recursive .SUFFIXES: $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/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 $(am__aclocal_m4_deps): doxygen.cfg: $(top_builddir)/config.status $(srcdir)/doxygen.cfg.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-udevDATA: $(udev_DATA) @$(NORMAL_INSTALL) test -z "$(udevdir)" || $(MKDIR_P) "$(DESTDIR)$(udevdir)" @list='$(udev_DATA)'; test -n "$(udevdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(udevdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(udevdir)" || exit $$?; \ done uninstall-udevDATA: @$(NORMAL_UNINSTALL) @list='$(udev_DATA)'; test -n "$(udevdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(udevdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(udevdir)" && rm -f $$files # 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): @fail= 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; \ ($(am__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" $(RECURSIVE_CLEAN_TARGETS): @fail= 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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 || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(udevdir)"; 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-udevDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-udevDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip install-udevDATA \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am uninstall-udevDATA doc: doxygen.cfg rm -rf html refman.pdf doxygen doxygen.cfg # 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: pilot-link-0.12.5-dfsg/doc/60-libpisock.rules0000644000175000017500000000514010565373541021134 0ustar rousseaurousseau# $Id: 60-libpisock.rules,v 1.4 2007/02/16 18:26:41 desrod Exp $ # # udev rules file for pilot-link's libpisock library, enabled for libusb # SUBSYSTEMS!="usb", ACTION!="add", GOTO="libpisock_rules_end" # Sony handheld devices ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0038", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0066", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0095", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="054c", ATTRS{idProduct}=="009a", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="054c", ATTRS{idProduct}=="00da", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="054c", ATTRS{idProduct}=="00e9", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0144", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0169", GROUP="dialout", MODE="0664" # Handspring handheld devices ATTRS{idVendor}=="082d", ATTRS{idProduct}=="0100", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="082d", ATTRS{idProduct}=="0200", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="082d", ATTRS{idProduct}=="0300", GROUP="dialout", MODE="0664" # Palm, Inc. and palmOne handheld devices ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6601", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="8001", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="0830", ATTRS{idProduct}=="0001", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="0830", ATTRS{idProduct}=="0002", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="0830", ATTRS{idProduct}=="0003", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="0830", ATTRS{idProduct}=="0020", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="0830", ATTRS{idProduct}=="0031", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="0830", ATTRS{idProduct}=="0040", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="0830", ATTRS{idProduct}=="0050", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="0830", ATTRS{idProduct}=="0060", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="0830", ATTRS{idProduct}=="0061", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="0830", ATTRS{idProduct}=="0070", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="0830", ATTRS{idProduct}=="0080", GROUP="dialout", MODE="0664" # Garmin iQue 3600 ATTRS{idVendor}=="091e", ATTRS{idProduct}=="0004", GROUP="dialout", MODE="0664" ATTRS{idVendor}=="0c88", ATTRS{idProduct}=="0021", GROUP="dialout", MODE="0664" # Tapwave Zodiac 1 & 2 ATTRS{idVendor}=="12ef", ATTRS{idProduct}=="0100", GROUP="dialout", MODE="0664" # Unknown device (can someone confirm?) ATTRS{idVendor}=="4766", ATTRS{idProduct}=="0001", GROUP="dialout", MODE="0664" LABEL="libpisock_rules_end" pilot-link-0.12.5-dfsg/doc/xml/0000755000175000017500000000000011333433324016444 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/doc/xml/Makefile.in0000644000175000017500000004675611333433243020533 0ustar rousseaurousseau# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ # $Id: Makefile.am,v 1.7 2007/02/16 18:26:42 desrod Exp $ # # Autoconf breaks distcheck when passing in these variables. To get it # to "mostly" build, use the following: # # make distcheck DISTCHECK_CONFIGURE_FLAGS="XSLTPROC=xsltproc # # You'll also need to add ../ to the docbook.xsl and pilot-link.docbook # to get past a bug in autoconf when using the distcheck target here. # Sigh. VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ target_triplet = @target@ subdir = doc/xml DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/catalog.xml.in $(srcdir)/docbook.xsl.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/bluez.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/tcl.m4 \ $(top_srcdir)/m4/threads.m4 \ $(top_srcdir)/m4/vl_lib_readline.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/include/pi-md5.h CONFIG_CLEAN_FILES = catalog.xml docbook.xsl CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLUEZ_CFLAGS = @BLUEZ_CFLAGS@ BLUEZ_LIBS = @BLUEZ_LIBS@ CAT_ENTRY_END = @CAT_ENTRY_END@ CAT_ENTRY_START = @CAT_ENTRY_START@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOCBOOK_ROOT = @DOCBOOK_ROOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVA = @JAVA@ JAVABASE = @JAVABASE@ JAVAC = @JAVAC@ JAVA_VERSION = @JAVA_VERSION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PIC_LIBS = @PIC_LIBS@ PILOT_LINK_MAJOR = @PILOT_LINK_MAJOR@ PILOT_LINK_MINOR = @PILOT_LINK_MINOR@ PILOT_LINK_PATCH = @PILOT_LINK_PATCH@ PILOT_LINK_VERS = @PILOT_LINK_VERS@ PISOCK_AGE = @PISOCK_AGE@ PISOCK_CURRENT = @PISOCK_CURRENT@ PISOCK_REVISION = @PISOCK_REVISION@ PISYNC_AGE = @PISYNC_AGE@ PISYNC_CURRENT = @PISYNC_CURRENT@ PISYNC_REVISION = @PISYNC_REVISION@ PKG_CONFIG = @PKG_CONFIG@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ POPT_INCLUDES = @POPT_INCLUDES@ POPT_LIBS = @POPT_LIBS@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_H = @PYTHON_H@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RL_LIBS = @RL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ XML_CATALOG = @XML_CATALOG@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ builddir = @builddir@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ usb_libs = @usb_libs@ SUBDIRS = . EXTRA_DIST = \ docbook.xsl \ pilot-link.docbook all: all-recursive .SUFFIXES: $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/xml/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/xml/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 $(am__aclocal_m4_deps): catalog.xml: $(top_builddir)/config.status $(srcdir)/catalog.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ docbook.xsl: $(top_builddir)/config.status $(srcdir)/docbook.xsl.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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): @fail= 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; \ ($(am__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" $(RECURSIVE_CLEAN_TARGETS): @fail= 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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 || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-local distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am all: $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(top_srcdir)/doc/man/ \ $(top_srcdir)/doc/xml/docbook.xsl \ $(top_srcdir)/doc/xml/pilot-link.docbook distclean-local: $(RM) -f xml/catalog.xml $(RM) -f xml/docbook.xsl # 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: pilot-link-0.12.5-dfsg/doc/xml/catalog.xml.in0000644000175000017500000000207710565373542021226 0ustar rousseaurousseau @CAT_ENTRY_START@ @CAT_ENTRY_END@ pilot-link-0.12.5-dfsg/doc/xml/docbook.xsl.in0000644000175000017500000004327010565501744021237 0ustar rousseaurousseau \fB \fR \fI \fR .RS .Sh " : " .RE .SS " .SH " " .SS " " .SH "SYNOPSIS" .PP 3 1 .\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH " " "Copyright 1996-2007 FSF" "@VERSION@" "PILOT-LINK" .SH AUTHOR S , . .br Man page edited by . Copyright \(co .Sp < > .SH NAME , \- .IP \fI\fR \fB\fR \fB\fR \fI\fR `` '' .nf .fi ( ) \fI \fR : \fI \fR bullet \(bu \(co \(tm \(tm \(rg (SM) \~ \(lq \(rq ` ' \(em \(em \(en \(en \(bu No refentry elements! pilot-link-0.12.5-dfsg/doc/xml/Makefile.am0000644000175000017500000000123410565373542020513 0ustar rousseaurousseau# $Id: Makefile.am,v 1.7 2007/02/16 18:26:42 desrod Exp $ # # Autoconf breaks distcheck when passing in these variables. To get it # to "mostly" build, use the following: # # make distcheck DISTCHECK_CONFIGURE_FLAGS="XSLTPROC=xsltproc # # You'll also need to add ../ to the docbook.xsl and pilot-link.docbook # to get past a bug in autoconf when using the distcheck target here. # Sigh. SUBDIRS= . EXTRA_DIST = \ docbook.xsl \ pilot-link.docbook all: $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(top_srcdir)/doc/man/ \ $(top_srcdir)/doc/xml/docbook.xsl \ $(top_srcdir)/doc/xml/pilot-link.docbook distclean-local: $(RM) -f xml/catalog.xml $(RM) -f xml/docbook.xsl pilot-link-0.12.5-dfsg/doc/xml/docbook.xsl0000644000175000017500000004326511333433255020631 0ustar rousseaurousseau \fB \fR \fI \fR .RS .Sh " : " .RE .SS " .SH " " .SS " " .SH "SYNOPSIS" .PP 3 1 .\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH " " "Copyright 1996-2007 FSF" "0.12.5" "PILOT-LINK" .SH AUTHOR S , . .br Man page edited by . Copyright \(co .Sp < > .SH NAME , \- .IP \fI\fR \fB\fR \fB\fR \fI\fR `` '' .nf .fi ( ) \fI \fR : \fI \fR bullet \(bu \(co \(tm \(tm \(rg (SM) \~ \(lq \(rq ` ' \(em \(em \(en \(en \(bu No refentry elements! pilot-link-0.12.5-dfsg/doc/xml/pilot-link.docbook0000644000175000017500000000552110716077144022103 0ustar rousseaurousseau ]> manpages &ietf2; &pilotaddresses; &pilotclip; &pilotcsd; &pilotdebugsh; &pilotdedupe; &pilotdlpsh; &pilotfile; &pilotfoto; &pilotgetram; &pilotgetrom; &pilotgetromtoken; &pilothinotes; &pilotinstalldatebook; &pilotinstallexpenses; &pilotinstallhinote; &pilotinstallmemo; &pilotinstallnetsync; &pilotinstalltodo; &pilotinstalltodos; &pilotinstalluser; &pilotlink; &pilotmemos; &pilotnredir; &pilotreadexpenses; &pilotreadical; &pilotreadnotepad; &pilotreadpalmpix; &pilotreadscreenshot; &pilotreadtodos; &pilotreadveo; &pilotreminders; &pilotschlep; &pilotfototreo600; &pilotfototreo650; &pilotwav; &pilotxfer; pilot-link-0.12.5-dfsg/doc/xml/README0000644000175000017500000000333710565373542017345 0ustar rousseaurousseau$Id: README,v 1.3 2007/02/16 18:26:42 desrod Exp $ README ============================== pilot-link automated documentation conversion The manpage files are generated automatically Only edit the files in this xml directory! If you edit the troff pages directly, the changes you make WILL be lost. ============================== The pilot-link.docbook should only be edited directly when adding or removing subpages from the documentation. Documentation generation: ========================= To generate new documentation after modifying files in xml/, just use make from this tree. ./autogen.sh checks to see if the manpages have been created each time it is run, so that work on the rest of the tree is not delayed and so that the make dist tarball does not require xsltproc to build. If cd doc/ && make does not generate the man pages it is probably because you have run ./autogen.sh since the manpages were created. To create new manpages, delete the old manpages in doc/man first, then run ./autogen.sh and finally make. Pilot-link customisations: ========================== Pilot-link uses a customised manpage XSL stylesheet for aesthetic reasons only. Other stylesheets can be used for other outputs, as long as the installed manpages use the customised XSL. The Makefile process uses automake substitution to configure xsltproc and generate the XSL and catalog files. Make then writes out the manpages using xsltproc -o ../man/ pilot-link.docbook Depending on your installation, xsltproc will use the nonet option to avoid requesting validation data from the internet or may avoid validation altogether with the novalid option. If your installation uses -novalid, ensure you check the XML files for validity after making changes! pilot-link-0.12.5-dfsg/doc/doxygen.cfg.in0000644000175000017500000001744510256013732020422 0ustar rousseaurousseau#--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = pilot-link PROJECT_NUMBER = @VERSION@ OUTPUT_DIRECTORY = dox OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES ABBREVIATE_BRIEF = ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = NO STRIP_FROM_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO DETAILS_AT_TOP = YES INHERIT_DOCS = YES DISTRIBUTE_GROUP_DOC = NO TAB_SIZE = 8 ALIASES = OPTIMIZE_OUTPUT_FOR_C = YES OPTIMIZE_OUTPUT_JAVA = NO SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = YES EXTRACT_PRIVATE = YES EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = YES 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 GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES GENERATE_DEPRECATEDLIST= YES ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = NO WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = . FILE_PATTERNS = RECURSIVE = YES EXCLUDE = bindings EXCLUDE_SYMLINKS = YES EXCLUDE_PATTERNS = EXAMPLE_PATH = EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = NO IMAGE_PATH = dox INPUT_FILTER = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = YES INLINE_SOURCES = YES STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = YES 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 = dox/header.html HTML_FOOTER = dox/footer.html HTML_STYLESHEET = dox/doxygen.css HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = YES CHM_FILE = HHC_LOCATION = GENERATE_CHI = NO BINARY_TOC = NO TOC_EXPAND = NO DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = NO 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 = YES EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = include INCLUDE_FILE_PATTERNS = PREDEFINED = PI_ARGS(x)=x EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = NO #--------------------------------------------------------------------------- # Configuration::addtions 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 = NO HIDE_UNDOC_RELATIONS = NO HAVE_DOT = YES CLASS_GRAPH = YES COLLABORATION_GRAPH = YES UML_LOOK = YES TEMPLATE_RELATIONS = YES INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES CALL_GRAPH = YES GRAPHICAL_HIERARCHY = YES DOT_IMAGE_FORMAT = png DOT_PATH = DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 800 MAX_DOT_GRAPH_HEIGHT = 600 MAX_DOT_GRAPH_DEPTH = 0 GENERATE_LEGEND = YES DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::addtions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = YES pilot-link-0.12.5-dfsg/doc/TODO0000644000175000017500000000765710565373541016365 0ustar rousseaurousseau$Id: TODO,v 1.20 2007/02/16 18:26:41 desrod Exp $ Major Issues ------------ Open/Pending ------------ - read-expenses/install-expense doesn't return the string of Type for 'Train, Airplane', etc. - Check RPC code (something broken on large-endian machines?) - pilot-xfer -f fix (support '-f FooDB' as 'FooDB.p{db|rc|qa} - Split out "Sync" from Backup function - "strict-ify" pilot-sync-plan.pl Fixed/Closed ------------ - Fix DLP to understand multiple return arguments. Minor Issues ------------ Open/Pending ------------ - Add current date/time to dlp_AddSyncLogEntry(); - install-hinote duplicate note detection, export of notes from Hi-NoteDB.pdb into desktop text files. Can we easily handle images? - Add progress callbacks to libpisock so that you can find out how far a file transfer has gone (this is complex, as you also need to instrument PADP and perhaps SLP transmissions, receptions, and calculating exactly how many bytes is needed to transfer a file won't be fun.) knghtbrd: this is partly done now. - Update Java bindings to use Ant instead of {g|n}make - Rewrite Perl bindings to take advantage of MakeMaker - There's a small perl problem with writing the binary character 11 to the end of a record. The following example illustates this: #!/usr/bin/perl -w use diagnostics; use PDA::Pilot; # it's the last value which makes the program fail; # and it fails only for the value 11! @rec = (0,0,0,0,0,0,0,0,11); %info = ("type"=>"Data","creator"=>"XXXX","name"=>"test"); $pdb = PDA::Pilot::File::create("test.pdb", \%info ) or die "Oops!\n"; $rec = join('', map(chr, @rec)); $pdb->addRecordRaw($rec,0,0,0); Tweaks/Enhancements ------------------- - Add proper curses updates to pilot-xfer -b -f -i -s -p to look something like: .--------------------------------------------------------------. | File: /tmp/palm/Alpha-Lg.pdb Successful | | Size: 3,462 bytes, 3.38k 1,028,492 bytes total | | Progress: [==========================> ] 62% | | Overall: [=======================> ] 50% | | Time: 00:11:23 | | Files: 234 remaining, 468 total | `--------------------------------------------------------------' knghtbrd: suggest wget-style output? curses not required. - Start to condense the install-* binaries into one binary called pilot-install. getopt() is a prerequisite for this, so we can do 'pilot-install -memos -todos' for example. Too much duplicated code in there. Symlink the rest of the apps to pilot-install, and just test argv[0] to run the proper functions. Multi-call binary. - 'pilot-xfer -f Foo' to pull 'Foo.prc' from your Palm works. Additional option to pull by CrID would be nice as well (and faster, since we can use the DLP equivalent of DmOpenDatabaseByTypeCreator()) - Add Tcl 8 specific code to allow retrieval of raw records, and optionally use Tcl routines for packing and unpacking; Add all dlp functions, clean up the channel code rats nest. Somehow. (Separate source file?) - Perl bindings: Change record representation from string to object to match Python implementation. Add packers. Document. - Collapse: read-todos/install-todos, memos/install-memos, etc. New Features ------------ - pxd, first cut at a pilot-xfer'ized daemon - Standard output format for the "4 Magic Buttons". XML? csv? iCal/vCard? - Teach pilot-sync-plan.pl about the other repetition types that are convertable from Plan to Pilot. - pilot-xfer --daemon. Would be a good test to get it listening on a port in a non-scripted hacky way. All applications which return should have this functionality. Interactive applications should be left alone. Documentation Updates --------------------- - Reference IP_FORWARD=yes in /etc/sysconfig/sysctl for the ppp HOWTO pilot-link-0.12.5-dfsg/doc/Makefile.am0000644000175000017500000000060410715113726017704 0ustar rousseaurousseauif BUILD_XML if ENABLE_XSLTPROC SUBDIRS = xml man endif else SUBDIRS = man endif EXTRA_DIST = \ CodingGuidelines \ README.debugging \ README.libusb \ README.usb \ TODO \ 60-libpisock.rules \ doxygen.cfg.in udevdir = $(datadir)/pilot-link/udev udev_DATA = 60-libpisock.rules DIST_CLEAN_FILES=doxygen.cfg doc: doxygen.cfg rm -rf html refman.pdf doxygen doxygen.cfg pilot-link-0.12.5-dfsg/doc/README.libusb0000644000175000017500000003417310565373541020025 0ustar rousseaurousseau$Id: README.libusb,v 1.4 2007/02/16 18:26:41 desrod Exp $ ====================================================================== README.libusb Author: David A. Desrosiers Updated: Sun Feb 4 15:49:15 EST 2007 ====================================================================== This README will describe in detail, the process and programs necessary to get pilot-link 0.12.0 and later working with libusb on Linux and Mac OS X machines. Why do I want to use libusb? -------------------------------------------------------------------------- libusb is an alternative way of communicating with USB devices on Linux, Unix, Mac OS X and Windows machines. In the Linux world, Palm devices using USB would require the Linux kernel's "visor" module, written and maintained by Greg Kroah-Hartman. A lot of work and testing has been put into the visor module over the years and it is very solid, but making sure that it remains current with released Palm devices can be problematic, because the devices coming out are always different and some can require special handling. The current version of the visor module allows you to insert it into the kernel namespace with the proper Palm product and vendor values at runtime (described in README.usb), so modifying the module's source code and rebuilding it is no longer necessary as it was with earlier versions of the visor module. Using libusb, you no longer have to use the visor module, and you can talk "directly" to the device. In short, libusb requires less maintenance overhead, and is MUCH faster to use with current Palm devices (roughly 200% to 600% faster, depending on your Palm's processor speed and the type of records you are syncronizing across. YMMV, of course.). Why is visor so slow? Why is libusb so much faster? -------------------------------------------------------------------------- In testing, syncronizing a Palm device with libusb has been shown to be anywhere from 200% to 600% faster vs. using the kernel visor module. The kernel visor module itself is not "slow", there are just more kernel interfaces to pass through, which slows down the communication between kernel and Palm. It has never been optimized for speed, and certainly could be, if someone was interested in doing so. The primary maintainer is not. Does it work with every device? -------------------------------------------------------------------------- It works with every device I've personally tested it with, which isn't saying much. This includes an m505, T2, T3, Treo650 and Treo680 device. They all work over libusb without too much trouble at all. Some devices behave very differently with respect to the "timing" between the point where you hit HotSync and the time libusb recognizes it on the bus, but everything I've used with it seems to work once I get a feel for the right timing. Does that mean it will work with every device? No. We need testers to make sure it works reliably. If you have a device that doesn't work with libusb, we want to know about it. How do I use libusb, assuming I have all the pieces? -------------------------------------------------------------------------- Simply pass the port of 'usb:' (without the quotes) as the port designation when using any pilot-link or GUI conduits or tools. Some examples of that are: pilot-xfer -p usb: -b $HOME/Palm/backups pilot-dlpsh -p usb: pilot-nredir -e -p usb: The same syntax applies when running pilot-link on Mac OS X machines. When you configure J-Pilot, gnome-pilot or KPilot, the port designation of 'usb:' is still the same. What are these "pieces" I need? -------------------------------------------------------------------------- Now things get really interesting. Below are the necessary programs and versions you'll need. These are the MINIMUM versions you can use. Anything earlier than these versions WILL NOT work, and will likely cause other problems. - pilot-link....: 0.12.0 - libusb........: 0.1 - libusb-dev....: 0.1 headers - udev..........: 0.70 - Linux kernel..: 2.4.21 or 2.6.10 You'll also need the 60-libpisock.rules file included in the latest pilot-link release. A copy of the current file can be found at the following URL, and will always be updated to reflect the latest changes or additions: http://cvs.pilot-link.org/index.cgi/doc/60-libpisock.rules Let's go through each item above and see what we need here: pilot-link --------------------------------------------------- First, you'll need to grab a copy of the latest release of pilot-link 0.12.0 or later. libusb does NOT work with pilot-link v0.11.8 or previous versions. There is no code in pilot-link 0.11.8 to use libusb, so you can't use that version or anything earlier than that. You MUST use 0.12.0 or later to use libusb. Stick with the latest public release (and not CVS versions) and you'll be fine. CVS versions tend to include some unstable code being put there for other developers to test, and may sometimes break, so its best to stick with a public, released version. libusb --------------------------------------------------- libusb should be a part of your current Linux or FreeBSD distribution. If it isn't, you can install it with the standard Linux package management tools for your distribution (apt-get, yast2, yum, etc.) On Debian, this is as simple as: apt-get update && apt-get install libusb libusb-dev This should get you the pieces you'll need. On Fedora/Red Hat, you can use yum or urpmi or similar tools, as in: yum update yum install libusb libusb libusb-devel Other distributions may vary, but the package names should be similar. Remember, you'll want version 0.1 or later, and make sure you use the one supplied with your distribution. Don't try to build and install your own version from source, unless your distribution uses that method (FreeBSD, Gentoo, LFS) udev --------------------------------------------------- Your distribution should have this already, there is no need to install it, but you may need to update it to the latest, current version if you are behind in updates. The important thing is that you have a version of AT LEAST 0.70 or later. Anything earlier will cause problems, and we cannot support it. BIG FAT WARNING: Do not... I repeat, do NOT try to build and install udev from source. The documentation that comes with it warns against it, and it WILL break things. Don't do it. Use your distributions package for it and you'll be fine. How do I configure these pieces on Linux? -------------------------------------------------------------------------- Easy! Assuming you have all of the prerequisites above, and have compiled (but NOT installed!) pilot-link 0.12.0 against libusb (described below, don't worry), and that it reported a successful libusb implementation at configure time, you can proceed. setting up the rules file for udev --------------------------------------------------- We need to configure and restart udev first, and since its the easiest of the pieces, we'll start there. Put the 60-libpisock.rules file that came with your pilot-link release in '/etc/udev/rules.d/' and restart udev. Check that the file was read and parsed by udev by looking at the udev logs in /var/log (if you log, if not, enable logging in /etc/udev/udev.conf and restart udev to verify), or use the following to enable logging at runtime: udevcontrol log_priority="debug" Check that it saw the new file and has correctly parsed it. mount the kernel's usbfs --------------------------------------------------- Make sure you have usbfs mounted, which can be found in fstab, by adding the following line: # none /proc/bus/usb usbfs defaults Then 'mount -a' to make sure its mounted. You should now have a /proc/bus/usb directory heirarchy. The "new" udev and libusb will be using /dev/bus/usb, but many applications still use /proc/bus/usb, so we'll mount it until that gets deprecated. blacklist the kernel visor module --------------------------------- In order to use libusb, you'll want to make sure the kernel "visor" module does not automatically load when it sees a Palm device connecting to the USB root hub on your system. udev method (for newer udev versions, no hotplug) ------------------------------------------------- If your udev is new enough and you no longer use hotplug, you can use the following process to blacklist the visor module: Simply add the two words 'blacklist visor' (without quotes) to a new file called: /etc/modprobe.d/blacklist-palm If that file doesn't exist, create it and put the one-line entry into it. older method (for systems still using hotplug) ------------------------------------------------- You can blacklist list by adding 'visor' to the /etc/hotplug/blacklist file to stop hotplug from loading it at connect time. Don't forget to restart hotplug to re-read the blacklist file. pilot-link --------------------------------------------------- You'll need to compile pilot-link by passing the --enable-libusb option at configure time. When you configure it with libusb support, you should see the following output in the summary page: Direct USB support...... : yes, libusb If you do not see that, you are missing some critical build dependency (such as the libusb development package, which includes the necessary header files to provide this support). Check config.log, search for libusb and see what went wrong. Remember, you'll need the libusb headers to build the support into pilot-link for it, not the runtime. This will be a libusb-dev or libusb-devel package on most distributions. How do I configure these pieces on OS X? -------------------------------------------------------------------------- OSX is even easier, you don't have to do anything. Just configure pilot-link *WITHOUT* passing the --enable-libusb option, and use the same port designation ('usb:' without quotes), and it will "Just Work(tm)". Many thanks go to Florent Pillet for debugging this and making it work as quickly as it does. Florent's SyncBuddy product is based on libpisock, the core library behind pilot-link. If you want a VERY fast syncronization application for OSX which can read Photos, external storage, backup, and do many other things, check it out and support his efforts and contributions: http://www.florentpillet.com/syncbuddy.html Ok, I have all the pieces, I've configured them, now what? -------------------------------------------------------------------------- If you're sure you've done everything above, and all services and pieces are configured and restarted properly, you're almost done. The last step is to try it. To do that, just launch any of the pilot-link conduits using the following syntax: pilot-link -p usb: -l pilot-dlpsh -p usb: You should see something like this: $ pilot-xfer -p usb: -l Listening for incoming connection on usb:... The port designation for libusb is simply 'usb:' (minus the quotes). You can launch it at the desktop side first, and it will wait for an incoming connection for as long as it takes to receive one. That's it. If you get any sort of error or other problem, make sure the visor module is truly unloaded (rmmod visor, as root), make sure udev and hotplug are restarted, make sure your pilot-link is the right version (built with libusb support), and make sure your .rules file is in the right place for your Palm device. None of this is working! Where do I go for help now? -------------------------------------------------------------------------- There are mailing lists and an irc channel that can help. You can find those at the following places: General discussion, problems, configuration issues ------------------------------------------------------ http://www.pilot-link.org/mailman/listinfo/pilot-link-general Development-related issues and discussion, i.e. "code" ------------------------------------------------------ http://www.pilot-link.org/mailman/listinfo/pilot-link-devel pilot-link irc channel ------------------------------------------------------ We can also be found on irc, at irc.pilot-link.org in the channel #pilot-link If your irc client supports SSL, you can point to port 994 on irc.pilot-link.org and have a secured session (no cleartext). If you cannot use SSL, use port 6667 for "normal" irc. Lastly, I can be reached directly at desrod@gnu-designs.com if nothing else works for you. Try the mailing lists and irc first though, as I might be hard to reach at times. Donating to pilot-link -------------------------------------------------------------------------- Do you like our work? Do you rely on the code we release for your daily work or for your own commercial or OSS project? Please consider donating to keep the project going. We're 100% self-funded, and we see a LOT of traffic from users and downloads. Every contribution helps, whether to pay for bandwidth or to buy devices for testing. You can help support us by visiting the pilot-link.org site and clicking on the "Donate" button on the left side of the page. We thank you for your contributions, whatever you can offer. Thanks go to... -------------------------------------------------------------------------- Justin Paulsen, "Petaris" on irc, for his tireless testing efforts, mirroring pilot-link releases, helping out users on irc, and keeping things lively in general. Florent Pillet, "fpillet" on irc, for helping fix up libpisock to work on OSX and doing testing on newer devices to work out the various Heisenbergs found in there. His work has been invaluable over the last year or two with usb, devices and OS X support. Zephania Hull, "Mercury" on irc for spending the time and effort to get libusb worked out on the Linux side. Without his effort, libusb wouldn't be where it is today. Other thanks go to Knghtbird, Nicholas Piper, Adriaan de Groot, John Marshall, Kenneth Albanowski and many others through the years for helping bring this to where it is today. If I've forgotten to mention you, just let me know. pilot-link-0.12.5-dfsg/doc/README.usb0000644000175000017500000004604510565373541017337 0ustar rousseaurousseau$Id: README.usb,v 1.14 2007/02/16 18:26:41 desrod Exp $ ====================================================================== README.usb Author: David A. Desrosiers Updated: Sun Feb 4 16:10:15 EST 2007 ---------------------------------------------------------------------- TODO: - Create README.porting as referenced in this HOWTO ====================================================================== This README will describe in detail, the process and programs required to get pilot-link 0.12.0 and later working with standard usb connectivity on Linux and Mac OS X machines. Since the release of version 0.10.99 of pilot-link, USB-based Palm handheld devices are fully supported by the entire suite of pilot-link tools, conduits and bindings. To get this working may require a few things to be configured on your desktop or server machine first, and you should verify a few items to make sure that it is working properly. Currently (as of 2/4/2007), USB connections are supported on Mac OS X, Linux and BSD-based operating systems on several hardware different architectures. Porting it to work with Win32 or and any other POSIX-compliant environment (such as OS/2 or BeOS) should not be much harder. Please see README.porting in the pilot-link docs subdirectory for more details on how to help with these efforts. Mac OS X USB Configuration -------------------------- There is nothing specific to do at all. No really, its just that easy. When you compile pilot-link on Mac OS X, the darwinusb driver code under ./libpisock/ is detected and built and supports USB handhelds as well as the PalmConnect USB serial adapter. All pilot-link command line tools take a special port "name" as their sole port argument. This is different from Linux where there is a very specific entry in /dev to manage, depending on your particular handheld (more on this point later). In OS X, there is no /dev filesystem, so we use a magic port designation which talks to the bus directly. On OS X, use the port designation of "-p usb:" if your Palm handheld is connected through a USB cradle, cable or a PalmConnect serial-to-USB adapter. That's it. Note that USB support on OS X requires Mac OS X 10.2 or later, and will not work on MacOS 9 or earlier versions. If you are running Mac OS X, you can ignore all the rest of this document, your job is done here; It Should "Just Work(tm)". Linux USB Configuration ----------------------- Roll up your sleeves, this could get a bit confusing... but don't fret, I'm thorough and I'll walk you through every single step. First, in order to get USB working with your Palm device, your desktop machine must support the USB subsystem. Depending on your machine's configuration, this may require enabling USB in the machine's BIOS, or in your Linux kernel configuration, or perhaps just as simple as loading the required modules for your USB subsystem. Many of these are supported by current Linux kernels and recent Linux distributions (as of 2/2007). If you should find that your kernel is older than 2.4.21 (as of the date of this README), you will need to do a kernel upgrade to something more recent. Using kernels older than 2.4.21 are not recommended and may not work for newer Palm devices, as the kernel-level visor module that is required may not have support for your newer Palm device. In short, the kernel was released before your Palm device was released, so it doesn't know how to speak to it. With each new Palm device that is released, the vendor and product identifiers in the hardware have to be added to the visor module to allow it to recognize the device at connect time. See the "Loading visor" section below for more detail. First, verify that you have USB functioning properly on your system. If you're using a USB-based keyboard or a USB mouse and it works properly, you already have functioning USB support in your linux kernel, which was probably provided through your Linux distribution by default. If you are not using a USB device already, you can try to probe for the USB host controller that your system supports (you do have a system with USB ports on it, right? =) with the following syntax, as the 'root' user (only root can load and unload kernel modules in Linux): For 2.4.xx kernels ----------------------- # /sbin/modprobe usb-ohci or.. # /sbin/modprobe usb-uhci or.. # /sbin/modprobe usb For 2.6.xx kernels ----------------------- # /sbin/modprobe uhci_hcd or.. # /sbin/modprobe ehci_hcd Each motherboard will have a specific chipset that one of these modules should support. You will only need one, so please don't be alarmed if you try to modprobe one of the above, and receive errors. If you do, it simply means that the host controller isn't what the module expects; try one of the others. Once you have that working (verified to be loaded with lsmod(1), you can then try loading the USB serial support layer, using: # /sbin/modprobe usbserial If this is successful, you should see the following in the system logs (usually /var/log/messages): kernel: usb.c: registered new driver serial kernel: usbserial.c: USB Serial support registered for Generic kernel: usbserial.c: USB Serial Driver core v1.4 Then on top of that, load the visor module. The name of the module is called "visor" for historical reasons, here's why: The very first Palm device to support USB was a Handspring Visor. Since then, many vendors such as Sony, Palm, and others have provided Palm handhelds with USB support, and this "visor" module should contain the proper code to sync and communicate with them as well; the code is still inside the module but it retains its legacy name. # /sbin/modprobe visor If successful, you should see the following entries in the logs: kernel: usbserial.c: USB Serial support registered for Handspring Visor / Treo / Palm 4.0 / Clié 4.x kernel: usbserial.c: USB Serial support registered for Sony Clié 3.5 kernel: visor.c: USB HandSpring Visor, Palm m50x, Treo, Sony Clié driver v1.7 Don't be alarmed if your version does not show these exact strings. As long as you see the usbserial and visor module load successfully, without reporting any errors or unresolved symbols, the system is ready for the next step. Now if you do an '/sbin/lsmod' you should see something similar to this: Module Size Used by Tainted: PF visor 9036 0 (unused) usbserial 19904 0 [visor] usb-ohci 18080 0 (unused) usb-uhci 23012 0 (unused) Loading visor dynamically with custom device ids ------------------------------------------------ If you're running Linux kernel 2.4.22 or higher, you can add your vendor_id and product_id at module load time by passing the values to modprobe(1) as follows: modprobe visor product=0x70 vendor=0x80 If you do not know the values that your device requires, you can check your system logs in /var/log/messages after you hit HotSync on your Palm device. It should show something like this: usb.c: USB device 11 (vend/prod 0x830/0x61) is not claimed by any active driver. In that case, you know you want to pass the following values to modprobe: modprobe visor product=0x61 vendor=0x830 Or you can put it in your /etc/modules.conf file as well, using a similar syntax as follows: options visor vendor=0x54c product=0x144 Simple, right? Yes. Verifying device inode creation (non-udev) ------------------------------------------ Next we must verify that the actual USB devices are created and registered in /dev for you. In your kernel source directory, under the kernel source directory Documentation/usb/usb-serial.txt, is an overview of how to create the proper USB devices on your system. For Palm devices, you will need no more than two of these devices, dev/ttyUSB0 and /dev/ttyUSB1, depending on your Palm device manufacturer (as of the time of this README, two Sony models use dev/ttyUSB0, and the rest of the Sony and Palm models seem to be using /dev/ttyUSB1) # /bin/mknod /dev/ttyUSB0 c 188 0 # /bin/mknod /dev/ttyUSB1 c 188 1 If you are using devfs (currently not recommended for security reasons), the devices supported will show up as /dev/usb/tts/0 and /dev/usb/tts/1 respectively. More on devfs issues will be covered later in this README. Also, make sure your user has read and write permissions to those device nodes: # the '?' used below is a wildcard and will chmod all # ttyUSB* devices with a single digit (USB1, USB2, # USB3, and so on). # /bin/chmod 0666 /dev/ttyUSB? ..or # /bin/chmod a+rw /dev/ttyUSB? Configuring udev to create inodes dynamically for you ----------------------------------------------------- With the newer Linux distributions, you can take advantage of udev(1), which will create and name devices for you dynamically. Using udev, you don't have to create the devices in /dev manually, nor do you have to create symlinks to /dev/pilot if you want to use that interface. Configuring udev is fairly straightforward: 1. Install the latest udev package for your Linux distribution 2. Create a file in /etc/udev/rules.d called pilot.rules, with the following information in it (all on one line, and do not make a typo or it will not work properly): BUS=="usb", SYSFS{product}=="Palm Handheld*|Handspring *", KERNEL=="ttyUSB*", NAME="ttyUSB%n", SYMLINK="pilot", GROUP="usb", MODE="0666" Yep, that's it. 3. Restart udev using whatever service restart tools your distribution provides. You do not have to reboot for this to take effect. Linux Kernel Configuration --------------------------- If your distrubution-supplied Linux kernel does not have native USB support, you will have to build it into your kernel first. Building a Linux kernel is not as hard or as daunting as it seems, and is in fact, quite rewarding. Not only do custom kernels perform better, but they tend to be faster, because they only include support for hardware _on_ your system, and not hardware you don't. You wouldn't build a kernel for SCSI support, if you didn't have SCSI drives in your system, would you? There is a very comprehensive and concise kernel-building-HOWTO which will walk you through the entire process, in non-confusing language, found here: http://howto.gnu-designs.com/kernel-HOWTO Once you have built a kernel, and tested it, you can easily add the necessary support for USB devices and USB host controller support into it afterwards. After configuring your Linux kernel, you will find in your kernel source directory, is a file called .config ("dot config"). In this file, are several parameters you will need to add/change to enable proper USB support. CONFIG_USB=y CONFIG_USB_DEBUG=y CONFIG_USB_DEVICEFS=y CONFIG_USB_UHCI=m CONFIG_USB_UHCI_ALT=m CONFIG_USB_OHCI=m CONFIG_USB_SERIAL=m CONFIG_USB_SERIAL_GENERIC=y CONFIG_USB_SERIAL_VISOR=m If you would like to support for other USB devices (such as a USB-based digital camera, or scanner) you can add it here as well. Rebuild your kernel as specified in your favorite kernel HOWTO, and then proceed to the previous section to verify that all required USB bits are functioning. Talking to your Palm over USB ----------------------------- To now "speak" to these devices you've created, using the drivers you loaded, you must hit the HotSync button on your cradle first, before launching any of pilot-link's various utilities, if your version of pilot-link is earlier than 0.11.8. When you hit the HotSync button on the cradle or by tapping on your HotSync icon on the Palm itself, you should see something similar to the following in the system logs (/var/log): kernel: Manufacturer: Palm, Inc. kernel: Product: Palm Handheld kernel: SerialNumber: L0JH14R12345 kernel: usbserial.c: Handspring Visor / Palm 4.0 / Clié 4.x converter detected kernel: visor.c: Handspring Visor / Palm 4.0 / Clié 4.x: Number of ports: 2 kernel: visor.c: Handspring Visor / Palm 4.0 / Clié 4.x: port 1, is for Generic use and is bound to ttyUSB0 kernel: visor.c: Handspring Visor / Palm 4.0 / Clié 4.x: port 2, is for HotSync use and is bound to ttyUSB1 kernel: usbserial.c: Handspring Visor / Palm 4.0 / Clié 4.x converter now attached to ttyUSB0 (or usb/tts/0 for devfs) kernel: usbserial.c: Handspring Visor / Palm 4.0 / Clié 4.x converter now attached to ttyUSB1 (or usb/tts/1 for devfs) kernel: usb.c: serial driver claimed interface c76aa160 If you received errors or see a message similar to the following: kernel: usb.c: USB device 28 (vend/prod 0x54c/0x95) is not claimed by any active driver ...see the "Loading visor dynamically with custom ids" section above. Once your module is loaded, and you see the successful message when you hit HotSync, you can now launch any of pilot-link's various conduits such as: $ pilot-dlpsh -p /dev/ttyUSB1 ..or $ pilot-dlpsh -p /dev/pilot export PILOTPORT=/dev/ttyUSB1 $ pilot-xfer -l It should connect and allow you to talk to your Palm device. The PILOTPORT environment variable will be read if the '-p' option is not specified. If you do not specify either, /dev/pilot will be used if it exists. Substitute ttyUSB1 for your port, based on the DeviceMatrix above. FreeBSD USB Configuration ------------------------- This information copyright 2002 Anish Mistry & David A. Desrosiers. All rights reserved. Written by Anish Mistry of AM Productions (http://am-productions.yi.org) Configuring FreeBSD to speak to your Palm device over USB is a bit different from Linux and OSX. Here are the quick steps: 1. Create a small shell script to be executed from your usbd.conf. #!/bin/sh # export the following enviornmental variables to enable full # logging of a connection # # export PILOT_LOGFILE=$HOME/.pilot/pilot-link.log # export PILOT_LOG=1 # set to 0 to disable logging # export PILOT_DEBUG="DEV SLP CMP PADP NET SOCK" # export PILOT_DEBUG_LEVEL="DEBUG" /usr/local/bin/pilot-xfer -p usb:/dev/$1 --sync $HOME/.pilot/ 2. You will need to su to root and add the following to your /etc/usbd.conf before the passthrough entry. Your entry may vary depending on your handheld. In order to find out what your particular Palm handheld requires for 'vendor' and 'product' below, make sure your kernel has support for 'ucom' and 'uvisor', and run 'usbdevs -v' AFTER hitting HotSync on your Palm device. The fields will be displayed, simply copy them into the appropriate places as shown below. ########################## ## Handspring visor (PDA) device "Handspring Visor" devname "ugen0" vendor 0x082d product 0x0100 release 0x0100 # pilot-link # attach "/home/dir/.pliot/pilot-sync.sh ${DEVNAME}" 3. Kill and restart the usbd daemon with the following (as root) # killall usbd && usbd Verify that usbd properly restarted with: # ps ax | grep usbd 4. Press the HotSync button again on your cradle. 5. Launch the application of your choice to syncronize with your Palm handheld. 'pilot-xfer' and 'dlpsh' are two common ones to try. The correct syntax is: $ /usr/local/bin/pilot-xfer -p /dev/ucom0 -b $HOME/.pilot/ $ /usr/local/bin/dlpsh -p /dev/ucom0 The first sync can take a while, so please be patient. Alternately, you can uncomment the 'attach' line in /etc/usbd.conf above and restart usbd as explained in step 3 above. 6. You're done. Enjoy! (This is the most important item.) USB Palm Handheld Device Kernel Matrix -------------------------------------- Many thanks go to Greg Kroah for his tireless work supporting these new devices as they come out. The matrix of which kernels support which Palm handheld device can be found at the pilot-link wiki, at the following URL: http://www.pilot-link.org/DeviceMatrix If you see your Palm in this list, you must be running the corresponding kernel version to be able to use it with pilot-link or ColdSync using the USB interface. If you don't see your Palm device there, feel free to add your entry so others can benefit from the vendor and product information you've added. None of this is working! Where do I go for help now? -------------------------------------------------------------------------- There are mailing lists and an irc channel that can help. You can find those at the following places: General discussion, problems, configuration issues ------------------------------------------------------ http://www.pilot-link.org/mailman/listinfo/pilot-link-general Development-related issues and discussion, i.e. "code" ------------------------------------------------------ http://www.pilot-link.org/mailman/listinfo/pilot-link-devel pilot-link irc channel ------------------------------------------------------ We can also be found on irc, at irc.pilot-link.org in the channel #pilot-link If your irc client supports SSL, you can point to port 994 on irc.pilot-link.org and have a secured session (no cleartext). If you cannot use SSL, use port 6667 for "normal" irc. Lastly, I can be reached directly at desrod@gnu-designs.com if nothing else works for you. Try the mailing lists and irc first though, as I might be hard to reach at times. Donating to pilot-link -------------------------------------------------------------------------- Do you like our work? Do you rely on the code we release for your daily work or for your own commercial or OSS project? Please consider donating to keep the project going. We're 100% self-funded, and we see a LOT of traffic from users and downloads. Every contribution helps, whether to pay for bandwidth or to buy devices for testing. You can help support us by visiting the pilot-link.org site and clicking on the "Donate" button on the left side of the page. We thank you for your contributions, whatever you can offer. Thanks go to... -------------------------------------------------------------------------- Justin Paulsen, "Petaris" on irc, for his tireless testing efforts, mirroring pilot-link releases, helping out users on irc, and keeping things lively in general. Florent Pillet, "fpillet" on irc, for helping fix up libpisock to work on OSX and doing testing on newer devices to work out the various Heisenbergs found in there. His work has been invaluable over the last year or two with usb, devices and OS X support. Zephania Hull, "Mercury" on irc for spending the time and effort to get libusb worked out on the Linux side. Without his effort, libusb wouldn't be where it is today. Other thanks go to Knghtbird, Nicholas Piper, Adriaan de Groot, John Marshall, Kenneth Albanowski and many others through the years for helping bring this to where it is today. If I've forgotten to mention you, just let me know. pilot-link-0.12.5-dfsg/doc/CodingGuidelines0000644000175000017500000005076010565373541021025 0ustar rousseaurousseau/* * $Id: CodingGuidelines,v 1.6 2007/02/16 18:26:41 desrod Exp $ * * CodingGuidelines: pilot-link Coding Guidelines * * (c) 2002-2007, David A. Desrosiers * * * (2002-01-26) dd * Initial release of Coding Guidelines * * (2002-05-04) dd * Added some user-submitted suggestions to formatting and content, * fixed a pilot-unix reference * * (2007-02-07) dd * Updated some links and verbage here and there, based on user input * over the last 5 years. */ There are bound to be errors in this document, but this document strives to capture the ideas and concepts distributed throughout the pilot-link codebase, userland conduits and language bindings. This document should assist anyone who wants to modify the code found here, or work on active development of the codebase or submit patches to it. Anyone who wishes to contribute code should adhere to these guidelines. Code that doesn't follow these conventions will be modified or (in extreme cases) rejected. If you have additional suggestions or a good case for changing some of these guidelines then send a message or post a message on one of the pilot-link mailing lists[1]. First, start off by reading the ANSI C99 Coding Standards document[2]. I may have deviated in a few places but just about everything in the document applies here as well. If you are new to C programming, and reading the code seems confusing to you, you might want to try some of the available FAQs[3][4][5] out there, as well as the K&R "The C Programming Language"[6] books. Above all, write code that is easy to read and easy to maintain. Comment blocks of code and functions at all times. And get on my case if I deviate too much as well! Some Advice to Contributors --------------------------- Document and comment your code while you're writing it, not after you have it debugged and working correctly. Everyone who will have to look at your unfinished but well-documented program will appreciate the explanations. File Organization ----------------- A source file consists of various sections that should be separated by several blank lines. Although there is no maximum length limit for source files, files with more than about 1,000 lines are cumbersome to deal with.. so try to break them up into logical source files based on function, rather than name. Many rows of asterisks, for example, present little information compared to the time it takes to scroll past, and are discouraged. Lines longer than 79 columns are not handled well by all terminals and should be avoided if possible. Excessively long lines which result from deep indenting are often a symptom of poorly-organized code. Avoid it if you can (yes, we fall into this trap in several places in pilot-link too). Every source file should start at the top with comments containing a copyright notice, the name of the file, and a half-to-one-line summary of what the file contains. If you create a file by copying the boilerplate from another file, make sure to edit the copyright year and the file name as well as add your own name to the top if you are the original author. File Naming Conventions ----------------------- Some compilers and tools require certain suffix conventions for names of files. The following suffixes are required and are lowercase unless otherwise noted: * C source file names must end in a .c extension * Header files, otherwise called includes, must end in .h * Headers for C++ code in pilot-link may end in .hxx * Perl source files should always end in .pl, or .plt for "tainted" Perl scripts * All Java source files should end in .java * All Python source files should end in .py (or .i for swig source) The following conventions are universally followed: * Relocatable object file names end in .o * Include header file names end in .h An alternate convention that may be preferable in multi-language environments like pilot-link is to suffix both the language type and .h (e.g. 'foo.cc' or 'foo.hxx') to separate the standard .h headers and includes from those that are C++ specific. * Yacc source file names end in .y C++ has compiler-dependent suffix conventions, including .c, ..c, .cc, .c.c, and .C. Since much C code is also C++ code, there is no clear solution here, just stick with .c for C and .cxx for C++. In addition, it is conventional to use 'Makefile' (not 'makefile', note the lowercase 'M' in the second case) for the main control file for make (for systems that support it) and 'README' for a summary of the contents of the directory or directory tree. We use Makefile.am for automake versions of the Makefile targets in pilot-link. Program Files ------------- The suggested order of sections for a program file is as follows: 1. First in the file is a prologue that tells what is in that file. A description of the purpose of the objects in the files (whether they be functions, external data declarations or definitions, or something else) is more useful than a list of the object names. The prologue may optionally contain author(s), revision control information, references, etc. 2. Any header file includes should be next. If the include is for a non-obvious reason, the reason should be commented. In most cases, system include files like stdio.h should be included before user include files. In pilot-link, the stacking order looks like this: #include #include #include #include #include #include #include "pi-source.h" #include "pi-socket.h" #include "pi-file.h" #include "pi-dlp.h" #include "pi-version.h" #include "pi-header.h" 3. Any defines and typedefs that apply to the file as a whole are next. One normal order is to have "constant" macros first, then "function" macros, followed by typedefs and enums. 4. Next come the global (external) data declarations, usually in the order: externs, non-static globals, static globals. If a set of defines applies to a particular piece of global data (such as a flags word), the defines should be immediately after the data declaration or embedded in structure declarations, indented to put the defines one level deeper than the first keyword of the declaration to which they apply. 5. The functions come last, and should be in some sort of meaningful order. Like functions should appear together. A "breadth-first" approach (functions on a similar level of abstraction together) is preferred over "depth-first" (functions defined as soon as possible before or after their calls). Considerable judgement is called for here. If defining large numbers of essentially-independent utility functions, consider alphabetical order. You'll notice a convention in pilot-link's source files which models the following boilerplate structure, that main() is ALWAYS last, and any Help() functions appear directly above main(): /* * MyConduit.c: Palm boilerplate conduit template * * Copyright (c) 1996-2002, John Q. Public * * This is licensed under the Foo License * */ #ifdef HAVE_CONFIG_H # include #endif #include #include "local.h" #define something somevalue /* Declare prototypes */ int main(int argc, char *argv[]) void my_function(char foo, FILE *blort); static void Help(char *progname) void my_function(foo, FILE *blort) { ..function data; } /* Help() always directly precedes main() */ static void Help(char *progname) { ..Help text here; ..right above main(); } /* main(); is always last, at the bottom */ int main(int argc, char *argv[]) { ..main last function; } Header Files ------------ The header file is the first place that a contributor will go to find out information about procedures, structures, constants, etc. Make sure that every procedure and structure has a comment that says what it does. Divide procedures into meaningful groups set off by some distinguished form of comment. Avoid private header filenames that are the same as library header filenames. Namespace pollution is no fun for anyone. Avoid it if you can. Don't use absolute pathnames for header files. Use the construction for getting them from a standard place, or define them relative to the current directory. Use the -I (include-path) to handle extensive private libraries of header files. This allows reorganizing the project directory structure without having to alter source files. If you're creating your own header files, remember that header files that declare functions or external variables should be included in the file that defines the function or variable. That way, the compiler can do type checking and the external declaration will always agree with the definition. Avoid defining variables in a header file. It is bad design, and is a common symptom of poor "partitioning" of code between files. Some objects like typedefs and initialized data definitions cannot be seen twice by the compiler in one compilation. On some systems, repeating uninitialized declarations without the extern keyword also causes problems. Repeated declarations can happen if include files are nested and will cause the compilation to fail. Header files should not be nested. In extreme cases, where a large number of header files are to be included in several different source files, please put all common #includes in one include file, such as the legacy include/pi-config.h file in previous pilot-link releases. One trick to avoid "double-inclusion" of headers is to use the syntax below. It is not widely used in pilot-link, but the project is moving in that direction. #ifndef MYHEADER_H define MYHEADER_H ..body of myheader.h #endif /* end MYHEADER_H */ Comments -------- The comments should describe what is happening, how it is being done, what parameters mean, which globals are used and which are modified, and any restrictions or bugs. C is not assembler; putting a comment at the top of a 3-10 line section telling what it does overall is often more useful than a comment on each line describing micrologic. Comments should justify offensive code. The justification should be that something bad will happen if unoffensive code is used. Just making code faster is not enough to rationalize a hack; the performance must be shown to be unacceptable without the hack. The comment should explain the unacceptable behavior and describe why the hack is a "good fix" solution to the problem. Block comments inside a function are appropriate, and they should be tabbed over to the same tab setting as the code that they describe. One-line comments alone on a line should be indented to the tab setting of the code that follows. if (argc > 1) { /* Get input file from command line. */ if (freopen(argv[1], "r", stdin) == NULL) { perror(argv[1]); } } Very short comments may appear on the same line as the code they describe, and should be tabbed over to separate them from the statements. If more than one short comment appears in a block of code they should all be tabbed to the same tab setting. if (a == EXCEPTION) { b = TRUE; /* special case */ } else { b = isprime(a); /* works only for odd 'a' */ } Declarations ------------ Global declarations should begin in column one at the top of the file. All external data declaration should be preceded by the extern keyword. Repeated size declarations are particularly beneficial to someone picking up code written by another. The "pointer" qualifier, '*', should be with the variable name rather than with the type. char *s, *t, *u; ..instead of char* s, t, u; which would be incorrect, since 't' and 'u' do not get declared as pointers in the second example. You may notice throughout pilot-link's codebase, a very different indenting standard on declaring types. This style is called "Berkeley Indenting". In the above two examples, you can see that the types are indented one level beyond the type name, and each additional declaration of the same type is indented underneath it, separated by commas. The following two are functionally equivalent: char *s, *t, *u; char *s, /* S is for Santa */ *t, /* T is for Type */ *u; /* U know what this is */ However, the second type is much more readable, and easier to maintain. It also allows type-level commenting, which the first example does not. Please adhere to this style when developing code against pilot-link, or updating existing pilot-link code. The names, values, and comments are usually tabbed so that they line up underneath each other. Use the tab character rather than blanks (spaces). Any variable whose initial value is important should be explicitly initialized, or at the very least should be commented to indicate that C's default initialization to zero is being relied upon. Constants used to initialize longs should be explicitly long. Use capital letters; for example two long '2l' looks a lot like '21', the number twenty-one. A proper example would be similar to: int sd = -1; char *msg = "string"; struct bar foo[] = { { 40, BLORT, 60000L }, /* Note the capital L */ { 28, QUUX, 0L }, { 0 }, }; In any file which is part of a larger whole rather than a self-contained program, maximum use should be made of the static keyword to make functions and variables local to single files. Variables in particular should be accessible from other files only when there is a clear need that cannot be filled in another way. Such usage should be commented to make it clear that another file's variables are being used; the comment should name the other file. Function Declarations --------------------- Each function should be preceded by a block comment prologue that gives a short description of what the function does and (if not clear) how to use it. Discussion of non-trivial design decisions and side-effects is also appropriate. Avoid duplicating information clear from the code. An example from pilot-link's libsock/dlp.c file: /************************************************************ * * Function: dlp_GetSysDateTime * * Summary: DLP 1.0 GetSysDateTime function to get * device date and time * * Parameters: None * * Returns: A negative number on error, the number of * bytes read otherwise * ************************************************************/ The function return type should be alone on a line, and indented one stop (if necessary) Do not default to int; if the function does not return a value then it should be given return type void static void Help(char *progname) { printf("This is some Help text that" "extends to a second line\n"); return; } Each parameter should be declared (do not default to int). In general the role of each variable in the function should be described. This may either be done in the function comment or, if each declaration is on its own line, in a comment on that line. Loop counters called 'i', 'j', 'k', string pointers called 's', and integral types called 'c' when used for characters are typically excluded. If a group of functions all have a similar parameter or local variable name, it helps to call the repeated variable by the same name in all functions (int i; /* for example */). Avoid using the same name for different purposes in related functions. Like parameters should also appear in the same place in the various argument lists. Comments for parameters and local variables should be tabbed so that they line up underneath each other. Local variable declarations should be separated from the function's statements by a blank line. Avoid local declarations that override declarations at higher levels. In particular, local variables should not be redeclared in nested blocks. Whitespace ---------- Use vertical and horizontal whitespace tactfully. Indentation and spacing should reflect the block structure of the code; i.e. there should be at least two blank lines between the end of one function and the comments for the next. A long string of conditional operators should be split onto separate lines for easier readability. A conditional expressed as: if (foo->next==NULL && totalcountnext == NULL && totalcount < needed && needed <= MAX_ALLOT && server_active(current_input)) { ..stuff } Compound Statements ------------------- A compound statement is a list of statements enclosed by braces. There are many common ways of formatting the braces. Be consistent with your local standard, if you have one, or pick one and use it consistently. When editing someone else's code, always use the style used in that code. control { statement; statement; } The style above is called "K&R style", and is preferred if you haven't already got a favorite. With K&R style, the else part of an if-else statement and the while part of a do-while statement should appear on the same line as the close brace. With most other styles, the braces are always alone on a line. In pilot-link, you will see a mix of both K&R and Berkeley style indenting. Either is appropriate, and they are functionally interchangable. If you are unsure which to use, follow similar code examples in the pilot-link project as a baseline. Defaulting to K&R will always work as well. When a block of code has several labels, the labels are placed on separate lines. The fall-through feature of the C switch statement, (with no break between a code segment and the next case statement) must be commented for future maintenance. A lint-style comment/directive is best. switch (expr) { case ABC: case DEF: statement; break; case GHI: statement; /* FALLTHROUGH */ case XYZ: statement; break; } The last break above is unnecessary, but is required because it prevents a fall-through error if another case is added later after the last one. The "default" case, if used, should be last and does not require a break if it is last. Whenever an if-else statement has a compound statement for either the if or else section, the statements of both the if and else sections should both be enclosed in braces (called fully bracketed syntax). if (expr) { statement; } else { statement; statement; } An if-else with else if statements should be written with the else conditions left-justified. There are several examples of this usage throughout pilot-link's conduits. if (STREQ(reply, "yes")) { statements for yes ... } else if (STREQ(reply, "no")) { ... } else if (STREQ(reply, "maybe")) { ... } else { statements for default ... } ################################################################## # # This part is not finished yet, these are just my notes while I # work my way down the document # ################################################################## Naming Classes -------------- * Use FirstLetterOfWordIsCaptilized style (Camel Notation) Naming Files ------------ * Use all lower case. * Use - to separate words. eg. pilot-install.c * Use .c file extensions for source files, .h for headers, .cpp or .cc for C++, .hxx for C++ private headers, .pl for perl, and so on. * Filenames must be less than 32 characters in length. This plays nice with older file systems like MacOS. General Formatting ------------------ * Use TABS with a size of 8 to make the code easily readable while not wasting too much space Braces and Parenthesis ---------------------- * Paranthesis should be right after a function name. i.e. function() not function () * Paranthesis should have a space right after a keyword (if, while, for) eg: for (...) Miscellaneous ------------- * Avoid magic numbers. The only magic numbers in use should be 1 and 0. There are some cases where this may not apply, such as: #define APPEND_CRLF 1 my_strcat(str, "Hello World", APPEND_CRLF); Instead of using: my_strcat(str, "Hello World", 1); Numbers are only magic if its not readily apparent what they are for. Appendices ---------- [1] http://lists.pilot-link.org/ [2] http://webstore.ansi.org/ansidocstore/product.asp?sku=INCITS%2FISO%2FIEC+9899-1999+(R2005) [3] http://www.eskimo.com/~scs/C-faq/top.html [4] http://c-faq.com/ [5] http://www.faqs.org/faqs/C-faq/ [6] http://isbn.nu/0131103628 pilot-link-0.12.5-dfsg/doc/README0000644000175000017500000000170510565373541016541 0ustar rousseaurousseau$Id: README,v 1.1 2007/02/16 18:26:41 desrod Exp $ ====================================================================== README Author: David A. Desrosiers Updated: Fri Feb 16 13:11:17 EST 2007 ====================================================================== The various pieces of documentation for pilot-link can be found here. Below this tree, you will find various README documents describing how to configure or connect your Palm device using various methods (such as usb or libusb). I have written many HOWTO documents describing how to use your Palm in various situations, such as over bluetooth, with Evolution, over the network and so on. You can find those here: http://howto.pilot-link.org/ The manpages are also found here as well. We are keeping them in XML format for easy maintenance, and these XML sources can be found in CVS, or publically via the web-view of CVS at the following link: http://cvs.pilot-link.org/index.cgi/doc/xml/ pilot-link-0.12.5-dfsg/doc/README.debugging0000644000175000017500000000745510565373541020503 0ustar rousseaurousseau$Id: README.debugging,v 1.7 2007/02/16 18:26:41 desrod Exp $ ====================================================================== README.debugging Author: JP Rosevear, David A. Desrosiers Updated: Mon Oct 16 16:37:45 EDT 2006 ====================================================================== This README will describe in detail, the process and programs necessary to debug any problems you might have with pilot-link with libusb on Linux and Mac OS X machines. Debugging pilot-link -------------------------------------------------------------------------- To begin debugging problems, the core library "libpisock" contains runtime debugging features. You do not need to recompile pilot-link to include these. If you want to disable them (not recommended, but you may if you know what you're doing), simply pass the --disable-debug configure option to disable at build time. Debugging is enabled by default, so there is no --enable-debugging target. Environment variables for debugging -------------------------------------------------------------------------- The runtime debugging is controlled by setting four different environment variables. These are: PILOT_DEBUG PILOT_DEBUG_LEVEL PILOT_LOG PILOT_LOGFILE PILOT_DEBUG controls what type of information is output to STDOUT or your logfile. The levels of information available are: DEV Device IO SLP Serial Link Protocol PADP Packet Assembly/Disassembly Protocol CMP Connection Management Protocol NET Network Sync Protocol SOCK Socket Commands API API (datebook, address, todo, memos, etc) USER User data You can specify multiple types of information to be output/captured as follows: setenv PILOT_DEBUG "DEV SLP PADP" # for csh or export PILOT_DEBUG="DEV SLP PADP" # for bash PILOT_DEBUG_LEVEL controls the level of information displayed for each type. The availab levels are: NONE No information displayed at all ERR Critical errors WARN Non-critical errors INFO General information DEBUG Verbose debugging info, everything! If the variable PILOT_LOG is set (nonzero), the information will be written to the file "pilot-link.debug" by default. This logfile name be overridden by setting PILOT_LOGFILE to the desired file name you wish to use. If you wish to disable logging for a particular session, just set PILOT_LOG to 0. Here's an example of the overall usage (for bash, your shell may vary): export PILOT_DEBUG="DEV SLP CMP PADP SOCK NET USER" export PILOT_DEBUG_LEVEL="DEBUG" export PILOT_LOG=1 export PILOT_LOGFILE="debug.log" These logs will provide a level of detail necessay for the pilot-link developers (or yourself) to try to track down why your Palm device is not communicating properly with pilot-link on your machine or operating system. Capturing the output -------------------------------------------------------------------------- FIXME How do I read this stuff? -------------------------------------------------------------------------- FIXME Now what do I do next? -------------------------------------------------------------------------- FIXME Donating to pilot-link -------------------------------------------------------------------------- Do you like our work? Do you rely on the code we release for your daily work or for your own commercial or OSS project? Please consider donating to keep the project going. We're 100% self-funded, and we see a LOT of traffic from users and downloads. Every contribution helps, whether to pay for bandwidth or to buy devices for testing. You can help support us by visiting the pilot-link.org site and clicking on the "Donate" button on the left side of the page. We thank you for your contributions, whatever you can offer. pilot-link-0.12.5-dfsg/autogen.sh0000755000175000017500000001505710560614574017121 0ustar rousseaurousseau#!/bin/sh # Run this to generate all the initial makefiles, etc. PKG_NAME=pilot-link srcdir=`dirname $0` test -z "$srcdir" && srcdir=. DIE=0 (autoconf --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`autoconf' installed to compile $PKG_NAME." echo "Download the appropriate package for your distribution or get the source." echo "Get ftp://ftp.gnu.org/pub/gnu/autoconf/autoconf-2.50.tar.gz" echo "(or a newer version if it is available)" DIE=1 } (grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && { (glibtool --version) < /dev/null > /dev/null 2>&1 || (libtool --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`libtool' installed to compile $PKG_NAME." echo "Get ftp://ftp.gnu.org/pub/gnu/libtool/libtool-1.5.tar.gz" echo "(or a newer version if it is available)" DIE=1 } } # usage: test_version program version # returns 0 if program >= version; returns 1 if not. test_version() { this_prog="$1" want_vers="$2" testv=`"$this_prog" --version 2>/dev/null | head -1 | awk '{print $NF}'` if test -z "$testv" ; then return 1 ; fi testv_major=`echo "$testv" | sed 's/\([0-9]*\).\([0-9]*\).*$/\1/'` testv_minor=`echo "$testv" | sed 's/\([0-9]*\).\([0-9]*\).*$/\2/'` vers_major=`echo "$want_vers" | sed 's/\([0-9]*\).\([0-9]*\).*$/\1/'` vers_minor=`echo "$want_vers" | sed 's/\([0-9]*\).\([0-9]*\).*$/\2/'` # if wanted_major > found_major, this isn't good enough if test $vers_major -gt $testv_major ; then return 1 # if wanted_major < found_major, then this is fine elif test $vers_major -lt $testv_major ; then return 0 # if we get here, then the majors are equal, so test the minor version # we want found_minor >= want_minor. # So, if want_minor > found_minor, this is bad. elif test $vers_minor -gt $testv_minor ; then return 1 # this is it. else return 0 fi } # usage: find_program preset program version "" # sets "program" to the name of the program to use. # if preset is set, then use that regardless, # otherwise check if "program" is of a good enough version and use that, # otherwise check if "program-version" is of a good enough version and use that. # otherwise return an error. find_program() { find="$1" prog="$2" vers="$3" extravers="$4" if test -n "$find" ; then test_version "$find" "$vers" status="$?" if test "$status" = 0 ; then program="$find" return 0 fi echo "**Error**: cannot use $find" else test_version "$prog" "$vers" status=$? if test "$status" = 0 ; then program="$prog" return 0 fi for test_vers in $vers $extravers ; do test_version "$prog-$test_vers" "$vers" status=$? if test "$status" = 0 ; then program="$prog-$test_vers" return 0 fi done fi echo echo "**Warning**: Could not find a $prog that identifies itself >= $vers." echo program="$prog" } # These statics should really be defined at the top find_program "$AUTOCONF" autoconf "2.53" AUTOCONF="$program" find_program "$AUTOHEADER" autoheader "2.53" AUTOHEADER="$program" find_program "$AUTOMAKE" automake "1.5 1.6 1.7 1.8" AUTOMAKE="$program" find_program "$ACLOCAL" aclocal "1.5 1.6 1.7 1.8" ACLOCAL="$program" ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`automake' installed to compile $PKG_NAME." echo "Get ftp://ftp.gnu.org/pub/gnu/automake/automake-1.7.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/automake-1.7.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.ac -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 ( cd $dr aclocalinclude="$ACLOCAL_FLAGS -I m4" if grep "^AM_GNU_GETTEXT" configure.ac >/dev/null; then if grep "sed.*POTFILES" configure.ac >/dev/null; then : do nothing -- we still have an old unmodified configure.ac else echo "Creating $dr/aclocal.m4 ..." test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 echo "Running gettextize... Ignore non-fatal messages." echo "no" | gettextize --force --copy 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.ac >/dev/null; then if test -z "$NO_LIBTOOLIZE" ; then case "$OSTYPE" in *darwin*) echo "Running glibtoolize... ($MACHTYPE)" glibtoolize --force --copy ;; *) echo "Running libtoolize..." libtoolize --force --copy ;; esac fi fi echo "Running aclocal $aclocalinclude ..." $ACLOCAL $aclocalinclude || { echo echo "**Error**: aclocal failed. This may mean that you have not" echo "installed all of the packages you need, or you may need to" echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\"" echo "for the prefix where you installed the packages whose" echo "macros were not found" exit 1 } if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then echo "Running autoheader..." $AUTOHEADER || { echo "**Error**: autoheader failed."; exit 1; } fi echo "Running automake --gnu $am_opt ..." $AUTOMAKE --add-missing --gnu $am_opt || { echo "**Error**: automake failed."; exit 1; } echo "Running autoconf ..." $AUTOCONF || { echo "**Error**: autoconf failed."; exit 1; } ) || exit 1 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 || exit 1 else echo Skipping configure process. fi pilot-link-0.12.5-dfsg/Makefile.am0000644000175000017500000000055710256020755017145 0ustar rousseaurousseauAUTOMAKE_OPTIONS = 1.6 SUBDIRS=popt \ libpisock \ libpisync \ include \ src \ bindings \ doc \ tests \ darwin m4dir = $(datadir)/aclocal m4_DATA = pilot-link.m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = pilot-link.pc ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ autogen.sh \ $(m4_DATA) \ pilot-link.pc.in \ pilot-link-pp.pc.in pilot-link-0.12.5-dfsg/aclocal.m40000644000175000017500000012252611333433242016746 0ustar rousseaurousseau# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 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. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],, [m4_warning([this file was generated for autoconf 2.65. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # 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 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 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. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # 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` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # 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 9 # 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])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl 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) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # 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 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # 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 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # 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, 2006, 2008, 2009 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 16 # 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.62])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 if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi 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 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])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) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 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 AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # 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_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 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 if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi 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, 2008 # 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 5 # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless `enable' is passed literally. # For symmetry, `disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful (and sometimes confusing) to the casual installer], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) 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]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 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_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # 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 6 # 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 AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # 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, 2006 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 for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 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_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], [m4_foreach_w([_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, 2008 # 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 5 # 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 # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # 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="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 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_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # 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 m4_include([m4/bluez.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/python.m4]) m4_include([m4/socklen.m4]) m4_include([m4/tcl.m4]) m4_include([m4/threads.m4]) m4_include([m4/vl_lib_readline.m4]) pilot-link-0.12.5-dfsg/install-sh0000755000175000017500000003253711331674343017123 0ustar rousseaurousseau#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # 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. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false 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: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -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. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; 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 if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? 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 "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # 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: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # 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 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 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. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: pilot-link-0.12.5-dfsg/INSTALL0000644000175000017500000001722707422114244016142 0ustar rousseaurousseauBasic 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, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). 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 at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' 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. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure 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 supports 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' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' 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' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM 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 host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. 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. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--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. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. pilot-link-0.12.5-dfsg/config.h.in0000644000175000017500000001427411333433256017136 0ustar rousseaurousseau/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT /* Define if we build with BlueZ */ #undef HAVE_BLUEZ /* Define to 1 if you have the `cfmakeraw' function. */ #undef HAVE_CFMAKERAW /* Define to 1 if you have the `cfsetispeed' function. */ #undef HAVE_CFSETISPEED /* Define to 1 if you have the `cfsetospeed' function. */ #undef HAVE_CFSETOSPEED /* Define to 1 if you have the `cfsetspeed' function. */ #undef HAVE_CFSETSPEED /* Define to 1 if you have the header file. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `dup2' function. */ #undef HAVE_DUP2 /* 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 `gethostname' function. */ #undef HAVE_GETHOSTNAME /* Define to 1 if you have the `gnu_get_libc_version' function. */ #undef HAVE_GNU_GET_LIBC_VERSION /* Define to 1 if you have the header file. */ #undef HAVE_HISTORY_H /* Define if we have libiconv support */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_IFADDRS_H /* Define to 1 if you have the `inet_aton' function. */ #undef HAVE_INET_ATON /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_IOKIT_IOBSD_H /* Define to 1 if you have the `popt' library (-lpopt). */ #undef HAVE_LIBPOPT /* Define if you have a readline compatible library */ #undef HAVE_LIBREADLINE /* Define to 1 if you have the `malloc' function. */ #undef HAVE_MALLOC /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define if we have PNG support */ #undef HAVE_PNG /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD /* Define if we have pthreads */ #undef HAVE_PTHREADS /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_H /* Define if your readline library has \`add_history' */ #undef HAVE_READLINE_HISTORY /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_HISTORY_H /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_READLINE_H /* Define to 1 if you have the header file. */ #undef HAVE_REGEX_H /* Define to 1 if you have the `sigaction' function. */ #undef HAVE_SIGACTION /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* 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 `strtok' function. */ #undef HAVE_STRTOK /* 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_COMPAT_H /* 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_MALLOC_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKIO_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_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UTSNAME_H /* Define to 1 if you have the `uname' function. */ #undef HAVE_UNAME /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define if we have USB support */ #undef HAVE_USB /* Host type */ #undef HOST_OS /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Your system's bitbucket (usually /dev/null or NUL) */ #undef NULL_DEVICE /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* 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 home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define if we have debugging enabled */ #undef PI_DEBUG /* Define to necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define if we have termios(3) support */ #undef TERMIOS_CSPEED /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Define verbose tty device */ #undef TTYPrompt /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* type to use in place of socklen_t if not defined */ #undef pl_socklen_t pilot-link-0.12.5-dfsg/popt/0000755000175000017500000000000011333433323016060 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/popt/Makefile.in0000644000175000017500000004214411333433244020134 0ustar rousseaurousseau# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ target_triplet = @target@ subdir = popt DIST_COMMON = README $(am__noinst_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/bluez.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/tcl.m4 \ $(top_srcdir)/m4/threads.m4 \ $(top_srcdir)/m4/vl_lib_readline.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/include/pi-md5.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libpopt_la_LIBADD = am__libpopt_la_SOURCES_DIST = popt.c findme.c poptparse.c poptconfig.c \ popthelp.c @INCLUDED_POPT_TRUE@am_libpopt_la_OBJECTS = popt.lo findme.lo \ @INCLUDED_POPT_TRUE@ poptparse.lo poptconfig.lo popthelp.lo libpopt_la_OBJECTS = $(am_libpopt_la_OBJECTS) @INCLUDED_POPT_TRUE@am_libpopt_la_rpath = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libpopt_la_SOURCES) DIST_SOURCES = $(am__libpopt_la_SOURCES_DIST) am__noinst_HEADERS_DIST = findme.h poptint.h system.h popt.h HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLUEZ_CFLAGS = @BLUEZ_CFLAGS@ BLUEZ_LIBS = @BLUEZ_LIBS@ CAT_ENTRY_END = @CAT_ENTRY_END@ CAT_ENTRY_START = @CAT_ENTRY_START@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOCBOOK_ROOT = @DOCBOOK_ROOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVA = @JAVA@ JAVABASE = @JAVABASE@ JAVAC = @JAVAC@ JAVA_VERSION = @JAVA_VERSION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PIC_LIBS = @PIC_LIBS@ PILOT_LINK_MAJOR = @PILOT_LINK_MAJOR@ PILOT_LINK_MINOR = @PILOT_LINK_MINOR@ PILOT_LINK_PATCH = @PILOT_LINK_PATCH@ PILOT_LINK_VERS = @PILOT_LINK_VERS@ PISOCK_AGE = @PISOCK_AGE@ PISOCK_CURRENT = @PISOCK_CURRENT@ PISOCK_REVISION = @PISOCK_REVISION@ PISYNC_AGE = @PISYNC_AGE@ PISYNC_CURRENT = @PISYNC_CURRENT@ PISYNC_REVISION = @PISYNC_REVISION@ PKG_CONFIG = @PKG_CONFIG@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ POPT_INCLUDES = @POPT_INCLUDES@ POPT_LIBS = @POPT_LIBS@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_H = @PYTHON_H@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RL_LIBS = @RL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ XML_CATALOG = @XML_CATALOG@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ builddir = @builddir@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ usb_libs = @usb_libs@ @INCLUDED_POPT_TRUE@INCLUDES = -I$(top_srcdir)/include @INCLUDED_POPT_TRUE@noinst_HEADERS = findme.h poptint.h system.h popt.h @INCLUDED_POPT_TRUE@noinst_LTLIBRARIES = libpopt.la @INCLUDED_POPT_TRUE@libpopt_la_SOURCES = popt.c findme.c poptparse.c poptconfig.c popthelp.c EXTRA_DIST = \ findme.c findme.h poptint.h system.h popt.c popt.h \ poptparse.c poptconfig.c popthelp.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu popt/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu popt/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 $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libpopt.la: $(libpopt_la_OBJECTS) $(libpopt_la_DEPENDENCIES) $(LINK) $(am_libpopt_la_rpath) $(libpopt_la_OBJECTS) $(libpopt_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/findme.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/popt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poptconfig.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/popthelp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poptparse.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(LTLIBRARIES) $(HEADERS) installdirs: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am @INCLUDED_POPT_TRUE@.PHONY: sources @INCLUDED_POPT_TRUE@sources: @INCLUDED_POPT_TRUE@ @echo $(libpopt_la_SOURCES:%=popt/%) @INCLUDED_POPT_TRUE@.PHONY: lclint @INCLUDED_POPT_TRUE@lclint: @INCLUDED_POPT_TRUE@ lclint ${DEFS} ${INCLUDES} ${libpopt_la_SOURCES} # 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: pilot-link-0.12.5-dfsg/popt/COPYING0000644000175000017500000000237510113660404017117 0ustar rousseaurousseauCopyright (c) 1998 Red Hat Software 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 CONNECTION 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 dealings in this Software without prior written authorization from the X Consortium. pilot-link-0.12.5-dfsg/popt/poptconfig.c0000644000175000017500000001110210113125377020371 0ustar rousseaurousseau/** \ingroup popt * \file popt/poptconfig.c */ /* (C) 1998-2002 Red Hat, Inc. -- Licensing details are in the COPYING file accompanying popt source distributions, available from ftp://ftp.rpm.org/pub/rpm/dist. */ #include "system.h" #include "poptint.h" /*@-compmempass@*/ /* FIX: item->option.longName kept, not dependent. */ static void configLine(poptContext con, char * line) /*@modifies con @*/ { /*@-type@*/ int nameLength = strlen(con->appName); /*@=type@*/ const char * entryType; const char * opt; poptItem item = alloca(sizeof(*item)); int i, j; /*@-boundswrite@*/ memset(item, 0, sizeof(*item)); /*@-type@*/ if (strncmp(line, con->appName, nameLength)) return; /*@=type@*/ line += nameLength; if (*line == '\0' || !isspace(*line)) return; while (*line != '\0' && isspace(*line)) line++; entryType = line; while (*line == '\0' || !isspace(*line)) line++; *line++ = '\0'; while (*line != '\0' && isspace(*line)) line++; if (*line == '\0') return; opt = line; while (*line == '\0' || !isspace(*line)) line++; *line++ = '\0'; while (*line != '\0' && isspace(*line)) line++; if (*line == '\0') return; /*@-temptrans@*/ /* FIX: line alias is saved */ if (opt[0] == '-' && opt[1] == '-') item->option.longName = opt + 2; else if (opt[0] == '-' && opt[2] == '\0') item->option.shortName = opt[1]; /*@=temptrans@*/ if (poptParseArgvString(line, &item->argc, &item->argv)) return; /*@-modobserver@*/ item->option.argInfo = POPT_ARGFLAG_DOC_HIDDEN; for (i = 0, j = 0; i < item->argc; i++, j++) { const char * f; if (!strncmp(item->argv[i], "--POPTdesc=", sizeof("--POPTdesc=")-1)) { f = item->argv[i] + sizeof("--POPTdesc="); if (f[0] == '$' && f[1] == '"') f++; item->option.descrip = f; item->option.argInfo &= ~POPT_ARGFLAG_DOC_HIDDEN; j--; } else if (!strncmp(item->argv[i], "--POPTargs=", sizeof("--POPTargs=")-1)) { f = item->argv[i] + sizeof("--POPTargs="); if (f[0] == '$' && f[1] == '"') f++; item->option.argDescrip = f; item->option.argInfo &= ~POPT_ARGFLAG_DOC_HIDDEN; item->option.argInfo |= POPT_ARG_STRING; j--; } else if (j != i) item->argv[j] = item->argv[i]; } if (j != i) { item->argv[j] = NULL; item->argc = j; } /*@=modobserver@*/ /*@=boundswrite@*/ /*@-nullstate@*/ /* FIX: item->argv[] may be NULL */ if (!strcmp(entryType, "alias")) (void) poptAddItem(con, item, 0); else if (!strcmp(entryType, "exec")) (void) poptAddItem(con, item, 1); /*@=nullstate@*/ } /*@=compmempass@*/ int poptReadConfigFile(poptContext con, const char * fn) { const char * file, * chptr, * end; char * buf; /*@dependent@*/ char * dst; int fd, rc; off_t fileLength; fd = open(fn, O_RDONLY); if (fd < 0) return (errno == ENOENT ? 0 : POPT_ERROR_ERRNO); fileLength = lseek(fd, 0, SEEK_END); if (fileLength == -1 || lseek(fd, 0, 0) == -1) { rc = errno; (void) close(fd); /*@-mods@*/ errno = rc; /*@=mods@*/ return POPT_ERROR_ERRNO; } file = alloca(fileLength + 1); if (read(fd, (char *)file, fileLength) != fileLength) { rc = errno; (void) close(fd); /*@-mods@*/ errno = rc; /*@=mods@*/ return POPT_ERROR_ERRNO; } if (close(fd) == -1) return POPT_ERROR_ERRNO; /*@-boundswrite@*/ dst = buf = alloca(fileLength + 1); chptr = file; end = (file + fileLength); /*@-infloops@*/ /* LCL: can't detect chptr++ */ while (chptr < end) { switch (*chptr) { case '\n': *dst = '\0'; dst = buf; while (*dst && isspace(*dst)) dst++; if (*dst && *dst != '#') configLine(con, dst); chptr++; /*@switchbreak@*/ break; case '\\': *dst++ = *chptr++; if (chptr < end) { if (*chptr == '\n') dst--, chptr++; /* \ at the end of a line does not insert a \n */ else *dst++ = *chptr++; } /*@switchbreak@*/ break; default: *dst++ = *chptr++; /*@switchbreak@*/ break; } } /*@=infloops@*/ /*@=boundswrite@*/ return 0; } int poptReadDefaultConfig(poptContext con, /*@unused@*/ int useEnv) { char * fn, * home; int rc; /*@-type@*/ if (!con->appName) return 0; /*@=type@*/ rc = poptReadConfigFile(con, "/etc/popt"); if (rc) return rc; #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) if (getuid() != geteuid()) return 0; #endif if ((home = getenv("HOME"))) { fn = alloca(strlen(home) + 20); strcpy(fn, home); strcat(fn, "/.popt"); rc = poptReadConfigFile(con, fn); if (rc) return rc; } return 0; } pilot-link-0.12.5-dfsg/popt/popt.h0000644000175000017500000003715610113125377017231 0ustar rousseaurousseau/** \file popt/popt.h * \ingroup popt */ /* (C) 1998-2000 Red Hat, Inc. -- Licensing details are in the COPYING file accompanying popt source distributions, available from ftp://ftp.rpm.org/pub/rpm/dist. */ #ifndef H_POPT #define H_POPT #include /* for FILE * */ #define POPT_OPTION_DEPTH 10 /** \ingroup popt * \name Arg type identifiers */ /*@{*/ #define POPT_ARG_NONE 0 /*!< no arg */ #define POPT_ARG_STRING 1 /*!< arg will be saved as string */ #define POPT_ARG_INT 2 /*!< arg will be converted to int */ #define POPT_ARG_LONG 3 /*!< arg will be converted to long */ #define POPT_ARG_INCLUDE_TABLE 4 /*!< arg points to table */ #define POPT_ARG_CALLBACK 5 /*!< table-wide callback... must be set first in table; arg points to callback, descrip points to callback data to pass */ #define POPT_ARG_INTL_DOMAIN 6 /*!< set the translation domain for this table and any included tables; arg points to the domain string */ #define POPT_ARG_VAL 7 /*!< arg should take value val */ #define POPT_ARG_FLOAT 8 /*!< arg will be converted to float */ #define POPT_ARG_DOUBLE 9 /*!< arg will be converted to double */ #define POPT_ARG_MASK 0x0000FFFF /*@}*/ /** \ingroup popt * \name Arg modifiers */ /*@{*/ #define POPT_ARGFLAG_ONEDASH 0x80000000 /*!< allow -longoption */ #define POPT_ARGFLAG_DOC_HIDDEN 0x40000000 /*!< don't show in help/usage */ #define POPT_ARGFLAG_STRIP 0x20000000 /*!< strip this arg from argv(only applies to long args) */ #define POPT_ARGFLAG_OPTIONAL 0x10000000 /*!< arg may be missing */ #define POPT_ARGFLAG_OR 0x08000000 /*!< arg will be or'ed */ #define POPT_ARGFLAG_NOR 0x09000000 /*!< arg will be nor'ed */ #define POPT_ARGFLAG_AND 0x04000000 /*!< arg will be and'ed */ #define POPT_ARGFLAG_NAND 0x05000000 /*!< arg will be nand'ed */ #define POPT_ARGFLAG_XOR 0x02000000 /*!< arg will be xor'ed */ #define POPT_ARGFLAG_NOT 0x01000000 /*!< arg will be negated */ #define POPT_ARGFLAG_LOGICALOPS \ (POPT_ARGFLAG_OR|POPT_ARGFLAG_AND|POPT_ARGFLAG_XOR) #define POPT_BIT_SET (POPT_ARG_VAL|POPT_ARGFLAG_OR) /*!< set arg bit(s) */ #define POPT_BIT_CLR (POPT_ARG_VAL|POPT_ARGFLAG_NAND) /*!< clear arg bit(s) */ #define POPT_ARGFLAG_SHOW_DEFAULT 0x00800000 /*!< show default value in --help */ /*@}*/ /** \ingroup popt * \name Callback modifiers */ /*@{*/ #define POPT_CBFLAG_PRE 0x80000000 /*!< call the callback before parse */ #define POPT_CBFLAG_POST 0x40000000 /*!< call the callback after parse */ #define POPT_CBFLAG_INC_DATA 0x20000000 /*!< use data from the include line, not the subtable */ #define POPT_CBFLAG_SKIPOPTION 0x10000000 /*!< don't callback with option */ #define POPT_CBFLAG_CONTINUE 0x08000000 /*!< continue callbacks with option */ /*@}*/ /** \ingroup popt * \name Error return values */ /*@{*/ #define POPT_ERROR_NOARG -10 /*!< missing argument */ #define POPT_ERROR_BADOPT -11 /*!< unknown option */ #define POPT_ERROR_OPTSTOODEEP -13 /*!< aliases nested too deeply */ #define POPT_ERROR_BADQUOTE -15 /*!< error in paramter quoting */ #define POPT_ERROR_ERRNO -16 /*!< errno set, use strerror(errno) */ #define POPT_ERROR_BADNUMBER -17 /*!< invalid numeric value */ #define POPT_ERROR_OVERFLOW -18 /*!< number too large or too small */ #define POPT_ERROR_BADOPERATION -19 /*!< mutually exclusive logical operations requested */ #define POPT_ERROR_NULLARG -20 /*!< opt->arg should not be NULL */ #define POPT_ERROR_MALLOC -21 /*!< memory allocation failed */ /*@}*/ /** \ingroup popt * \name poptBadOption() flags */ /*@{*/ #define POPT_BADOPTION_NOALIAS (1 << 0) /*!< don't go into an alias */ /*@}*/ /** \ingroup popt * \name poptGetContext() flags */ /*@{*/ #define POPT_CONTEXT_NO_EXEC (1 << 0) /*!< ignore exec expansions */ #define POPT_CONTEXT_KEEP_FIRST (1 << 1) /*!< pay attention to argv[0] */ #define POPT_CONTEXT_POSIXMEHARDER (1 << 2) /*!< options can't follow args */ #define POPT_CONTEXT_ARG_OPTS (1 << 4) /*!< return args as options with value 0 */ /*@}*/ /** \ingroup popt */ struct poptOption { /*@observer@*/ /*@null@*/ const char * longName; /*!< may be NULL */ char shortName; /*!< may be '\0' */ int argInfo; /*@shared@*/ /*@null@*/ void * arg; /*!< depends on argInfo */ int val; /*!< 0 means don't return, just update flag */ /*@observer@*/ /*@null@*/ const char * descrip; /*!< description for autohelp -- may be NULL */ /*@observer@*/ /*@null@*/ const char * argDescrip; /*!< argument description for autohelp */ }; /** \ingroup popt * A popt alias argument for poptAddAlias(). */ struct poptAlias { /*@owned@*/ /*@null@*/ const char * longName; /*!< may be NULL */ char shortName; /*!< may be '\0' */ int argc; /*@owned@*/ const char ** argv; /*!< must be free()able */ }; /** \ingroup popt * A popt alias or exec argument for poptAddItem(). */ /*@-exporttype@*/ typedef struct poptItem_s { struct poptOption option; /*!< alias/exec name(s) and description. */ int argc; /*!< (alias) no. of args. */ /*@owned@*/ const char ** argv; /*!< (alias) args, must be free()able. */ } * poptItem; /*@=exporttype@*/ /** \ingroup popt * \name Auto-generated help/usage */ /*@{*/ /** * Empty table marker to enable displaying popt alias/exec options. */ /*@-exportvar@*/ /*@unchecked@*/ /*@observer@*/ extern struct poptOption poptAliasOptions[]; /*@=exportvar@*/ #define POPT_AUTOALIAS { NULL, '\0', POPT_ARG_INCLUDE_TABLE, poptAliasOptions, \ 0, "Options implemented via popt alias/exec:", NULL }, /** * Auto help table options. */ /*@-exportvar@*/ /*@unchecked@*/ /*@observer@*/ extern struct poptOption poptHelpOptions[]; /*@=exportvar@*/ #define POPT_AUTOHELP { NULL, '\0', POPT_ARG_INCLUDE_TABLE, poptHelpOptions, \ 0, "Help options:", NULL }, #define POPT_TABLEEND { NULL, '\0', 0, 0, 0, NULL, NULL } /*@}*/ /** \ingroup popt */ /*@-exporttype@*/ typedef /*@abstract@*/ struct poptContext_s * poptContext; /*@=exporttype@*/ /** \ingroup popt */ #ifndef __cplusplus /*@-exporttype -typeuse@*/ typedef struct poptOption * poptOption; /*@=exporttype =typeuse@*/ #endif /*@-exportconst@*/ enum poptCallbackReason { POPT_CALLBACK_REASON_PRE = 0, POPT_CALLBACK_REASON_POST = 1, POPT_CALLBACK_REASON_OPTION = 2 }; /*@=exportconst@*/ #ifdef __cplusplus extern "C" { #endif /*@-type@*/ /** \ingroup popt * Table callback prototype. * @param con context * @param reason reason for callback * @param opt option that triggered callback * @param arg @todo Document. * @param data @todo Document. */ typedef void (*poptCallbackType) (poptContext con, enum poptCallbackReason reason, /*@null@*/ const struct poptOption * opt, /*@null@*/ const char * arg, /*@null@*/ const void * data) /*@*/; /** \ingroup popt * Initialize popt context. * @param name * @param argc no. of arguments * @param argv argument array * @param options address of popt option table * @param flags or'd POPT_CONTEXT_* bits * @return initialized popt context */ /*@only@*/ /*@null@*/ poptContext poptGetContext( /*@dependent@*/ /*@keep@*/ const char * name, int argc, /*@dependent@*/ /*@keep@*/ const char ** argv, /*@dependent@*/ /*@keep@*/ const struct poptOption * options, int flags) /*@*/; /** \ingroup popt * Reinitialize popt context. * @param con context */ /*@-exportlocal@*/ void poptResetContext(/*@null@*/poptContext con) /*@modifies con @*/; /*@=exportlocal@*/ /** \ingroup popt * Return value of next option found. * @param con context * @return next option val, -1 on last item, POPT_ERROR_* on error */ int poptGetNextOpt(/*@null@*/poptContext con) /*@globals fileSystem, internalState @*/ /*@modifies con, fileSystem, internalState @*/; /*@-redecl@*/ /** \ingroup popt * Return next option argument (if any). * @param con context * @return option argument, NULL if no more options are available */ /*@observer@*/ /*@null@*/ const char * poptGetOptArg(/*@null@*/poptContext con) /*@modifies con @*/; /** \ingroup popt * Return current option's argument. * @param con context * @return option argument, NULL if no more options are available */ /*@observer@*/ /*@null@*/ const char * poptGetArg(/*@null@*/poptContext con) /*@modifies con @*/; /** \ingroup popt * Peek at current option's argument. * @param con context * @return option argument */ /*@observer@*/ /*@null@*/ const char * poptPeekArg(/*@null@*/poptContext con) /*@*/; /** \ingroup popt * Return remaining arguments. * @param con context * @return argument array, terminated with NULL */ /*@observer@*/ /*@null@*/ const char ** poptGetArgs(/*@null@*/poptContext con) /*@modifies con @*/; /** \ingroup popt * Return the option which caused the most recent error. * @param con context * @param flags * @return offending option */ /*@observer@*/ const char * poptBadOption(/*@null@*/poptContext con, int flags) /*@*/; /*@=redecl@*/ /** \ingroup popt * Destroy context. * @param con context * @return NULL always */ /*@null@*/ poptContext poptFreeContext( /*@only@*/ /*@null@*/ poptContext con) /*@modifies con @*/; /** \ingroup popt * Add arguments to context. * @param con context * @param argv argument array, NULL terminated * @return 0 on success, POPT_ERROR_OPTSTOODEEP on failure */ int poptStuffArgs(poptContext con, /*@keep@*/ const char ** argv) /*@modifies con @*/; /** \ingroup popt * Add alias to context. * @todo Pass alias by reference, not value. * @deprecated Use poptAddItem instead. * @param con context * @param alias alias to add * @param flags (unused) * @return 0 on success */ /*@unused@*/ int poptAddAlias(poptContext con, struct poptAlias alias, int flags) /*@modifies con @*/; /** \ingroup popt * Add alias/exec item to context. * @param con context * @param newItem alias/exec item to add * @param flags 0 for alias, 1 for exec * @return 0 on success */ int poptAddItem(poptContext con, poptItem newItem, int flags) /*@modifies con @*/; /** \ingroup popt * Read configuration file. * @param con context * @param fn file name to read * @return 0 on success, POPT_ERROR_ERRNO on failure */ int poptReadConfigFile(poptContext con, const char * fn) /*@globals fileSystem, internalState @*/ /*@modifies con->execs, con->numExecs, fileSystem, internalState @*/; /** \ingroup popt * Read default configuration from /etc/popt and $HOME/.popt. * @param con context * @param useEnv (unused) * @return 0 on success, POPT_ERROR_ERRNO on failure */ int poptReadDefaultConfig(poptContext con, /*@unused@*/ int useEnv) /*@globals fileSystem, internalState @*/ /*@modifies con->execs, con->numExecs, fileSystem, internalState @*/; /** \ingroup popt * Duplicate an argument array. * @note: The argument array is malloc'd as a single area, so only argv must * be free'd. * * @param argc no. of arguments * @param argv argument array * @retval argcPtr address of returned no. of arguments * @retval argvPtr address of returned argument array * @return 0 on success, POPT_ERROR_NOARG on failure */ int poptDupArgv(int argc, /*@null@*/ const char **argv, /*@null@*/ /*@out@*/ int * argcPtr, /*@null@*/ /*@out@*/ const char *** argvPtr) /*@modifies *argcPtr, *argvPtr @*/; /** \ingroup popt * Parse a string into an argument array. * The parse allows ', ", and \ quoting, but ' is treated the same as " and * both may include \ quotes. * @note: The argument array is malloc'd as a single area, so only argv must * be free'd. * * @param s string to parse * @retval argcPtr address of returned no. of arguments * @retval argvPtr address of returned argument array */ int poptParseArgvString(const char * s, /*@out@*/ int * argcPtr, /*@out@*/ const char *** argvPtr) /*@modifies *argcPtr, *argvPtr @*/; /** \ingroup popt * Parses an input configuration file and returns an string that is a * command line. For use with popt. You must free the return value when done. * * Given the file: \verbatim # this line is ignored # this one too aaa bbb ccc bla=bla this_is = fdsafdas bad_line= reall bad line reall bad line = again 5555= 55555 test = with lots of spaces \endverbatim * * The result is: \verbatim --aaa --bbb --ccc --bla="bla" --this_is="fdsafdas" --5555="55555" --test="with lots of spaces" \endverbatim * * Passing this to poptParseArgvString() yields an argv of: \verbatim '--aaa' '--bbb' '--ccc' '--bla=bla' '--this_is=fdsafdas' '--5555=55555' '--test=with lots of spaces' \endverbatim * * @bug NULL is returned if file line is too long. * @bug Silently ignores invalid lines. * * @param fp file handle to read * @param *argstrp return string of options (malloc'd) * @param flags unused * @return 0 on success * @see poptParseArgvString */ /*@-fcnuse@*/ int poptConfigFileToString(FILE *fp, /*@out@*/ char ** argstrp, int flags) /*@globals fileSystem @*/ /*@modifies *fp, *argstrp, fileSystem @*/; /*@=fcnuse@*/ /** \ingroup popt * Return formatted error string for popt failure. * @param error popt error * @return error string */ /*@-redecl@*/ /*@observer@*/ const char *const poptStrerror(const int error) /*@*/; /*@=redecl@*/ /** \ingroup popt * Limit search for executables. * @param con context * @param path single path to search for executables * @param allowAbsolute absolute paths only? */ void poptSetExecPath(poptContext con, const char * path, int allowAbsolute) /*@modifies con @*/; /** \ingroup popt * Print detailed description of options. * @param con context * @param fp ouput file handle * @param flags (unused) */ void poptPrintHelp(poptContext con, FILE * fp, /*@unused@*/ int flags) /*@globals fileSystem @*/ /*@modifies *fp, fileSystem @*/; /** \ingroup popt * Print terse description of options. * @param con context * @param fp ouput file handle * @param flags (unused) */ void poptPrintUsage(poptContext con, FILE * fp, /*@unused@*/ int flags) /*@globals fileSystem @*/ /*@modifies *fp, fileSystem @*/; /** \ingroup popt * Provide text to replace default "[OPTION...]" in help/usage output. * @param con context * @param text replacement text */ /*@-fcnuse@*/ void poptSetOtherOptionHelp(poptContext con, const char * text) /*@modifies con @*/; /*@=fcnuse@*/ /** \ingroup popt * Return argv[0] from context. * @param con context * @return argv[0] */ /*@-redecl -fcnuse@*/ /*@observer@*/ const char * poptGetInvocationName(poptContext con) /*@*/; /*@=redecl =fcnuse@*/ /** \ingroup popt * Shuffle argv pointers to remove stripped args, returns new argc. * @param con context * @param argc no. of args * @param argv arg vector * @return new argc */ /*@-fcnuse@*/ int poptStrippedArgv(poptContext con, int argc, char ** argv) /*@modifies *argv @*/; /*@=fcnuse@*/ /** * Save a long, performing logical operation with value. * @warning Alignment check may be too strict on certain platorms. * @param arg integer pointer, aligned on int boundary. * @param argInfo logical operation (see POPT_ARGFLAG_*) * @param aLong value to use * @return 0 on success, POPT_ERROR_NULLARG/POPT_ERROR_BADOPERATION */ /*@-incondefs@*/ int poptSaveLong(/*@null@*/ long * arg, int argInfo, long aLong) /*@modifies *arg @*/ /*@requires maxSet(arg) >= 0 /\ maxRead(arg) == 0 @*/; /*@=incondefs@*/ /** * Save an integer, performing logical operation with value. * @warning Alignment check may be too strict on certain platorms. * @param arg integer pointer, aligned on int boundary. * @param argInfo logical operation (see POPT_ARGFLAG_*) * @param aLong value to use * @return 0 on success, POPT_ERROR_NULLARG/POPT_ERROR_BADOPERATION */ /*@-incondefs@*/ int poptSaveInt(/*@null@*/ int * arg, int argInfo, long aLong) /*@modifies *arg @*/ /*@requires maxSet(arg) >= 0 /\ maxRead(arg) == 0 @*/; /*@=incondefs@*/ /*@=type@*/ #ifdef __cplusplus } #endif #endif pilot-link-0.12.5-dfsg/popt/poptparse.c0000644000175000017500000001213510113125377020245 0ustar rousseaurousseau/** \ingroup popt * \file popt/poptparse.c */ /* (C) 1998-2002 Red Hat, Inc. -- Licensing details are in the COPYING file accompanying popt source distributions, available from ftp://ftp.rpm.org/pub/rpm/dist. */ #include "system.h" #define POPT_ARGV_ARRAY_GROW_DELTA 5 /*@-boundswrite@*/ int poptDupArgv(int argc, const char **argv, int * argcPtr, const char *** argvPtr) { size_t nb = (argc + 1) * sizeof(*argv); const char ** argv2; char * dst; int i; if (argc <= 0 || argv == NULL) /* XXX can't happen */ return POPT_ERROR_NOARG; for (i = 0; i < argc; i++) { if (argv[i] == NULL) return POPT_ERROR_NOARG; nb += strlen(argv[i]) + 1; } dst = malloc(nb); if (dst == NULL) /* XXX can't happen */ return POPT_ERROR_MALLOC; argv2 = (void *) dst; dst += (argc + 1) * sizeof(*argv); /*@-branchstate@*/ for (i = 0; i < argc; i++) { argv2[i] = dst; dst += strlen(strcpy(dst, argv[i])) + 1; } /*@=branchstate@*/ argv2[argc] = NULL; if (argvPtr) { *argvPtr = argv2; } else { free(argv2); argv2 = NULL; } if (argcPtr) *argcPtr = argc; return 0; } /*@=boundswrite@*/ /*@-bounds@*/ int poptParseArgvString(const char * s, int * argcPtr, const char *** argvPtr) { const char * src; char quote = '\0'; int argvAlloced = POPT_ARGV_ARRAY_GROW_DELTA; const char ** argv = malloc(sizeof(*argv) * argvAlloced); int argc = 0; int buflen = strlen(s) + 1; char * buf = memset(alloca(buflen), 0, buflen); int rc = POPT_ERROR_MALLOC; if (argv == NULL) return rc; argv[argc] = buf; for (src = s; *src != '\0'; src++) { if (quote == *src) { quote = '\0'; } else if (quote != '\0') { if (*src == '\\') { src++; if (!*src) { rc = POPT_ERROR_BADQUOTE; goto exit; } if (*src != quote) *buf++ = '\\'; } *buf++ = *src; } else if (isspace(*src)) { if (*argv[argc] != '\0') { buf++, argc++; if (argc == argvAlloced) { argvAlloced += POPT_ARGV_ARRAY_GROW_DELTA; argv = realloc(argv, sizeof(*argv) * argvAlloced); if (argv == NULL) goto exit; } argv[argc] = buf; } } else switch (*src) { case '"': case '\'': quote = *src; /*@switchbreak@*/ break; case '\\': src++; if (!*src) { rc = POPT_ERROR_BADQUOTE; goto exit; } /*@fallthrough@*/ default: *buf++ = *src; /*@switchbreak@*/ break; } } if (strlen(argv[argc])) { argc++, buf++; } rc = poptDupArgv(argc, argv, argcPtr, argvPtr); exit: if (argv) free(argv); return rc; } /*@=bounds@*/ /* still in the dev stage. * return values, perhaps 1== file erro * 2== line to long * 3== umm.... more? */ int poptConfigFileToString(FILE *fp, char ** argstrp, /*@unused@*/ int flags) { char line[999]; char * argstr; char * p; char * q; char * x; int t; int argvlen = 0; size_t maxlinelen = sizeof(line); size_t linelen; int maxargvlen = 480; int linenum = 0; *argstrp = NULL; /* | this_is = our_line * p q x */ if (fp == NULL) return POPT_ERROR_NULLARG; argstr = calloc(maxargvlen, sizeof(*argstr)); if (argstr == NULL) return POPT_ERROR_MALLOC; while (fgets(line, (int)maxlinelen, fp) != NULL) { linenum++; p = line; /* loop until first non-space char or EOL */ while( *p != '\0' && isspace(*p) ) p++; linelen = strlen(p); if (linelen >= maxlinelen-1) return POPT_ERROR_OVERFLOW; /* XXX line too long */ if (*p == '\0' || *p == '\n') continue; /* line is empty */ if (*p == '#') continue; /* comment line */ q = p; while (*q != '\0' && (!isspace(*q)) && *q != '=') q++; if (isspace(*q)) { /* a space after the name, find next non space */ *q++='\0'; while( *q != '\0' && isspace((int)*q) ) q++; } if (*q == '\0') { /* single command line option (ie, no name=val, just name) */ q[-1] = '\0'; /* kill off newline from fgets() call */ argvlen += (t = q - p) + (sizeof(" --")-1); if (argvlen >= maxargvlen) { maxargvlen = (t > maxargvlen) ? t*2 : maxargvlen*2; argstr = realloc(argstr, maxargvlen); if (argstr == NULL) return POPT_ERROR_MALLOC; } strcat(argstr, " --"); strcat(argstr, p); continue; } if (*q != '=') continue; /* XXX for now, silently ignore bogus line */ /* *q is an equal sign. */ *q++ = '\0'; /* find next non-space letter of value */ while (*q != '\0' && isspace(*q)) q++; if (*q == '\0') continue; /* XXX silently ignore missing value */ /* now, loop and strip all ending whitespace */ x = p + linelen; while (isspace(*--x)) *x = 0; /* null out last char if space (including fgets() NL) */ /* rest of line accept */ t = x - p; argvlen += t + (sizeof("' --='")-1); if (argvlen >= maxargvlen) { maxargvlen = (t > maxargvlen) ? t*2 : maxargvlen*2; argstr = realloc(argstr, maxargvlen); if (argstr == NULL) return POPT_ERROR_MALLOC; } strcat(argstr, " --"); strcat(argstr, p); strcat(argstr, "=\""); strcat(argstr, q); strcat(argstr, "\""); } *argstrp = argstr; return 0; } pilot-link-0.12.5-dfsg/popt/poptint.h0000644000175000017500000000532710113125377017737 0ustar rousseaurousseau/** \ingroup popt * \file popt/poptint.h */ /* (C) 1998-2000 Red Hat, Inc. -- Licensing details are in the COPYING file accompanying popt source distributions, available from ftp://ftp.rpm.org/pub/rpm/dist. */ #ifndef H_POPTINT #define H_POPTINT /** * Wrapper to free(3), hides const compilation noise, permit NULL, return NULL. * @param p memory to free * @retval NULL always */ /*@unused@*/ static inline /*@null@*/ void * _free(/*@only@*/ /*@null@*/ const void * p) /*@modifies p @*/ { if (p != NULL) free((void *)p); return NULL; } /* Bit mask macros. */ /*@-exporttype -redef @*/ typedef unsigned int __pbm_bits; /*@=exporttype =redef @*/ #define __PBM_NBITS (8 * sizeof (__pbm_bits)) #define __PBM_IX(d) ((d) / __PBM_NBITS) #define __PBM_MASK(d) ((__pbm_bits) 1 << (((unsigned)(d)) % __PBM_NBITS)) /*@-exporttype -redef @*/ typedef struct { __pbm_bits bits[1]; } pbm_set; /*@=exporttype =redef @*/ #define __PBM_BITS(set) ((set)->bits) #define PBM_ALLOC(d) calloc(__PBM_IX (d) + 1, sizeof(__pbm_bits)) #define PBM_FREE(s) _free(s); #define PBM_SET(d, s) (__PBM_BITS (s)[__PBM_IX (d)] |= __PBM_MASK (d)) #define PBM_CLR(d, s) (__PBM_BITS (s)[__PBM_IX (d)] &= ~__PBM_MASK (d)) #define PBM_ISSET(d, s) ((__PBM_BITS (s)[__PBM_IX (d)] & __PBM_MASK (d)) != 0) struct optionStackEntry { int argc; /*@only@*/ /*@null@*/ const char ** argv; /*@only@*/ /*@null@*/ pbm_set * argb; int next; /*@only@*/ /*@null@*/ const char * nextArg; /*@observer@*/ /*@null@*/ const char * nextCharArg; /*@dependent@*/ /*@null@*/ poptItem currAlias; int stuffed; }; struct poptContext_s { struct optionStackEntry optionStack[POPT_OPTION_DEPTH]; /*@dependent@*/ struct optionStackEntry * os; /*@owned@*/ /*@null@*/ const char ** leftovers; int numLeftovers; int nextLeftover; /*@keep@*/ const struct poptOption * options; int restLeftover; /*@only@*/ /*@null@*/ const char * appName; /*@only@*/ /*@null@*/ poptItem aliases; int numAliases; int flags; /*@owned@*/ /*@null@*/ poptItem execs; int numExecs; /*@only@*/ /*@null@*/ const char ** finalArgv; int finalArgvCount; int finalArgvAlloced; /*@dependent@*/ /*@null@*/ poptItem doExec; /*@only@*/ const char * execPath; int execAbsolute; /*@only@*/ const char * otherHelp; /*@null@*/ pbm_set * arg_strip; }; #ifdef HAVE_LIBINTL_H #include #endif #if defined(HAVE_GETTEXT) && !defined(__LCLINT__) #define _(foo) gettext(foo) #else #define _(foo) foo #endif #if defined(HAVE_DCGETTEXT) && !defined(__LCLINT__) #define D_(dom, str) dgettext(dom, str) #define POPT_(foo) D_("popt", foo) #else #define D_(dom, str) str #define POPT_(foo) foo #endif #define N_(foo) foo #endif pilot-link-0.12.5-dfsg/popt/Makefile.am0000644000175000017500000000074010055467711020125 0ustar rousseaurousseauif INCLUDED_POPT INCLUDES = -I$(top_srcdir)/include noinst_HEADERS = findme.h poptint.h system.h popt.h noinst_LTLIBRARIES = libpopt.la libpopt_la_SOURCES = popt.c findme.c poptparse.c poptconfig.c popthelp.c .PHONY: sources sources: @echo $(libpopt_la_SOURCES:%=popt/%) .PHONY: lclint lclint: lclint ${DEFS} ${INCLUDES} ${libpopt_la_SOURCES} endif EXTRA_DIST = \ findme.c findme.h poptint.h system.h popt.c popt.h \ poptparse.c poptconfig.c popthelp.c pilot-link-0.12.5-dfsg/popt/popthelp.c0000644000175000017500000004635510113125377020076 0ustar rousseaurousseau/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /*@-type@*/ /** \ingroup popt * \file popt/popthelp.c */ /* (C) 1998-2002 Red Hat, Inc. -- Licensing details are in the COPYING file accompanying popt source distributions, available from ftp://ftp.rpm.org/pub/rpm/dist. */ #include "system.h" #include "poptint.h" /** * Display arguments. * @param con context * @param foo (unused) * @param key option(s) * @param arg (unused) * @param data (unused) */ static void displayArgs(poptContext con, /*@unused@*/ enum poptCallbackReason foo, struct poptOption * key, /*@unused@*/ const char * arg, /*@unused@*/ void * data) /*@globals fileSystem@*/ /*@modifies fileSystem@*/ { if (key->shortName == '?') poptPrintHelp(con, stdout, 0); else poptPrintUsage(con, stdout, 0); exit(0); } #ifdef NOTYET /*@unchecked@*/ static int show_option_defaults = 0; #endif /** * Empty table marker to enable displaying popt alias/exec options. */ /*@observer@*/ /*@unchecked@*/ struct poptOption poptAliasOptions[] = { POPT_TABLEEND }; /** * Auto help table options. */ /*@-castfcnptr@*/ /*@observer@*/ /*@unchecked@*/ struct poptOption poptHelpOptions[] = { { NULL, '\0', POPT_ARG_CALLBACK, (void *)&displayArgs, '\0', NULL, NULL }, { "help", '?', 0, NULL, '?', N_("Show this help message"), NULL }, { "usage", '\0', 0, NULL, 'u', N_("Display brief usage message"), NULL }, #ifdef NOTYET { "defaults", '\0', POPT_ARG_NONE, &show_option_defaults, 0, N_("Display option defaults in message"), NULL }, #endif POPT_TABLEEND } ; /*@=castfcnptr@*/ /** * @param table option(s) */ /*@observer@*/ /*@null@*/ static const char *const getTableTranslationDomain(/*@null@*/ const struct poptOption *table) /*@*/ { const struct poptOption *opt; if (table != NULL) for (opt = table; opt->longName || opt->shortName || opt->arg; opt++) { if (opt->argInfo == POPT_ARG_INTL_DOMAIN) return opt->arg; } return NULL; } /** * @param opt option(s) * @param translation_domain translation domain */ /*@observer@*/ /*@null@*/ static const char *const getArgDescrip(const struct poptOption * opt, /*@-paramuse@*/ /* FIX: i18n macros disabled with lclint */ /*@null@*/ const char * translation_domain) /*@=paramuse@*/ /*@*/ { if (!(opt->argInfo & POPT_ARG_MASK)) return NULL; if (opt == (poptHelpOptions + 1) || opt == (poptHelpOptions + 2)) if (opt->argDescrip) return POPT_(opt->argDescrip); if (opt->argDescrip) return D_(translation_domain, opt->argDescrip); switch (opt->argInfo & POPT_ARG_MASK) { case POPT_ARG_NONE: return POPT_("NONE"); #ifdef DYING case POPT_ARG_VAL: return POPT_("VAL"); #else case POPT_ARG_VAL: return NULL; #endif case POPT_ARG_INT: return POPT_("INT"); case POPT_ARG_LONG: return POPT_("LONG"); case POPT_ARG_STRING: return POPT_("STRING"); case POPT_ARG_FLOAT: return POPT_("FLOAT"); case POPT_ARG_DOUBLE: return POPT_("DOUBLE"); default: return POPT_("ARG"); } } /** * Display default value for an option. * @param lineLength * @param opt option(s) * @param translation_domain translation domain * @return */ static /*@only@*/ /*@null@*/ char * singleOptionDefaultValue(int lineLength, const struct poptOption * opt, /*@-paramuse@*/ /* FIX: i18n macros disabled with lclint */ /*@null@*/ const char * translation_domain) /*@=paramuse@*/ /*@*/ { const char * defstr = D_(translation_domain, "default"); char * le = malloc(4*lineLength + 1); char * l = le; if (le == NULL) return NULL; /* XXX can't happen */ /*@-boundswrite@*/ *le = '\0'; *le++ = '('; strcpy(le, defstr); le += strlen(le); *le++ = ':'; *le++ = ' '; if (opt->arg) /* XXX programmer error */ switch (opt->argInfo & POPT_ARG_MASK) { case POPT_ARG_VAL: case POPT_ARG_INT: { long aLong = *((int *)opt->arg); le += sprintf(le, "%ld", aLong); } break; case POPT_ARG_LONG: { long aLong = *((long *)opt->arg); le += sprintf(le, "%ld", aLong); } break; case POPT_ARG_FLOAT: { double aDouble = *((float *)opt->arg); le += sprintf(le, "%g", aDouble); } break; case POPT_ARG_DOUBLE: { double aDouble = *((double *)opt->arg); le += sprintf(le, "%g", aDouble); } break; case POPT_ARG_STRING: { const char * s = *(const char **)opt->arg; if (s == NULL) { strcpy(le, "null"); le += strlen(le); } else { size_t slen = 4*lineLength - (le - l) - sizeof("\"...\")"); *le++ = '"'; strncpy(le, s, slen); le[slen] = '\0'; le += strlen(le); if (slen < strlen(s)) { strcpy(le, "..."); le += strlen(le); } *le++ = '"'; } } break; case POPT_ARG_NONE: default: l = _free(l); return NULL; /*@notreached@*/ break; } *le++ = ')'; *le = '\0'; /*@=boundswrite@*/ return l; } /** * Display help text for an option. * @param fp output file handle * @param maxLeftCol * @param opt option(s) * @param translation_domain translation domain */ static void singleOptionHelp(FILE * fp, int maxLeftCol, const struct poptOption * opt, /*@null@*/ const char * translation_domain) /*@globals fileSystem @*/ /*@modifies *fp, fileSystem @*/ { int indentLength = maxLeftCol + 5; int lineLength = 79 - indentLength; const char * help = D_(translation_domain, opt->descrip); const char * argDescrip = getArgDescrip(opt, translation_domain); int helpLength; char * defs = NULL; char * left; int nb = maxLeftCol + 1; /* Make sure there's more than enough room in target buffer. */ if (opt->longName) nb += strlen(opt->longName); if (argDescrip) nb += strlen(argDescrip); /*@-boundswrite@*/ left = malloc(nb); if (left == NULL) return; /* XXX can't happen */ left[0] = '\0'; left[maxLeftCol] = '\0'; if (opt->longName && opt->shortName) sprintf(left, "-%c, %s%s", opt->shortName, ((opt->argInfo & POPT_ARGFLAG_ONEDASH) ? "-" : "--"), opt->longName); else if (opt->shortName != '\0') sprintf(left, "-%c", opt->shortName); else if (opt->longName) sprintf(left, "%s%s", ((opt->argInfo & POPT_ARGFLAG_ONEDASH) ? "-" : "--"), opt->longName); if (!*left) goto out; if (argDescrip) { char * le = left + strlen(left); if (opt->argInfo & POPT_ARGFLAG_OPTIONAL) *le++ = '['; /* Choose type of output */ /*@-branchstate@*/ if (opt->argInfo & POPT_ARGFLAG_SHOW_DEFAULT) { defs = singleOptionDefaultValue(lineLength, opt, translation_domain); if (defs) { char * t = malloc((help ? strlen(help) : 0) + strlen(defs) + sizeof(" ")); if (t) { char * te = t; *te = '\0'; if (help) { strcpy(te, help); te += strlen(te); } *te++ = ' '; strcpy(te, defs); defs = _free(defs); } defs = t; } } /*@=branchstate@*/ if (opt->argDescrip == NULL) { switch (opt->argInfo & POPT_ARG_MASK) { case POPT_ARG_NONE: break; case POPT_ARG_VAL: #ifdef NOTNOW /* XXX pug ugly nerdy output */ { long aLong = opt->val; int ops = (opt->argInfo & POPT_ARGFLAG_LOGICALOPS); int negate = (opt->argInfo & POPT_ARGFLAG_NOT); /* Don't bother displaying typical values */ if (!ops && (aLong == 0L || aLong == 1L || aLong == -1L)) break; *le++ = '['; switch (ops) { case POPT_ARGFLAG_OR: *le++ = '|'; /*@innerbreak@*/ break; case POPT_ARGFLAG_AND: *le++ = '&'; /*@innerbreak@*/ break; case POPT_ARGFLAG_XOR: *le++ = '^'; /*@innerbreak@*/ break; default: /*@innerbreak@*/ break; } *le++ = '='; if (negate) *le++ = '~'; /*@-formatconst@*/ le += sprintf(le, (ops ? "0x%lx" : "%ld"), aLong); /*@=formatconst@*/ *le++ = ']'; } #endif break; case POPT_ARG_INT: case POPT_ARG_LONG: case POPT_ARG_FLOAT: case POPT_ARG_DOUBLE: case POPT_ARG_STRING: *le++ = '='; strcpy(le, argDescrip); le += strlen(le); break; default: break; } } else { *le++ = '='; strcpy(le, argDescrip); le += strlen(le); } if (opt->argInfo & POPT_ARGFLAG_OPTIONAL) *le++ = ']'; *le = '\0'; } /*@=boundswrite@*/ if (help) fprintf(fp," %-*s ", maxLeftCol, left); else { fprintf(fp," %s\n", left); goto out; } left = _free(left); if (defs) { help = defs; defs = NULL; } helpLength = strlen(help); /*@-boundsread@*/ while (helpLength > lineLength) { const char * ch; char format[16]; ch = help + lineLength - 1; while (ch > help && !isspace(*ch)) ch--; if (ch == help) break; /* give up */ while (ch > (help + 1) && isspace(*ch)) ch--; ch++; sprintf(format, "%%.%ds\n%%%ds", (int) (ch - help), indentLength); /*@-formatconst@*/ fprintf(fp, format, help, " "); /*@=formatconst@*/ help = ch; while (isspace(*help) && *help) help++; helpLength = strlen(help); } /*@=boundsread@*/ if (helpLength) fprintf(fp, "%s\n", help); out: /*@-dependenttrans@*/ defs = _free(defs); /*@=dependenttrans@*/ left = _free(left); } /** * @param opt option(s) * @param translation_domain translation domain */ static int maxArgWidth(const struct poptOption * opt, /*@null@*/ const char * translation_domain) /*@*/ { int max = 0; int len = 0; const char * s; if (opt != NULL) while (opt->longName || opt->shortName || opt->arg) { if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE) { if (opt->arg) /* XXX program error */ len = maxArgWidth(opt->arg, translation_domain); if (len > max) max = len; } else if (!(opt->argInfo & POPT_ARGFLAG_DOC_HIDDEN)) { len = sizeof(" ")-1; if (opt->shortName != '\0') len += sizeof("-X")-1; if (opt->shortName != '\0' && opt->longName) len += sizeof(", ")-1; if (opt->longName) { len += ((opt->argInfo & POPT_ARGFLAG_ONEDASH) ? sizeof("-")-1 : sizeof("--")-1); len += strlen(opt->longName); } s = getArgDescrip(opt, translation_domain); if (s) len += sizeof("=")-1 + strlen(s); if (opt->argInfo & POPT_ARGFLAG_OPTIONAL) len += sizeof("[]")-1; if (len > max) max = len; } opt++; } return max; } /** * Display popt alias and exec help. * @param fp output file handle * @param items alias/exec array * @param nitems no. of alias/exec entries * @param left * @param translation_domain translation domain */ static void itemHelp(FILE * fp, /*@null@*/ poptItem items, int nitems, int left, /*@null@*/ const char * translation_domain) /*@globals fileSystem @*/ /*@modifies *fp, fileSystem @*/ { poptItem item; int i; if (items != NULL) for (i = 0, item = items; i < nitems; i++, item++) { const struct poptOption * opt; opt = &item->option; if ((opt->longName || opt->shortName) && !(opt->argInfo & POPT_ARGFLAG_DOC_HIDDEN)) singleOptionHelp(fp, left, opt, translation_domain); } } /** * Display help text for a table of options. * @param con context * @param fp output file handle * @param table option(s) * @param left * @param translation_domain translation domain */ static void singleTableHelp(poptContext con, FILE * fp, /*@null@*/ const struct poptOption * table, int left, /*@null@*/ const char * translation_domain) /*@globals fileSystem @*/ /*@modifies *fp, fileSystem @*/ { const struct poptOption * opt; const char *sub_transdom; if (table == poptAliasOptions) { itemHelp(fp, con->aliases, con->numAliases, left, NULL); itemHelp(fp, con->execs, con->numExecs, left, NULL); return; } if (table != NULL) for (opt = table; (opt->longName || opt->shortName || opt->arg); opt++) { if ((opt->longName || opt->shortName) && !(opt->argInfo & POPT_ARGFLAG_DOC_HIDDEN)) singleOptionHelp(fp, left, opt, translation_domain); } if (table != NULL) for (opt = table; (opt->longName || opt->shortName || opt->arg); opt++) { if ((opt->argInfo & POPT_ARG_MASK) != POPT_ARG_INCLUDE_TABLE) continue; sub_transdom = getTableTranslationDomain(opt->arg); if (sub_transdom == NULL) sub_transdom = translation_domain; if (opt->descrip) fprintf(fp, "\n%s\n", D_(sub_transdom, opt->descrip)); singleTableHelp(con, fp, opt->arg, left, sub_transdom); } } /** * @param con context * @param fp output file handle */ static int showHelpIntro(poptContext con, FILE * fp) /*@globals fileSystem @*/ /*@modifies *fp, fileSystem @*/ { int len = 6; const char * fn; fprintf(fp, POPT_("Usage:")); if (!(con->flags & POPT_CONTEXT_KEEP_FIRST)) { /*@-boundsread@*/ /*@-nullderef@*/ /* LCL: wazzup? */ fn = con->optionStack->argv[0]; /*@=nullderef@*/ /*@=boundsread@*/ if (fn == NULL) return len; if (strchr(fn, '/')) fn = strrchr(fn, '/') + 1; fprintf(fp, " %s", fn); len += strlen(fn) + 1; } return len; } void poptPrintHelp(poptContext con, FILE * fp, /*@unused@*/ int flags) { int leftColWidth; (void) showHelpIntro(con, fp); if (con->otherHelp) fprintf(fp, " %s\n", con->otherHelp); else fprintf(fp, " %s\n", POPT_("[OPTION...]")); leftColWidth = maxArgWidth(con->options, NULL); singleTableHelp(con, fp, con->options, leftColWidth, NULL); } /** * @param fp output file handle * @param cursor * @param opt option(s) * @param translation_domain translation domain */ static int singleOptionUsage(FILE * fp, int cursor, const struct poptOption * opt, /*@null@*/ const char *translation_domain) /*@globals fileSystem @*/ /*@modifies *fp, fileSystem @*/ { int len = 4; char shortStr[2] = { '\0', '\0' }; const char * item = shortStr; const char * argDescrip = getArgDescrip(opt, translation_domain); if (opt->shortName != '\0' && opt->longName != NULL) { len += 2; if (!(opt->argInfo & POPT_ARGFLAG_ONEDASH)) len++; len += strlen(opt->longName); } else if (opt->shortName != '\0') { len++; shortStr[0] = opt->shortName; shortStr[1] = '\0'; } else if (opt->longName) { len += strlen(opt->longName); if (!(opt->argInfo & POPT_ARGFLAG_ONEDASH)) len++; item = opt->longName; } if (len == 4) return cursor; if (argDescrip) len += strlen(argDescrip) + 1; if ((cursor + len) > 79) { fprintf(fp, "\n "); cursor = 7; } if (opt->longName && opt->shortName) { fprintf(fp, " [-%c|-%s%s%s%s]", opt->shortName, ((opt->argInfo & POPT_ARGFLAG_ONEDASH) ? "" : "-"), opt->longName, (argDescrip ? " " : ""), (argDescrip ? argDescrip : "")); } else { fprintf(fp, " [-%s%s%s%s]", ((opt->shortName || (opt->argInfo & POPT_ARGFLAG_ONEDASH)) ? "" : "-"), item, (argDescrip ? (opt->shortName != '\0' ? " " : "=") : ""), (argDescrip ? argDescrip : "")); } return cursor + len + 1; } /** * Display popt alias and exec usage. * @param fp output file handle * @param cursor * @param item alias/exec array * @param nitems no. of ara/exec entries * @param translation_domain translation domain */ static int itemUsage(FILE * fp, int cursor, poptItem item, int nitems, /*@null@*/ const char * translation_domain) /*@globals fileSystem @*/ /*@modifies *fp, fileSystem @*/ { int i; /*@-branchstate@*/ /* FIX: W2DO? */ if (item != NULL) for (i = 0; i < nitems; i++, item++) { const struct poptOption * opt; opt = &item->option; if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INTL_DOMAIN) { translation_domain = (const char *)opt->arg; } else if ((opt->longName || opt->shortName) && !(opt->argInfo & POPT_ARGFLAG_DOC_HIDDEN)) { cursor = singleOptionUsage(fp, cursor, opt, translation_domain); } } /*@=branchstate@*/ return cursor; } /** * Keep track of option tables already processed. */ typedef struct poptDone_s { int nopts; int maxopts; const void ** opts; } * poptDone; /** * Display usage text for a table of options. * @param con context * @param fp output file handle * @param cursor * @param opt option(s) * @param translation_domain translation domain * @param done tables already processed * @return */ static int singleTableUsage(poptContext con, FILE * fp, int cursor, /*@null@*/ const struct poptOption * opt, /*@null@*/ const char * translation_domain, /*@null@*/ poptDone done) /*@globals fileSystem @*/ /*@modifies *fp, done, fileSystem @*/ { /*@-branchstate@*/ /* FIX: W2DO? */ if (opt != NULL) for (; (opt->longName || opt->shortName || opt->arg) ; opt++) { if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INTL_DOMAIN) { translation_domain = (const char *)opt->arg; } else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE) { if (done) { int i = 0; for (i = 0; i < done->nopts; i++) { /*@-boundsread@*/ const void * that = done->opts[i]; /*@=boundsread@*/ if (that == NULL || that != opt->arg) /*@innercontinue@*/ continue; /*@innerbreak@*/ break; } /* Skip if this table has already been processed. */ if (opt->arg == NULL || i < done->nopts) continue; /*@-boundswrite@*/ if (done->nopts < done->maxopts) done->opts[done->nopts++] = (const void *) opt->arg; /*@=boundswrite@*/ } cursor = singleTableUsage(con, fp, cursor, opt->arg, translation_domain, done); } else if ((opt->longName || opt->shortName) && !(opt->argInfo & POPT_ARGFLAG_DOC_HIDDEN)) { cursor = singleOptionUsage(fp, cursor, opt, translation_domain); } } /*@=branchstate@*/ return cursor; } /** * Return concatenated short options for display. * @todo Sub-tables should be recursed. * @param opt option(s) * @param fp output file handle * @retval str concatenation of short options * @return length of display string */ static int showShortOptions(const struct poptOption * opt, FILE * fp, /*@null@*/ char * str) /*@globals fileSystem @*/ /*@modifies *str, *fp, fileSystem @*/ { char * s = alloca(300); /* larger then the ascii set */ s[0] = '\0'; /*@-branchstate@*/ /* FIX: W2DO? */ if (str == NULL) { memset(s, 0, sizeof(s)); str = s; } /*@=branchstate@*/ /*@-boundswrite@*/ if (opt != NULL) for (; (opt->longName || opt->shortName || opt->arg); opt++) { if (opt->shortName && !(opt->argInfo & POPT_ARG_MASK)) str[strlen(str)] = opt->shortName; else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE) if (opt->arg) /* XXX program error */ (void) showShortOptions(opt->arg, fp, str); } /*@=boundswrite@*/ if (s != str || *s != '\0') return 0; fprintf(fp, " [-%s]", s); return strlen(s) + 4; } void poptPrintUsage(poptContext con, FILE * fp, /*@unused@*/ int flags) { poptDone done = memset(alloca(sizeof(*done)), 0, sizeof(*done)); int cursor; done->nopts = 0; done->maxopts = 64; cursor = done->maxopts * sizeof(*done->opts); /*@-boundswrite@*/ done->opts = memset(alloca(cursor), 0, cursor); done->opts[done->nopts++] = (const void *) con->options; /*@=boundswrite@*/ cursor = showHelpIntro(con, fp); cursor += showShortOptions(con->options, fp, NULL); cursor = singleTableUsage(con, fp, cursor, con->options, NULL, done); cursor = itemUsage(fp, cursor, con->aliases, con->numAliases, NULL); cursor = itemUsage(fp, cursor, con->execs, con->numExecs, NULL); if (con->otherHelp) { cursor += strlen(con->otherHelp) + 1; if (cursor > 79) fprintf(fp, "\n "); fprintf(fp, " %s", con->otherHelp); } fprintf(fp, "\n"); } void poptSetOtherOptionHelp(poptContext con, const char * text) { con->otherHelp = _free(con->otherHelp); con->otherHelp = xstrdup(text); } /*@=type@*/ pilot-link-0.12.5-dfsg/popt/system.h0000644000175000017500000000316710113125377017566 0ustar rousseaurousseau#ifdef HAVE_CONFIG_H #include "config.h" #endif #if defined (__GLIBC__) && defined(__LCLINT__) /*@-declundef@*/ /*@unchecked@*/ extern __const __int32_t *__ctype_tolower; /*@unchecked@*/ extern __const __int32_t *__ctype_toupper; /*@=declundef@*/ #endif #include #include #include #include #if HAVE_MCHECK_H #include #endif #include #include #include #if HAVE_UNISTD_H #include #endif #ifdef __NeXT /* access macros are not declared in non posix mode in unistd.h - don't try to use posix on NeXTstep 3.3 ! */ #include #endif #if defined(__LCLINT__) /*@-declundef -incondefs -redecl@*/ /* LCL: missing annotation */ /*@only@*/ void * alloca (size_t __size) /*@ensures MaxSet(result) == (__size - 1) @*/ /*@*/; /*@=declundef =incondefs =redecl@*/ #endif /* AIX requires this to be the first thing in the file. */ #ifndef __GNUC__ # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif #elif defined(__GNUC__) && defined(__STRICT_ANSI__) #define alloca __builtin_alloca #endif /*@-redecl -redef@*/ /*@mayexit@*/ /*@only@*/ char * xstrdup (const char *str) /*@*/; /*@=redecl =redef@*/ #if HAVE_MCHECK_H && defined(__GNUC__) #define vmefail() (fprintf(stderr, "virtual memory exhausted.\n"), exit(EXIT_FAILURE), NULL) #define xstrdup(_str) (strcpy((malloc(strlen(_str)+1) ? : vmefail()), (_str))) #else #define xstrdup(_str) strdup(_str) #endif /* HAVE_MCHECK_H && defined(__GNUC__) */ #include "popt.h" pilot-link-0.12.5-dfsg/popt/popt.c0000644000175000017500000010257310113660404017213 0ustar rousseaurousseau/** \ingroup popt * \file popt/popt.c */ /* (C) 1998-2002 Red Hat, Inc. -- Licensing details are in the COPYING file accompanying popt source distributions, available from ftp://ftp.rpm.org/pub/rpm/dist */ #undef MYDEBUG #include "system.h" #if HAVE_FLOAT_H #include #endif #include #include #include "findme.h" #include "poptint.h" #ifdef MYDEBUG /*@unchecked@*/ int _popt_debug = 0; #endif #ifndef HAVE_STRERROR static char * strerror(int errno) { extern int sys_nerr; extern char * sys_errlist[]; if ((0 <= errno) && (errno < sys_nerr)) return sys_errlist[errno]; else return POPT_("unknown errno"); } #endif #ifdef MYDEBUG /*@unused@*/ static void prtcon(const char *msg, poptContext con) { if (msg) fprintf(stderr, "%s", msg); fprintf(stderr, "\tcon %p os %p nextCharArg \"%s\" nextArg \"%s\" argv[%d] \"%s\"\n", con, con->os, (con->os->nextCharArg ? con->os->nextCharArg : ""), (con->os->nextArg ? con->os->nextArg : ""), con->os->next, (con->os->argv && con->os->argv[con->os->next] ? con->os->argv[con->os->next] : "")); } #endif void poptSetExecPath(poptContext con, const char * path, int allowAbsolute) { con->execPath = _free(con->execPath); con->execPath = xstrdup(path); con->execAbsolute = allowAbsolute; /*@-nullstate@*/ /* LCL: con->execPath can be NULL? */ return; /*@=nullstate@*/ } static void invokeCallbacksPRE(poptContext con, const struct poptOption * opt) /*@globals internalState@*/ /*@modifies internalState@*/ { if (opt != NULL) for (; opt->longName || opt->shortName || opt->arg; opt++) { if (opt->arg == NULL) continue; /* XXX program error. */ if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE) { /* Recurse on included sub-tables. */ invokeCallbacksPRE(con, opt->arg); } else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_CALLBACK && (opt->argInfo & POPT_CBFLAG_PRE)) { /*@-castfcnptr@*/ poptCallbackType cb = (poptCallbackType)opt->arg; /*@=castfcnptr@*/ /* Perform callback. */ /*@-moduncon -noeffectuncon @*/ cb(con, POPT_CALLBACK_REASON_PRE, NULL, NULL, opt->descrip); /*@=moduncon =noeffectuncon @*/ } } } static void invokeCallbacksPOST(poptContext con, const struct poptOption * opt) /*@globals internalState@*/ /*@modifies internalState@*/ { if (opt != NULL) for (; opt->longName || opt->shortName || opt->arg; opt++) { if (opt->arg == NULL) continue; /* XXX program error. */ if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE) { /* Recurse on included sub-tables. */ invokeCallbacksPOST(con, opt->arg); } else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_CALLBACK && (opt->argInfo & POPT_CBFLAG_POST)) { /*@-castfcnptr@*/ poptCallbackType cb = (poptCallbackType)opt->arg; /*@=castfcnptr@*/ /* Perform callback. */ /*@-moduncon -noeffectuncon @*/ cb(con, POPT_CALLBACK_REASON_POST, NULL, NULL, opt->descrip); /*@=moduncon =noeffectuncon @*/ } } } static void invokeCallbacksOPTION(poptContext con, const struct poptOption * opt, const struct poptOption * myOpt, /*@null@*/ const void * myData, int shorty) /*@globals internalState@*/ /*@modifies internalState@*/ { const struct poptOption * cbopt = NULL; if (opt != NULL) for (; opt->longName || opt->shortName || opt->arg; opt++) { if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE) { /* Recurse on included sub-tables. */ if (opt->arg != NULL) /* XXX program error */ invokeCallbacksOPTION(con, opt->arg, myOpt, myData, shorty); } else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_CALLBACK && !(opt->argInfo & POPT_CBFLAG_SKIPOPTION)) { /* Save callback info. */ cbopt = opt; } else if (cbopt != NULL && ((myOpt->shortName && opt->shortName && shorty && myOpt->shortName == opt->shortName) || (myOpt->longName && opt->longName && /*@-nullpass@*/ /* LCL: opt->longName != NULL */ !strcmp(myOpt->longName, opt->longName))) /*@=nullpass@*/ ) { /*@-castfcnptr@*/ poptCallbackType cb = (poptCallbackType)cbopt->arg; /*@=castfcnptr@*/ const void * cbData = (cbopt->descrip ? cbopt->descrip : myData); /* Perform callback. */ if (cb != NULL) { /* XXX program error */ /*@-moduncon -noeffectuncon @*/ cb(con, POPT_CALLBACK_REASON_OPTION, myOpt, con->os->nextArg, cbData); /*@=moduncon =noeffectuncon @*/ } /* Terminate (unless explcitly continuing). */ if (!(cbopt->argInfo & POPT_CBFLAG_CONTINUE)) return; } } } poptContext poptGetContext(const char * name, int argc, const char ** argv, const struct poptOption * options, int flags) { poptContext con = malloc(sizeof(*con)); if (con == NULL) return NULL; /* XXX can't happen */ memset(con, 0, sizeof(*con)); con->os = con->optionStack; con->os->argc = argc; /*@-dependenttrans -assignexpose@*/ /* FIX: W2DO? */ con->os->argv = argv; /*@=dependenttrans =assignexpose@*/ con->os->argb = NULL; if (!(flags & POPT_CONTEXT_KEEP_FIRST)) con->os->next = 1; /* skip argv[0] */ con->leftovers = calloc( (argc + 1), sizeof(*con->leftovers) ); /*@-dependenttrans -assignexpose@*/ /* FIX: W2DO? */ con->options = options; /*@=dependenttrans =assignexpose@*/ con->aliases = NULL; con->numAliases = 0; con->flags = flags; con->execs = NULL; con->numExecs = 0; con->finalArgvAlloced = argc * 2; con->finalArgv = calloc( con->finalArgvAlloced, sizeof(*con->finalArgv) ); con->execAbsolute = 1; con->arg_strip = NULL; if (getenv("POSIXLY_CORRECT") || getenv("POSIX_ME_HARDER")) con->flags |= POPT_CONTEXT_POSIXMEHARDER; if (name) { char * t = malloc(strlen(name) + 1); if (t) con->appName = strcpy(t, name); } /*@-internalglobs@*/ invokeCallbacksPRE(con, con->options); /*@=internalglobs@*/ return con; } static void cleanOSE(/*@special@*/ struct optionStackEntry *os) /*@uses os @*/ /*@releases os->nextArg, os->argv, os->argb @*/ /*@modifies os @*/ { os->nextArg = _free(os->nextArg); os->argv = _free(os->argv); os->argb = PBM_FREE(os->argb); } /*@-boundswrite@*/ void poptResetContext(poptContext con) { int i; if (con == NULL) return; while (con->os > con->optionStack) { cleanOSE(con->os--); } con->os->argb = PBM_FREE(con->os->argb); con->os->currAlias = NULL; con->os->nextCharArg = NULL; con->os->nextArg = NULL; con->os->next = 1; /* skip argv[0] */ con->numLeftovers = 0; con->nextLeftover = 0; con->restLeftover = 0; con->doExec = NULL; if (con->finalArgv != NULL) for (i = 0; i < con->finalArgvCount; i++) { /*@-unqualifiedtrans@*/ /* FIX: typedef double indirection. */ con->finalArgv[i] = _free(con->finalArgv[i]); /*@=unqualifiedtrans@*/ } con->finalArgvCount = 0; con->arg_strip = PBM_FREE(con->arg_strip); /*@-nullstate@*/ /* FIX: con->finalArgv != NULL */ return; /*@=nullstate@*/ } /*@=boundswrite@*/ /* Only one of longName, shortName should be set, not both. */ /*@-boundswrite@*/ static int handleExec(/*@special@*/ poptContext con, /*@null@*/ const char * longName, char shortName) /*@uses con->execs, con->numExecs, con->flags, con->doExec, con->finalArgv, con->finalArgvAlloced, con->finalArgvCount @*/ /*@modifies con @*/ { poptItem item; int i; if (con->execs == NULL || con->numExecs <= 0) /* XXX can't happen */ return 0; for (i = con->numExecs - 1; i >= 0; i--) { item = con->execs + i; if (longName && !(item->option.longName && !strcmp(longName, item->option.longName))) continue; else if (shortName != item->option.shortName) continue; break; } if (i < 0) return 0; if (con->flags & POPT_CONTEXT_NO_EXEC) return 1; if (con->doExec == NULL) { con->doExec = con->execs + i; return 1; } /* We already have an exec to do; remember this option for next time 'round */ if ((con->finalArgvCount + 1) >= (con->finalArgvAlloced)) { con->finalArgvAlloced += 10; con->finalArgv = realloc(con->finalArgv, sizeof(*con->finalArgv) * con->finalArgvAlloced); } i = con->finalArgvCount++; if (con->finalArgv != NULL) /* XXX can't happen */ { char *s = malloc((longName ? strlen(longName) : 0) + 3); if (s != NULL) { /* XXX can't happen */ if (longName) sprintf(s, "--%s", longName); else sprintf(s, "-%c", shortName); con->finalArgv[i] = s; } else con->finalArgv[i] = NULL; } /*@-nullstate@*/ /* FIX: con->finalArgv[] == NULL */ return 1; /*@=nullstate@*/ } /*@=boundswrite@*/ /* Only one of longName, shortName may be set at a time */ static int handleAlias(/*@special@*/ poptContext con, /*@null@*/ const char * longName, char shortName, /*@exposed@*/ /*@null@*/ const char * nextCharArg) /*@uses con->aliases, con->numAliases, con->optionStack, con->os, con->os->currAlias, con->os->currAlias->option.longName @*/ /*@modifies con @*/ { poptItem item = con->os->currAlias; int rc; int i; if (item) { if (longName && (item->option.longName && !strcmp(longName, item->option.longName))) return 0; if (shortName && shortName == item->option.shortName) return 0; } if (con->aliases == NULL || con->numAliases <= 0) /* XXX can't happen */ return 0; for (i = con->numAliases - 1; i >= 0; i--) { item = con->aliases + i; if (longName && !(item->option.longName && !strcmp(longName, item->option.longName))) continue; else if (shortName != item->option.shortName) continue; break; } if (i < 0) return 0; if ((con->os - con->optionStack + 1) == POPT_OPTION_DEPTH) return POPT_ERROR_OPTSTOODEEP; /*@-boundsread@*/ if (nextCharArg && *nextCharArg) con->os->nextCharArg = nextCharArg; /*@=boundsread@*/ con->os++; con->os->next = 0; con->os->stuffed = 0; con->os->nextArg = NULL; con->os->nextCharArg = NULL; con->os->currAlias = con->aliases + i; rc = poptDupArgv(con->os->currAlias->argc, con->os->currAlias->argv, &con->os->argc, &con->os->argv); con->os->argb = NULL; return (rc ? rc : 1); } /*@-bounds -boundswrite @*/ static int execCommand(poptContext con) /*@globals internalState @*/ /*@modifies internalState @*/ { poptItem item = con->doExec; const char ** argv; int argc = 0; int rc; if (item == NULL) /*XXX can't happen*/ return POPT_ERROR_NOARG; if (item->argv == NULL || item->argc < 1 || (!con->execAbsolute && strchr(item->argv[0], '/'))) return POPT_ERROR_NOARG; argv = malloc(sizeof(*argv) * (6 + item->argc + con->numLeftovers + con->finalArgvCount)); if (argv == NULL) return POPT_ERROR_MALLOC; /* XXX can't happen */ if (!strchr(item->argv[0], '/') && con->execPath) { char *s = alloca(strlen(con->execPath) + strlen(item->argv[0]) + sizeof("/")); sprintf(s, "%s/%s", con->execPath, item->argv[0]); argv[argc] = s; } else { argv[argc] = findProgramPath(item->argv[0]); } if (argv[argc++] == NULL) return POPT_ERROR_NOARG; if (item->argc > 1) { memcpy(argv + argc, item->argv + 1, sizeof(*argv) * (item->argc - 1)); argc += (item->argc - 1); } if (con->finalArgv != NULL && con->finalArgvCount > 0) { memcpy(argv + argc, con->finalArgv, sizeof(*argv) * con->finalArgvCount); argc += con->finalArgvCount; } if (con->leftovers != NULL && con->numLeftovers > 0) { #if 0 argv[argc++] = "--"; #endif memcpy(argv + argc, con->leftovers, sizeof(*argv) * con->numLeftovers); argc += con->numLeftovers; } argv[argc] = NULL; #ifdef __hpux rc = setresuid(getuid(), getuid(),-1); if (rc) return POPT_ERROR_ERRNO; #else /* * XXX " ... on BSD systems setuid() should be preferred over setreuid()" * XXX sez' Timur Bakeyev * XXX from Norbert Warmuth */ #if defined(HAVE_SETUID) rc = setuid(getuid()); if (rc) return POPT_ERROR_ERRNO; #elif defined (HAVE_SETREUID) rc = setreuid(getuid(), getuid()); /*hlauer: not portable to hpux9.01 */ if (rc) return POPT_ERROR_ERRNO; #else ; /* Can't drop privileges */ #endif #endif if (argv[0] == NULL) return POPT_ERROR_NOARG; #ifdef MYDEBUG if (_popt_debug) { const char ** avp; fprintf(stderr, "==> execvp(%s) argv[%d]:", argv[0], argc); for (avp = argv; *avp; avp++) fprintf(stderr, " '%s'", *avp); fprintf(stderr, "\n"); } #endif rc = execvp(argv[0], (char *const *)argv); return POPT_ERROR_ERRNO; } /*@=bounds =boundswrite @*/ /*@-boundswrite@*/ /*@observer@*/ /*@null@*/ static const struct poptOption * findOption(const struct poptOption * opt, /*@null@*/ const char * longName, char shortName, /*@null@*/ /*@out@*/ poptCallbackType * callback, /*@null@*/ /*@out@*/ const void ** callbackData, int singleDash) /*@modifies *callback, *callbackData */ { const struct poptOption * cb = NULL; /* This happens when a single - is given */ if (singleDash && !shortName && (longName && *longName == '\0')) shortName = '-'; for (; opt->longName || opt->shortName || opt->arg; opt++) { if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE) { const struct poptOption * opt2; /* Recurse on included sub-tables. */ if (opt->arg == NULL) continue; /* XXX program error */ opt2 = findOption(opt->arg, longName, shortName, callback, callbackData, singleDash); if (opt2 == NULL) continue; /* Sub-table data will be inheirited if no data yet. */ if (!(callback && *callback)) return opt2; if (!(callbackData && *callbackData == NULL)) return opt2; /*@-observertrans -dependenttrans @*/ *callbackData = opt->descrip; /*@=observertrans =dependenttrans @*/ return opt2; } else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_CALLBACK) { cb = opt; } else if (longName && opt->longName && (!singleDash || (opt->argInfo & POPT_ARGFLAG_ONEDASH)) && /*@-nullpass@*/ /* LCL: opt->longName != NULL */ !strcmp(longName, opt->longName)) /*@=nullpass@*/ { break; } else if (shortName && shortName == opt->shortName) { break; } } if (!opt->longName && !opt->shortName) return NULL; /*@-modobserver -mods @*/ if (callback) *callback = NULL; if (callbackData) *callbackData = NULL; if (cb) { if (callback) /*@-castfcnptr@*/ *callback = (poptCallbackType)cb->arg; /*@=castfcnptr@*/ if (!(cb->argInfo & POPT_CBFLAG_INC_DATA)) { if (callbackData) /*@-observertrans@*/ /* FIX: typedef double indirection. */ *callbackData = cb->descrip; /*@=observertrans@*/ } } /*@=modobserver =mods @*/ return opt; } /*@=boundswrite@*/ static const char * findNextArg(/*@special@*/ poptContext con, unsigned argx, int delete_arg) /*@uses con->optionStack, con->os, con->os->next, con->os->argb, con->os->argc, con->os->argv @*/ /*@modifies con @*/ { struct optionStackEntry * os = con->os; const char * arg; do { int i; arg = NULL; while (os->next == os->argc && os > con->optionStack) os--; if (os->next == os->argc && os == con->optionStack) break; if (os->argv != NULL) for (i = os->next; i < os->argc; i++) { /*@-sizeoftype@*/ if (os->argb && PBM_ISSET(i, os->argb)) /*@innercontinue@*/ continue; if (*os->argv[i] == '-') /*@innercontinue@*/ continue; if (--argx > 0) /*@innercontinue@*/ continue; arg = os->argv[i]; if (delete_arg) { if (os->argb == NULL) os->argb = PBM_ALLOC(os->argc); if (os->argb != NULL) /* XXX can't happen */ PBM_SET(i, os->argb); } /*@innerbreak@*/ break; /*@=sizeoftype@*/ } if (os > con->optionStack) os--; } while (arg == NULL); return arg; } /*@-boundswrite@*/ static /*@only@*/ /*@null@*/ const char * expandNextArg(/*@special@*/ poptContext con, const char * s) /*@uses con->optionStack, con->os, con->os->next, con->os->argb, con->os->argc, con->os->argv @*/ /*@modifies con @*/ { const char * a = NULL; size_t alen; char *t, *te; size_t tn = strlen(s) + 1; char c; te = t = malloc(tn);; if (t == NULL) return NULL; /* XXX can't happen */ while ((c = *s++) != '\0') { switch (c) { #if 0 /* XXX can't do this */ case '\\': /* escape */ c = *s++; /*@switchbreak@*/ break; #endif case '!': if (!(s[0] == '#' && s[1] == ':' && s[2] == '+')) /*@switchbreak@*/ break; /* XXX Make sure that findNextArg deletes only next arg. */ if (a == NULL) { if ((a = findNextArg(con, 1, 1)) == NULL) /*@switchbreak@*/ break; } s += 3; alen = strlen(a); tn += alen; *te = '\0'; t = realloc(t, tn); te = t + strlen(t); strncpy(te, a, alen); te += alen; continue; /*@notreached@*/ /*@switchbreak@*/ break; default: /*@switchbreak@*/ break; } *te++ = c; } *te = '\0'; t = realloc(t, strlen(t) + 1); /* XXX memory leak, hard to plug */ return t; } /*@=boundswrite@*/ static void poptStripArg(/*@special@*/ poptContext con, int which) /*@uses con->arg_strip, con->optionStack @*/ /*@defines con->arg_strip @*/ /*@modifies con @*/ { /*@-sizeoftype@*/ if (con->arg_strip == NULL) con->arg_strip = PBM_ALLOC(con->optionStack[0].argc); if (con->arg_strip != NULL) /* XXX can't happen */ PBM_SET(which, con->arg_strip); /*@=sizeoftype@*/ /*@-compdef@*/ /* LCL: con->arg_strip udefined? */ return; /*@=compdef@*/ } int poptSaveLong(long * arg, int argInfo, long aLong) { #if 0 /* XXX Check alignment, may fail on funky platforms. */ if (arg == NULL || (((unsigned long)arg) & (sizeof(*arg)-1))) #else /* It does! pm@debian.org */ if (arg == NULL) #endif return POPT_ERROR_NULLARG; if (argInfo & POPT_ARGFLAG_NOT) aLong = ~aLong; switch (argInfo & POPT_ARGFLAG_LOGICALOPS) { case 0: *arg = aLong; break; case POPT_ARGFLAG_OR: *arg |= aLong; break; case POPT_ARGFLAG_AND: *arg &= aLong; break; case POPT_ARGFLAG_XOR: *arg ^= aLong; break; default: return POPT_ERROR_BADOPERATION; /*@notreached@*/ break; } return 0; } int poptSaveInt(/*@null@*/ int * arg, int argInfo, long aLong) { #if 0 /* XXX Check alignment, may fail on funky platforms. */ if (arg == NULL || (((unsigned long)arg) & (sizeof(*arg)-1))) #else /* It does! pm@debian.org */ if (arg == NULL) #endif return POPT_ERROR_NULLARG; if (argInfo & POPT_ARGFLAG_NOT) aLong = ~aLong; switch (argInfo & POPT_ARGFLAG_LOGICALOPS) { case 0: *arg = aLong; break; case POPT_ARGFLAG_OR: *arg |= aLong; break; case POPT_ARGFLAG_AND: *arg &= aLong; break; case POPT_ARGFLAG_XOR: *arg ^= aLong; break; default: return POPT_ERROR_BADOPERATION; /*@notreached@*/ break; } return 0; } /*@-boundswrite@*/ /* returns 'val' element, -1 on last item, POPT_ERROR_* on error */ int poptGetNextOpt(poptContext con) { const struct poptOption * opt = NULL; int done = 0; if (con == NULL) return -1; while (!done) { const char * origOptString = NULL; poptCallbackType cb = NULL; const void * cbData = NULL; const char * longArg = NULL; int canstrip = 0; int shorty = 0; while (!con->os->nextCharArg && con->os->next == con->os->argc && con->os > con->optionStack) { cleanOSE(con->os--); } if (!con->os->nextCharArg && con->os->next == con->os->argc) { /*@-internalglobs@*/ invokeCallbacksPOST(con, con->options); /*@=internalglobs@*/ if (con->doExec) return execCommand(con); return -1; } /* Process next long option */ if (!con->os->nextCharArg) { char * localOptString, * optString; int thisopt; /*@-sizeoftype@*/ if (con->os->argb && PBM_ISSET(con->os->next, con->os->argb)) { con->os->next++; continue; } /*@=sizeoftype@*/ thisopt = con->os->next; if (con->os->argv != NULL) /* XXX can't happen */ origOptString = con->os->argv[con->os->next++]; if (origOptString == NULL) /* XXX can't happen */ return POPT_ERROR_BADOPT; if (con->restLeftover || *origOptString != '-') { if (con->flags & POPT_CONTEXT_POSIXMEHARDER) con->restLeftover = 1; if (con->flags & POPT_CONTEXT_ARG_OPTS) { con->os->nextArg = xstrdup(origOptString); return 0; } if (con->leftovers != NULL) /* XXX can't happen */ con->leftovers[con->numLeftovers++] = origOptString; continue; } /* Make a copy we can hack at */ localOptString = optString = strcpy(alloca(strlen(origOptString) + 1), origOptString); if (optString[0] == '\0') return POPT_ERROR_BADOPT; if (optString[1] == '-' && !optString[2]) { con->restLeftover = 1; continue; } else { char *oe; int singleDash; optString++; if (*optString == '-') singleDash = 0, optString++; else singleDash = 1; /* XXX aliases with arg substitution need "--alias=arg" */ if (handleAlias(con, optString, '\0', NULL)) continue; if (handleExec(con, optString, '\0')) continue; /* Check for "--long=arg" option. */ for (oe = optString; *oe && *oe != '='; oe++) {}; if (*oe == '=') { *oe++ = '\0'; /* XXX longArg is mapped back to persistent storage. */ longArg = origOptString + (oe - localOptString); } opt = findOption(con->options, optString, '\0', &cb, &cbData, singleDash); if (!opt && !singleDash) return POPT_ERROR_BADOPT; } if (!opt) { con->os->nextCharArg = origOptString + 1; } else { if (con->os == con->optionStack && opt->argInfo & POPT_ARGFLAG_STRIP) { canstrip = 1; poptStripArg(con, thisopt); } shorty = 0; } } /* Process next short option */ /*@-branchstate@*/ /* FIX: W2DO? */ if (con->os->nextCharArg) { origOptString = con->os->nextCharArg; con->os->nextCharArg = NULL; if (handleAlias(con, NULL, *origOptString, origOptString + 1)) continue; if (handleExec(con, NULL, *origOptString)) { /* Restore rest of short options for further processing */ origOptString++; if (*origOptString != '\0') con->os->nextCharArg = origOptString; continue; } opt = findOption(con->options, NULL, *origOptString, &cb, &cbData, 0); if (!opt) return POPT_ERROR_BADOPT; shorty = 1; origOptString++; if (*origOptString != '\0') con->os->nextCharArg = origOptString; } /*@=branchstate@*/ if (opt == NULL) return POPT_ERROR_BADOPT; /* XXX can't happen */ if (opt->arg && (opt->argInfo & POPT_ARG_MASK) == POPT_ARG_NONE) { if (poptSaveInt((int *)opt->arg, opt->argInfo, 1L)) return POPT_ERROR_BADOPERATION; } else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_VAL) { if (opt->arg) { if (poptSaveInt((int *)opt->arg, opt->argInfo, (long)opt->val)) return POPT_ERROR_BADOPERATION; } } else if ((opt->argInfo & POPT_ARG_MASK) != POPT_ARG_NONE) { con->os->nextArg = _free(con->os->nextArg); /*@-usedef@*/ /* FIX: W2DO? */ if (longArg) { /*@=usedef@*/ longArg = expandNextArg(con, longArg); con->os->nextArg = longArg; } else if (con->os->nextCharArg) { longArg = expandNextArg(con, con->os->nextCharArg); con->os->nextArg = longArg; con->os->nextCharArg = NULL; } else { while (con->os->next == con->os->argc && con->os > con->optionStack) { cleanOSE(con->os--); } if (con->os->next == con->os->argc) { if (!(opt->argInfo & POPT_ARGFLAG_OPTIONAL)) /*@-compdef@*/ /* FIX: con->os->argv not defined */ return POPT_ERROR_NOARG; /*@=compdef@*/ con->os->nextArg = NULL; } else { /* * Make sure this isn't part of a short arg or the * result of an alias expansion. */ if (con->os == con->optionStack && (opt->argInfo & POPT_ARGFLAG_STRIP) && canstrip) { poptStripArg(con, con->os->next); } if (con->os->argv != NULL) { /* XXX can't happen */ /* XXX watchout: subtle side-effects live here. */ longArg = con->os->argv[con->os->next++]; longArg = expandNextArg(con, longArg); con->os->nextArg = longArg; } } } longArg = NULL; if (opt->arg) { switch (opt->argInfo & POPT_ARG_MASK) { case POPT_ARG_STRING: /* XXX memory leak, hard to plug */ *((const char **) opt->arg) = (con->os->nextArg) ? xstrdup(con->os->nextArg) : NULL; /*@switchbreak@*/ break; case POPT_ARG_INT: case POPT_ARG_LONG: { long aLong = 0; char *end; if (con->os->nextArg) { aLong = strtol(con->os->nextArg, &end, 0); if (!(end && *end == '\0')) return POPT_ERROR_BADNUMBER; } if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_LONG) { if (aLong == LONG_MIN || aLong == LONG_MAX) return POPT_ERROR_OVERFLOW; if (poptSaveLong((long *)opt->arg, opt->argInfo, aLong)) return POPT_ERROR_BADOPERATION; } else { if (aLong > INT_MAX || aLong < INT_MIN) return POPT_ERROR_OVERFLOW; if (poptSaveInt((int *)opt->arg, opt->argInfo, aLong)) return POPT_ERROR_BADOPERATION; } } /*@switchbreak@*/ break; case POPT_ARG_FLOAT: case POPT_ARG_DOUBLE: { double aDouble = 0.0; char *end; if (con->os->nextArg) { /*@-mods@*/ int saveerrno = errno; errno = 0; aDouble = strtod(con->os->nextArg, &end); if (errno == ERANGE) return POPT_ERROR_OVERFLOW; errno = saveerrno; /*@=mods@*/ if (*end != '\0') return POPT_ERROR_BADNUMBER; } if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_DOUBLE) { *((double *) opt->arg) = aDouble; } else { #define _ABS(a) ((((a) - 0.0) < DBL_EPSILON) ? -(a) : (a)) if ((_ABS(aDouble) - FLT_MAX) > DBL_EPSILON) return POPT_ERROR_OVERFLOW; if ((FLT_MIN - _ABS(aDouble)) > DBL_EPSILON) return POPT_ERROR_OVERFLOW; *((float *) opt->arg) = aDouble; } } /*@switchbreak@*/ break; default: fprintf(stdout, POPT_("option type (%d) not implemented in popt\n"), (opt->argInfo & POPT_ARG_MASK)); exit(EXIT_FAILURE); /*@notreached@*/ /*@switchbreak@*/ break; } } } if (cb) { /*@-internalglobs@*/ invokeCallbacksOPTION(con, con->options, opt, cbData, shorty); /*@=internalglobs@*/ } else if (opt->val && ((opt->argInfo & POPT_ARG_MASK) != POPT_ARG_VAL)) done = 1; if ((con->finalArgvCount + 2) >= (con->finalArgvAlloced)) { con->finalArgvAlloced += 10; con->finalArgv = realloc(con->finalArgv, sizeof(*con->finalArgv) * con->finalArgvAlloced); } if (con->finalArgv != NULL) { char *s = malloc((opt->longName ? strlen(opt->longName) : 0) + 3); if (s != NULL) { /* XXX can't happen */ if (opt->longName) sprintf(s, "%s%s", ((opt->argInfo & POPT_ARGFLAG_ONEDASH) ? "-" : "--"), opt->longName); else sprintf(s, "-%c", opt->shortName); con->finalArgv[con->finalArgvCount++] = s; } else con->finalArgv[con->finalArgvCount++] = NULL; } if (opt->arg && (opt->argInfo & POPT_ARG_MASK) == POPT_ARG_NONE) /*@-ifempty@*/ ; /*@=ifempty@*/ else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_VAL) /*@-ifempty@*/ ; /*@=ifempty@*/ else if ((opt->argInfo & POPT_ARG_MASK) != POPT_ARG_NONE) { if (con->finalArgv != NULL && con->os->nextArg) con->finalArgv[con->finalArgvCount++] = /*@-nullpass@*/ /* LCL: con->os->nextArg != NULL */ xstrdup(con->os->nextArg); /*@=nullpass@*/ } } return (opt ? opt->val : -1); /* XXX can't happen */ } /*@=boundswrite@*/ const char * poptGetOptArg(poptContext con) { const char * ret = NULL; /*@-branchstate@*/ if (con) { ret = con->os->nextArg; con->os->nextArg = NULL; } /*@=branchstate@*/ return ret; } const char * poptGetArg(poptContext con) { const char * ret = NULL; if (con && con->leftovers != NULL && con->nextLeftover < con->numLeftovers) ret = con->leftovers[con->nextLeftover++]; return ret; } const char * poptPeekArg(poptContext con) { const char * ret = NULL; if (con && con->leftovers != NULL && con->nextLeftover < con->numLeftovers) ret = con->leftovers[con->nextLeftover]; return ret; } /*@-boundswrite@*/ const char ** poptGetArgs(poptContext con) { if (con == NULL || con->leftovers == NULL || con->numLeftovers == con->nextLeftover) return NULL; /* some apps like [like RPM ;-) ] need this NULL terminated */ con->leftovers[con->numLeftovers] = NULL; /*@-nullret -nullstate @*/ /* FIX: typedef double indirection. */ return (con->leftovers + con->nextLeftover); /*@=nullret =nullstate @*/ } /*@=boundswrite@*/ poptContext poptFreeContext(poptContext con) { poptItem item; int i; if (con == NULL) return con; poptResetContext(con); con->os->argb = _free(con->os->argb); if (con->aliases != NULL) for (i = 0; i < con->numAliases; i++) { item = con->aliases + i; /*@-modobserver -observertrans -dependenttrans@*/ item->option.longName = _free(item->option.longName); item->option.descrip = _free(item->option.descrip); item->option.argDescrip = _free(item->option.argDescrip); /*@=modobserver =observertrans =dependenttrans@*/ item->argv = _free(item->argv); } con->aliases = _free(con->aliases); if (con->execs != NULL) for (i = 0; i < con->numExecs; i++) { item = con->execs + i; /*@-modobserver -observertrans -dependenttrans@*/ item->option.longName = _free(item->option.longName); item->option.descrip = _free(item->option.descrip); item->option.argDescrip = _free(item->option.argDescrip); /*@=modobserver =observertrans =dependenttrans@*/ item->argv = _free(item->argv); } con->execs = _free(con->execs); con->leftovers = _free(con->leftovers); con->finalArgv = _free(con->finalArgv); con->appName = _free(con->appName); con->otherHelp = _free(con->otherHelp); con->execPath = _free(con->execPath); con->arg_strip = PBM_FREE(con->arg_strip); con = _free(con); return con; } int poptAddAlias(poptContext con, struct poptAlias alias, /*@unused@*/ int flags) { poptItem item = alloca(sizeof(*item)); memset(item, 0, sizeof(*item)); item->option.longName = alias.longName; item->option.shortName = alias.shortName; item->option.argInfo = POPT_ARGFLAG_DOC_HIDDEN; item->option.arg = 0; item->option.val = 0; item->option.descrip = NULL; item->option.argDescrip = NULL; item->argc = alias.argc; item->argv = alias.argv; return poptAddItem(con, item, 0); } /*@-boundswrite@*/ /*@-mustmod@*/ /* LCL: con not modified? */ int poptAddItem(poptContext con, poptItem newItem, int flags) { poptItem * items, item; int * nitems; switch (flags) { case 1: items = &con->execs; nitems = &con->numExecs; break; case 0: items = &con->aliases; nitems = &con->numAliases; break; default: return 1; /*@notreached@*/ break; } *items = realloc((*items), ((*nitems) + 1) * sizeof(**items)); if ((*items) == NULL) return 1; item = (*items) + (*nitems); item->option.longName = (newItem->option.longName ? xstrdup(newItem->option.longName) : NULL); item->option.shortName = newItem->option.shortName; item->option.argInfo = newItem->option.argInfo; item->option.arg = newItem->option.arg; item->option.val = newItem->option.val; item->option.descrip = (newItem->option.descrip ? xstrdup(newItem->option.descrip) : NULL); item->option.argDescrip = (newItem->option.argDescrip ? xstrdup(newItem->option.argDescrip) : NULL); item->argc = newItem->argc; item->argv = newItem->argv; (*nitems)++; return 0; } /*@=mustmod@*/ /*@=boundswrite@*/ const char * poptBadOption(poptContext con, int flags) { struct optionStackEntry * os = NULL; if (con != NULL) os = (flags & POPT_BADOPTION_NOALIAS) ? con->optionStack : con->os; /*@-nullderef@*/ /* LCL: os->argv != NULL */ return (os && os->argv ? os->argv[os->next - 1] : NULL); /*@=nullderef@*/ } const char *const poptStrerror(const int error) { switch (error) { case POPT_ERROR_NOARG: return POPT_("missing argument"); case POPT_ERROR_BADOPT: return POPT_("unknown option"); case POPT_ERROR_BADOPERATION: return POPT_("mutually exclusive logical operations requested"); case POPT_ERROR_NULLARG: return POPT_("opt->arg should not be NULL"); case POPT_ERROR_OPTSTOODEEP: return POPT_("aliases nested too deeply"); case POPT_ERROR_BADQUOTE: return POPT_("error in parameter quoting"); case POPT_ERROR_BADNUMBER: return POPT_("invalid numeric value"); case POPT_ERROR_OVERFLOW: return POPT_("number too large or too small"); case POPT_ERROR_MALLOC: return POPT_("memory allocation failed"); case POPT_ERROR_ERRNO: return strerror(errno); default: return POPT_("unknown error"); } } int poptStuffArgs(poptContext con, const char ** argv) { int argc; int rc; if ((con->os - con->optionStack) == POPT_OPTION_DEPTH) return POPT_ERROR_OPTSTOODEEP; for (argc = 0; argv[argc]; argc++) {}; con->os++; con->os->next = 0; con->os->nextArg = NULL; con->os->nextCharArg = NULL; con->os->currAlias = NULL; rc = poptDupArgv(argc, argv, &con->os->argc, &con->os->argv); con->os->argb = NULL; con->os->stuffed = 1; return rc; } const char * poptGetInvocationName(poptContext con) { return (con->os->argv ? con->os->argv[0] : ""); } /*@-boundswrite@*/ int poptStrippedArgv(poptContext con, int argc, char ** argv) { int numargs = argc; int j = 1; int i; /*@-sizeoftype@*/ if (con->arg_strip) for (i = 1; i < argc; i++) { if (PBM_ISSET(i, con->arg_strip)) numargs--; } for (i = 1; i < argc; i++) { if (con->arg_strip && PBM_ISSET(i, con->arg_strip)) continue; argv[j] = (j < numargs) ? argv[i] : NULL; j++; } /*@=sizeoftype@*/ return numargs; } /*@=boundswrite@*/ pilot-link-0.12.5-dfsg/popt/findme.c0000644000175000017500000000221410113125377017467 0ustar rousseaurousseau/** \ingroup popt * \file popt/findme.c */ /* (C) 1998-2002 Red Hat, Inc. -- Licensing details are in the COPYING file accompanying popt source distributions, available from ftp://ftp.rpm.org/pub/rpm/dist. */ #include "system.h" #include "findme.h" const char * findProgramPath(const char * argv0) { char * path = getenv("PATH"); char * pathbuf; char * start, * chptr; char * buf; if (argv0 == NULL) return NULL; /* XXX can't happen */ /* If there is a / in the argv[0], it has to be an absolute path */ if (strchr(argv0, '/')) return xstrdup(argv0); if (path == NULL) return NULL; start = pathbuf = alloca(strlen(path) + 1); buf = malloc(strlen(path) + strlen(argv0) + sizeof("/")); if (buf == NULL) return NULL; /* XXX can't happen */ strcpy(pathbuf, path); chptr = NULL; /*@-branchstate@*/ do { if ((chptr = strchr(start, ':'))) *chptr = '\0'; sprintf(buf, "%s/%s", start, argv0); if (!access(buf, X_OK)) return buf; if (chptr) start = chptr + 1; else start = NULL; } while (start && *start); /*@=branchstate@*/ free(buf); return NULL; } pilot-link-0.12.5-dfsg/popt/findme.h0000644000175000017500000000077010113125377017501 0ustar rousseaurousseau/** \ingroup popt * \file popt/findme.h */ /* (C) 1998-2000 Red Hat, Inc. -- Licensing details are in the COPYING file accompanying popt source distributions, available from ftp://ftp.rpm.org/pub/rpm/dist. */ #ifndef H_FINDME #define H_FINDME /** * Return absolute path to executable by searching PATH. * @param argv0 name of executable * @return (malloc'd) absolute path to executable (or NULL) */ /*@null@*/ const char * findProgramPath(/*@null@*/ const char * argv0) /*@*/; #endif pilot-link-0.12.5-dfsg/popt/README0000644000175000017500000000152610113660404016741 0ustar rousseaurousseauThis is the popt command line option parsing library. While it is similiar to getopt(3), it contains a number of enhancements, including: 1) popt is fully reentrant 2) popt can parse arbitrary argv[] style arrays while getopt(2) makes this quite difficult 3) popt allows users to alias command line arguments 4) popt provides convience functions for parsing strings into argv[] style arrays popt is used by rpm, the Red Hat install program, and many other Red Hat utilities, all of which provide excellent examples of how to use popt. Complete documentation on popt is available in popt.ps (included in this tarball), which is excerpted with permission from the book "Linux Application Development" by Michael K. Johnson and Erik Troan (availble from Addison Wesley in May, 1998). Comments on popt should be addressed to ewt@redhat.com. pilot-link-0.12.5-dfsg/ylwrap0000755000175000017500000001404311331674343016353 0ustar rousseaurousseau#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, # 2007, 2009 Free Software Foundation, Inc. # # Written by Tom Tromey . # # 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, see . # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . case "$1" in '') echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input="$1" shift case "$input" in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input="`pwd`/$input" ;; esac pairlist= while test "$#" -ne 0; do if test "$1" = "--"; then shift break fi pairlist="$pairlist $1" shift done # The program to run. prog="$1" shift # Make any relative path in $prog absolute. case "$prog" in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog="`pwd`/$prog" ;; esac # FIXME: add hostname here for parallel makes that run commands on # other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ trap "cd '`pwd`'; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then set X $pairlist shift first=yes # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot="no" if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot="yes" fi # The directory holding the input. input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` # Quote $INPUT_DIR so we can use it in a regexp. # FIXME: really we should care about more than `.' and `\'. input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` while test "$#" -ne 0; do from="$1" # Handle y_tab.c and y_tab.h output by DOS if test $y_tab_nodot = "yes"; then if test $from = "y.tab.c"; then from="y_tab.c" else if test $from = "y.tab.h"; then from="y_tab.h" fi fi fi if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend `../'. case "$2" in [\\/]* | ?:[\\/]*) target="$2";; *) target="../$2";; esac # We do not want to overwrite a header file if it hasn't # changed. This avoid useless recompilations. However the # parser itself (the first file) should always be updated, # because it is the destination of the .y.c rule in the # Makefile. Divert the output of all other files to a temporary # file so we can compare them to existing versions. if test $first = no; then realtarget="$target" target="tmp-`echo $target | sed s/.*[\\/]//g`" fi # Edit out `#line' or `#' directives. # # We don't want the resulting debug information to point at # an absolute srcdir; it is better for it to just mention the # .y file with no path. # # We want to use the real output file name, not yy.lex.c for # instance. # # We want the include guards to be adjusted too. FROM=`echo "$from" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` TARGET=`echo "$2" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? # Check whether header files must be updated. if test $first = no; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$2" is unchanged rm -f "$target" else echo updating "$2" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the first file. This # is a blatant hack to let us support using "yacc -d". If -d # is not specified, we don't want an error when the header # file is "missing". if test $first = yes; then ret=1 fi fi shift shift first=no done else ret=$? fi # Remove the directory. cd .. rm -rf $dirname exit $ret # 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: pilot-link-0.12.5-dfsg/missing0000755000175000017500000002623311331674343016512 0ustar rousseaurousseau#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 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, see . # 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=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # 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' autom4te touch the output file, or create a stub one 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] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. 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 # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # 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). This is about non-GNU programs, so use $1 not # $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 $program 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 "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 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 test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -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 test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -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 "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? 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 "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: pilot-link-0.12.5-dfsg/include/0000755000175000017500000000000011333433323016521 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/include/pi-cmp.h0000644000175000017500000000557510515154566020105 0ustar rousseaurousseau/* * $Id: pi-cmp.h,v 1.22 2006/10/17 13:24:06 desrod Exp $ * * pi-cmp.h - Palm Connection Management Protocol interface * * This latches early in the sync to determine serial sync speeds * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_CMP_H_ #define _PILOT_CMP_H_ /** @file pi-cmp.h * @brief Palm Connection Management Protocol definitions * */ #include "pi-args.h" #include "pi-buffer.h" #ifdef __cplusplus extern "C" { #endif #define PI_CMP_HEADER_LEN 10 #define PI_CMP_MTU 10 #define PI_CMP_OFFSET_TYPE 0 #define PI_CMP_OFFSET_FLGS 1 #define PI_CMP_OFFSET_VERS 2 #define PI_CMP_OFFSET_RESV 4 #define PI_CMP_OFFSET_BAUD 6 #define PI_CMP_TYPE_WAKE 0x01 #define PI_CMP_TYPE_INIT 0x02 #define PI_CMP_TYPE_ABRT 0x03 #define PI_CMP_TYPE_EXTN 0x04 /**< Type for extended CMP packets */ #define PI_CMP_VERS_1_0 0x0100L #define PI_CMP_VERS_1_1 0x0101L #define PI_CMP_VERS_1_2 0x0102L #define PI_CMP_VERS_1_3 0x0103L #define PI_CMP_VERSION PI_CMP_VERS_1_2 /* CMP packet flag values */ #define CMP_FL_CHANGE_BAUD_RATE 0x80 /**< Want to switch speeds */ #define CMP_FL_ONE_MINUTE_TIMEOUT 0x40 /**< Use a 1 minute timeout before dropping link */ #define CMP_FL_TWO_MINUTE_TIMEOUT 0x20 /**< Use a 2 minute timeout before dropping ling */ #define CMP_FL_LONG_PACKET_SUPPORT 0x10 /**< long PADP packet format is supported */ struct pi_cmp_data { unsigned char type; unsigned char flags; unsigned int version; int baudrate; }; extern pi_protocol_t *cmp_protocol PI_ARGS((void)); extern int cmp_rx_handshake PI_ARGS((pi_socket_t *ps, int establishrate, int establishhighrate)); extern int cmp_tx_handshake PI_ARGS((pi_socket_t *ps)); extern ssize_t cmp_tx PI_ARGS((pi_socket_t *ps, PI_CONST unsigned char *buf, size_t len, int flags)); extern ssize_t cmp_rx PI_ARGS((pi_socket_t *ps, pi_buffer_t *msg, size_t expect, int flags)); extern int cmp_init PI_ARGS((pi_socket_t *ps, int baudrate)); extern int cmp_abort PI_ARGS((pi_socket_t *ps, int reason)); extern int cmp_wakeup PI_ARGS((pi_socket_t *ps, int maxbaud)); extern void cmp_dump PI_ARGS((PI_CONST unsigned char *cmp, int rxtx)); #ifdef __cplusplus } #endif #endif /* _PILOT_CMP_H_ */ pilot-link-0.12.5-dfsg/include/pi-socket.h0000644000175000017500000005143310515154567020611 0ustar rousseaurousseau/* * $Id: pi-socket.h,v 1.72 2006/10/17 13:24:07 desrod Exp $ * * pi-socket.h: Socket-like interface to talk to handhelds * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** @file pi-socket.h * @brief Socket-like interface to talk to handhelds * * pi-socket is the root of the way you'll talk to a device. You'll first * create a socket using pi_socket(), then either use pi_bind(), pi_listen() * and pi_accept() to accept a connection, or pi_connect() to initiate a * network connection. * * A socket encapsulates the various protocol layers required to talk to the * handheld. You can access the various protocol levels using pi_protocol(). * * Each protocol layer has options you can get and set using pi_getsockopt() * and pi_setsockopt(). * * It is possible to read and write data using pi_read() and pi_write(), * though this usually not necessary. Instead, you will use the functions * from pi-dlp.h to talk to the device. They take care of all the low-level * stuff. * * At any time, you can check whether a connection is still established * using pi_socket_connected(). After each DLP call, you can call pi_error() * to check the latest error code. If the error code was #PI_ERR_DLP_PALMOS, * you should call pi_palmos_error() to retrieve the error code returned by * the device itself. See the pi-dlp.h documentation for more information. * * Finally, pi_version() returns the version of the DLP protocol on the * device. This can be used to check whether some features are supported, * such as VFS calls. See pi-dlp.h for more information. * * @see pi-dlp.h */ #ifndef _PILOT_SOCKET_H_ #define _PILOT_SOCKET_H_ #include #include "pi-args.h" #ifdef __cplusplus extern "C" { #endif #include "pi-version.h" #include "pi-sockaddr.h" #include "pi-buffer.h" #include "pi-error.h" /* For PI_ERR */ #define PI_AF_PILOT 0x00 #define PI_SOCK_STREAM 0x0010 /**< Stream socket type, for pi_socket() function */ #define PI_SOCK_RAW 0x0030 /**< Raw socket type, for pi_socket() function */ #define PI_CMD_CMP 0x01 /**< CMD command protocol type (for serial connections) */ #define PI_CMD_NET 0x02 /**< NET protocol type (for inet and USB connections) */ #define PI_CMD_SYS 0x03 /**< SYS protocol type (low-level, debugger connections) */ #define PI_MSG_PEEK 0x01 /**< Use this flag with pi_recv() to 'peek' at the incoming data (will not be removed from input buffer) */ /* deprecated (wasn't used) #define PI_MSG_REALLOC 0x02 */ /** @brief Protocol types */ enum PiProtocolTypes { PI_PF_DEV = 0x01, /**< Device-level protocol */ PI_PF_SLP = 0x02, /**< Serial-level protocol */ PI_PF_SYS = 0x03, /**< System-level protocol */ PI_PF_PADP = 0x04, /**< PAD-level protocol */ PI_PF_NET = 0x05, /**< NET-level protocol */ PI_PF_DLP = 0x06 /**< DLP-level protocol */ }; /** @brief Protocol levels for the socket's protocol queue */ enum PiOptLevels { PI_LEVEL_DEV, /**< Device level */ PI_LEVEL_SLP, /**< Serial link protocol level */ PI_LEVEL_PADP, /**< PADP protocol level */ PI_LEVEL_NET, /**< NET protocol level */ PI_LEVEL_SYS, /**< System protocol level */ PI_LEVEL_CMP, /**< CMP protocol level */ PI_LEVEL_DLP, /**< Desktop link protocol level*/ PI_LEVEL_SOCK /**< Socket level */ }; /** @brief Device level socket options (use pi_getsockopt() and pi_setsockopt()) */ enum PiOptDevice { PI_DEV_RATE, PI_DEV_ESTRATE, PI_DEV_HIGHRATE, PI_DEV_TIMEOUT }; /** @brief Serial link protocol socket options (use pi_getsockopt() and pi_setsockopt()) */ enum PiOptSLP { PI_SLP_DEST, PI_SLP_LASTDEST, PI_SLP_SRC, PI_SLP_LASTSRC, PI_SLP_TYPE, PI_SLP_LASTTYPE, PI_SLP_TXID, PI_SLP_LASTTXID }; /** @brief PADP protocol socket options (use pi_getsockopt() and pi_setsockopt()) */ enum PiOptPADP { PI_PADP_TYPE, PI_PADP_LASTTYPE, PI_PADP_FREEZE_TXID, /**< if set, don't increment txid when receiving a packet. Mainly used by dlp_VFSFileRead() */ PI_PADP_USE_LONG_FORMAT /**< if set, use the long packet size format when transmitting */ }; /** @brief CMP protocol socket options (use pi_getsockopt() and pi_setsockopt()) */ enum PiOptCMP { PI_CMP_TYPE, PI_CMP_FLAGS, PI_CMP_VERS, PI_CMP_BAUD }; /** @brief NET protocol socket options (use pi_getsockopt() and pi_setsockopt()) */ enum PiOptNet { PI_NET_TYPE, PI_NET_SPLIT_WRITES, /**< if set, write separately the NET header and data */ PI_NET_WRITE_CHUNKSIZE /**< size of data chunks if PI_NET_SPLIT_WRITES is set. 0 for no chunking of data */ }; /** @brief Socket level options (use pi_getsockopt() and pi_setsockopt()) */ enum PiOptSock { PI_SOCK_STATE, /**< Socket state (listening, closed, etc.) */ PI_SOCK_HONOR_RX_TIMEOUT /**< Set to 1 to honor timeouts when waiting for data. Set to 0 to disable timeout (i.e. during dlp_CallApplication) */ }; struct pi_protocol; /* forward declaration */ /** @brief Definition of a socket */ typedef struct pi_socket { int sd; /**< Socket descriptor to pass to other functions */ int type; /**< Socket type (i.e #PI_SOCK_STREAM) */ int protocol; /**< Protocol (usually #PI_PF_DLP) */ int cmd; struct sockaddr *laddr; /**< Socket local address */ size_t laddrlen; /**< Local address length */ struct sockaddr *raddr; /**< Socket remote address */ size_t raddrlen; /**< Remote address length */ struct pi_protocol **protocol_queue; /**< Ptr to the protocol queue */ int queue_len; /**< Protocol queue length */ struct pi_protocol **cmd_queue; /**< Ptr to the command queue */ int cmd_len; /**< Command queue length */ struct pi_device *device; /**< Low-level device we're talking to */ int state; /**< Current socket state (initially #PI_SOCK_CLOSE). Use pi_setsockopt() with #PI_SOCK_STATE to set the state. */ int honor_rx_to; /**< Honor packet reception timeouts. Set most to 1 of the time to have timeout management on incoming packets. Can be disabled when needed using pi_setsockopt() with #PI_SOCK_HONOR_RX_TIMEOUT. This is used, for example, to disable timeouts in dlp_CallApplication() so that lengthy tasks don't return an error. */ int command; /**< true when socket in command state */ int accept_to; /**< timeout value for call to accept() */ int dlprecord; /**< Index used for some DLP functions */ int dlpversion; /**< version of the DLP protocol running on the device */ unsigned long maxrecsize; /**< max record size on the device */ int last_error; /**< error code returned by the last dlp_* command */ int palmos_error; /**< Palm OS error code returned by the last transaction with the handheld */ } pi_socket_t; /** @brief Internal sockets chained list */ typedef struct pi_socket_list { pi_socket_t *ps; struct pi_socket_list *next; } pi_socket_list_t; /** @name Socket management */ /*@{*/ /** @brief Create a new socket * * Call this function to allocate a new socket which you will later * bind to a specific port * * @param domain Not used. Set to 0. * @param type Socket type (#PI_SOCK_STREAM or #PI_SOCK_RAW) * @param protocol Protocol to use (usually #PI_PF_DLP for #PI_SOCK_STREAM sockets) * @return Socket ID */ extern int pi_socket PI_ARGS((int domain, int type, int protocol)); /** @brief Assign a new socket descriptor * * Assign a new socket descriptor to the socket. On platforms that * support it, this function reuses the socket's existing descriptor * after closing it first. In all cases (whether the sd changed or * not), you don't have to close the new @a pi_sd you passed. * * @param ps Socket structure * @param pi_sd New socket descriptor * @return The socket structure's new socket descriptor value or negative on error */ extern int pi_socket_setsd PI_ARGS((pi_socket_t *ps, int pi_sd)); /** @brief Get socket name * * Structure needs to have its @a laddr member initialized and valid * * @param pi_sd Socket descriptor * @param remote_addr Will receive the local name * @param namelen On input, the size allocated to receive the name. On output, the actual name length * @return 0 on success, negative on error */ extern int pi_getsockname PI_ARGS((int pi_sd, struct sockaddr * remote_addr, size_t *namelen)); /** @brief Get a socket's remote address * * @param pi_sd Socket descriptor * @param remote_addr Will receive the remote address/name * @param namelen On input, maximum name/address length. On output, actual length * @return 0 on success, negative on error. */ extern int pi_getsockpeer PI_ARGS((int pi_sd, struct sockaddr * remote_addr, size_t *namelen)); /** @brief Get a socket option * * You can get socket options for various levels of the protocol * stack. See the options list in #socket.h * * @param pi_sd Socket descriptor * @param level Protocol level (see #PiOptLevels enum) * @param option_name Option "name" (i.e. #PI_DEV_TIMEOUT at #PI_LEVEL_DEV level) * @param option_value Pointer to the option value * @param option_len Len of the pointed option_value. * @return Negative code on error */ extern int pi_getsockopt PI_ARGS((int pi_sd, int level, int option_name, void *option_value, size_t *option_len)); /** @brief Set a socket option * * You can set socket options for various levels of the protocol * stack. See the options list in #socket.h * * @param pi_sd Socket descriptor * @param level Protocol level (see #PiOptLevels enum) * @param option_name Option "name" (i.e. #PI_DEV_TIMEOUT at #PI_LEVEL_DEV level) * @param option_value Pointer to the option value * @param option_len Len of the pointed option_value. * @return Negative code on error */ extern int pi_setsockopt PI_ARGS((int pi_sd, int level, int option_name, const void *option_value, size_t *option_len)); /** @brief Retrieve the protocol structure for the given level * * You should rarely need to use this function. It allows retrieving * the protocol structure for any protocol in a socket's protocol * stack * * @param pi_sd Socket descriptor * @param level Protocol level (see #PiOptLevels enum) * @return Protocol structure pointer or NULL if not found */ extern struct pi_protocol *pi_protocol PI_ARGS((int pi_sd, int level)); /** @brief Browse the protocol stack * * You should rarely need to use this function. It allows retrieving * the next protocol in the stack, up from lower levels to upper * levels. A protocol stack always has a PI_LEVEL_DEV at bottom, so * you can use pi_protocol() to retrieve the lowest stack level, * then repeatedly call pi_protocol_next() to get the next protocol * in the chain * * @param pi_sd Socket descriptor * @param level Level from which you want to get the next protocol (see #PiOptLevels enum) * @return Protocol structure ptr, or NULL if not found */ extern struct pi_protocol *pi_protocol_next PI_ARGS((int pi_sd, int level)); /*@}*/ /** @name Connection management */ /*@{*/ /** @brief Checks whether a connection is established * * If the socket wasn't found, returns 0 and @a errno is set to * ESRCH. * * @param pi_sd Socket descriptor * @return != 0 if a connection is established */ extern int pi_socket_connected PI_ARGS((int pi_sd)); /** @brief Connect to a remote server * * Connect to a remote server. * * @param pi_sd Socket descriptor * @param port Port string (see pi_bind() description) * @return Negative on error */ extern PI_ERR pi_connect PI_ARGS((int pi_sd, const char *port)); /** @brief Bind the socket to a specific port * * Call this function after creating a new socket with pi_socket() * to bind the socket to a specific port. Recognized port prefixes * are: "serial:", "usb:" and "net:". On Unix platforms, you need to * indicate the /dev entry to bind serial: and usb: to. * * @param pi_sd Socket descriptor * @param port Port string as described above * @return Negative error code on error */ extern PI_ERR pi_bind PI_ARGS((int pi_sd, const char *port)); extern PI_ERR pi_listen PI_ARGS((int pi_sd, int backlog)); /** @brief Wait for a handheld * * This function calls pi_accept_to() with a timeout of 0 (wait * forever). If an error occurs, the socket is closed. * * @param pi_sd Socket descriptor * @param remote_addr Unused. Pass NULL. * @param namelen Unused. Pass NULL. * @return Negative error code on error, returns 0 once a device connects */ extern PI_ERR pi_accept PI_ARGS((int pi_sd, struct sockaddr * remote_addr, size_t *namelen)); /** @brief Wait for a handheld * * Wait for a device to connect on the port the socket has been * bound to (using pi_bind()). If an error or timeout occurs, the * socket is closed. * * @param pi_sd Socket descriptor * @param remote_addr Unused. Pass NULL. * @param namelen Unused. Pass NULL. * @param timeout Number of seconds to wait. Pass 0 to wait forever. * @return Negative error code on error, returns 0 once a device connects */ extern PI_ERR pi_accept_to PI_ARGS((int pi_sd, struct sockaddr * remote_addr, size_t *namelen, int timeout)); /** @brief Close a socket * * This function closes a socket and disposes of all the internal * structures. If a device is currently connected to this socket, * the connection is interrupted. * * @param pi_sd Socket descriptor * @return Negative error code on error */ extern int pi_close PI_ARGS((int pi_sd)); /*@}*/ /** @name Low-level data transfers */ /*@{*/ /** @brief Send data on the given socket * * Perform a synchronous write on the given socket. Writes are * performed through the protocol stack. Therefore, the data you * send will be properly encapsulated in a packet conforming to the * connected protocol (i.e. NET protocol if you're talking to a * network or USB device). Usually, you won't send data directly, * but rather use the dlp_XXX functions to talk to the device. * * @param pi_sd Socket descriptor * @param msg Ptr to the data to send * @param len Size of the data to send * @param flags No write flag defined at this time * @return Number of bytes sent. Negative on error. */ extern int pi_send PI_ARGS((int pi_sd, PI_CONST void *msg, size_t len, int flags)); /** @brief Wait for incoming data from the device * * Wait for data sent by the device. Note that this function goes * through the protocol stack, therefore it waits for well-formed * packets and decodes them to extract the data. Usually, you won't * use this function directly. Instead, you'll use the dlp_XXX * functions to talk to the device. Remember that you need to pass a * valid pi_buffer_t (for example one allocated with * pi_buffer_new()). * * @param pi_sd Socket descriptor * @param msg Ptr to a valid pi_buffer_t buffer that will contain the received data * @param len Size of the data we want to read * @param flags Read flags. Use #PI_MSG_PEEK to leave data in the input buffer. * @return Number of bytes read. Negative on error. */ extern ssize_t pi_recv PI_ARGS((int pi_sd, pi_buffer_t *msg, size_t len, int flags)); /** @brief Wait for incoming data from the device * * Alias for the pi_recv() function. * * @param pi_sd Socket descriptor * @param msg Ptr to a valid pi_buffer_t buffer that will contain the received data * @param len Size of the data we want to read * @return Number of bytes read. Negative on error. */ extern ssize_t pi_read PI_ARGS((int pi_sd, pi_buffer_t *msg, size_t len)); /** @brief Write data on the given socket * * Alias for the pi_send() function. * * @param pi_sd Socket descriptor * @param databuf Ptr to the data to send * @param datasize Size of the data to send * @return Number of bytes sent. Negative on error. */ extern ssize_t pi_write PI_ARGS((int pi_sd, PI_CONST void *databuf, size_t datasize)); /** @brief Flush input and/or output bytes * * Flush incoming and/or outgoing data. Most device implementations * currently only support flushing the bytes in the incoming data * buffer, as most writes are synchronous. * * @param pi_sd Socket descriptor * @param flags Mask with valus #PI_FLUSH_INPUT, #PI_FLUSH_OUTPUT. * @return Negative on error */ extern void pi_flush PI_ARGS((int pi_sd, int flags)); /*@}*/ /** @name Error codes management */ /*@{*/ /** @brief Return the last error after a low-level or DLP call * * If the socket wasn't found, @a errno is set to ESRCH and the * function returns #PI_ERR_SOCK_INVALID. * * @param pi_sd Socket descriptor * @return Error code or 0 if no error or #PI_ERR_SOCK_INVALID is socket was not found */ extern int pi_error PI_ARGS((int pi_sd)); /** @brief Set the last error code * * If the socket wasn't found, @a errno is set to ESRCH. If the * error code is #PI_ERR_GENERIC_MEMORY, @a errno is set to ENOMEM. * * @param pi_sd Socket descriptor * @param error_code Error code to set * @return The error code */ extern int pi_set_error PI_ARGS((int pi_sd, int error_code)); /** @brief Get the last Palm OS error code the device returned to us * * After a DLP transaction, if you got a #PI_ERR_DLP_PALMOS error, * you should call this function to obtain the error code returned * by the device. It may be either a standard Palm OS error code, or * one of the DLP errors (see #dlpErrors enum) If the socket wasn't * found, @a errno is set to ESRCH and the function returns * #PI_ERR_SOCK_INVALID. * * @param pi_sd Socket descriptor * @return The Palm OS error code or #PI_ERR_SOCK_INVALID if socket was not found */ extern int pi_palmos_error PI_ARGS((int pi_sd)); /** @brief Set the last Palm OS error code * * If the socket wasn't found, @a errno is set to ESRCH. * * @param pi_sd Socket descriptor * @param error_code Error code to set * @return The error code */ extern int pi_set_palmos_error PI_ARGS((int pi_sd, int error_code)); /** @brief Clear both the last error code and the last Palm OS error code * * If the socket wasn't found, @a errno is set to ESRCH. * * @param sd Socket descriptor */ extern void pi_reset_errors PI_ARGS((int sd)); /*@}*/ /** @name Miscellaneous functions */ /*@{*/ /** @brief Return the version of the DLP protocol supported by the device * * Once connected to a handheld, you can call this function to * obtain the version of the DLP protocol it supports. See pi-dlp.h * for information about the various DLP versions. * * @param pi_sd Socket descriptor * @return DLP version or #PI_ERR_SOCK_INVALID if socket was not found */ extern PI_ERR pi_version PI_ARGS((int pi_sd)); /** @brief Return the maximum size of a database record that can be transferred * * Use this function to obtain the maximum size a database record * can be when transferring it to the device. On-device records may * be larger than what is currently supported by the version of the * DLP protocol that runs on the device. On devices with an * implementation of DLP < 1.4, you'll get 0xFFFF meaning that you * can't transfer records larger than 64k. * * If the socket wasn't found, returns 0 and errno is set to ESRCH. * * @param pi_sd Socket descriptor * @return Maximum record transfer size */ extern unsigned long pi_maxrecsize PI_ARGS((int pi_sd)); /** @brief Tickle a stream connection to keep it alive * * Call pi_tickle() at regular intervals to keep the connection * alive. If you're not sending any command to the device, some * devices will automatically disconnect after some time. Calling * pi_tickle() does keep the connection opened, which can be * necessary if you are writing a conduit that performs lengthy * tasks like retrieving data from the Internet. * * @param pi_sd Socket descriptor * @return An error code if an error occured (see pi-error.h) */ extern PI_ERR pi_tickle PI_ARGS((int pi_sd)); /** @brief Set a watchdog that will call pi_tickle() at regular intervals * * The watchdog uses the unix SIGALRM to fire an alarm at regular * intervals. If the socket is still connected when the alarm fires, * pi_tickle() is called to keep the connection alive. * * @param pi_sd Socket descriptor * @param interval Time interval in seconds between alarms * @return 0, or #PI_ERR_SOCK_INVALID if the socket wasn't found */ extern int pi_watchdog PI_ARGS((int pi_sd, int interval)); /*@}*/ #ifdef __cplusplus } #endif #endif /* _PILOT_SOCKET_H_ */ pilot-link-0.12.5-dfsg/include/pi-contact.h0000644000175000017500000001226711206407417020747 0ustar rousseaurousseau/******************************************************************************* * * $Id: pi-contact.h,v 1.12 2009/02/23 11:59:16 nicholas Exp $ * * pi-contact.h: Translate Palm contact data formats * Derived from a module of J-Pilot http://jpilot.org (jp-pi-contact.h 1.5) * * Rewrite Copyright 2006, 2007 Judd Montgomery * Rewrite Copyright 2004, 2005 Joseph Carter * Copyright 2003, 2004 Judd Montgomery * * 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; version 2 of the License. * * 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 ******************************************************************************/ /* * Hints for uses of this library <= 1.11: * * appinfo->internal has changed from a pi_buffer_t to char array of fixed length. * * appinfo->labels has changed from a pi_buffer_t to an array of char * arrays of fixed length, and is no longer 'opaque'. * * contact->reminder has changed from -1 for 'not set', to 0 for 'not * set' and the reminder/advance duration is now in contact->advance. * * contact->picture has changed from a pi_buffer_t to a ContactPicture * * There is no longer a contact->pictype (if the picture exists, it's a JPEG.) * */ #ifndef _PILOT_CONTACT_H_ #define _PILOT_CONTACT_H_ #include #include #include #include #define MAX_CONTACT_VERSION 11 #define NUM_CONTACT_ENTRIES 39 #define NUM_CONTACT_V10_LABELS 49 #define NUM_CONTACT_V11_LABELS 53 /* Blob types, or blob creator IDs, can range from BD00 - Bd09 for Contacts */ #define BLOB_TYPE_PICTURE_ID "Bd00" #define MAX_CONTACT_BLOBS 10 #ifdef __cplusplus extern "C" { #endif typedef enum { contacts_v10, contacts_v11 } contactsType; /* Entry fields */ enum { contLastname, contFirstname, contCompany, contTitle, contPhone1, contPhone2, contPhone3, contPhone4, contPhone5, contPhone6, contPhone7, contIM1, contIM2, contWebsite, contCustom1, contCustom2, contCustom3, contCustom4, contCustom5, contCustom6, contCustom7, contCustom8, contCustom9, contAddress1, contCity1, contState1, contZip1, contCountry1, contAddress2, contCity2, contState2, contZip2, contCountry2, contAddress3, contCity3, contState3, contZip3, contCountry3, contNote }; /* Non-entry fields */ enum { contBirthday = contNote + 1, contPicture }; struct ContactBlob { /* type ranges from "Bd00" - "Bd09" */ char type[4]; int length; unsigned char *data; }; struct ContactPicture { /* The picture pointer is only for convienience and * will point to the 3rd byte of the last picture blob. * The data will not need to be freed. The blob structure will. */ unsigned int dirty; /* data points to blob data in jpeg format */ unsigned int length; unsigned char *data; }; struct Contact { int phoneLabel[7]; int addressLabel[3]; int IMLabel[2]; int showPhone; int birthdayFlag; int reminder; int advance; int advanceUnits; struct tm birthday; char *entry[39]; struct ContactBlob *blob[MAX_CONTACT_BLOBS]; struct ContactPicture *picture; }; struct ContactAppInfo { contactsType type; int num_labels; struct CategoryAppInfo category; char internal[26]; /* Palm has not documented what this is */ char labels[53][16]; /* Hairy to explain, obvious to look at */ /*int labelRenamed[53];*/ /* list of booleans showing which labels were modified */ int country; int sortByCompany; int numCustoms; /* Included for source compatibility with pi-contact.h <= 1.11 */ char customLabels[9][16]; /* Duplication of some labels, to greatly reduce hair */ char phoneLabels[8][16]; /* Duplication of some labels, to greatly reduce hair */ char addrLabels[3][16]; /* Duplication of some labels, to greatly reduce hair */ char IMLabels[5][16]; /* Duplication of some labels, to greatly reduce hair */ }; extern void free_Contact PI_ARGS((struct Contact *)); extern int unpack_Contact PI_ARGS((struct Contact *, pi_buffer_t *, contactsType)); extern int pack_Contact PI_ARGS((struct Contact *, pi_buffer_t *, contactsType)); extern int unpack_ContactAppInfo PI_ARGS((struct ContactAppInfo *, pi_buffer_t *)); extern int pack_ContactAppInfo PI_ARGS((struct ContactAppInfo *, pi_buffer_t *)); extern void free_ContactAppInfo PI_ARGS((struct ContactAppInfo *)); extern int Contact_add_blob PI_ARGS((struct Contact *, struct ContactBlob *)); extern int Contact_add_picture PI_ARGS((struct Contact *, struct ContactPicture *)); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* _PILOT_CONTACT_H_ */ pilot-link-0.12.5-dfsg/include/Makefile.in0000644000175000017500000003563711333433243020605 0ustar rousseaurousseau# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ # Makefile for pilot-link headers VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ target_triplet = @target@ subdir = include DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/pi-md5.h.in $(srcdir)/pi-version.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/bluez.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/tcl.m4 \ $(top_srcdir)/m4/threads.m4 \ $(top_srcdir)/m4/vl_lib_readline.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h pi-md5.h CONFIG_CLEAN_FILES = pi-version.h CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(c_headerdir)" DATA = $(c_header_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLUEZ_CFLAGS = @BLUEZ_CFLAGS@ BLUEZ_LIBS = @BLUEZ_LIBS@ CAT_ENTRY_END = @CAT_ENTRY_END@ CAT_ENTRY_START = @CAT_ENTRY_START@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOCBOOK_ROOT = @DOCBOOK_ROOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVA = @JAVA@ JAVABASE = @JAVABASE@ JAVAC = @JAVAC@ JAVA_VERSION = @JAVA_VERSION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PIC_LIBS = @PIC_LIBS@ PILOT_LINK_MAJOR = @PILOT_LINK_MAJOR@ PILOT_LINK_MINOR = @PILOT_LINK_MINOR@ PILOT_LINK_PATCH = @PILOT_LINK_PATCH@ PILOT_LINK_VERS = @PILOT_LINK_VERS@ PISOCK_AGE = @PISOCK_AGE@ PISOCK_CURRENT = @PISOCK_CURRENT@ PISOCK_REVISION = @PISOCK_REVISION@ PISYNC_AGE = @PISYNC_AGE@ PISYNC_CURRENT = @PISYNC_CURRENT@ PISYNC_REVISION = @PISYNC_REVISION@ PKG_CONFIG = @PKG_CONFIG@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ POPT_INCLUDES = @POPT_INCLUDES@ POPT_LIBS = @POPT_LIBS@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_H = @PYTHON_H@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RL_LIBS = @RL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ XML_CATALOG = @XML_CATALOG@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ builddir = @builddir@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ usb_libs = @usb_libs@ c_headers = \ pi-address.h \ pi-appinfo.h \ pi-args.h \ pi-blob.h \ pi-bluetooth.h \ pi-buffer.h \ pi-calendar.h \ pi-cmp.h \ pi-contact.h \ pi-datebook.h \ pi-debug.h \ pi-dlp.h \ pi-error.h \ pi-expense.h \ pi-file.h \ pi-foto.h \ pi-header.h \ pi-hinote.h \ pi-inet.h \ pi-location.h \ pi-macros.h \ pi-mail.h \ pi-md5.h \ pi-memo.h \ pi-money.h \ pi-net.h \ pi-notepad.h \ pi-padp.h \ pi-palmpix.h \ pi-serial.h \ pi-slp.h \ pi-sockaddr.h \ pi-socket.h \ pi-source.h \ pi-sync.h \ pi-sys.h \ pi-syspkt.h \ pi-threadsafe.h \ pi-todo.h \ pi-usb.h \ pi-util.h \ pi-veo.h \ pi-versamail.h \ pi-version.h c_privheaders = \ pi-userland.h \ pi-version.h.in c_header_DATA = $(c_headers) c_headerdir = $(includedir) EXTRA_DIST = \ $(c_headers) \ $(c_privheaders) all: pi-md5.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu include/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 $(am__aclocal_m4_deps): pi-md5.h: stamp-h2 @if test ! -f $@; then \ rm -f stamp-h2; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h2; \ else :; fi stamp-h2: $(srcdir)/pi-md5.h.in $(top_builddir)/config.status @rm -f stamp-h2 cd $(top_builddir) && $(SHELL) ./config.status include/pi-md5.h $(srcdir)/pi-md5.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h2 touch $@ distclean-hdr: -rm -f pi-md5.h stamp-h2 pi-version.h: $(top_builddir)/config.status $(srcdir)/pi-version.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-c_headerDATA: $(c_header_DATA) @$(NORMAL_INSTALL) test -z "$(c_headerdir)" || $(MKDIR_P) "$(DESTDIR)$(c_headerdir)" @list='$(c_header_DATA)'; test -n "$(c_headerdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(c_headerdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(c_headerdir)" || exit $$?; \ done uninstall-c_headerDATA: @$(NORMAL_UNINSTALL) @list='$(c_header_DATA)'; test -n "$(c_headerdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(c_headerdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(c_headerdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(DATA) pi-md5.h installdirs: for dir in "$(DESTDIR)$(c_headerdir)"; 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-c_headerDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-c_headerDATA .MAKE: all install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-hdr distclean-libtool \ distdir dvi dvi-am html html-am info info-am install \ install-am install-c_headerDATA install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am uninstall uninstall-am uninstall-c_headerDATA # 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: pilot-link-0.12.5-dfsg/include/pi-error.h0000644000175000017500000001072510515154567020451 0ustar rousseaurousseau/* * $Id: pi-error.h,v 1.11 2006/10/17 13:24:07 desrod Exp $ * * pi-error.h: definitions for errors returned by the SOCKET, DLP and * FILE layers * * Copyright (c) 2004-2005, Florent Pillet. * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_ERROR_H_ #define _PILOT_ERROR_H_ /** @file pi-error.h * @brief Error definitions for the errors returned by libpisock's dlp_XXX functions. * * Most dlp_XXX functions return a value that is >= if the function * succeeded, or < 0 if there was an error. The error code can be directly * tested, and can also be retrieved using pi_error(). If the error code is * #PI_ERR_DLP_PALMOS, you should read the error code returned by the device * using pi_palmos_error(). * * @note These error codes are tailored to not conflict with dlpErr* codes * defined in dlp.h, and which can be checked using pi_palmos_error() * */ /** @brief Type definition for error returned by various function. * * The reason we have a typedef is mostly for swig-generated bindings to * properly handle result codes */ /**< Type for result codes returned by various library functions (mainly for swig-generated bindings) */ typedef int PI_ERR; /** @brief Definition of errors returned by various libpisock functions */ enum dlpErrorDefinitions { /* PROTOCOL level errors */ PI_ERR_PROT_ABORTED = -100, /**< aborted by other end */ PI_ERR_PROT_INCOMPATIBLE = -101, /**< can't talk with other end */ PI_ERR_PROT_BADPACKET = -102, /**< bad packet (used with serial protocols) */ /* SOCKET level errors */ PI_ERR_SOCK_DISCONNECTED = -200, /**< connection has been broken */ PI_ERR_SOCK_INVALID = -201, /**< invalid protocol stack */ PI_ERR_SOCK_TIMEOUT = -202, /**< communications timeout (but link not known as broken) */ PI_ERR_SOCK_CANCELED = -203, /**< last data transfer was canceled */ PI_ERR_SOCK_IO = -204, /**< generic I/O error */ PI_ERR_SOCK_LISTENER = -205, /**< socket can't listen/accept */ /* DLP level errors */ PI_ERR_DLP_BUFSIZE = -300, /**< provided buffer is not big enough to store data */ PI_ERR_DLP_PALMOS = -301, /**< a non-zero error was returned by the device */ PI_ERR_DLP_UNSUPPORTED = -302, /**< this DLP call is not supported by the connected handheld */ PI_ERR_DLP_SOCKET = -303, /**< invalid socket */ PI_ERR_DLP_DATASIZE = -304, /**< requested transfer with data block too large (>64k) */ PI_ERR_DLP_COMMAND = -305, /**< command error (the device returned an invalid response) */ /* FILE level error */ PI_ERR_FILE_INVALID = -400, /**< invalid prc/pdb/pqa/pi_file file */ PI_ERR_FILE_ERROR = -401, /**< generic error when reading/writing file */ PI_ERR_FILE_ABORTED = -402, /**< file transfer was aborted by progress callback, see pi_file_retrieve(), pi_file_install(), pi_file_merge() */ PI_ERR_FILE_NOT_FOUND = -403, /**< record or resource not found */ PI_ERR_FILE_ALREADY_EXISTS = -404, /**< a record with same UID or resource with same type/ID already exists */ /* GENERIC errors */ PI_ERR_GENERIC_MEMORY = -500, /**< not enough memory */ PI_ERR_GENERIC_ARGUMENT = -501, /**< invalid argument(s) */ PI_ERR_GENERIC_SYSTEM = -502 /**< generic system error */ }; /** @name libpisock error management macros */ /*@{*/ #define IS_PROT_ERR(error) ((error)<=-100 && (error)>-200) /**< Check whether the error code is at protocol level */ #define IS_SOCK_ERR(error) ((error)<=-200 && (error)>-300) /**< Check whether the error code is at socket level */ #define IS_DLP_ERR(error) ((error)<=-300 && (error)>-400) /**< Check whether the error code is at DLP level */ #define IS_FILE_ERR(error) ((error)<=-400 && (error)>-500) /**< Check whether the error code os a file error */ #define IS_GENERIC_ERR(error) ((error)<=-500 && (error)>-600) /**< Check whether the error code is a generic error */ /*@}*/ #endif pilot-link-0.12.5-dfsg/include/pi-expense.h0000644000175000017500000000635310515154567020771 0ustar rousseaurousseau/* * $Id: pi-expense.h,v 1.17 2006/10/17 13:24:07 desrod Exp $ * * pi-expense.h: definitions for Palm Expense application * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_EXPENSE_H_ #define _PILOT_EXPENSE_H_ #include #include "pi-appinfo.h" #ifdef __cplusplus extern "C" { #endif #define Expense_Creator makelong("exps") #define Expense_DB "ExpenseDB" extern char *ExpenseSortNames[]; extern char *ExpenseDistanceNames[]; extern char *ExpensePaymentNames[]; extern char *ExpenseTypeNames[]; enum ExpenseSort { esDate, esType }; enum ExpenseDistance { edMiles, edKilometers }; enum ExpensePayment { epAmEx, epCash, epCheck, epCreditCard, epMasterCard, epPrepaid, epVISA, epUnfiled }; enum ExpenseType { etAirfare, etBreakfast, etBus, etBusinessMeals, etCarRental, etDinner, etEntertainment, etFax, etGas, etGifts, etHotel, etIncidentals, etLaundry, etLimo, etLodging, etLunch, etMileage, etOther, etParking, etPostage, etSnack, etSubway, etSupplies, etTaxi, etTelephone, etTips, etTolls, etTrain }; typedef struct ExpenseCustomCurrency { char name[16]; char symbol[4]; char rate[8]; } ExpenseCustomCurrency_t; typedef struct Expense { struct tm date; enum ExpenseType type; enum ExpensePayment payment; int currency; char *amount; char *vendor; char *city; char *attendees; char *note; } Expense_t; typedef struct ExpenseAppInfo { struct CategoryAppInfo category; enum ExpenseSort sortOrder; struct ExpenseCustomCurrency currencies[4]; } ExpenseAppInfo_t; #define Expense_Pref 1 typedef struct ExpensePref { int currentCategory; int defaultCurrency; int attendeeFont; int showAllCategories; int showCurrency; int saveBackup; int allowQuickFill; enum ExpenseDistance unitOfDistance; int currencies[5]; int unknown[2]; int noteFont; } ExpensePref_t; extern void free_Expense PI_ARGS((struct Expense *)); extern int unpack_Expense PI_ARGS((struct Expense *, unsigned char *record, int len)); extern int pack_Expense PI_ARGS((struct Expense *, unsigned char *record, int len)); extern int unpack_ExpensePref PI_ARGS((struct ExpensePref *, unsigned char *record, int len)); extern int pack_ExpensePref PI_ARGS((struct ExpensePref *, unsigned char *record, int len)); extern int unpack_ExpenseAppInfo PI_ARGS((struct ExpenseAppInfo *, unsigned char *AppInfo, size_t len)); extern int pack_ExpenseAppInfo PI_ARGS((struct ExpenseAppInfo *, unsigned char *AppInfo, size_t len)); #ifdef __cplusplus } #endif #endif /* _PILOT_EXPENSE_H_ */ pilot-link-0.12.5-dfsg/include/pi-macros.h0000644000175000017500000002062010515154567020577 0ustar rousseaurousseau/* * $Id: pi-macros.h,v 1.17 2006/10/17 13:24:07 desrod Exp $ * * pi-macros.h: pilot-link specific macro defintions * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_MACROS_H_ #define _PILOT_MACROS_H_ #include #include "pi-args.h" typedef unsigned long recordid_t; #ifdef __cplusplus extern "C" { #endif extern double get_float PI_ARGS((void *)); extern void set_float PI_ARGS((void *, double)); extern int compareTm PI_ARGS((struct tm * a, struct tm * b)); #ifdef __cplusplus } #endif #ifndef __cplusplus #define get_long(ptr) \ (unsigned long) ( \ (((unsigned long)((unsigned char *)(ptr))[0]) << 24) | \ (((unsigned long)((unsigned char *)(ptr))[1]) << 16) | \ (((unsigned long)((unsigned char *)(ptr))[2]) << 8) | \ (((unsigned long)((unsigned char *)(ptr))[3]) ) ) #define get_treble(ptr) ((unsigned long)\ ((((unsigned char*)(ptr))[0] << 16) | \ (((unsigned char*)(ptr))[1] << 8) | \ (((unsigned char*)(ptr))[2]))) #define get_short(ptr) ((unsigned short)\ ((((unsigned char*)(ptr))[0] << 8) | \ (((unsigned char*)(ptr))[1]))) #define get_byte(ptr) (((unsigned char*)(ptr))[0]) #define get_slong(ptr) (signed long)(\ (get_long((ptr)) > 0x7FFFFFFF) ?\ (((signed long)(get_long((ptr)) & 0x7FFFFFFF)) - 0x80000000):\ ((signed long)(get_long((ptr))))\ ) #define get_streble(ptr) (signed long)(\ (get_treble((ptr)) > 0x7FFFFF) ?\ (((signed long)(get_treble((ptr)) & 0x7FFFFF)) - 0x800000):\ ((signed long)(get_treble((ptr))))\ ) #define get_sshort(ptr) (signed short)(\ (get_short((ptr)) > 0x7FFF) ?\ (((signed short)(get_short((ptr)) & 0x7FFF)) - 0x8000):\ ((signed short)(get_short((ptr))))\ ) #define get_sbyte(ptr) (signed char)(\ (get_byte((ptr)) > 0x7F) ?\ (((signed char)(get_byte((ptr)) & 0x7F)) - 0x80):\ ((signed char)(get_byte((ptr))))\ ) #define set_long(ptr,val) ((((unsigned char*)(ptr))[0] = (unsigned char)(((unsigned long)(val)) >> 24) & 0xff), \ (((unsigned char*)(ptr))[1] = (((unsigned long)(val)) >> 16) & 0xff), \ (((unsigned char*)(ptr))[2] = (((unsigned long)(val)) >> 8) & 0xff), \ (((unsigned char*)(ptr))[3] = (((unsigned long)(val)) >> 0) & 0xff)) #define set_slong(ptr,val) set_long((ptr),((unsigned long)(\ (((signed long)(val)) < 0) ?\ ((unsigned long)(((signed long)(val)) + 0x80000000) | 0x80000000) :\ (val)\ ))) #define set_treble(ptr,val) ((((unsigned char*)(ptr))[0] = (unsigned char)(((unsigned long)(val)) >> 16) & 0xff), \ (((unsigned char*)(ptr))[1] = (((unsigned long)(val)) >> 8) & 0xff), \ (((unsigned char*)(ptr))[2] = (((unsigned long)(val)) >> 0) & 0xff)) #define set_streble(ptr,val) set_treble((ptr),((unsigned long)(\ (((signed long)(val)) < 0) ?\ ((unsigned long)(((signed long)(val)) + 0x800000) | 0x800000) :\ (val)\ ))) #define set_short(ptr,val) ((((unsigned char*)(ptr))[0] = (((unsigned short)(val)) >> 8) & 0xff), \ (((unsigned char*)(ptr))[1] = (((unsigned short)(val)) >> 0) & 0xff)) #define set_sshort(ptr,val) set_short((ptr),((unsigned short)(\ (((signed short)(val)) < 0) ?\ ((unsigned short)(((signed short)(val)) + 0x8000) | 0x8000) :\ (val)\ ))) #define set_byte(ptr,val) (((unsigned char*)(ptr))[0]=(val)) #define set_sbyte(ptr,val) set_byte((ptr),((unsigned char)(\ (((signed char)(val)) < 0) ?\ ((unsigned char)(((signed char)(val)) + 0x80) | 0x80) :\ (val)\ ))) #define char4(c1,c2,c3,c4) (((c1)<<24)|((c2)<<16)|((c3)<<8)|(c4)) #else /*ifdef __cplusplus */ inline unsigned long get_long(const void *buf) { unsigned char *ptr = (unsigned char *) buf; return (*ptr << 24) | (*(++ptr) << 16) | (*(++ptr) << 8) | *(++ptr); } inline signed long get_slong(const void *buf) { unsigned long val = get_long(buf); if (val > 0x7FFFFFFF) return ((signed long) (val & 0x7FFFFFFF)) - 0x80000000; else return val; } inline unsigned long get_treble(const void *buf) { unsigned char *ptr = (unsigned char *) buf; return (*ptr << 16) | (*(++ptr) << 8) | *(++ptr); } inline signed long get_streble(const void *buf) { unsigned long val = get_treble(buf); if (val > 0x7FFFFF) return ((signed long) (val & 0x7FFFFF)) - 0x800000; else return val; } inline int get_short(const void *buf) { unsigned char *ptr = (unsigned char *) buf; return (*ptr << 8) | *(++ptr); } inline signed short get_sshort(const void *buf) { unsigned short val = get_short(buf); if (val > 0x7FFF) return ((signed short) (val & 0x7FFF)) - 0x8000; else return val; } inline int get_byte(const void *buf) { return *((unsigned char *) buf); } inline signed char get_sbyte(const void *buf) { unsigned char val = get_byte(buf); if (val > 0x7F) return ((signed char) (val & 0x7F)) - 0x80; else return val; } inline void set_long(void *buf, const unsigned long val) { unsigned char *ptr = (unsigned char *) buf; *ptr = (unsigned char) ((val >> 24) & 0xff); *(++ptr) = (unsigned char) ((val >> 16) & 0xff); *(++ptr) = (unsigned char) ((val >> 8) & 0xff); *(++ptr) = (unsigned char) (val & 0xff); } inline void set_slong(void *buf, const signed long val) { unsigned long uval; if (val < 0) { uval = (val + 0x80000000); uval |= 0x80000000; } else uval = val; set_long(buf, uval); } inline void set_treble(void *buf, const unsigned long val) { unsigned char *ptr = (unsigned char *) buf; *ptr = (unsigned char) ((val >> 16) & 0xff); *(++ptr) = (unsigned char) ((val >> 8) & 0xff); *(++ptr) = (unsigned char) (val & 0xff); } inline void set_streble(void *buf, const signed long val) { unsigned long uval; if (val < 0) { uval = (val + 0x800000); uval |= 0x800000; } else uval = val; set_treble(buf, uval); } inline void set_short(void *buf, const int val) { unsigned char *ptr = (unsigned char *) buf; *ptr = (val >> 8) & 0xff; *(++ptr) = val & 0xff; } inline void set_sshort(void *buf, const signed short val) { unsigned short uval; if (val < 0) { uval = (val + 0x8000); uval |= 0x8000; } else uval = val; set_treble(buf, uval); } inline void set_byte(void *buf, const int val) { *((unsigned char *) buf) = val; } inline void set_sbyte(void *buf, const signed char val) { unsigned char uval; if (val < 0) { uval = (val + 0x80); uval |= 0x80; } else uval = val; set_byte(buf, uval); } inline struct tm *getBufTm(struct tm *t, const void *buf, int setTime) { unsigned short int d = get_short(buf); t->tm_year = (d >> 9) + 4; t->tm_mon = ((d >> 5) & 15) - 1; t->tm_mday = d & 31; if (setTime) { t->tm_hour = 0; t->tm_min = 0; t->tm_sec = 0; } t->tm_isdst = -1; mktime(t); return t; } inline void setBufTm(void *buf, const struct tm *t) { set_short(buf, ((t->tm_year - 4) << 9) | ((t->tm_mon + 1) << 5) | t->tm_mday); } inline unsigned long char4(char c1, char c2, char c3, char c4) { return (c1 << 24) | (c2 << 16) | (c3 << 8) | c4; } #endif /*__cplusplus*/ #endif /* _PILOT_MACROS_H_ */ pilot-link-0.12.5-dfsg/include/pi-memo.h0000644000175000017500000000347510552545407020257 0ustar rousseaurousseau/* * $Id: pi-memo.h,v 1.16 2006/11/22 22:52:25 adridg Exp $ * * pi-memo.h: Support for the Palm Memos application * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_MEMO_H_ /* -*- C++ -*- */ #define _PILOT_MEMO_H_ #ifdef __cplusplus extern "C" { #endif #include "pi-appinfo.h" #include "pi-buffer.h" typedef enum { memo_v1, } memoType; typedef struct Memo { char *text; } Memo_t; typedef struct MemoAppInfo { memoType type; struct CategoryAppInfo category; /* New for 2.0 memo application, 0 is manual, 1 is alphabetical. */ int sortByAlpha; } MemoAppInfo_t; extern void free_Memo PI_ARGS((struct Memo *)); extern int unpack_Memo PI_ARGS((struct Memo *, const pi_buffer_t *record, memoType type)); extern int pack_Memo PI_ARGS((const struct Memo *, pi_buffer_t *record, memoType type)); extern int unpack_MemoAppInfo PI_ARGS((struct MemoAppInfo *, const unsigned char *AppInfo, size_t len)); extern int pack_MemoAppInfo PI_ARGS((const struct MemoAppInfo *, unsigned char *AppInfo, size_t len)); #ifdef __cplusplus }; #endif #endif /* _PILOT_MEMO_H_ */ pilot-link-0.12.5-dfsg/include/pi-location.h0000644000175000017500000000715611150204033021110 0ustar rousseaurousseau/* * $Id: pi-location.h,v 1.1 2009/02/22 08:08:59 nicholas Exp $ * * pi-location.h: Support for Palm Location databases (locLCusLocationDB, locLDefLocationDB and part of CalendarDB-PDat) * (c) 2008, Jon Schewe * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_LOCATION_H_ #define _PILOT_LOCATION_H_ #include #include #include #ifdef __cplusplus extern "C" { #endif enum DayOfWeek { sunday, monday, tuesday, wednesday, thursday, friday, saturday }; enum WeekOfMonth { first, second, third, fourth, last }; enum Month { none, january, february, march, april, may, june, july, august, september, october, november, december }; typedef struct { enum DayOfWeek dayOfWeek; enum WeekOfMonth weekOfMonth; enum Month month; uint8_t unknown; } DST_t; enum CompassDirection { north, east, south, west }; typedef struct { int16_t degrees; /* negative is N/E */ int16_t minutes; /* negative is N/E */ enum CompassDirection direction; } EarthPoint_t; typedef struct { int16_t offset; /* Offset from GMT */ uint8_t t2; /* 00 - 03 */ DST_t dstStart; DST_t dstEnd; uint8_t dstObserved; uint8_t t4; uint8_t unknown; /* always 0x80 or 0x00 */ char* name; /* the name of the entry, null terminated, max 21 plus null */ } Timezone_t; typedef struct { Timezone_t tz; uint8_t unknownExists; uint8_t unknown; /* byte that sometimes exists before the lat/lon */ EarthPoint_t latitude; EarthPoint_t longitude; char* note; /* the note for this timezone, null terminated string or just null */ } Location_t; extern void new_Timezone PI_ARGS((Timezone_t *)); extern void new_Location PI_ARGS((Location_t *)); extern void free_Timezone PI_ARGS((Timezone_t *tz)); extern void free_Location PI_ARGS((Location_t *loc)); extern int unpack_DST PI_ARGS((DST_t *dst, const pi_buffer_t *buf)); extern int unpack_DST_p PI_ARGS((DST_t *dst, const unsigned char *data, const size_t position)); extern int unpack_Timezone PI_ARGS((Timezone_t *tz, const pi_buffer_t *buf)); extern int unpack_Timezone_p PI_ARGS((Timezone_t *tz, const unsigned char *data, const size_t position)); extern int unpack_Location PI_ARGS((Location_t *tz, const pi_buffer_t *buf)); extern int pack_DST PI_ARGS((const DST_t *dst, pi_buffer_t *buf)); extern int pack_Timezone PI_ARGS((const Timezone_t *tz, pi_buffer_t *buf)); extern int pack_Location PI_ARGS((const Location_t *tz, pi_buffer_t *buf)); extern Timezone_t *dup_Timezone PI_ARGS((const Timezone_t *tz)); extern int copy_Timezone PI_ARGS((const Timezone_t *source, Timezone_t *dest)); extern int copy_Location PI_ARGS((const Location_t *source, Location_t *dest)); #ifdef __cplusplus }; #endif #endif /* _PILOT_LOCATION_H_ */ /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/include/pi-file.h0000644000175000017500000003672310515154567020245 0ustar rousseaurousseau/* * $Id: pi-file.h,v 1.29 2006/10/17 13:24:07 desrod Exp $ * * pi-file.h: Pilot File Interface Library * * This is free software, licensed under the GNU Library Public License V2. * See the file COPYING.LIB for details. * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** @file pi-file.h * @brief Database file install, retrieve and management interface * * The pi-file layer is a convenience management library that provides for * easy access, creation, install and retrieve of database files (PRC, PDB, * PQA) * * Palm databases on the local machines can be created with pi_file_create() * or opened read-only using pi_file_open(). Several functions are provided * to access resources and records. Caller must make sure to use the * appropriate functions, depending on the type of the database (i.e. only * use the record read/write functions on data databases, only use the * resource read/write functions on resource databases). * * A set of utility functions are provided to facilitate installing and * retrieving databases on the devide. pi_file_install() will perform all * the steps required to install a database on a device. pi_file_merge() can * be used to update an existing database or add new records/resources to * it. pi_file_retrieve() will read a database from the device. */ #ifndef _PILOT_FILE_H_ #define _PILOT_FILE_H_ #ifdef __cplusplus extern "C" { #endif #include "pi-dlp.h" /* For DBInfo */ /** @brief Structure describing a record or resource entry in a database file */ typedef struct pi_file_entry { int offset; /**< Offset in the on-disk file */ int size; /**< Size of the resource or record */ int resource_id; /**< For resources, resource ID */ int attrs; /**< Record attributes */ unsigned long type; /**< For resdources, resource type */ recordid_t uid; /**< For records, record unique ID */ } pi_file_entry_t; typedef struct pi_file { int err; int for_writing; /**< Non-zero if the file was opened with pi_file_create() */ int app_info_size; /**< Size of the appInfo block */ int sort_info_size; /**< Size of the sortInfo block */ int next_record_list_id; int resource_flag; int ent_hdr_size; /**< Size of the header for each resource/record (depends on whether the file is a resource or record file) */ int num_entries; /**< Number of actual entries in the entries memory block */ int num_entries_allocated; /**< Number of entries allocated in the entries memory block */ int rbuf_size; /**< Size of the internal read buffer */ FILE *f; /**< Actual on-disk file */ pi_buffer_t *tmpbuf; /**< Temporary buffer for databases opened with pi_file_create() */ char *file_name; /**< Access path */ void *app_info; /**< Pointer to the appInfo block or NULL */ void *sort_info; /**< Pointer to the sortInfo block or NULL */ void *rbuf; /**< Read buffer, used internally */ unsigned long unique_id_seed; /**< Database file's unique ID seed as read from an existing file */ struct DBInfo info; /**< Database information and attributes */ struct pi_file_entry *entries; /**< Array of records / resources */ } pi_file_t; /** @brief Transfer progress callback structure * * The progress callback structure is prepared by the client application and * passed to pi_file_install(), pi_file_merge() and pi_file_retrieve() * functions. It allows the client application to be notified during a file * transfer (i.e. to update a progress indicator) and gives it a chance to * cancel transfers. */ typedef struct { int type; /**< Transfer type (see #piProgressType enum) */ int transferred_bytes; /**< Current transferred bytes */ void *userinfo; /**< Provided by and passed back to client (not used for now, will be in a future release) */ union { struct { pi_file_t *pf; /**< May be NULL */ struct DBSizeInfo size; /**< Size information */ int transferred_records;/**< Number of records or resources */ } db; struct { char *path; /**< VFS file path */ long total_bytes; /**< File size in bytes */ } vfs; } data; } pi_progress_t; /** @brief Progress callback function definition * * Callback should return either #PI_TRANSFER_STOP or * #PI_TRANSFER_CONTINUE */ typedef int (*progress_func)(int socket, pi_progress_t *progress); /** @brief Transfer progress types for the @a type member of pi_progress_t */ enum piProgressType { PI_PROGRESS_SEND_DB = 1, /**< Sending a database */ PI_PROGRESS_RECEIVE_DB, /**< Receiving a database */ PI_PROGRESS_SEND_VFS, /**< Sending a VFS file */ PI_PROGRESS_RECEIVE_VFS /**< Receiving a VFS file */ }; #define PI_TRANSFER_STOP 0 /**< Returned by progress callback to stop the transfer */ #define PI_TRANSFER_CONTINUE 1 /**< Returned by progress callback to continue the transfer */ /** @name Opening and closing files */ /*@{*/ /** @brief Open a database for read-only access * * Don't dispose of the returned structure directly. * Use pi_file_close() instead. * * @param name The access path to the database to open on the local machine * @return An initialized pi_file_t structure or NULL. */ extern pi_file_t *pi_file_open PI_ARGS((const char *name)); /** @brief Create a new database file * * A new database file is created on the local machine. * * @param name Access path of the new file to create * @param INPUT Characteristics of the database to create * @return A new pi_file_t structure. Use pi_file_close() to write data and close file. */ extern pi_file_t *pi_file_create PI_ARGS((const char *name, const struct DBInfo *INPUT)); /** @brief Closes a local file * * If the file had been opened with pi_file_create, all * modifications are written to disk before the file is closed * * @param pf The pi_file_t structure is being disposed of by this function * @return An error code (see file pi-error.h) */ extern int pi_file_close PI_ARGS((pi_file_t *pf)); /*@}*/ /** @name Reading from open files */ /*@{*/ /** @brief Returns database specification * * @param pf An open file * @return DBInfo structure describing the file */ extern void pi_file_get_info PI_ARGS((const pi_file_t *pf, struct DBInfo *OUTPUT)); /** @brief Returns the file's appInfo block * * The returned data is not a copy of the pi_file_t's appInfo * structures. Don't dispose or modify it. * * @param pf An open file * @param datap On return, ptr to appInfo data or NULL * @param sizep On return, size of the appInfoBlock */ extern void pi_file_get_app_info PI_ARGS((pi_file_t *pf, void **datap, size_t *sizep)); /** @brief Returns the file's sortInfo block * * The returned data is not a copy of the pi_file_t's sortInfo * block: do not dispose of it! * * @param pf An open file * @param datap On return, ptr to sortInfo data or NULL * @param sizep On return, size of the sortInfoBlock */ extern void pi_file_get_sort_info PI_ARGS((pi_file_t *pf, void **dadtap, size_t *sizep)); /** @brief Read a resource by index * * If it exists, the returned data points directly into the file * structures. Don't dispose or modify it. * * @param pf An open file * @param resindex The resource index * @param bufp On return, pointer to the resource data block * @param sizep If not NULL, size of the resource data * @param restype If not NULL, resource type * @param resid If not NULL, resource * @return Negative error code on error */ extern int pi_file_read_resource PI_ARGS((pi_file_t *pf, int resindex, void **bufp, size_t *sizep, unsigned long *restype, int *resid)); /** @brief Read a resource by type and ID * * If it exists, the returned data points directly into the file * structures. * * @param pf An open file * @param restype Resource type * @param resid Resource ID * @param bufp On return, pointer to the resource data or NULL * @param sizep If not NULL, the size of the resource data * @param resindex If not NULL, on return contains the resource index * @return Negative error code on error */ extern int pi_file_read_resource_by_type_id PI_ARGS((pi_file_t *pf, unsigned long restype, int resid, void **bufp, size_t *sizep, int *resindex)); /** @brief Checks whether a resource type/id exists in an open file * * @param pf An open file * @param restype Resource type to check * @param resid Resource ID to check * @return Non-zero if a resource with same type and id exists */ extern int pi_file_type_id_used PI_ARGS((const pi_file_t *pf, unsigned long restype, int resid)); /** @brief Checks whether a record with the given UID exists * * @param pf An open file * @param uid The record UID to look for * @return Non-zero if a record with the same UID exists */ extern int pi_file_id_used PI_ARGS((const pi_file_t *pf, recordid_t uid)); /** @brief Read a record by index * * If it exists, the returned data points directly into the file * structures. Don't dispose or modify it. * * @param pf An open file * @param recindex Record index * @param bufp On return, pointer to the resource data or NULL * @param sizep If not NULL, the size of the resource data * @param recattrs If not NULL, the record attributes * @param category If not NULL, the record category * @param recuid If not NULL, the record unique ID * @return Negative error code on error */ extern int pi_file_read_record PI_ARGS((pi_file_t *pf, int recindex, void **bufp, size_t *sizep, int *recattrs, int *category, recordid_t *recuid)); /** @brief Read a record by unique ID * * If it exists, the returned data points directly into the file * structures. Don't dispose or modify it. * * @param pf An open file * @param recuid The record unique ID * @param bufp On return, pointer to the resource data or NULL * @param sizep If not NULL, the size of the resource data * @param recindex If not NULL, the record index * @param recattrs If not NULL, the record attributes * @param category If not NULL, the record category * @return Negative error code on error */ extern int pi_file_read_record_by_id PI_ARGS((pi_file_t *pf, recordid_t recuid, void **bufp, size_t *sizep, int *recindex, int *recattrs, int *category)); #ifndef SWIG extern void pi_file_get_entries PI_ARGS((pi_file_t *pf, int *entries)); #endif /*@}*/ /** @name Modifying files open for write */ /*@{*/ /* may call these any time before close (even multiple times) */ extern int pi_file_set_info PI_ARGS((pi_file_t *pf, const struct DBInfo *infop)); /** @brief Set the database's appInfo block * * The file takes ownership of the passed data block * * @param pf A file open for write * @param data Pointer to the data or NULL to clear the appInfo block * @param size Size of the new data block * @return Negative code on error */ extern int pi_file_set_app_info PI_ARGS((pi_file_t *pf, void *data, size_t size)); /** @brief Set the database's sortInfo block * * The file takes ownership of the passed data block * * @param pf A file open for write * @param data Pointer to the data or NULL to clear the sortInfo block * @param size Size of the new data block * @return Negative code on error */ extern int pi_file_set_sort_info PI_ARGS((pi_file_t *pf, void *data, size_t size)); /** @brief Add a resource to a file open for write * * The file takes ownership of the passed data block * Function will return PI_ERR_FILE_ALREADY_EXISTS if resource with * same type/id already exists * * @param pf A file open for write * @param data The resource data * @param size The resource size * @param restype Resource type * @param resid Resource ID * @return Negative code on error. */ extern int pi_file_append_resource PI_ARGS((pi_file_t *pf, void *data, size_t size, unsigned long restype, int resid)); /** @brief Add a record to a file open for write * * The file takes ownership of the passed data block Function will * return PI_ERR_FILE_ALREADY_EXISTS if record with same unique ID * already exists in the database * * @param pf A file open for write * @param data The resource data * @param size The resource size * @param recattrs Record attributes * @param category Record category * @param recuid Record unique ID (pass 0 to have recuid automatically allocated) * @return Negative code on error. */ extern int pi_file_append_record PI_ARGS((pi_file_t *pf, void *buf, size_t size, int recattrs, int category, recordid_t recuid)); /*@}*/ /** @name File transfer utilities */ /*@{*/ /** @brief Retrieve a file from the handheld * * You must first create the local file using pi_file_create() * * @param pf A file open for write * @param socket Socket to the connected handheld * @param cardno Card number the file resides on (usually 0) * @param report_progress Progress function callback or NULL (see #pi_progress_t structure) * @return Negative code on error */ extern int pi_file_retrieve PI_ARGS((pi_file_t *pf, int socket, int cardno, progress_func report_progress)); /** @brief Install a new file on the handheld * * You must first open the local file with pi_file_open() * * @param pf An open file * @param socket Socket to the connected handheld * @param cardno Card number to install to (usually 0) * @param report_progress Progress function callback or NULL (see #pi_progress_t structure) * @return Negative code on error */ extern int pi_file_install PI_ARGS((pi_file_t *pf, int socket, int cardno, progress_func report_progress)); /** @brief Install a new file on the handheld or merge with an existing file * * The difference between this function and pi_file_install() is * that if the file already exists on the handheld, pi_file_merge() * will append data to the existing file. For resource files, all * resources from the local file are sent to the handheld. If * resources with the same type/ID exist in the handheld file, they * are replaced with the new one. * * You must first open the local file with pi_file_open() * * @param pf An open file * @param socket Socket to the connected handheld * @param cardno Card number to install to (usually 0) * @param report_progress Progress function callback or NULL (see #pi_progress_t structure) * @return Negative code on error */ extern int pi_file_merge PI_ARGS((pi_file_t *pf, int socket, int cardno, progress_func report_progress)); /*@}*/ /** @name Time utilities */ /*@{*/ /** @brief Convert Unix time to Palm OS time * * @param t Unix time value * @return Time value with Palm OS timebase */ extern unsigned long unix_time_to_pilot_time PI_ARGS((time_t t)); /** @brief Convert Palm OS time to Unix time * * @param raw_time Time value expressed in Palm OS timebase (seconds from 01-JAN-1904, 00:00) * @return Unix time */ extern time_t pilot_time_to_unix_time PI_ARGS((unsigned long raw_time)); /*@}*/ #ifdef __cplusplus } #endif #endif pilot-link-0.12.5-dfsg/include/pi-version.h0000644000175000017500000000127211333433255020773 0ustar rousseaurousseau#ifndef _PILOT_VERSION_H_ #define _PILOT_VERSION_H_ /* * pi-version.h: Version numbers and global macros. * * This file contains #defines for pilot-link's version number, * and some macros that may be used anywhere in the codebase. * * PILOT_LINK_IS(0,12,0) may be used to determine if the * pilot-link version is _at least_ 0.12.0 (added in 0.12.0). * */ #define PILOT_LINK_VERSION 0 #define PILOT_LINK_MAJOR 12 #define PILOT_LINK_MINOR 5 #define PILOT_LINK_PATCH "" #define PILOT_LINK_IS(a,b,c) \ ((PILOT_LINK_VERSION > a) || \ ((PILOT_LINK_VERSION == a) && \ ((PILOT_LINK_MAJOR > b) || \ ((PILOT_LINK_MAJOR == b) && (PILOT_LINK_MINOR >= c))))) #endif /* _PILOT_VERSION_H_ */ pilot-link-0.12.5-dfsg/include/pi-versamail.h0000644000175000017500000000425710515154567021306 0ustar rousseaurousseau/* * $Id: pi-versamail.h,v 1.7 2006/10/17 13:24:07 desrod Exp $ * * pi-versamail.h: Palm VersaMail application support (replaced Palm Mail * application) * * Copyright (c) 2005, Florent Pillet. * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_VERSAMAIL_H_ #define _PILOT_VERSAMAIL_H_ #include #include "pi-args.h" #include "pi-appinfo.h" #ifdef __cplusplus extern "C" { #endif struct VersaMail { unsigned long imapuid; struct tm date; unsigned int category; unsigned int accountNo; unsigned int unknown1; unsigned int download; unsigned int mark; unsigned int unknown2; unsigned int reserved1; unsigned int reserved2; unsigned int read; unsigned int msgSize; unsigned int attachmentCount; char *messageUID; char *to; char *from; char *cc; char *bcc; char *subject; char *dateString; char *body; char *replyTo; void *unknown3; unsigned int unknown3length; }; struct VersaMailAppInfo { struct CategoryAppInfo category; }; extern int unpack_VersaMail PI_ARGS((struct VersaMail *, char *record, size_t len)); extern int pack_VersaMail PI_ARGS((struct VersaMail *a, char *buffer, size_t len)); extern void free_VersaMail PI_ARGS((struct VersaMail *)); extern void free_VersaMailAppInfo PI_ARGS((struct VersaMailAppInfo *)); extern int unpack_VersaMailAppInfo PI_ARGS((struct VersaMailAppInfo *, unsigned char *AppInfo, size_t len)); #ifdef __cplusplus } #endif #endif /* _PILOT_VERSAMAIL_H_ */ pilot-link-0.12.5-dfsg/include/pi-sockaddr.h0000644000175000017500000000174710515154567021116 0ustar rousseaurousseau/* * $Id: pi-sockaddr.h,v 1.10 2006/10/17 13:24:07 desrod Exp $ * * pi-sockaddr.h * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_SOCKADDR_H_ #define _PILOT_SOCKADDR_H_ struct pi_sockaddr { unsigned short pi_family; char pi_device[255]; }; #endif /* _PILOT_SOCKADDR_H_ */ pilot-link-0.12.5-dfsg/include/pi-address.h0000644000175000017500000000460510552545407020743 0ustar rousseaurousseau/* * $Id: pi-address.h,v 1.21 2006/11/22 22:52:25 adridg Exp $ * * pi-address.h: Macros for Palm "Classic" Address support * see pi-contact.h for the "Extended" Contacts support * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_ADDRESS_H_ #define _PILOT_ADDRESS_H_ #include "pi-appinfo.h" #include "pi-buffer.h" #ifdef __cplusplus extern "C" { #endif typedef enum { address_v1, } addressType; typedef enum { entryLastname, entryFirstname, entryCompany, entryPhone1, entryPhone2, entryPhone3, entryPhone4, entryPhone5, entryAddress, entryCity, entryState, entryZip, entryCountry, entryTitle, entryCustom1, entryCustom2, entryCustom3, entryCustom4, entryNote, entryCategory } AddressField_t; typedef struct Address { int phoneLabel[5]; int showPhone; char *entry[19]; } Address_t; typedef struct AddressAppInfo { addressType type; struct CategoryAppInfo category; char labels[19 + 3][16]; /* Hairy to explain, obvious to look */ int labelRenamed[19 + 3]; /* Booleans show labels modified */ char phoneLabels[8][16]; /* Dup some labels, reduce hair */ int country; int sortByCompany; } AddressAppInfo_t; extern void free_Address PI_ARGS((Address_t *)); extern int unpack_Address PI_ARGS((Address_t *, const pi_buffer_t *buf, addressType type)); extern int pack_Address PI_ARGS((const Address_t *, pi_buffer_t *buf, addressType type)); extern int unpack_AddressAppInfo PI_ARGS((AddressAppInfo_t *, const unsigned char *AppInfo, size_t len)); extern int pack_AddressAppInfo PI_ARGS((const AddressAppInfo_t *, unsigned char *AppInfo, size_t len)); #ifdef __cplusplus }; #endif #endif /* _PILOT_ADDRESS_H_ */ pilot-link-0.12.5-dfsg/include/pi-usb.h0000644000175000017500000001120110563116471020072 0ustar rousseaurousseau/* * $Id: pi-usb.h,v 1.21 2007/02/09 16:11:37 desrod Exp $ * * pi-usb.h: Support for USB-connected Palm devices * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_USB_H_ #define _PILOT_USB_H_ #include "pi-args.h" #include "pi-buffer.h" #ifdef __cplusplus extern "C" { #endif #if defined(sun) && defined(__SVR4) #define u_int8_t uint8_t #define u_int16_t uint16_t #define u_int32_t uint32_t #endif #define PI_USB_DEV 1 struct pi_usb_data; typedef struct pi_usb_impl { int (*open) PI_ARGS((pi_socket_t *ps, struct pi_sockaddr *addr, size_t addrlen)); int (*close) PI_ARGS((pi_socket_t *ps)); ssize_t (*write) PI_ARGS((pi_socket_t *ps, PI_CONST unsigned char *buf, size_t len, int flags)); ssize_t (*read) PI_ARGS((pi_socket_t *ps, pi_buffer_t *buf, size_t expect, int flags)); int (*flush) PI_ARGS((pi_socket_t *ps, int flags)); int (*poll) PI_ARGS((pi_socket_t *ps, int timeout)); int (*wait_for_device) PI_ARGS((pi_socket_t *ps, int *timeout)); int (*changebaud) PI_ARGS((pi_socket_t *ps)); int (*control_request) PI_ARGS((struct pi_usb_data *usb_data, int request_type, int request, int value, int reqindex, void *data, int size, int timeout)); } pi_usb_impl_t; #define USB_INIT_NONE (1<<0) #define USB_INIT_TAPWAVE (1<<1) #define USB_INIT_VISOR (1<<2) #define USB_INIT_SONY_CLIE (1<<3) typedef struct pi_usb_dev { u_int16_t vendor, product; u_int32_t flags; char *idstr; } pi_usb_dev_t; typedef struct pi_usb_data { struct pi_usb_impl impl; /**< structure containing ptr to the actual implementations for the current platform */ struct pi_usb_dev dev; /**< device structure */ unsigned char buf[256]; /**< temp. buffer to hold incoming data when peeking at init time */ size_t buf_size; /* IO options */ void *ref; /**< Used by the platform implementation to keep a ptr to additional private data */ /* Baud rate info (for USB serial adapters on platforms where they connect through the USB layer, like Darwin) */ int rate; /**< Current port baud rate */ int establishrate; /**< Baud rate to use after link is established */ int establishhighrate; /**< Boolean: try to establish rate higher than the device publishes */ int timeout; } pi_usb_data_t; extern pi_device_t *pi_usb_device PI_ARGS((int type)); extern void pi_usb_impl_init PI_ARGS((struct pi_usb_impl *impl)); extern int USB_check_device PI_ARGS((pi_usb_data_t *dev, u_int16_t vendor, u_int16_t product)); extern int USB_configure_device PI_ARGS((pi_usb_data_t *dev, u_int8_t *input_pipe, u_int8_t *output_pipe)); /* Start of the new generic USB pilot init stuff. */ /* * USB control requests we send to the devices From * linux/drivers/usb/serial/visor.h */ #define GENERIC_REQUEST_BYTES_AVAILABLE 0x01 #define GENERIC_CLOSE_NOTIFICATION 0x02 #define VISOR_GET_CONNECTION_INFORMATION 0x03 #define PALM_GET_EXT_CONNECTION_INFORMATION 0x04 /* * Reply struct and defines for VISOR_GET_CONNECTION_INFORMATION */ typedef struct { u_int16_t num_ports; struct { u_int8_t port_function_id; u_int8_t port; } connections[2]; } visor_connection_info_t; /* struct visor_connection_info.connection[x].port defines: */ #define VISOR_ENDPOINT_1 0x01 #define VISOR_ENDPOINT_2 0x02 /* struct visor_connection_info.connection[x].port_function_id defines: */ #define VISOR_FUNCTION_GENERIC 0x00 #define VISOR_FUNCTION_DEBUGGER 0x01 #define VISOR_FUNCTION_HOTSYNC 0x02 #define VISOR_FUNCTION_CONSOLE 0x03 #define VISOR_FUNCTION_REMOTE_FILE_SYS 0x04 /* * Reply struct for PALM_GET_EXT_CONNECTION_INFORMATION */ typedef struct { u_int8_t num_ports; u_int8_t endpoint_numbers_different; u_int16_t reserved1; struct { char port_function_id[4]; u_int8_t port; u_int8_t endpoint_info; u_int16_t reserved; } connections[2]; } palm_ext_connection_info_t; #ifdef __cplusplus } #endif #endif pilot-link-0.12.5-dfsg/include/pi-mail.h0000644000175000017500000000645710515154567020251 0ustar rousseaurousseau/* * $Id: pi-mail.h,v 1.19 2006/10/17 13:24:07 desrod Exp $ * * pi-mail.h: Palm Mail application macros * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_MAIL_H_ #define _PILOT_MAIL_H_ #include #include "pi-appinfo.h" #ifdef __cplusplus extern "C" { #endif typedef struct Mail { int read; int signature; int confirmRead; int confirmDelivery; int priority; int addressing; int dated; struct tm date; char *subject; char *from; char *to; char *cc; char *bcc; char *replyTo; char *sentTo; char *body; } Mail_t; typedef struct MailAppInfo { struct CategoryAppInfo category; int dirty; /* boolean */ int sortOrder; unsigned long unsentMessage; /* UniqueID of unsent message */ /* not implemented by Palm char *signature; */ } MailAppInfo_t; typedef struct MailSyncPref { int syncType; int getHigh; int getContaining; int truncate; char *filterTo; char *filterFrom; char *filterSubject; } MailSyncPref_t; typedef struct MailSignaturePref { char *signature; } MailSignaturePref_t; extern char *MailSyncTypeNames[]; extern char *MailSortTypeNames[]; typedef enum { mailCtgInbox = 0, mailCtgOutbox, mailCtgDeleted, mailCtgFiled, mailCtgDraft } MailCategory; typedef enum { mailSyncAll = 0, mailSyncSend, mailSyncFilter, mailSyncUnread = 3 } MailSyncType; typedef enum { /* XXX 0? */ mailPrefLocal = 1, mailPrefRemote, mailPrefSig } MailPrefId; extern void free_Mail PI_ARGS((struct Mail *)); extern void free_MailAppInfo PI_ARGS((struct MailAppInfo *)); extern void free_MailSyncPref PI_ARGS((struct MailSyncPref *)); extern void free_MailSignaturePref PI_ARGS((struct MailSignaturePref *)); extern int unpack_Mail PI_ARGS((struct Mail *, unsigned char *record, size_t len)); extern int pack_Mail PI_ARGS((struct Mail *, unsigned char *record, size_t len)); extern int unpack_MailAppInfo PI_ARGS((struct MailAppInfo *, unsigned char *AppInfo, size_t len)); extern int pack_MailAppInfo PI_ARGS((struct MailAppInfo *, unsigned char *AppInfo, size_t len)); extern int unpack_MailSyncPref PI_ARGS((struct MailSyncPref *, unsigned char *record, size_t len)); extern int unpack_MailSignaturePref PI_ARGS((struct MailSignaturePref *, unsigned char *record, size_t len)); extern int pack_MailSyncPref PI_ARGS((struct MailSyncPref *, unsigned char *record, size_t len)); extern int pack_MailSignaturePref PI_ARGS((struct MailSignaturePref *, unsigned char *record, size_t len)); #ifdef __cplusplus } #endif #endif /* _PILOT_MAIL_H_ */ pilot-link-0.12.5-dfsg/include/pi-foto.h0000644000175000017500000000344610515154567020271 0ustar rousseaurousseau/* * $Id: pi-foto.h,v 1.4 2006/10/17 13:24:07 desrod Exp $ * * pi-foto.h - Macro definitions for the palmOne Photo application * * Copyright (C) 2004 Steve Ratcliffe, 23 Feb 2004 * * This latches early in the sync to determine serial sync speeds * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PI_FOTO_H_ #define _PI_FOTO_H_ /** @file pi-foto.h * @brief Macros for the Palm Photo application's data * */ /* * Offsets into the thumbnail record header. */ #define FOTO_IMAGE_WIDTH 0x04 /* Width of the image jpg. 2 bytes */ #define FOTO_IMAGE_HEIGHT 0x06 /* Height of the image jpg. 2 bytes */ #define FOTO_MODIFY_DATE 0x08 /* Date modified. 4 bytes */ #define FOTO_IMAGE_SIZE 0x0c /* (Related to) the size of the jpg pdb, 4b */ #define FOTO_THUMB_WIDTH 0x10 /* Width of thumbnail. 1 byte */ #define FOTO_THUMB_HEIGHT 0x11 /* Height of thumbnail. 1 byte */ #define FOTO_NAME_LEN 0x16 /* Length of name. 1 byte(?) */ #define FOTO_IMAGE_DATE 0x1c /* Date displayed with image. 4 bytes */ #define FOTO_THUMB_SIZE 0x26 /* Size of thumbnail. 2 bytes */ #endif /* _PI_FOTO_H_ */ pilot-link-0.12.5-dfsg/include/pi-buffer.h0000644000175000017500000001126610515154566020571 0ustar rousseaurousseau/* * $Id: pi-buffer.h,v 1.6 2006/10/17 13:24:06 desrod Exp $ * * pi-buffer.h: simple data block management for variable data storage * * Copyright (c) 2004-2005, Florent Pillet. * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** @file pi-buffer.h * @brief Variable size buffer management interface * @author Florent Pillet * * pi-buffer provides for a reliable and easy to use variable size buffer * management, allowing for buffers that grow as needed to store * variable-length data. * * When you create a buffer with pi_buffer_new(), you indicate an initial * capacity that is allocated. The number of used bytes is set to 0. To * append data to the buffer, use pi_buffer_append(). This ensures that the * buffer grows as needed. * * You can access data in the buffer using the @a buffer->data member. The * number of bytes used is always accessible using @a buffer->used. * * It is possible to use the pi-buffer functions on static buffers. In this * case, you won't call pi_buffer_free() on the structure. You'll dispose of * the memory yourself instead. Here is an example: * * @code * pi_buffer_t mybuf; * mybuf.data = (unsigned char *) malloc(256); * mybuf.allocated = 256; * mybuf.used = 0; * * // ... perform your tasks here .... * pi_buffer_append(&mybuf, somedata, somedatasize); * // ... * * free(mybuf.data); * @endcode */ #ifndef _PILOT_BUFFER_H_ #define _PILOT_BUFFER_H_ #include "pi-args.h" #ifdef __cplusplus extern "C" { #endif /** @brief Variable buffer structure */ typedef struct pi_buffer_t { unsigned char *data; /**< Pointer to the data */ size_t allocated; /**< Number of bytes allocated */ size_t used; /**< Number of allocated bytes actually used */ } pi_buffer_t; /** @brief Create a new variable size buffer * * Dispose of this buffer with pi_buffer_free() * * @param capacity Initial size to allocate * @return A newly allocated pi_buffer_t structure */ extern pi_buffer_t* pi_buffer_new PI_ARGS((size_t capacity)); /** @brief Ensure the buffer is large enough to store @p capacity bytes of data * * This grows the allocated buffer as needed and updates the @a allocated * member. Doesn't touch the @a used member. After this call succeeds, you * can directly use the @a buffer->data pointer to store up to * @a buffer->allocated bytes using direct memory access. * * @param buf The buffer to grow * @param new_capacity The total number of bytes the buffer is expected to contain * @return The @p buf buffer on success, NULL if a memory error happened */ extern pi_buffer_t* pi_buffer_expect PI_ARGS((pi_buffer_t *buf, size_t new_capacity)); /** @brief Append data to the buffer * * Grow the buffer if needed. * * @param buf The buffer to grow * @param data Pointer to the data to append * @param len Length of the data to append * @return The @p buf buffer on success, NULL if a memory error happened */ extern pi_buffer_t* pi_buffer_append PI_ARGS((pi_buffer_t *buf, PI_CONST void *data, size_t len)); /** @brief Append a buffer to another buffer * * @param dest The buffer to append to * @param src Buffer whose data will be appended to @p dest * @return The @p dest buffer on success, NULL if a memory error happened */ extern pi_buffer_t* pi_buffer_append_buffer PI_ARGS((pi_buffer_t *dest, PI_CONST pi_buffer_t *src)); /** @brief Reset the @a used member of a buffer * * The @p used member is set to 0. If the actual allocated bytes is large, * the allocation may shrink to a reasonable value to prevent unneeded * memory use. * * @param buf The buffer to clear * @return The @p buf parameter */ extern void pi_buffer_clear PI_ARGS((pi_buffer_t *buf)); /** @brief Dispose of all memory used by a buffer allocated with pi_buffer_new() * * After this call, the @p buf structure itself will have been freed as well. * Do not reuse the pointer. * * @param buf The buffer to dispose of */ extern void pi_buffer_free PI_ARGS((pi_buffer_t *buf)); #ifdef __cplusplus } #endif #endif pilot-link-0.12.5-dfsg/include/pi-sync.h0000644000175000017500000000560210515154567020272 0ustar rousseaurousseau/* * $Id: pi-sync.h,v 1.20 2006/10/17 13:24:07 desrod Exp $ * * pi-sync.h: Header for generic synchronization algorithm * * Copyright (c) 2000-2001, Ximian Inc. * * Author: JP Rosevear * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_SYNC_H_ #define _PILOT_SYNC_H_ #ifdef __cplusplus extern "C" { #endif #include "pi-macros.h" typedef struct _SyncHandler SyncHandler; typedef struct _DesktopRecord DesktopRecord; typedef struct _PilotRecord PilotRecord; struct _DesktopRecord { int recID; int catID; int flags; }; struct _PilotRecord { recordid_t recID; int catID; int flags; void *buffer; size_t len; }; struct _SyncHandler { int sd; char *name; int secret; void *data; int (*Pre) (SyncHandler *, int dbhandle, int *slow); int (*Post) (SyncHandler *, int dbhandle); int (*SetPilotID) (SyncHandler *, DesktopRecord *, recordid_t); int (*SetStatusCleared) (SyncHandler *, DesktopRecord *); int (*ForEach) (SyncHandler *, DesktopRecord **); int (*ForEachModified) (SyncHandler *, DesktopRecord **); int (*Compare) (SyncHandler *, PilotRecord *, DesktopRecord *); int (*AddRecord) (SyncHandler *, PilotRecord *); int (*ReplaceRecord) (SyncHandler *, DesktopRecord *, PilotRecord *); int (*DeleteRecord) (SyncHandler *, DesktopRecord *); int (*ArchiveRecord) (SyncHandler *, DesktopRecord *, int archive); int (*Match) (SyncHandler *, PilotRecord *, DesktopRecord **); int (*FreeMatch) (SyncHandler *, DesktopRecord *); int (*Prepare) (SyncHandler *, DesktopRecord *, PilotRecord *); }; PilotRecord *sync_NewPilotRecord(int buf_size); PilotRecord *sync_CopyPilotRecord(const PilotRecord * precord); void sync_FreePilotRecord(PilotRecord * precord); DesktopRecord *sync_NewDesktopRecord(void); DesktopRecord *sync_CopyDesktopRecord(const DesktopRecord * drecord); void sync_FreeDesktopRecord(DesktopRecord * drecord); int sync_CopyToPilot(SyncHandler * sh); int sync_CopyFromPilot(SyncHandler * sh); int sync_MergeToPilot(SyncHandler * sh); int sync_MergeFromPilot(SyncHandler * sh); int sync_Synchronize(SyncHandler * sh); #ifdef __cplusplus } #endif #endif pilot-link-0.12.5-dfsg/include/pi-notepad.h0000644000175000017500000000606310515154567020752 0ustar rousseaurousseau/* * $Id: pi-notepad.h,v 1.8 2006/10/17 13:24:07 desrod Exp $ * * pi-notepad.h: Palm Notepad application support * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_NOTEPAD_H_ #define _PILOT_NOTEPAD_H_ #include "pi-appinfo.h" #ifdef __cplusplus extern "C" { #endif typedef struct NotePadAppInfo { int dirty, sortByPriority; struct CategoryAppInfo category; } NotePadAppInfo_t; typedef struct { unsigned short sec; unsigned short min; unsigned short hour; unsigned short day; unsigned short month; unsigned short year; unsigned short s; /* Haven't figured this one out - Angus */ } noteDate_t; typedef struct { noteDate_t createDate; noteDate_t changeDate; unsigned short flags; } noteHdr_t; /* flags */ #define NOTEPAD_FLAG_BODY 0x01 #define NOTEPAD_FLAG_NAME 0x02 #define NOTEPAD_FLAG_ALARM 0x04 /* Actions */ #define NOTEPAD_ACTION_OUTPUT 0x01 #define NOTEPAD_ACTION_LIST 0x02 /* Output type */ #define NOTE_OUT_PPM 0x01 #define NOTE_OUT_PNG 0x02 /* Data Type */ #define NOTEPAD_DATA_UNCOMPRESSED 0x00 /* OS 4 notepad? */ #define NOTEPAD_DATA_BITS 0x01 /* OS 4 notepad */ #define NOTEPAD_DATA_PNG 0x02 /* OS 5 notepad */ /* Note structure When flags = 0x03 noteHdr_t char name[0]; NULL termniated and 1 padded to 2 byte boundary noteBody_t When flags = 0x07 noteHdr_t noteDate_t alarmTime char name[0]; NULL termniated and 1 padded to 2 byte boundary noteBody_t */ typedef struct body { unsigned long bodyLen; unsigned long width; unsigned long height; unsigned long l1; /* 1 ul x ? */ unsigned long dataType; unsigned int dataLen; /* length of dataRecs in bytes */ } body_t; typedef struct dataRec { unsigned char repeat; unsigned char data; } dataRec_t; typedef struct NotePad { noteDate_t createDate; noteDate_t changeDate; unsigned short flags; char *name; noteDate_t alarmDate; body_t body; dataRec_t *data; } NotePad_t; void free_NotePad( NotePad_t *a ); int unpack_NotePad(NotePad_t *a, unsigned char *buffer, size_t len); int unpack_NotePadAppInfo(NotePadAppInfo_t *ai, unsigned char *record, size_t len); int pack_NotePad(NotePad_t *a, unsigned char *buffer, size_t len); int pack_NotePadAppInfo(NotePadAppInfo_t *ai, unsigned char *record, size_t len); #ifdef __cplusplus } #endif /*__cplusplus*/ #endif pilot-link-0.12.5-dfsg/include/pi-palmpix.h0000644000175000017500000000562510515154567020775 0ustar rousseaurousseau/* * $Id: pi-palmpix.h,v 1.5 2006/10/17 13:24:07 desrod Exp $ * * pi-palmpix.h: Kodak PalmPix Camera support * (Kodak didn't like that we did this, tee hee!) * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef PILOT_PALMPIX_H #define PILOT_PALMPIX_H #include "pi-args.h" #ifdef __cplusplus extern "C" { #endif #define PalmPix_Creator (makelong ("COCO")) #define PalmPix_DB "ArchImage" /* flags values */ #define PALMPIX_COLOUR_CORRECTION 1 #define PALMPIX_HISTOGRAM_STRETCH 2 struct PalmPixState { /* This callback should read record #RECNO into BUFFER and BUFSIZE, and return 0 when successful, just like pi_file_read_record(). */ int (*getrecord) PI_ARGS ((struct PalmPixState *self, int recno, void **buffer, size_t *bufsize)); /* This will be filled in by pixName. */ char pixname[33]; /* After unpack_PalmPix, this will be the last record index which is part of the current picture. */ int highest_recno; /* Set these to some permutation of 0,1,2 before using pixPixmap. */ int offset_r, offset_g, offset_b; /* This specifies the png or ppm output */ int output_type; /* This will be filled in by pixPixmap. */ unsigned char *pixmap; /* The output brightness adjustment */ int bias; /* This controls colour correction and histogram stretch */ int flags; }; enum { pixChannelGR, pixChannelR, pixChannelB, pixChannelGB }; struct PalmPixHeader { int w, h, resolution, zoom, num; int year, month, day, hour, min, sec; int numRec, thumbLen; int chansize[4]; }; enum { pixName = 0x01, pixThumbnail = 0x02, pixPixmap = 0x04 }; /* picture output types */ #define PALMPIX_OUT_PPM 1 #define PALMPIX_OUT_PNG 2 /* Returns the number of bytes from the buffer that were consumed, or 0 on error (generally the record not in fact being a PalmPixHeader). */ extern int unpack_PalmPixHeader PI_ARGS ((struct PalmPixHeader *h, const unsigned char *p, int len)); extern int unpack_PalmPix PI_ARGS ((struct PalmPixState *state, const struct PalmPixHeader *h, int recno, int wanted)); extern int free_PalmPix_data PI_ARGS ((struct PalmPixState *state)); #ifdef __cplusplus } #endif #endif pilot-link-0.12.5-dfsg/include/pi-padp.h0000644000175000017500000000474010515154567020244 0ustar rousseaurousseau/* * $Id: pi-padp.h,v 1.20 2006/10/17 13:24:07 desrod Exp $ * * pi-padp.h: * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_PADP_H_ #define _PILOT_PADP_H_ #ifdef __cplusplus extern "C" { #endif #include "pi-socket.h" #define PI_PADP_HEADER_LEN 4 #define PI_PADP_MTU 1024 #define PI_PADP_OFFSET_TYPE 0 #define PI_PADP_OFFSET_FLGS 1 #define PI_PADP_OFFSET_SIZE 2 #define padData 0x01 #define padWake 0x101 #define padAck 0x02 #define padTickle 0x04 #define padAbort 0x08 /* PalmOS 2.0 only */ #define PADP_FL_FIRST 0x80 /**< Flag indicating that this is the first fragment in a PADP packet */ #define PADP_FL_LAST 0x40 /**< Flag indicating that this is the last fragment in a PADP packet */ #define PADP_FL_MEMERROR 0x20 /**< Flag denoting a memory error on the device */ #define PADP_FL_LONG 0x10 /**< If set, the PADP packet size is stored on a long */ typedef struct padp { unsigned char type; unsigned char flags; int size; } padp_t; typedef struct pi_padp_data { int type; int last_type; int freeze_txid; /**< see #PI_PADP_FREEZE_TXID sockopt */ int use_long_format; /**< set to != 0 if we want to transmit packets using the long size format */ unsigned char txid; unsigned next_txid; unsigned char last_ack_txid; struct padp last_ack_padp; } pi_padp_data_t; extern pi_protocol_t *padp_protocol PI_ARGS((void)); extern ssize_t padp_tx PI_ARGS((pi_socket_t *ps, PI_CONST unsigned char *buf, size_t len, int flags)); extern ssize_t padp_rx PI_ARGS((pi_socket_t *ps, pi_buffer_t *buf, size_t expect, int flags)); extern void padp_dump_header PI_ARGS((PI_CONST unsigned char *data, int rxtx)); extern void padp_dump PI_ARGS((PI_CONST unsigned char *data)); #ifdef __cplusplus } #endif #endif /* _PILOT_PADP_H_ */ pilot-link-0.12.5-dfsg/include/pi-header.h0000644000175000017500000000222410515154567020543 0ustar rousseaurousseau/* * $Id: pi-header.h,v 1.15 2006/10/17 13:24:07 desrod Exp $ * * pi-header.h: Silly header definitions for each userland binary * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PI_HEADER_H_ #define _PI_HEADER_H_ #include "pi-source.h" #ifndef SWIG /* Print the version splash */ void print_splash(const char *progname) PI_DEPRECATED; /* Connect to the Palm device */ int pilot_connect(const char *port) PI_DEPRECATED; #endif #endif /* _PI_HEADER_H_ */ pilot-link-0.12.5-dfsg/include/pi-source.h0000644000175000017500000001042010515154567020610 0ustar rousseaurousseau/* * $Id: pi-source.h,v 1.42 2006/10/17 13:24:07 desrod Exp $ * * pi-source.h * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_SOURCE_H_ #define _PILOT_SOURCE_H_ # include # include # include # include # include # include # include # include # include # include # include #ifdef NeXT # include # include #endif #ifdef __EMX__ # define OS2 # include # include # include /* for htonl .. */ # define ENOMSG 150 # define strcasecmp stricmp # define strncasecmp strnicmp # define TTYPrompt "com#" # define RETSIGTYPE void # define HAVE_SIGACTION # define HAVE_DUP2 # define HAVE_SYS_SELECT_H # define HAVE_STRDUP #else #endif #ifdef SGTTY # include #else # include #endif #ifndef PI_DEPRECATED #if __GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2) # define PI_DEPRECATED __attribute__ ((deprecated)) #else # define PI_DEPRECATED #endif #endif #ifdef __cplusplus extern "C" { #endif #include "pi-socket.h" #include "pi-macros.h" #include "pi-buffer.h" #define PI_SOCK_LISTEN 0x01 /* Listener */ #define PI_SOCK_CONN_ACCEPT 0x02 /* Connected by accepting */ #define PI_SOCK_CONN_INIT 0x04 /* Connected by initiating */ #define PI_SOCK_CONN_BREAK 0x08 /* Connected but broken */ #define PI_SOCK_CONN_END 0x10 /* Connected but end */ #define PI_SOCK_CLOSE 0x20 /* Closed */ #define PI_FLUSH_INPUT 0x01 /* for flush() */ #define PI_FLUSH_OUTPUT 0x02 /* for flush() */ typedef struct pi_protocol { int level; struct pi_protocol *(*dup) PI_ARGS((struct pi_protocol *)); void (*free) PI_ARGS((struct pi_protocol *)); ssize_t (*read) PI_ARGS((pi_socket_t *ps, pi_buffer_t *buf, size_t expect, int flags)); ssize_t (*write) PI_ARGS((pi_socket_t *ps, PI_CONST unsigned char *buf, size_t len, int flags)); int (*flush) PI_ARGS((pi_socket_t *ps, int flags)); int (*getsockopt) PI_ARGS((pi_socket_t *ps, int level, int option_name, void *option_value, size_t *option_len)); int (*setsockopt) PI_ARGS((pi_socket_t *ps, int level, int option_name, const void *option_value, size_t *option_len)); void *data; } pi_protocol_t; typedef struct pi_device { void (*free) PI_ARGS((struct pi_device *dev)); struct pi_protocol *(*protocol) PI_ARGS((struct pi_device *dev)); int (*bind) PI_ARGS((pi_socket_t *ps, struct sockaddr *addr, size_t addrlen)); int (*listen) PI_ARGS((pi_socket_t *ps, int backlog)); int (*accept) PI_ARGS((pi_socket_t *ps, struct sockaddr *addr, size_t *addrlen)); int (*connect) PI_ARGS((pi_socket_t *ps, struct sockaddr *addr, size_t addrlen)); int (*close) PI_ARGS((pi_socket_t *ps)); void *data; } pi_device_t; /* internal functions */ extern pi_socket_list_t *pi_socket_recognize PI_ARGS((pi_socket_t *)); extern pi_socket_t *find_pi_socket PI_ARGS((int sd)); extern int crc16 PI_ARGS((unsigned char *ptr, int count)); extern char *printlong PI_ARGS((unsigned long val)); extern unsigned long makelong PI_ARGS((char *c)); /* provide compatibility for old code. Code should now use pi_dumpline() and pi_dumpdata() */ extern void dumpline PI_ARGS((PI_CONST char *buf, size_t len, unsigned int addr)) PI_DEPRECATED; extern void dumpdata PI_ARGS((PI_CONST char *buf, size_t len)) PI_DEPRECATED; #ifdef __cplusplus } #endif #endif /* _PILOT_SOURCE_H_ */ pilot-link-0.12.5-dfsg/include/pi-inet.h0000644000175000017500000000236310515154567020256 0ustar rousseaurousseau/* * $Id: pi-inet.h,v 1.10 2006/10/17 13:24:07 desrod Exp $ * * pi-inet.h: Network macro definitions * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_INET_H_ #define _PILOT_INET_H_ #include "pi-args.h" #ifdef __cplusplus extern "C" { #endif #define PI_NET_DEV 1 typedef struct pi_inet_data { /* Time out */ int timeout; /* Statistics */ int rx_bytes; int rx_errors; int tx_bytes; int tx_errors; } pi_inet_data_t; extern pi_device_t *pi_inet_device PI_ARGS((int type)); #ifdef __cplusplus } #endif #endif pilot-link-0.12.5-dfsg/include/pi-money.h0000644000175000017500000000460710515154567020451 0ustar rousseaurousseau/* * $Id: pi-money.h,v 1.9 2006/10/17 13:24:07 desrod Exp $ * * pi-money.h: Support for the pilot-money userland conduit (deprecated) * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_MONEY_H_ #define _PILOT_MONEY_H_ #include "pi-appinfo.h" #ifdef __cplusplus extern "C" { #endif typedef struct Transaction { char flags; /* 1:cleared, 2:Unflagged */ unsigned int checknum; /* Check number or 0 */ long amount; /* integer amount and */ long total; /* the running total after cleared */ int amountc; /* cents as above */ int totalc; int second; /* Date */ int minute; int hour; int day; int month; int year; int wday; char repeat; /* 0:single, 1:weekly, 2: every two */ /* weeks, 3:monthly, 4: monthly end */ char flags2; /* 1:receipt */ char type; /* Type (Category) index to typeLabels */ char reserved[2]; char xfer; /* Account Xfer (index to categories) */ char description[19]; /* Description (Payee) */ char note[401]; /* Note (\0) */ } Transaction_t; typedef struct MoneyAppInfo { struct CategoryAppInfo category; char typeLabels[20][10]; char tranLabels[20][20]; } MoneyAppInfo_t; extern int unpack_Transaction PI_ARGS((Transaction_t *, unsigned char *, size_t)); extern int pack_Transaction PI_ARGS((Transaction_t *, unsigned char *, size_t)); extern int unpack_MoneyAppInfo PI_ARGS((MoneyAppInfo_t *, unsigned char *, size_t)); extern int pack_MoneyAppInfo PI_ARGS((MoneyAppInfo_t *, unsigned char *, size_t)); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* _PILOT_MONEY_H_ */ pilot-link-0.12.5-dfsg/include/pi-version.h.in0000644000175000017500000000137510161635326021405 0ustar rousseaurousseau#ifndef _PILOT_VERSION_H_ #define _PILOT_VERSION_H_ /* * pi-version.h: Version numbers and global macros. * * This file contains #defines for pilot-link's version number, * and some macros that may be used anywhere in the codebase. * * PILOT_LINK_IS(0,12,0) may be used to determine if the * pilot-link version is _at least_ 0.12.0 (added in 0.12.0). * */ #define PILOT_LINK_VERSION @PILOT_LINK_VERS@ #define PILOT_LINK_MAJOR @PILOT_LINK_MAJOR@ #define PILOT_LINK_MINOR @PILOT_LINK_MINOR@ #define PILOT_LINK_PATCH "@PILOT_LINK_PATCH@" #define PILOT_LINK_IS(a,b,c) \ ((PILOT_LINK_VERSION > a) || \ ((PILOT_LINK_VERSION == a) && \ ((PILOT_LINK_MAJOR > b) || \ ((PILOT_LINK_MAJOR == b) && (PILOT_LINK_MINOR >= c))))) #endif /* _PILOT_VERSION_H_ */ pilot-link-0.12.5-dfsg/include/pi-util.h0000644000175000017500000000722610515154567020277 0ustar rousseaurousseau/* * $Id: pi-util.h,v 1.17 2006/10/17 13:24:07 desrod Exp $ * * pi-util.h: Header for utility routines * * Copyright (c) 2000, Helix Code Inc. * * Author: JP Rosevear * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef _PILOT_UTIL_H_ #define _PILOT_UTIL_H_ #ifdef __cplusplus extern "C" { #endif #include "pi-args.h" /* pi_mktag Turn a sequence of characters into a long (er.. 32 bit quantity) like those used on the PalmOS device to identify creators and similar. pi_untag Given a 32 bit identifier, unpack it into the 5-byte char array buf so it is suitable for printing. Both of these macros are deprecated for runtime use, but for calculating compile-time constants pi_mktag is ok. */ #define pi_mktag(c1,c2,c3,c4) (((c1)<<24)|((c2)<<16)|((c3)<<8)|(c4)) #define pi_untag(buf,tag) { buf[0]=(tag >> 24) & 0xff; \ buf[1]=(tag >> 16) & 0xff; \ buf[2]=(tag >> 8) & 0xff; \ buf[3]=(tag) & 0xff; \ buf[4]=0; } /** @brief Read the PILOTRATE environment variable * * If the PILOTRATE environment variable is set, read it. It should * be a speed value. If the first letter is an 'H', then it means we * want to use this speed even if it's higher than the highest speed * published by the device. * * @param establishrate On return, PILOTRATE value or -1 if environment variable not set * @param establishhighrate On return, 1 if speed prefixed with 'H', 0 otherwise */ extern void get_pilot_rate PI_ARGS((int *establishrate, int *establishhighrate)); extern int convert_ToPilotChar_WithCharset PI_ARGS((const char *charset, const char *text, int bytes, char **ptext, const char *pi_charset)); extern int convert_ToPilotChar PI_ARGS((const char *charset, const char *text, int bytes, char **ptext)); extern int convert_FromPilotChar_WithCharset PI_ARGS((const char *charset, const char *ptext, int bytes, char **text, const char *pi_charset)); extern int convert_FromPilotChar PI_ARGS((const char *charset, const char *ptext, int bytes, char **text)); /** @brief Convert a milliseconds timeout value to an absolute timespec * * @param timeout Timeout value from now, in milliseconds * @param ts Ptr to a timespec structure to fill. Contains the absolute time on return. */ extern void pi_timeout_to_timespec PI_ARGS((int timeout, struct timespec *ts)); /** @brief Convert an absolute time to a timeout value from now (in milliseconds) * * The returned timeout will be a negative if we passed the absolute * time already * * @param ts Timespec with an absolute time * @return Timeout value in milliseconds (negative if expired) */ extern int pi_timespec_to_timeout PI_ARGS((const struct timespec *ts)); /** @brief Checks if an absolute timeout is expired * * @param ts Absolute time defining the timeout time * @return Non-zero if expired */ extern int pi_timeout_expired PI_ARGS((const struct timespec *ts)); #ifdef __cplusplus } #endif #endif pilot-link-0.12.5-dfsg/include/pi-todo.h0000644000175000017500000000353610552545407020265 0ustar rousseaurousseau/* * $Id: pi-todo.h,v 1.21 2006/11/22 22:52:25 adridg Exp $ * * pi-todo.h: Palm ToDo application support (Classic) * see pi-tasks.h for Palm Tasks application support * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_TODO_H_ #define _PILOT_TODO_H_ #ifdef __cplusplus extern "C" { #endif #include #include "pi-appinfo.h" #include "pi-buffer.h" typedef enum { todo_v1, } todoType; typedef struct ToDo { int indefinite; struct tm due; int priority; int complete; char *description; char *note; } ToDo_t; typedef struct ToDoAppInfo { todoType type; struct CategoryAppInfo category; int dirty; int sortByPriority; } ToDoAppInfo_t; extern void free_ToDo PI_ARGS((ToDo_t *)); extern int unpack_ToDo PI_ARGS((ToDo_t *, const pi_buffer_t *record, todoType type)); extern int pack_ToDo PI_ARGS((const ToDo_t *, pi_buffer_t *record, todoType type)); extern int unpack_ToDoAppInfo PI_ARGS((ToDoAppInfo_t *, const unsigned char *record, size_t len)); extern int pack_ToDoAppInfo PI_ARGS((const ToDoAppInfo_t *, unsigned char *record, size_t len)); #ifdef __cplusplus }; #endif #endif /* _PILOT_TODO_H_ */ pilot-link-0.12.5-dfsg/include/pi-userland.h0000644000175000017500000001347210515154567021137 0ustar rousseaurousseau/* * $Id: pi-userland.h,v 1.8 2006/10/17 13:24:07 desrod Exp $ * * userland.h: General definitions for userland conduits. * * Copyright (C) 2004 by Adriaan de Groot * * 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. */ #ifndef PALM_USERLAND_H #define PALM_USERLAND_H #include #include "pi-appinfo.h" /* * This file defines general stuff for conduits -- common option processing, * perhaps some utility functions, etc. It prescribes how some of the code * of a conduit should look like, so as to preserve uniformity of options * and handling. * * - Each conduit should start its options table with * USERLAND_RESERVED_OPTIONS. This sets up the standard options --port, * --version, --quiet as well as popt autohelp. * - If an error is found while processing options, call plu_badoption. * This produces a standard error message. * - If no error is found, call plu_connect() instead of pilot_connect(). * This does the same as pilot_connect, but obeys --quiet and produces * output on stderr only if there _is_ an error. */ /*********************************************************************** * * Option-handling functions. * ***********************************************************************/ /* * These are definitions for popt support in userland. Every conduit's popt * table should start with USERLAND_RESERVED_OPTIONS to insert the standard * options into it. Also enables autohelp. */ #define USERLAND_RESERVED_OPTIONS \ {NULL,0,POPT_ARG_INCLUDE_TABLE,plu_common_options,0,"Options common to all conduits.",NULL}, \ POPT_AUTOHELP /* * Complain about a bad (ie. nonexistent) option and exit(); */ extern void plu_badoption(poptContext pc, int optc); /* * Add an alias to a popt context; remember to use --bad-option in the alias * to add a complaint about deprecated options. Do not pass in both a long * and a short option in one go, use two calls for that. */ void plu_popt_alias(poptContext pc, const char *alias_long, char alias_short, const char *expansion); /* * Set explanation of what options to use in response to an alias that * contains --bad-option. */ void plu_set_badoption_help(const char *help); /*********************************************************************** * * Connection functions. * ***********************************************************************/ /* * Connect to the Pilot specified by any --port option, respecting the quiet * flag as well. This is basically pilot_connect(), but marginally cleaner. */ extern int plu_connect(void); /*********************************************************************** * * Things to do once you're connected to the handheld. * ***********************************************************************/ /* * Look up a category name. Argument @p info is the category part of the * AppInfo block for the database, while @p name is the category to look up. * Returns the index of the category if found (0..15) or -1 if not. * * The flags passed to findcategory are a bitwise or of enums; the meanings * are: * * NOFLAGS : Match case-sensitive, return -1 if not found, do not * match numbers as category numbers, do not complain. * CASE_INSENSITIVE : Match in a case-insensitive fashion. * DEFAULT_UNFILED : Return 0 (unfiled) instead of -1 on no-match. * MATCH_NUMBERS : Match number strings 0 .. 15 as categories 0 .. 15. * WARN_UNKNOWN : Complain on stderr if category not found. */ typedef enum { PLU_CAT_NOFLAGS = 0, PLU_CAT_CASE_INSENSITIVE = 0x0001, PLU_CAT_DEFAULT_UNFILED = 0x0002, PLU_CAT_MATCH_NUMBERS = 0x0004, PLU_CAT_WARN_UNKNOWN = 0x0008 } plu_findcategory_flags_t; extern int plu_findcategory(const struct CategoryAppInfo *info, const char *name, int flags); typedef struct { /* Numeric parts of the ROM version */ int major, minor, bugfix, build, state; /* Textual representation of same: xxx.xx.xx-xxxxx */ char name[16]; } plu_romversion_t; /* * Retrieve the ROM version from the Palm; returns -1 on failure, 0 * otherwise and fills the fields of the @p d structure. */ extern int plu_getromversion(int sd, plu_romversion_t *d); /*********************************************************************** * * File-handling functions on the PC. * ***********************************************************************/ /* * Function: protect_files * * Summary: Adjust output file name so as to not overwrite an exsisting * file. * * Parameters: name <-> buffer for filename * extension --> file extension to add to name * namelength --> size of buffer * * Returns: 1 file name protected (and stored in buffer name) * 0 no alernate name found * -1 other failure * */ int plu_protect_files(char *name, const char *extension, const size_t namelength); /* * We need to be able to refer to the table of common options. */ extern struct poptOption plu_common_options[]; extern int plu_quiet; extern char *plu_port; extern int plu_timeout; #endif /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/include/Makefile.am0000644000175000017500000000160011206417270020554 0ustar rousseaurousseau# Makefile for pilot-link headers c_headers = \ pi-address.h \ pi-appinfo.h \ pi-args.h \ pi-blob.h \ pi-bluetooth.h \ pi-buffer.h \ pi-calendar.h \ pi-cmp.h \ pi-contact.h \ pi-datebook.h \ pi-debug.h \ pi-dlp.h \ pi-error.h \ pi-expense.h \ pi-file.h \ pi-foto.h \ pi-header.h \ pi-hinote.h \ pi-inet.h \ pi-location.h \ pi-macros.h \ pi-mail.h \ pi-md5.h \ pi-memo.h \ pi-money.h \ pi-net.h \ pi-notepad.h \ pi-padp.h \ pi-palmpix.h \ pi-serial.h \ pi-slp.h \ pi-sockaddr.h \ pi-socket.h \ pi-source.h \ pi-sync.h \ pi-sys.h \ pi-syspkt.h \ pi-threadsafe.h \ pi-todo.h \ pi-usb.h \ pi-util.h \ pi-veo.h \ pi-versamail.h \ pi-version.h c_privheaders = \ pi-userland.h \ pi-version.h.in c_header_DATA = $(c_headers) c_headerdir=$(includedir) EXTRA_DIST = \ $(c_headers) \ $(c_privheaders) pilot-link-0.12.5-dfsg/include/pi-md5.h.in0000644000175000017500000000205611333433271020377 0ustar rousseaurousseau/* * $Id: pi-md5.h.in,v 1.1 2008/11/06 01:14:13 judd Exp $ * * pi-md5.h: Header file for Colin Plumb's MD5 implementation. * Modified by Ian Jackson so as not to use Colin Plumb's * 'usuals.h'. * * Originally intended to be used for Palm password support * * This file is in the public domain. */ #ifndef MD5_H #define MD5_H #undef HAVE_INTTYPES_H #undef HAVE_STDINT_H #if HAVE_INTTYPES_H #include #endif #if HAVE_STDINT_H #include #endif #ifdef HAVE_INTTYPES_H || HAVE_STDINT_H #define UINT8 uint8_t #define UINT32 uint32_t #else #define UINT8 unsigned char #define UINT32 unsigned int #endif struct MD5Context { UINT32 buf[4]; UINT32 bytes[2]; UINT32 in[16]; }; void MD5Init(struct MD5Context *context); void MD5Update(struct MD5Context *context, UINT8 const *buf, unsigned len); void MD5Final(unsigned char digest[16], struct MD5Context *context); void MD5Transform(UINT32 buf[4], UINT32 const in[16]); void byteSwap(UINT32 * buf, unsigned words); #endif /* !MD5_H */ pilot-link-0.12.5-dfsg/include/pi-slp.h0000644000175000017500000000472710515154567020123 0ustar rousseaurousseau/* * $Id: pi-slp.h,v 1.21 2006/10/17 13:24:07 desrod Exp $ * * pi-slp.h: Palm Serial Link Protocol support * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_PADP_SLP_H_ #define _PILOT_PADP_SLP_H_ #include "pi-args.h" #include "pi-buffer.h" #ifdef __cplusplus extern "C" { #endif #define PI_SLP_HEADER_LEN 10 #define PI_SLP_FOOTER_LEN 2 #define PI_SLP_MTU 0xffff #define PI_SLP_SIG_BYTE1 0xbe #define PI_SLP_SIG_BYTE2 0xef #define PI_SLP_SIG_BYTE3 0xed #define PI_SLP_OFFSET_SIG1 0 #define PI_SLP_OFFSET_SIG2 1 #define PI_SLP_OFFSET_SIG3 2 #define PI_SLP_OFFSET_DEST 3 #define PI_SLP_OFFSET_SRC 4 #define PI_SLP_OFFSET_TYPE 5 #define PI_SLP_OFFSET_SIZE 6 #define PI_SLP_OFFSET_TXID 8 #define PI_SLP_OFFSET_SUM 9 #define PI_SLP_SOCK_DBG 0x00 #define PI_SLP_SOCK_CON 0x01 #define PI_SLP_SOCK_RUI 0x02 #define PI_SLP_SOCK_DLP 0x03 #define PI_SLP_TYPE_RDCP 0x00 #define PI_SLP_TYPE_PADP 0x02 #define PI_SLP_TYPE_LOOP 0x03 struct pi_slp_data { int dest; int last_dest; int src; int last_src; int type; int last_type; unsigned char txid; unsigned char last_txid; }; struct slp { unsigned char _be; unsigned char _ef; unsigned char _ed; unsigned char dest; unsigned char src; unsigned char type; unsigned short dlen; unsigned char id_; unsigned char csum; }; extern pi_protocol_t *slp_protocol PI_ARGS((void)); extern ssize_t slp_tx PI_ARGS((pi_socket_t * ps, PI_CONST unsigned char *buf, size_t len, int flags)); extern ssize_t slp_rx PI_ARGS((pi_socket_t *ps, pi_buffer_t *buf, size_t expect, int flags)); extern void slp_dump_header PI_ARGS((PI_CONST unsigned char *data, int rxtx)); extern void slp_dump PI_ARGS((PI_CONST unsigned char *data)); #ifdef __cplusplus } #endif #endif /* _PILOT_PADP_SLP_H_ */ pilot-link-0.12.5-dfsg/include/pi-dlp.h0000644000175000017500000022756710515154566020114 0ustar rousseaurousseau/* * $Id: pi-dlp.h,v 1.76 2006/10/17 13:24:06 desrod Exp $ * * pi-dlp.h: Desktop Link Protocol implementation (ala SLP) * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** @file pi-dlp.h * @brief Direct protocol interface to the device using the HotSync protocol. * * The DLP layer is the lowest interface layer applications can use to * access a handheld. It provides equivalents to Palm Conduit Development * Kit (CDK)'s SyncXXX functions, as well as a number of convenience * functions that are not found in the CDK. * * Once you have a socket number and a device is connected, you can start * using DLP calls to talk with the device. All DLP calls are @b * synchronous: they are immediately sent to the device and the current * thread is blocked until either a response is received, or an error * occurs. * * It is a good pratice to always check errors returned by DLP calls. * Usually, if the value is nagative, it is an error code. If the error is * #PI_ERR_DLP_PALMOS, an error code was returned by the device itself: you * can get this error code by calling pi_palmos_error() on the current * socket. Besides all the Palm OS error code defined in Palm's * documentation, there are a few values between #dlpErrNoError and * #dlpErrUnknown which are error returned by the DLP layer itself on the * device. * * The DLP protocol is the low level protocol that HotSync uses. Over the * years, there have been several iterations of DLP. Pre-Palm OS 5 devices * have DLP 1.2 or lower. Palm OS 5 devices have DLP 1.3 or 1.4 (Palm OS 5.2 * and up). Cobalt (Palm OS 6) uses DLP 2.1. * * Devices with DLP 1.4 and later are known to support transfers of large * records and resources (of size bigger than 64k). This is the case of the * Tapwave Zodiac, for example. * * Note that some devices report an incorrect version of DLP. Some Palm OS 5 * devices report using DLP 1.2 whereas they really support DLP 1.3. * * Depending on which devices you plan on being compatible with, you should adjust * #PI_DLP_VERSION_MAJOR and #PI_DLP_VERSION_MINOR. If you want to support * devices up to and including Palm OS 5, setting your DLP version to 1.4 is * a good idea. If you want to be able to connect to Palm OS 6, you need to * set your DLP version to 2.1. */ #ifndef _PILOT_DLP_H_ #define _PILOT_DLP_H_ #ifdef __cplusplus extern "C" { #endif #include #include "pi-macros.h" /* For recordid_t */ #include "pi-buffer.h" /* For pi_buffer_t */ #include "pi-error.h" /* For PI_ERR */ /* version of the DLP protocol supported in this version */ /* Hint for existing versions: * 1.2: Palm OS 4 / Palm OS 5 (OS 5 should be 1.3 but incorrectly reports 1.2) * 1.4: TapWave Palm OS 5 * 2.1: Palm OS 6 */ #define PI_DLP_VERSION_MAJOR 1 /**< Major DLP protocol version we report to the device. */ #define PI_DLP_VERSION_MINOR 4 /**< Minor DLP protocol version we report to the device. */ #ifndef SWIG #define DLP_BUF_SIZE 0xffff /**< Kept for compatibility, applications should avoid using this value. */ #endif /* !SWIG */ /** @name Internal definitions used to assemble DLP calls */ /*@{*/ #ifndef SWIG #define PI_DLP_OFFSET_CMD 0 #define PI_DLP_OFFSET_ARGC 1 #define PI_DLP_OFFSET_ARGV 2 #define PI_DLP_ARG_TINY_LEN 0x000000FFL #define PI_DLP_ARG_SHORT_LEN 0x0000FFFFL #define PI_DLP_ARG_LONG_LEN 0xFFFFFFFFL #define PI_DLP_ARG_FLAG_TINY 0x00 #define PI_DLP_ARG_FLAG_SHORT 0x80 #define PI_DLP_ARG_FLAG_LONG 0x40 #define PI_DLP_ARG_FLAG_MASK 0xC0 #define PI_DLP_ARG_FIRST_ID 0x20 #endif /* !SWIG */ /*@}*/ /** @name VFS definitions */ /*@{*/ #define vfsMountFlagsUseThisFileSystem 0x01 /**< Mount/Format the volume with the filesystem specified */ #define vfsMAXFILENAME 256 /**< The maximum size of a filename in a VFS volume */ #define vfsInvalidVolRef 0 /**< constant for an invalid volume reference, guaranteed not to represent a valid one. Use it like you would use NULL for a FILE*. */ #define vfsInvalidFileRef 0L /**< constant for an invalid file reference, guaranteed not to represent a valid one. Use it like you would use NULL for a FILE*. */ /*@}*/ typedef unsigned long FileRef; /**< Type for file references when working with VFS files and directories. */ /** @brief Information retrieved by dlp_VFSDirEntryEnumerate() */ struct VFSDirInfo { unsigned long attr; /**< File or directory attributes (see VSF File attribute definitions) */ char name[vfsMAXFILENAME]; /**< File or directory name */ }; /** @brief Information used to format a volume with dlp_VFSVolumeFormat() */ struct VFSAnyMountParam { unsigned short volRefNum; unsigned short reserved; unsigned long mountClass; }; /** @brief Information used to format a volume with dlp_VFSVolumeFormat() */ struct VFSSlotMountParam { struct VFSAnyMountParam vfsMountParam; unsigned short slotLibRefNum; unsigned short slotRefNum; }; /** @brief Information about a VFS volume, returned by dlp_VFSVolumeInfo() */ struct VFSInfo { /* 0: read-only etc. */ unsigned long attributes; /**< Volume attributes (see #dlpVFSVolumeAttributes enum) */ /* 4: Filesystem type for this volume (defined below). These you can expect to see in devices: 'vfat' (FAT12/FAT16 with long name support) Other values observed: 'twmf' (Tapwave Zodiac internal VFS) PalmSource defines these, but don't bet on device support: 'afsu' (Andrew network filesystem) 'ext2' (Linux ext2 filesystem) 'fats' (FAT12/FAT16 with 8.3 names) 'ffsb' (BSD block-based filesystem) 'hfse' (Macintosh HFS+) 'hfss' (Macintosh HFS, pre-8.x) 'hpfs' (OS/2 High Performance Filesystem) 'mfso' (Original Macintosh filesystem) 'nfsu' (NFS mount) 'novl' (Novell filesystem) 'ntfs' (Windows NT filesystem) */ unsigned long fsType; /**< File system time (four-char code, see above) */ /* 8: Creator code of filesystem driver for this volume. */ unsigned long fsCreator; /**< File system creator (four-char code) */ /* For slot based filesystems: (mountClass = VFSMountClass_SlotDriver) 12: mount class that mounted this volume */ unsigned long mountClass; /**< Mount class */ /* 16: Library on which the volume is mounted */ int slotLibRefNum; /**< Slot library reference number */ /* 18: ExpMgr slot number of card containing volume */ int slotRefNum; /**< Expansion manager slot number */ /* 20: Type of card media (mediaMemoryStick, mediaCompactFlash, etc.) These you can expect to see in devices: 'cfsh' (CompactFlash) 'mmcd' (MultiMedia Card) 'mstk' (Memory Stick) 'sdig' (SD card) Other values observed: 'TFFS' (palmOne Tungsten T5 internal VFS) 'twMF' (Tapwave Zodiac internal VFS) PalmSource also defines these: 'pose' (Host filesystem emulated by POSE) 'PSim' (Host filesystem emulated by Mac Simulator) 'ramd' (RAM disk) 'smed' (SmartMedia) */ unsigned long mediaType; /**< Media type (see above) */ /* 24: reserved for future use (other mountclasses may need more space) */ unsigned long reserved; /**< Reserved, set to 0 */ }; /** @brief Information about the handheld user * * This structure is used in dlp_ReadUserInfo() and dlp_WriteUserInfo() */ struct PilotUser { size_t passwordLength; char username[128]; char password[128]; unsigned long userID; unsigned long viewerID; unsigned long lastSyncPC; time_t successfulSyncDate; time_t lastSyncDate; }; /** @brief Device information. * * This structure is filled by dlp_ReadSysInfo() */ struct SysInfo { unsigned long romVersion; /**< Version of the device ROM, of the form 0xMMmmffssbb where MM=Major, mm=minor, ff=fix, ss=stage, bb=build */ unsigned long locale; /**< Locale for this device */ unsigned char prodIDLength; /**< Length of the prodID string */ char prodID[128]; /**< Product ID */ unsigned short dlpMajorVersion; /**< Major version of the DLP protocol on this device */ unsigned short dlpMinorVersion; /**< Minor version of the DLP protocol on this device */ unsigned short compatMajorVersion; /**< Minimum major version of DLP this device is compatible with */ unsigned short compatMinorVersion; /**< Minimum minor version of DLP this device is compatible with */ unsigned long maxRecSize; /**< Maximum record size. Usually <=0xFFFF or ==0 for older devices (means records are limited to 64k), can be much larger for devices with DLP >= 1.4 (i.e. 0x00FFFFFE) */ }; /** @brief Database information. * * A database information block is returned by dlp_ReadDBList(), dlp_FindDBInfo(), dlp_FindDBByName(), dlp_FindDBByOpenHandle() * and dlp_FindDBByTypeCreator(). */ struct DBInfo { int more; /**< When reading database list using dlp_ReadDBList(), this flag is set if there are more databases to come */ char name[34]; /**< Database name, 32 characters max. */ unsigned int flags; /**< Database flags (@see dlpDBFlags enum) */ unsigned int miscFlags; /**< Additional database flags filled by pilot-link (@see dlpDBMiscFlags enum) */ unsigned int version; /**< Database version number */ unsigned long type; /**< Database type (four-char code, i.e. 'appl') */ unsigned long creator; /**< Database creator (four-char code, i.e. 'DATA') */ unsigned long modnum; /**< Modification count */ unsigned int index; /**< Database index in database list */ time_t createDate; /**< Database creation date (using the machine's local time zone) */ time_t modifyDate; /**< Last time this database was modified (using the machine's local time zone). If the database was never modified, this field is set to 0x83DAC000 (Fri Jan 1 00:00:00 1904 GMT) */ time_t backupDate; /**< Last time this database was backed up using HotSync. If the database was never backed up, this field is set to 0x83DAC000 (Fri Jan 1 00:00:00 1904 GMT) */ }; /** @brief Size information for a database. * * Returned by dlp_FindDBByName(), dlp_FindDBByOpenHandle() and dlp_FindDBByTypeCreator(). */ struct DBSizeInfo { unsigned long numRecords; /**< Number of records or resources */ unsigned long totalBytes; /**< Total number of bytes occupied by the database, including header and records list */ unsigned long dataBytes; /**< Total number of data bytes contained in the database's records or resources */ unsigned long appBlockSize; /**< Size of the appInfo block */ unsigned long sortBlockSize; /**< Size of the sortInfo block */ unsigned long maxRecSize; /**< note: this field is always set to 0 on return from dlp_FindDBxxx */ }; /** @brief Information about a memory card. * * This structure describes a device's internal storage only, not removable media. * It is returned by dlp_ReadStorageInfo(). */ struct CardInfo { int card; /**< Memory card index (most devices only have one). */ int version; /**< Version of the card */ int more; /**< Set if there is another card after this one */ time_t creation; /**< Creation date (using the computer's local time zone) */ unsigned long romSize; /**< Size of the ROM block on this card (in bytes) */ unsigned long ramSize; /**< Size of the RAM block on this card (in bytes) */ unsigned long ramFree; /**< Total free RAM bytes */ char name[128]; /**< Card name */ char manufacturer[128]; /**< Card manufacturer name */ }; /** @brief Network HotSync information. * * Returned by dlp_ReadNetSyncInfo(). Gives the network location of a remote handheld. */ struct NetSyncInfo { int lanSync; /**< Non-zero if LanSync is turned on on the device */ char hostName[256]; /**< Device hostname if any. Null terminated string. */ char hostAddress[40]; /**< Device host address. Null terminated string. */ char hostSubnetMask[40]; /**< Device subnet mask. Null terminated string */ }; #ifndef SWIG /* no need to clutter the bindings with this */ enum dlpFunctions { /* range reserved for internal use */ dlpReservedFunc = 0x0F, /* DLP 1.0 FUNCTIONS START HERE (PalmOS v1.0) */ dlpFuncReadUserInfo, /* 0x10 */ dlpFuncWriteUserInfo, /* 0x11 */ dlpFuncReadSysInfo, /* 0x12 */ dlpFuncGetSysDateTime, /* 0x13 */ dlpFuncSetSysDateTime, /* 0x14 */ dlpFuncReadStorageInfo, /* 0x15 */ dlpFuncReadDBList, /* 0x16 */ dlpFuncOpenDB, /* 0x17 */ dlpFuncCreateDB, /* 0x18 */ dlpFuncCloseDB, /* 0x19 */ dlpFuncDeleteDB, /* 0x1a */ dlpFuncReadAppBlock, /* 0x1b */ dlpFuncWriteAppBlock, /* 0x1c */ dlpFuncReadSortBlock, /* 0x1d */ dlpFuncWriteSortBlock, /* 0x1e */ dlpFuncReadNextModifiedRec, /* 0x1f */ dlpFuncReadRecord, /* 0x20 */ dlpFuncWriteRecord, /* 0x21 */ dlpFuncDeleteRecord, /* 0x22 */ dlpFuncReadResource, /* 0x23 */ dlpFuncWriteResource, /* 0x24 */ dlpFuncDeleteResource, /* 0x25 */ dlpFuncCleanUpDatabase, /* 0x26 */ dlpFuncResetSyncFlags, /* 0x27 */ dlpFuncCallApplication, /* 0x28 */ dlpFuncResetSystem, /* 0x29 */ dlpFuncAddSyncLogEntry, /* 0x2a */ dlpFuncReadOpenDBInfo, /* 0x2b */ dlpFuncMoveCategory, /* 0x2c */ dlpProcessRPC, /* 0x2d */ dlpFuncOpenConduit, /* 0x2e */ dlpFuncEndOfSync, /* 0x2f */ dlpFuncResetRecordIndex, /* 0x30 */ dlpFuncReadRecordIDList, /* 0x31 */ /* DLP 1.1 FUNCTIONS ADDED HERE (PalmOS v2.0 Personal, and Professional) */ dlpFuncReadNextRecInCategory, /* 0x32 */ dlpFuncReadNextModifiedRecInCategory, /* 0x33 */ dlpFuncReadAppPreference, /* 0x34 */ dlpFuncWriteAppPreference, /* 0x35 */ dlpFuncReadNetSyncInfo, /* 0x36 */ dlpFuncWriteNetSyncInfo, /* 0x37 */ dlpFuncReadFeature, /* 0x38 */ /* DLP 1.2 FUNCTIONS ADDED HERE (PalmOS v3.0) */ dlpFuncFindDB, /* 0x39 */ dlpFuncSetDBInfo, /* 0x3a */ /* DLP 1.3 FUNCTIONS ADDED HERE (PalmOS v4.0) */ dlpLoopBackTest, /* 0x3b */ dlpFuncExpSlotEnumerate, /* 0x3c */ dlpFuncExpCardPresent, /* 0x3d */ dlpFuncExpCardInfo, /* 0x3e */ dlpFuncVFSCustomControl, /* 0x3f */ dlpFuncVFSGetDefaultDir, /* 0x40 */ dlpFuncVFSImportDatabaseFromFile, /* 0x41 */ dlpFuncVFSExportDatabaseToFile, /* 0x42 */ dlpFuncVFSFileCreate, /* 0x43 */ dlpFuncVFSFileOpen, /* 0x44 */ dlpFuncVFSFileClose, /* 0x45 */ dlpFuncVFSFileWrite, /* 0x46 */ dlpFuncVFSFileRead, /* 0x47 */ dlpFuncVFSFileDelete, /* 0x48 */ dlpFuncVFSFileRename, /* 0x49 */ dlpFuncVFSFileEOF, /* 0x4a */ dlpFuncVFSFileTell, /* 0x4b */ dlpFuncVFSFileGetAttributes, /* 0x4c */ dlpFuncVFSFileSetAttributes, /* 0x4d */ dlpFuncVFSFileGetDate, /* 0x4e */ dlpFuncVFSFileSetDate, /* 0x4f */ dlpFuncVFSDirCreate, /* 0x50 */ dlpFuncVFSDirEntryEnumerate, /* 0x51 */ dlpFuncVFSGetFile, /* 0x52 */ dlpFuncVFSPutFile, /* 0x53 */ dlpFuncVFSVolumeFormat, /* 0x54 */ dlpFuncVFSVolumeEnumerate, /* 0x55 */ dlpFuncVFSVolumeInfo, /* 0x56 */ dlpFuncVFSVolumeGetLabel, /* 0x57 */ dlpFuncVFSVolumeSetLabel, /* 0x58 */ dlpFuncVFSVolumeSize, /* 0x59 */ dlpFuncVFSFileSeek, /* 0x5a */ dlpFuncVFSFileResize, /* 0x5b */ dlpFuncVFSFileSize, /* 0x5c */ /* DLP 1.4 functions added here (Palm OS 5.2+, ie Tapwave Zodiac) */ dlpFuncExpSlotMediaType, /* 0x5d */ dlpFuncWriteRecordEx, /* 0x5e - function to write >64k records in Tapwave */ dlpFuncWriteResourceEx, /* 0x5f - function to write >64k resources in Tapwave */ dlpFuncReadRecordEx, /* 0x60 - function to read >64k records by index in Tapwave */ dlpFuncUnknown1, /* 0x61 (may be bogus definition in tapwave headers, is listed as dlpFuncReadRecordStream)*/ dlpFuncUnknown3, /* 0x62 */ dlpFuncUnknown4, /* 0x63 */ dlpFuncReadResourceEx, /* 0x64 - function to read resources >64k by index in Tapwave */ dlpLastFunc }; #endif /* !SWIG */ /** @name Database and record attributes */ /*@{*/ /** @brief Database flags in DBInfo structure and also for dlp_CreateDB() */ enum dlpDBFlags { dlpDBFlagResource = 0x0001, /**< Resource database */ dlpDBFlagReadOnly = 0x0002, /**< Database is read only */ dlpDBFlagAppInfoDirty = 0x0004, /**< AppInfo data has been modified */ dlpDBFlagBackup = 0x0008, /**< Database should be backed up during HotSync */ dlpDBFlagHidden = 0x0100, /**< Database is hidden */ dlpDBFlagLaunchable = 0x0200, /**< Database is launchable data (show in Launcher, launch app by Creator) */ dlpDBFlagRecyclable = 0x0400, /**< Database will be deleted shortly */ dlpDBFlagBundle = 0x0800, /**< Database is bundled with others having same creator (i.e. for Beam) */ dlpDBFlagOpen = 0x8000, /**< Database is currently open */ /* v2.0 specific */ dlpDBFlagNewer = 0x0010, /**< Newer version may be installed over open DB (Palm OS 2.0 and later) */ dlpDBFlagReset = 0x0020, /**< Reset after installation (Palm OS 2.0 and later) */ /* v3.0 specific */ dlpDBFlagCopyPrevention = 0x0040, /**< Database should not be beamed or sent (Palm OS 3.0 and later) */ dlpDBFlagStream = 0x0080, /**< Database is a file stream (Palm OS 3.0 and later) */ /* OS 6+ */ dlpDBFlagSchema = 0x1000, /**< Schema database (Palm OS 6.0 and later) */ dlpDBFlagSecure = 0x2000, /**< Secure database (Palm OS 6.0 and later) */ dlpDBFlagExtended = dlpDBFlagSecure, /**< Set if Schema not set and DB is Extended (Palm OS 6.0 and later) */ dlpDBFlagFixedUp = 0x4000 /**< Temp flag used to clear DB on write (Palm OS 6.0 and later) */ }; /** @brief Misc. flags in DBInfo structure */ enum dlpDBMiscFlags { dlpDBMiscFlagExcludeFromSync = 0x80, /**< DLP 1.1 and later: exclude this database from sync */ dlpDBMiscFlagRamBased = 0x40 /**< DLP 1.2 and later: this database is in RAM */ }; /** @brief Database record attributes */ enum dlpRecAttributes { dlpRecAttrDeleted = 0x80, /**< Tagged for deletion during next sync */ dlpRecAttrDirty = 0x40, /**< Record modified */ dlpRecAttrBusy = 0x20, /**< Record locked (in use) */ dlpRecAttrSecret = 0x10, /**< Record is secret */ dlpRecAttrArchived = 0x08 /**< Tagged for archival during next sync */ }; /** @brief Mode flags used in dlp_OpenDB() */ enum dlpOpenFlags { dlpOpenRead = 0x80, /**< Open database for reading */ dlpOpenWrite = 0x40, /**< Open database for writing */ dlpOpenExclusive = 0x20, /**< Open database with exclusive access */ dlpOpenSecret = 0x10, /**< Show secret records */ dlpOpenReadWrite = 0xC0 /**< Open database for reading and writing (equivalent to (#dlpOpenRead | #dlpOpenWrite)) */ }; /** @brief Flags passed to dlp_ReadDBList() */ enum dlpDBList { dlpDBListRAM = 0x80, /**< List RAM databases */ dlpDBListROM = 0x40, /**< List ROM databases */ dlpDBListMultiple = 0x20 /**< DLP 1.2 and above: list as many databases as possible at once */ }; enum dlpFindDBOptFlags { dlpFindDBOptFlagGetAttributes = 0x80, dlpFindDBOptFlagGetSize = 0x40, dlpFindDBOptFlagMaxRecSize = 0x20 }; enum dlpFindDBSrchFlags { dlpFindDBSrchFlagNewSearch = 0x80, dlpFindDBSrchFlagOnlyLatest = 0x40 }; /*@}*/ /** @brief End status values for dlp_EndOfSync() */ enum dlpEndStatus { dlpEndCodeNormal = 0, /**< Normal termination */ dlpEndCodeOutOfMemory, /**< End due to low memory on device */ dlpEndCodeUserCan, /**< Cancelled by user */ dlpEndCodeOther /**< dlpEndCodeOther and higher == "Anything else" */ }; /** @name Expansion manager and VFS manager constants */ /*@{*/ /** @brief Expansion card capabilities, as returned by dlp_ExpCardInfo() */ enum dlpExpCardCapabilities { dlpExpCapabilityHasStorage = 0x00000001, /**< Card supports reading (and maybe writing) */ dlpExpCapabilityReadOnly = 0x00000002, /**< Card is read-only */ dlpExpCapabilitySerial = 0x00000004 /**< Card supports dumb serial interface */ }; /** @brief VFS volume attributes as found in the @a attributes member of a VFSInfo structure */ enum dlpVFSVolumeAttributes { vfsVolAttrSlotBased = 0x00000001, /**< Volume is inserted is an expansion slot */ vfsVolAttrReadOnly = 0x00000002, /**< Volume is read-only */ vfsVolAttrHidden = 0x00000004 /**< Volume is hidden */ }; /** @brief Constants for dlp_VFSFileSeek() */ enum dlpVFSSeekConstants { vfsOriginBeginning = 0, /**< From the beginning (first data byte of file) */ vfsOriginCurrent = 1, /**< from the current position */ vfsOriginEnd = 2 /**< From the end of file (one position beyond last data byte, only negative offsets are legally allowed) */ }; /** @brief Flags for dlp_VFSFileOpen() */ enum dlpVFSOpenFlags { dlpVFSOpenExclusive = 0x01, /**< For dlp_VFSFileOpen(). Exclusive access */ dlpVFSOpenRead = 0x02, /**< For dlp_VFSFileOpen(). Read only */ dlpVFSOpenWrite = 0x05, /**< For dlp_VFSFileOpen(). Write only. Implies exclusive */ dlpVFSOpenReadWrite = 0x07, /**< For dlp_VFSFileOpen(). Read | write */ /* Remainder are aliases and special cases not for VFSFileOpen */ vfsModeExclusive = dlpVFSOpenExclusive, /**< Alias to #dlpVFSOpenExclusive */ vfsModeRead = dlpVFSOpenRead, /**< Alias to #dlpVFSOpenRead */ vfsModeWrite = dlpVFSOpenWrite, /**< Alias to #dlpVFSOpenWrite */ vfsModeReadWrite = vfsModeRead | vfsModeWrite, /**< Alias to #dlpVFSOpenReadWrite */ vfsModeCreate = 0x08 /**< Not for dlp_VFSFileOpen(). Create file if it doesn't exist. */, vfsModeTruncate = 0x10 /**< Not for dlp_VFSFileOpen(). Truncate to 0 bytes on open. */, vfsModeLeaveOpen = 0x20 /**< Not for dlp_VFSFileOpen(). Leave file open even if foreground task closes. */ } ; /** @brief VFS file attribute constants */ enum dlpVFSFileAttributeConstants { vfsFileAttrReadOnly = 0x00000001, /**< File is read only */ vfsFileAttrHidden = 0x00000002, /**< File is hidden */ vfsFileAttrSystem = 0x00000004, /**< File is a system file */ vfsFileAttrVolumeLabel = 0x00000008, /**< File is the volume label */ vfsFileAttrDirectory = 0x00000010, /**< File is a directory */ vfsFileAttrArchive = 0x00000020, /**< File is archived */ vfsFileAttrLink = 0x00000040 /**< File is a link to another file */ }; /** @brief Constants for dlp_VFSFileGetDate() and dlp_VFSFileSetDate() */ enum dlpVFSDateConstants { vfsFileDateCreated = 1, /**< The date the file was created. */ vfsFileDateModified = 2, /**< The date the file was last modified. */ vfsFileDateAccessed = 3 /**< The date the file was last accessed. */ }; /** @brief VFS file iterator constants */ enum dlpVFSFileIteratorConstants { vfsIteratorStart = 0, /** < Indicates that iterator is beginning */ vfsIteratorStop = -1 /**< Indicate that iterator has gone through all items */ }; /*@}*/ /** @brief Error codes returned by DLP transactions * * After a DLP transaction, there may be a DLP or Palm OS error * if the result code is #PI_ERR_DLP_PALMOS. In this case, use * pi_palmos_error() to obtain the error code. It can be in the * DLP error range (0 > error < #dlpErrLastError), or otherwise * in the Palm OS error range (see Palm OS header files for * definitions, in relation with each DLP call) */ enum dlpErrors { dlpErrNoError = 0, /**< No error */ dlpErrSystem, /**< System error (0x0001) */ dlpErrIllegalReq, /**< Illegal request, not supported by this version of DLP (0x0002) */ dlpErrMemory, /**< Not enough memory (0x0003) */ dlpErrParam, /**< Invalid parameter (0x0004) */ dlpErrNotFound, /**< File, database or record not found (0x0005) */ dlpErrNoneOpen, /**< No file opened (0x0006) */ dlpErrAlreadyOpen, /**< File already open (0x0007) */ dlpErrTooManyOpen, /**< Too many open files (0x0008) */ dlpErrExists, /**< File already exists (0x0009) */ dlpErrOpen, /**< Can't open file (0x000a) */ dlpErrDeleted, /**< File deleted (0x000b) */ dlpErrBusy, /**< Record busy (0x000c) */ dlpErrNotSupp, /**< Call not supported (0x000d) */ dlpErrUnused1, /**< @e Unused (0x000e) */ dlpErrReadOnly, /**< File is read-only (0x000f) */ dlpErrSpace, /**< Not enough space left on device (0x0010) */ dlpErrLimit, /**< Limit reached (0x0011) */ dlpErrSync, /**< Sync error (0x0012) */ dlpErrWrapper, /**< Wrapper error (0x0013) */ dlpErrArgument, /**< Invalid argument (0x0014) */ dlpErrSize, /**< Invalid size (0x0015) */ dlpErrUnknown = 127 /**< Unknown error (0x007F) */ }; #ifndef SWIG /* no need to clutter the bindings with this */ /** @brief Internal DLP argument structure */ struct dlpArg { int id_; /**< Argument ID (start at #PI_DLP_ARG_FIRST_ID) */ size_t len; /**< Argument length */ char *data; /**< Argument data */ }; /** @brief Internal DLP command request structure */ struct dlpRequest { enum dlpFunctions cmd; /**< Command ID */ int argc; /**< Number of arguments */ struct dlpArg **argv; /**< Ptr to arguments */ }; /** @brief Internal DLP command response structure */ struct dlpResponse { enum dlpFunctions cmd; /**< Command ID as returned by device. If not the same than requested command, this is an error */ enum dlpErrors err; /**< DLP error (see #dlpErrors enum) */ int argc; /**< Number of response arguments */ struct dlpArg **argv; /**< Response arguments */ }; #endif /* !SWIG */ /* @name Functions used internally by dlp.c */ /*@{*/ #ifndef SWIG /* don't export these functions to bindings */ extern struct dlpArg * dlp_arg_new PI_ARGS((int id_, size_t len)); extern void dlp_arg_free PI_ARGS((struct dlpArg *arg)); extern int dlp_arg_len PI_ARGS((int argc, struct dlpArg **argv)); extern struct dlpRequest *dlp_request_new PI_ARGS((enum dlpFunctions cmd, int argc, ...)); extern struct dlpRequest * dlp_request_new_with_argid PI_ARGS((enum dlpFunctions cmd, int argid, int argc, ...)); extern void dlp_request_free PI_ARGS((struct dlpRequest *req)); extern struct dlpResponse *dlp_response_new PI_ARGS((enum dlpFunctions cmd, int argc)); extern ssize_t dlp_response_read PI_ARGS((struct dlpResponse **res, int sd)); extern ssize_t dlp_request_write PI_ARGS((struct dlpRequest *req, int sd)); extern void dlp_response_free PI_ARGS((struct dlpResponse *req)); extern int dlp_exec PI_ARGS((int sd, struct dlpRequest *req, struct dlpResponse **res)); extern char *dlp_errorlist[]; extern char *dlp_strerror(int error); struct RPC_params; extern int dlp_RPC PI_ARGS((int sd, struct RPC_params * p, unsigned long *result)); #endif /* !SWIG */ /*@}*/ /** @name DLP library functions */ /*@{*/ /** @brief Set the version of the DLP protocol we report to the device. * * During the handshake phase, the device and the desktop exchange the * version of the DLP protocol both support. If the device's DLP version * is higher than the desktop's, the device usually refuses to connect. * * @note Call this function prior to accepting or initiating a connection. * * @param major Protocol major version * @param minor Protocol minor version */ extern void dlp_set_protocol_version PI_ARGS((int major, int minor)); /** @brief Convert a Palm OS date to a local date * * Local dates are using the local machine's timezone. If the Palm OS date * is undefined, the local date is set to @c 0x83DAC000 (Fri Jan 1 00:00:00 1904 GMT) * * @param timeDateData Ptr to a time/date data block returned by Palm OS * @return converted date */ extern time_t dlp_ptohdate PI_ARGS((PI_CONST unsigned char *timeDateData)); /** @brief Convert a date to Palm OS date * * If the local date is @c 0x83DAC000 (Fri Jan 1 00:00:00 1904 GMT) the Palm OS date * is set to undefined. Otherwise the date is converted from local time to Palm OS * * @param palm_time The date to convert * @param timeDateData Ptr to an 8 byte buffer to hold the Palm OS date */ extern void dlp_htopdate PI_ARGS((time_t palm_time, unsigned char *timeDateData)); /*@}*/ /** @name System functions */ /*@{*/ /** @brief Get the time from the device and return it as a local time_t value * * @param sd Socket number * @param palm_time Pointer to a time_t to fill * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_GetSysDateTime PI_ARGS((int sd, time_t *palm_time)); /** @brief Set the time on the Palm using a local time_t value. * * @param sd Socket number * @param palm_time New time to set the device to (expressed using the computer's timezone) * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_SetSysDateTime PI_ARGS((int sd, time_t palm_time)); /** @brief Read the system information block * * @param sd Socket number * @param sysinfo Returned system information * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ReadSysInfo PI_ARGS((int sd, struct SysInfo *sysinfo)); /** @brief Read information about internal handheld memory * * @param sd Socket number * @param cardno Card number (zero based) * @param cardinfo Returned information about the memory card. * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ReadStorageInfo PI_ARGS((int sd, int cardno, struct CardInfo *cardinfo)); /** @brief Read the device user information * * @param sd Socket number * @param user Returned user info * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ReadUserInfo PI_ARGS((int sd, struct PilotUser *user)); /** @brief Change the device user information * * @param sd Socket number * @param INPUT New user info * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_WriteUserInfo PI_ARGS((int sd, PI_CONST struct PilotUser *INPUT)); /** @brief Convenience function to reset lastSyncPC in the UserInfo to 0 * * @param sd Socket number * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ResetLastSyncPC PI_ARGS((int sd)); /** @brief Read Network HotSync information * * Supported on Palm OS 2.0 and later. * * @param sd Socket number * @param OUTPUT On return, filled NetSyncInfo structure * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ReadNetSyncInfo PI_ARGS((int sd, struct NetSyncInfo *OUTPUT)); /** @brief Set Network HotSync information * * Supported on Palm OS 2.0 and later * * @param sd Socket number * @param INPUT NetSyncInfo structure to set * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_WriteNetSyncInfo PI_ARGS((int sd, PI_CONST struct NetSyncInfo *INPUT)); /** @brief State that a conduit has started running on the desktop * * Puts up a status message on the device. Calling this method regularly * is also the only reliable way to know whether the user pressed the Cancel * button on the device. * * @param sd Socket number * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_OpenConduit PI_ARGS((int sd)); /** @brief Terminate connection with the device * * Required at the end of a session. The pi_socket layer * will call this for you if you don't. After the device receives this * command, it will terminate the connection. * * @param sd Socket number * @param status End of sync status (see #dlpEndStatus enum) * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_EndOfSync PI_ARGS((int sd, int status)); /** @brief Terminate HotSync _without_ notifying Palm. * * This will cause the Palm to time out, and should (if I remember right) * lose any changes to unclosed databases. _Never_ use under ordinary * circumstances. If the sync needs to be aborted in a reasonable * manner, use EndOfSync with a non-zero status. * * @param sd Socket number * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_AbortSync PI_ARGS((int sd)); /** @brief Read a Feature from the device * * @param sd Socket number * @param creator Feature creator * @param num Feature number * @param feature On return, the feature value * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ReadFeature PI_ARGS((int sd, unsigned long creator, int num, unsigned long *feature)); /** @brief Emulation of the SysGetROMToken function on the device * * Supported on Palm OS 2.0 through 4.0. Using this function * is not recommended. * * @warning This function uses 68K RPC calls to perform its duty, * and is therefore not supported on devices running Palm OS 5.0 * and later. Actually, it may even crash the device. * * @param sd Socket number * @param token ROM token to read * @param databuf Buffer to store the token data in * @param datasize Size of data to read * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_GetROMToken PI_ARGS((int sd, unsigned long token, void *databuf, size_t *datasize)); /** @brief Add an entry into the HotSync log on the device * * Move to the next line with \\n, as usual. You may invoke this * command once or more before calling dlp_EndOfSync(), but it is * not required. * * @param sd Socket number * @param string Nul-terminated string with the text to insert in the log * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_AddSyncLogEntry PI_ARGS((int sd, char *string)); /** @brief Call an application on the device * * 32-bit retcode and data over 64k only supported on Palm OS 2.0 and later. * * This function allows calling an application (or any PRC that responds * to launch codes) using a custom launch code and custom data. The * application can return data too, using DlkControl() and the * dlkCtlSendCallAppReply selector. See Palm OS documentation for more * information. * * @param sd Socket number * @param creator Creator code of the application to call * @param type Type code of the application to call * @param action Launch code to send to the application * @param datasize Length of data block to pass to the application * @param databuf Data block to pass to the application * @param retcode On return, result code returned by the application * @param retbuf Buffer allocated using pi_buffer_new(). On return contains the data returned by the application * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_CallApplication PI_ARGS((int sd, unsigned long creator, unsigned long type, int action, size_t datasize, PI_CONST void *databuf, unsigned long *retcode, pi_buffer_t *retbuf)); /** @brief Convenience function to ead an app preference data block * * Supported on Palm OS 2.0 and later, emulated for Palm OS 1.x. * * @param sd Socket number * @param creator Application creator * @param prefid Preference ID * @param backup If set, read from backup prefs (see Palm OS documentation). This flag is ignored on Palm OS 1.x. * @param maxsize Maximum size of the data to return in buffer * @param databuf If not NULL, buffer should be of size @p maxsize. On return, contains the preference data * @param datasize If not NULL, on return contains the size of the preference data block * @param version If not NULL * @return A negative value if an error occured (see pi-error.h), otherwise the size of the preference block */ extern PI_ERR dlp_ReadAppPreference PI_ARGS((int sd, unsigned long creator, int prefid, int backup, int maxsize, void *databuf, size_t *datasize, int *version)); /** @brief Write an app preference data block * * Supported on Palm OS 2.0 and later. Emulated on Palm OS 1.x. * * @param sd Socket number * @param creator Application creator * @param prefid Preference ID * @param backup If set, write to backup prefs (see Palm OS documentation). This flag is ignored on Palm OS 1.x. * @param version Version of the pref to write * @param databuf Ptr to the data to write * @param datasize Size of the data to write * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_WriteAppPreference PI_ARGS((int sd, unsigned long creator, int prefid, int backup, int version, PI_CONST void *databuf, size_t datasize)); /** @brief Require reboot of device after HotSync terminates * * @param sd Socket number * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ResetSystem PI_ARGS((int sd)); /*@}*/ /** @name Database access functions */ /*@{*/ /** @brief Read the database list from the device * * The database list can be read either one database at a time (slower), * or passing ::dlpDBListMultiple in the @p flags member. Pass ::dlpDBListRAM * in @p flags to get the list of databases in RAM, and ::dlpDBListROM to get * the list of databases in ROM. You can mix flags to obtain the desired * result. Passing ::dlpDBListMultiple will return several DBInfo * structures at once (usually 20). Use (info->used / sizeof(DBInfo)) to * know how many database information blocks were returned. * For the next call, pass the last DBInfo->index value + 1 to start to * the next database. @n @n * When all the database informations have been retrieved, this function returns * #PI_ERR_DLP_PALMOS and pi_palmos_error() returns #dlpErrNotFound. * * @param sd Socket number * @param cardno Card number (should be 0) * @param flags Flags (see #dlpDBList enum) * @param start Index of first database to list (zero based) * @param dblist Buffer filled with one or more DBInfo structure * @return A negative value if an error occured or the DB list is exhausted (see pi-error.h) * */ extern PI_ERR dlp_ReadDBList PI_ARGS((int sd, int cardno, int flags, int start, pi_buffer_t *dblist)); /** @brief Find a database by name * * Supported on Palm OS 3.0 (DLP 1.2) and later. * * @param sd Socket number * @param cardno Memory card number (usually 0) * @param dbname Database name * @param localid If not NULL, on return contains the LocalID of the database if it was found * @param dbhandle If not NULL, on return contains the handle of the database if it is currently open * @param dbInfo If not NULL, on return contains information about the database * @param dbSize If not NULL, on return contains information about the database size * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_FindDBByName PI_ARGS((int sd, int cardno, PI_CONST char *dbname, unsigned long *localid, int *dbhandle, struct DBInfo *dbInfo, struct DBSizeInfo *dbSize)); /** @brief Get information about an open database * * Supported on Palm OS 3.0 (DLP 1.2) and later. * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param cardno If not NULL, on return contains the cardno of the memory card the database resides on * @param localid If not NULL, on return contains the LocalID of the database * @param dbInfo If not NULL, on return contains information about the database * @param dbSize If not NULL, on return contains information about the database size * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_FindDBByOpenHandle PI_ARGS((int sd, int dbhandle, int *cardno, unsigned long *localid, struct DBInfo *dbInfo, struct DBSizeInfo *dbSize)); /** @brief Find databases by type and/or creator * * Supported on Palm OS 3.0 (DLP 1.2) and later. To look for multiple databases, * make a first call with @p start set to 1, then subsequent calls with @p start set to 0 * until no more database is found. * * @param sd Socket number * @param type If not 0, type code to look for * @param creator If not 0, creator code to look for * @param start If set, start a new search * @param latest If set, returns the database with the latest version if there are several identical databases * @param cardno If not NULL, on return contains the memory card number the database resides on * @param localid If not NULL, on return contains the LocalID of the database * @param dbhandle If not NULL, on return contains the handle of the database if it is currently open * @param dbInfo If not NULL, on return contains information about the database * @param dbSize If not NULL, on return contains information about the database size * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_FindDBByTypeCreator PI_ARGS((int sd, unsigned long type, unsigned long creator, int start, int latest, int *cardno, unsigned long *localid, int *dbhandle, struct DBInfo *dbInfo, struct DBSizeInfo *dbSize)); /** @brief Look for a database on the device * * This function does not match any DLP layer function, but is * intended as a shortcut for programs looking for databases. It * uses a fairly byzantine mechanism for ordering the RAM databases * before the ROM ones. You must feed the @a index slot from the * returned info in @p start the next time round. * * @param sd Socket number * @param cardno Card number (should be 0) * @param start Index of first database to list (zero based) * @param dbname If not NULL, look for a database with this name * @param type If not 0, matching database must have this type * @param creator If not 0, matching database must have this creator code * @param OUTPUT Returned database information on success * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_FindDBInfo PI_ARGS((int sd, int cardno, int start, PI_CONST char *dbname, unsigned long type, unsigned long creator, struct DBInfo *OUTPUT)); /** @brief Open a database on the Palm. * * @param sd Socket number * @param cardno Card number (should be 0) * @param mode Open mode (see #dlpOpenFlags enum) * @param dbname Database name * @param dbhandle Returned database handle to use if other calls like dlp_CloseDB() * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_OpenDB PI_ARGS((int sd, int cardno, int mode, PI_CONST char *dbname, int *dbhandle)); /** @brief Close an opened database * * @param sd Socket number * @param dbhandle The DB handle returned by dlp_OpenDB() * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_CloseDB PI_ARGS((int sd, int dbhandle)); /** @brief Close all opened databases * * @param sd Socket number * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_CloseDB_All PI_ARGS((int sd)); /** @brief Delete an existing database from the device * * @param sd Socket number * @param cardno Card number (should be 0) * @param dbname Database name * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_DeleteDB PI_ARGS((int sd, int cardno, PI_CONST char *dbname)); /** @brief Create database on the device * * After creation, the database is open and ready for use. You should * call dlp_CloseDB() once you're done with the database. * * @param sd Socket number * @param creator Creator code for the new database (four-char code) * @param type Type code for the new database (four-char code) * @param cardno Card number (should be 0) * @param flags Database flags (see #dlpDBFlags enum) * @param version Database version number * @param dbname Database name * @param dbhandle On return, DB handle to pass to other calls like dlp_CloseDB() * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_CreateDB PI_ARGS((int sd, unsigned long creator, unsigned long type, int cardno, int flags, unsigned int version, PI_CONST char *dbname, int *dbhandle)); /** @brief Return the number of records in an opened database. * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param numrecs On return, number of records in the database * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ReadOpenDBInfo PI_ARGS((int sd, int dbhandle, int *numrecs)); /** @brief Change information for an open database * * Supported on Palm OS 3.0 (DLP 1.2) and later. * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param flags Flags to set for this database (see #dlpDBFlags enum) * @param clearFlags Flags to clear for this database (see #dlpDBFlags enum) * @param version Version of this database * @param createDate Creation date of this database * @param modifyDate Modification date of this database (use @c 0x83DAC000 to unset) * @param backupDate Last backup date of this database (use @c 0x83DAC000 to unset) * @param type Database type code (four-char code) * @param creator Database creator code (four-char code) * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_SetDBInfo PI_ARGS((int sd, int dbhandle, int flags, int clearFlags, unsigned int version, time_t createDate, time_t modifyDate, time_t backupDate, unsigned long type, unsigned long creator)); /** @brief Delete a category from a database * * Any record in that category will be moved to the Unfiled category. * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param category Category to delete * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_DeleteCategory PI_ARGS((int sd, int dbhandle, int category)); /** @brief Move all records from a category to another category * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param fromcat Category to move from (0-15) * @param tocat Category to move to (0-15) * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_MoveCategory PI_ARGS((int sd, int dbhandle, int fromcat, int tocat)); /** @brief Read a database's AppInfo block * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param offset Offset to start reading from (0 based) * @param reqbytes Number of bytes to read (pass -1 to read all data from @p offset to the end of the AppInfo block) * @param retbuf Buffer allocated using pi_buffer_new(). On return contains the data from the AppInfo block * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ReadAppBlock PI_ARGS((int sd, int dbhandle, int offset, int reqbytes, pi_buffer_t *retbuf)); /** @brief Write a database's AppInfo block * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param databuf Pointer to the new AppInfo data. * @param datasize Length of the new AppInfo data. If 0, the AppInfo block is removed. * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_WriteAppBlock PI_ARGS((int sd, int dbhandle, PI_CONST void *databuf, size_t datasize)); /** @brief Read a database's SortInfo block * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param offset Offset to start reading from (0 based) * @param reqbytes Number of bytes to read (pass -1 to read all data from @p offset to the end of the SortInfo block) * @param retbuf Buffer allocated using pi_buffer_new(). On return contains the data from the SortInfo block * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ReadSortBlock PI_ARGS((int sd, int dbhandle, int offset, int reqbytes, pi_buffer_t *retbuf)); /** @brief Write a database's SortInfo block * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param databuf Pointer to the new SortInfo data. * @param datasize Length of the new SortInfo data. If 0, the SortInfo block is removed. * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_WriteSortBlock PI_ARGS((int sd, int dbhandle, PI_CONST void *databuf, size_t datasize)); /** @brief Clean up a database by removing deleted/archived records * * Delete all records in the opened database which are marked as * archived or deleted. * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_CleanUpDatabase PI_ARGS((int sd, int dbhandle)); /** @brief Reset dirty record flags, update sync time * * For record databases, reset all dirty flags. For both record and * resource databases, set the last sync time to now. * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ResetSyncFlags PI_ARGS((int sd, int dbhandle)); /** @brief Reset the nextRecord position used in dlp_ReadNextRecInCategory() * * This resets the nextRecord both internally and on the device. * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ResetDBIndex PI_ARGS((int sd, int dbhandle)); /** @brief Read the list of record IDs from an open database * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param sort If non-zero, the on-device application with the same DB creator will be called to re-sort the records prior to returning the list * @param start Index of first record ID to return (zero based) * @param max Maximum number of record IDs to return * @param recuids On return, @p count record UIDs * @param count On return, the number of record IDs found in @p IDs * @return A negative value if an error occured (see pi-error.h) */ #ifndef SWIG /* bindings provide a native implementation */ extern PI_ERR dlp_ReadRecordIDList PI_ARGS((int sd, int dbhandle, int sort, int start, int max, recordid_t *recuids, int *count)); #endif /** @brief Read a record using its unique ID * * Read a record identified by its unique ID. Make sure you only * request records that effectively exist in the database (use * dlp_ReadRecordIDList() to retrieve the unique IDs of all records * in the database). * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param recuid Record unique ID * @param retbuf If not NULL, a buffer allocated using pi_buffer_new(). On return, contains the record contents * @param recindex If not NULL, contains the record index on return. * @param recattrs If not NULL, contains the record attributes on return. * @param category If not NULL, contains the record category on return. * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ReadRecordById PI_ARGS((int sd, int dbhandle, recordid_t recuid, pi_buffer_t *retbuf, int *recindex, int *recattrs, int *category)); /** @brief Read a record using its index * * Read a record by record index (zero-based). Make sure you only * request records within the bounds of database records * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param recindex Record index (zero based) * @param retbuf If not NULL, a buffer allocated using pi_buffer_new(). On return, contains the record contents * @param recuid If not NULL, contains the record UID on return. * @param recattrs If not NULL, contains the record attributes on return. * @param category If not NULL, contains the record category on return. * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ReadRecordByIndex PI_ARGS((int sd, int dbhandle, int recindex, pi_buffer_t *retbuf, recordid_t *recuid, int *recattrs, int *category)); /** @brief Iterate through modified records in database * * Return subsequent modified records on each call. Use dlp_ResetDBIndex() * prior to starting iterations. Once all the records have been seen, * this function returns PI_ERR_DLP_PALMOS and pi_palmos_error() returns * #dlpErrNotFound. * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param retbuf If not NULL, a buffer created using pi_buffer_new(). Buffer is cleared first using pi_buffer_clear(). On return, contains the record data * @param recuid If not NULL, contains the record unique ID on return * @param recindex If not NULL, contains the record index on return * @param recattrs If not NULL, contains the record attributes on return (see #dlpRecAttributes enum) * @param category If not NULL, contains the record category on return * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ReadNextModifiedRec PI_ARGS((int sd, int dbhandle, pi_buffer_t *retbuf, recordid_t *recuid, int *recindex, int *recattrs, int *category)); /** @brief Iterate through modified records in category * * Return subsequent modified records on each call. Use dlp_ResetDBIndex() * prior to starting iterations. Once all the records have been seen, * this function returns PI_ERR_DLP_PALMOS and pi_palmos_error() returns * #dlpErrNotFound. * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param category The category to iterate into * @param retbuf If not NULL, a buffer created using pi_buffer_new(). Buffer is cleared first using pi_buffer_clear(). On return, contains the record data * @param recuid If not NULL, contains the record unique ID on return * @param recindex If not NULL, contains the record index on return * @param recattrs If not NULL, contains the record attributes on return (see #dlpRecAttributes enum) * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ReadNextModifiedRecInCategory PI_ARGS((int sd, int dbhandle, int category, pi_buffer_t *retbuf, recordid_t *recuid, int *recindex, int *recattrs)); /** @brief Iterate through records in category * * Return subsequent records on each call. Use dlp_ResetDBIndex() * prior to starting iterations. Once all the records have been seen, * this function returns PI_ERR_DLP_PALMOS and pi_palmos_error() returns * #dlpErrNotFound. * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param category The category to iterate into * @param retbuf If not NULL, a buffer created using pi_buffer_new(). Buffer is cleared first using pi_buffer_clear(). On return, contains the record data * @param recuid If not NULL, contains the record unique ID on return * @param recindex If not NULL, contains the record index on return * @param recattrs If not NULL, contains the record attributes on return (see #dlpRecAttributes enum) * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ReadNextRecInCategory PI_ARGS((int sd, int dbhandle, int category, pi_buffer_t *retbuf, recordid_t *recuid, int *recindex, int *recattrs)); /** @brief Create a new record in a database * * Use this call to add records to a database. On DLP 1.4 and later, you can create records * bigger than 64k. Set the record ID to 0 to have the device generate the record ID itself, * or assign a record ID of your own. Read Palm's documentation for information about * record IDs, as there is a way to indicate which records were created by the desktop and * which ones were created by the device applications. * * If you pass -1 as the data length, the function will treat the data as a string and use * strlen(data)+1 as the data length (that is, the string is written including the * terminating nul character). * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param flags Record attributes (see #dlpRecAttributes enum) * @param recuid Record ID of the new record. If 0, device will generate a new record ID for this record. * @param catid Category of the new record * @param databuf Ptr to record data * @param datasize Record data length * @param newrecuid On return, record ID that was assigned to this record * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_WriteRecord PI_ARGS((int sd, int dbhandle, int flags, recordid_t recuid, int catid, PI_CONST void *databuf, size_t datasize, recordid_t *newrecuid)); /** @brief Delete an existing record from a database * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param all If set, ALL records are deleted from the database. * @param recuid Record ID of record to delete if @p all == 0. * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_DeleteRecord PI_ARGS((int sd, int dbhandle, int all, recordid_t recuid)); /** @brief Read a resource identified by its type and ID * * @note To read resources larger than 64K, you should use dlp_ReadResourceByIndex(). * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param type Type code for the resource (four-char code) * @param resid Resource ID * @param retbuf If not NULL, a buffer allocated using pi_buffer_new(). On return, contains the resource contents * @param resindex If not NULL, on return contains the resource index * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ReadResourceByType PI_ARGS((int sd, int dbhandle, unsigned long type, int resid, pi_buffer_t *retbuf, int *resindex)); /** @brief Read a resource identified by its resource index * * This function supports reading resources larger than 64k on * DLP 1.4 and later (Palm OS 5.2 and later). * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param resindex Resource index * @param retbuf If not NULL, a buffer allocated using pi_buffer_new(). On return, contains the resource contents * @param restype If not NULL, on return contains the resource type * @param resid If not NULL, on return contains the resource ID * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ReadResourceByIndex PI_ARGS((int sd, int dbhandle, unsigned int resindex, pi_buffer_t *retbuf, unsigned long *restype, int *resid)); /** @brief Create a new resource of overwrite an existing one * * This function supports writing resources larger than 64k on * DLP 1.4 and later (Palm OS 5.2 and later). * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param restype Resource type (four-char code) * @param resid Resource ID * @param databuf Ptr to resource data * @param datasize Length of resource data to write * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_WriteResource PI_ARGS((int sd, int dbhandle, unsigned long restype, int resid, PI_CONST void *databuf, size_t datasize)); /** @brief Delete a resource or all resources from a resource file * * @param sd Socket number * @param dbhandle Open database handle, obtained from dlp_OpenDB() * @param all If set, all resources are removed from this database (@p restype and @p resid are ignored) * @param restype Resource type (four-char code) * @param resid Resource ID * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_DeleteResource PI_ARGS((int sd, int dbhandle, int all, unsigned long restype, int resid)); /*@}*/ /** @name Expansion manager functions */ /*@{*/ /** @brief Enumerate expansion slots * * Supported on Palm OS 4.0 and later. Expansion slots are physical slots * present on the device. To check whether a card is inserted in a slot, * use dlp_ExpCardPresent(). * * @param sd Socket number * @param numslots On input, maximum number of slots that can be returned in the slotRefs array. On return, the actual number of slot references returned in @p slotRefs. * @param slotrefs On return, @p numSlots slot references * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ExpSlotEnumerate PI_ARGS((int sd, int *numslots, int *slotrefs)); /** @brief Checks whether a card is inserted in a slot * * Supported on Palm OS 4.0 and later. Returns >=0 if a card * is inserted in the slot. * * @param sd Socket number * @param slotref The slot reference as returned by dlp_ExpSlotEnumerate(). * @return A negative value if an error occured (see pi-error.h), >=0 if a card is inserted */ extern PI_ERR dlp_ExpCardPresent PI_ARGS((int sd, int slotref)); /** @brief Get information about a removable card inserted in an expansion slot * * Supported on Palm OS 4.0 and later. The info strings are returned in a * single malloc()'ed buffer as a suite of nul-terminated string, one * after the other. * * @param sd Socket number * @param slotref The slot reference as returned by dlp_ExpSlotEnumerate(). * @param expflags If not NULL, the card flags (see #dlpExpCardCapabilities enum) * @param numstrings On return, the number of strings found in the @p strings array * @param strings If not NULL, ptr to a char*. If there are strings to return, this function allocates a buffer to hold the strings. You are responsible for free()'ing the buffer once you're done with it. * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ExpCardInfo PI_ARGS((int sd, int slotref, unsigned long *expflags, int *numstrings, char **strings)); /** @brief Return the type of media supported by an expansion slot * * Supported on Palm OS 5.2 and later (DLP 1.4 and later). * * @param sd Socket number * @param slotref The slot reference as returned by dlp_ExpSlotEnumerate(). * @param mediatype On return, the media type * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_ExpSlotMediaType PI_ARGS((int sd, int slotref, unsigned long *mediatype)); /*@}*/ /** @name VFS manager functions */ /*@{*/ /** @brief Returns a list of connected VFS volumes * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param numvols On input, the maximum number of volume references that can be returned. On output, the actual number of volume references * @param volrefs On output, @p numVols volume references * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSVolumeEnumerate PI_ARGS((int sd, int *numvols, int *volrefs)); /** @brief Returns information about a VFS volume * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param volref Volume reference number (obtained from dlp_VFSVolumeEnumerate()) * @param volinfo On return, volume information * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSVolumeInfo PI_ARGS((int sd, int volref, struct VFSInfo *volinfo)); /** @brief Return the label (name) of a VFS volume * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param volref Volume reference number (obtained from dlp_VFSVolumeEnumerate()) * @param len On input, the maximum size of the name buffer. On output, the name length (including the ending nul byte) * @param name On output, the nul-terminated volume name * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSVolumeGetLabel PI_ARGS((int sd, int volref, int *len, char *name)); /** @brief Change the label (name) of a VFS volume * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param volref Volume reference number (obtained from dlp_VFSVolumeEnumerate()) * @param name New volume name * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSVolumeSetLabel PI_ARGS((int sd, int volref, PI_CONST char *name)); /** @brief Return the total and used size of a VFS volume * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param volref Volume reference number (obtained from dlp_VFSVolumeEnumerate()) * @param usedbytes On return, number of bytes used on the volume * @param totalbytes On return, total size of the volume in bytes * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSVolumeSize PI_ARGS((int sd, int volref, long *usedbytes, long *totalbytes)); /** @brief Format a VFS volume * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param fmtflags Format flags (undocumented for now) * @param fsLibRef File system lib ref (undocumented for now) * @param param Slot mount parameters (undocumented for now) * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSVolumeFormat PI_ARGS((int sd, unsigned char fmtflags, int fsLibRef, struct VFSSlotMountParam *param)); /** @brief Get the default storage directory for a given file type * * Supported on Palm OS 4.0 and later. Return the default directory * for a file type. File types as expressed as MIME types, for * example "image/jpeg", or as a simple file extension (i.e. ".jpg") * * @param sd Socket number * @param volref Volume reference number (obtained from dlp_VFSVolumeEnumerate()) * @param name MIME type to get the default directory for * @param dir A buffer to hold the default path * @param len On input, the length of the @p dir buffer. On return, contains the length of the path string (including the nul terminator) * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSGetDefaultDir PI_ARGS((int sd, int volref, PI_CONST char *name, char *dir, int *len)); /** @brief Iterate through the entries in a directory * * Supported on Palm OS 4.0 and later. At the beginning you set * @p dirIterator to #vfsIteratorStart, then call this function * repeatedly until it returns an error code of the iterator becomes * #vfsIteratorStop. * * @bug On some early OS 5 devices like Tungsten T and Sony NX70, NX73 this * call crashes the device. This has been confirmed to be a bug in HotSync on * the device, as tests showed that a regular HotSync conduit does crash the * device with this call too. * * @param sd Socket number * @param dirref Directory reference obtained from dlp_VFSFileOpen() * @param diriterator Ptr to an iterator. Start with #vfsIteratorStart * @param maxitems On input, the max number of VFSDirInfo structures stored in @p dirItems. On output, the actual number of items. * @param diritems Preallocated array that contains a number of VFSDirInfo structures on return. * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSDirEntryEnumerate PI_ARGS((int sd, FileRef dirref, unsigned long *diriterator, int *maxitems, struct VFSDirInfo *diritems)); /** @brief Create a new directory on a VFS volume * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param volref Volume reference number (obtained from dlp_VFSVolumeEnumerate()) * @param path Full path for the directory to create * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSDirCreate PI_ARGS((int sd, int volref, PI_CONST char *path)); /** @brief Import a VFS file to a database on the handheld * * Supported on Palm OS 4.0 and later. The file is converted to a * full fledged database and stored in the handheld's RAM. * * @param sd Socket number * @param volref Volume reference number (obtained from dlp_VFSVolumeEnumerate()) * @param pathname Path of the file to transfer to the handheld * @param cardno On return, card number the database was created on (usually 0) * @param localid On return, LocalID of the database that was created * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSImportDatabaseFromFile PI_ARGS((int sd, int volref, PI_CONST char *pathname, int *cardno, unsigned long *localid)); /** @brief Export a database to a VFS file * * Supported on Palm OS 4.0 and later. The database is converted to a * .prc, .pdb or .pqa file on the VFS volume. * * @param sd Socket number * @param volref Volume reference number (obtained from dlp_VFSVolumeEnumerate()) * @param pathname Path of the file to create on the VFS volume * @param cardno Card number the database resides on (usually 0) * @param localid LocalID of the database to export * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSExportDatabaseToFile PI_ARGS((int sd, int volref, PI_CONST char *pathname, int cardno, unsigned int localid)); /** @brief Create a new file on a VFS volume * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param volref Volume reference number (obtained from dlp_VFSVolumeEnumerate()) * @param pathname Full path of the file to create * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSFileCreate PI_ARGS((int sd, int volref, PI_CONST char *pathname)); /** @brief Open an existing file on a VFS volume * * Supported on Palm OS 4.0 and later. On some devices, it is required to open the * file using the #dlpOpenReadWrite mode to be able to write to it (using * #dlpOpenWrite is not enough). * * @param sd Socket number * @param volref Volume reference number (obtained from dlp_VFSVolumeEnumerate()) * @param path Full path of the file to open * @param mode Open mode flags (see #dlpVFSOpenFlags enum) * @param fileref On return, file reference to the open file * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSFileOpen PI_ARGS((int sd, int volref, PI_CONST char *path, int mode, FileRef *fileref)); /** @brief Close an open VFS file * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param fileref File reference obtained from dlp_VFSFileOpen() * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSFileClose PI_ARGS((int sd, FileRef fileref)); /** @brief Write data to an open file * * Supported on Palm OS 4.0 and later. Will return the number of bytes * written if successful. * * @param sd Socket number * @param fileref File reference obtained from dlp_VFSFileOpen() * @param databuf Ptr to the data to write * @param datasize Length of the data to write * @return A negative value if an error occured (see pi-error.h), the number of bytes written otherwise. */ extern PI_ERR dlp_VFSFileWrite PI_ARGS((int sd, FileRef fileref, PI_CONST void *databuf, size_t datasize)); /** @brief Read data from an open file * * Supported on Palm OS 4.0 and later. Will return the total number of bytes * actually read. * * @param sd Socket number * @param fileref File reference obtained from dlp_VFSFileOpen() * @param retbuf Buffer allocated using pi_buffer_new(). Buffer is being emptied first with pi_buffer_clear(). On return contains the data read from the file. * @param reqbytes Number of bytes to read from the file. * @return A negative value if an error occured (see pi-error.h), or the total number of bytes read */ extern PI_ERR dlp_VFSFileRead PI_ARGS((int sd, FileRef fileref, pi_buffer_t *retbuf, size_t reqbytes)); /** @brief Delete an existing file from a VFS volume * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param volref Volume reference number (obtained from dlp_VFSVolumeEnumerate()) * @param pathname Full access path to the file to delete * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSFileDelete PI_ARGS((int sd, int volref, PI_CONST char *pathname)); /** @brief Rename an existing file * * Supported on Palm OS 4.0 and later. * * @note This function can NOT be used to move a file from one place * to another. You can only rename a file that will stay in the same * directory. * * @param sd Socket number * @param volref Volume reference number (obtained from dlp_VFSVolumeEnumerate()) * @param pathname Full access path to the file to rename * @param newname New file name, without the rest of the access path * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSFileRename PI_ARGS((int sd, int volref, PI_CONST char *pathname, PI_CONST char *newname)); /** @brief Checks whether the current position is at the end of file * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param fileref File reference obtained from dlp_VFSFileOpen() * @return A negative value if an error occured (see pi-error.h). 0 if not at EOF, >0 if at EOF. */ extern PI_ERR dlp_VFSFileEOF PI_ARGS((int sd, FileRef fileref)); /** @brief Return the current seek position in an open file * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param fileref File reference obtained from dlp_VFSFileOpen() * @param position On return, current absolute position in the file * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSFileTell PI_ARGS((int sd, FileRef fileref, int *position)); /** @brief Return the attributes of an open file * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param fileref File reference obtained from dlp_VFSFileOpen() * @param fileattrs On return, file attributes (see #dlpVFSFileAttributeConstants enum) * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSFileGetAttributes PI_ARGS((int sd, FileRef fileref, unsigned long *fileattrs)); /** @brief Change the attributes of an open file * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param fileref File reference obtained from dlp_VFSFileOpen() * @param fileattrs n-New file attributes (see #dlpVFSFileAttributeConstants enum) * @return A negative value if an error occured (see pi-error.h). */ extern PI_ERR dlp_VFSFileSetAttributes PI_ARGS((int sd, FileRef fileref, unsigned long fileattrs)); /** @brief Return one of the dates associated with an open file or directory * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param fileref File or directory reference obtained from dlp_VFSFileOpen() * @param which The date you want (see #dlpVFSDateConstants enum) * @param date On return, the requested date * @return A negative value if an error occured (see pi-error.h). */ extern PI_ERR dlp_VFSFileGetDate PI_ARGS((int sd, FileRef fileref, int which, time_t *date)); /** @brief Change one of the dates for an open file or directory * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param fileref File or directory reference obtained from dlp_VFSFileOpen() * @param which The date you want to change (see #dlpVFSDateConstants enum) * @param date The new date to set * @return A negative value if an error occured (see pi-error.h). */ extern PI_ERR dlp_VFSFileSetDate PI_ARGS((int sd, FileRef fileref, int which, time_t date)); /** @brief Change the current seek position in an open file * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param fileref File or directory reference obtained from dlp_VFSFileOpen() * @param origin Where to seek from (see #dlpVFSSeekConstants enum) * @param offset Seek offset * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSFileSeek PI_ARGS((int sd, FileRef fileref, int origin, int offset)); /** @brief Resize an open file * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param fileref File or directory reference obtained from dlp_VFSFileOpen() * @param newsize New file size * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSFileResize PI_ARGS((int sd, FileRef fileref, int newsize)); /** @brief Return the size of an open file * * Supported on Palm OS 4.0 and later. * * @param sd Socket number * @param fileref File or directory reference obtained from dlp_VFSFileOpen() * @param size On return, the actual size of the file * @return A negative value if an error occured (see pi-error.h) */ extern PI_ERR dlp_VFSFileSize PI_ARGS((int sd, FileRef fileref, int *size)); /*@}*/ #ifdef __cplusplus } #endif #endif /*_PILOT_DLP_H_*/ pilot-link-0.12.5-dfsg/include/pi-threadsafe.h0000644000175000017500000000337511104545315021417 0ustar rousseaurousseau/* * $Id: pi-threadsafe.h,v 1.6 2008/11/06 10:45:33 desrod Exp $ * * pi-threadsafe.h: utilities for thread-safe behavior * * Copyright (c) 2005, Florent Pillet. * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_THREADSAFE_H #define _PILOT_THREADSAFE_H #if HAVE_PTHREAD #include #define PI_THREADSAFE 1 #define PI_MUTEX_DECLARE(mutex_name) pthread_mutex_t mutex_name #define PI_MUTEX_DEFINE(mutex_name) pthread_mutex_t mutex_name = PTHREAD_MUTEX_INITIALIZER typedef pthread_mutex_t pi_mutex_t; #else /* when not in thread-safe mode, we still use dummy variables the code will simply do nothing */ #define PI_THREADSAFE 0 #define PI_MUTEX_DECLARE(mutex_name) int mutex_name /* dummy declaration for the code to compile */ #define PI_MUTEX_DEFINE(mutex_name) int mutex_name = 0 /* ditto from above */ typedef int pi_mutex_t; #endif extern int pi_mutex_lock(pi_mutex_t *mutex); extern int pi_mutex_trylock(pi_mutex_t *mutex); extern int pi_mutex_unlock(pi_mutex_t *mutex); extern unsigned long pi_thread_id(void); #endif pilot-link-0.12.5-dfsg/include/pi-calendar.h0000644000175000017500000001153011333421636021055 0ustar rousseaurousseau/* * $Id: pi-calendar.h,v 1.2 2010-01-16 22:29:35 judd Exp $ * * pi-calendar.h - Support for PalmOne Calendar application (CalendarDB-PDat), * this is a copy of datebook.c with the calendar fields added. * * (c) 2008, Jon Schewe * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_CALENDAR_H_ #define _PILOT_CALENDAR_H_ #include #include #include #include #include "pi-location.h" #include "pi-blob.h" #ifdef __cplusplus extern "C" { #endif typedef enum { calendar_v1, } calendarType; enum calendarRepeatType { calendarRepeatNone, calendarRepeatDaily, calendarRepeatWeekly, calendarRepeatMonthlyByDay, calendarRepeatMonthlyByDate, calendarRepeatYearly }; /* This enumeration normally isn't of much use, as you can get just as useful results by taking the value mod 7 to get the day of the week, and div 7 to get the week value, with week 4 (of 0) meaning the last, be it fourth or fifth. */ enum calendarDayOfMonthType { calendar_1stSun, calendar_1stMon, calendar_1stTue, calendar_1stWen, calendar_1stThu, calendar_1stFri, calendar_1stSat, calendar_2ndSun, calendar_2ndMon, calendar_2ndTue, calendar_2ndWen, calendar_2ndThu, calendar_2ndFri, calendar_2ndSat, calendar_3rdSun, calendar_3rdMon, calendar_3rdTue, calendar_3rdWen, calendar_3rdThu, calendar_3rdFri, calendar_3rdSat, calendar_4thSun, calendar_4thMon, calendar_4thTue, calendar_4thWen, calendar_4thThu, calendar_4thFri, calendar_4thSat, calendar_LastSun, calendar_LastMon, calendar_LastTue, calendar_LastWen, calendar_LastThu, calendar_LastFri, calendar_LastSat }; enum calendarAdvanceTypes { calendar_advMinutes, calendar_advHours, calendar_advDays }; /** * Times in this structure are assumed to be local unless tz is not null. */ typedef struct CalendarEvent { int event; /* Is this a timeless event? */ struct tm begin, end; /* When does this appointment start and end? */ int alarm; /* Should an alarm go off? */ int advance; /* How far in advance should it be? */ int advanceUnits; /* What am I measuring the advance in? */ enum calendarRepeatType repeatType; /* How should I repeat this appointment, if at all? */ int repeatForever; /* Do repetitions end at some date? */ struct tm repeatEnd; /* What date do they end on? */ int repeatFrequency; /* Should I skip an interval for each repetition? */ enum calendarDayOfMonthType repeatDay; /* for repeatMonthlyByDay */ int repeatDays[7]; /* for repeatWeekly */ int repeatWeekstart; /* What day did the user decide starts the week? */ int exceptions; /* How many repetitions are there to be ignored? */ struct tm *exception; /* What are they? */ char *description; /* What is the description of this appointment? */ char *note; /* Is there a note to go along with it? */ char *location; /* location of the event */ Blob_t *blob[MAX_BLOBS]; Timezone_t *tz; /* the timezone information */ } CalendarEvent_t; typedef struct CalendarAppInfo { calendarType type; struct CategoryAppInfo category; int startOfWeek; uint8_t internal[18]; /* don't know what this is yet */ } CalendarAppInfo_t; extern void new_CalendarEvent PI_ARGS((CalendarEvent_t *event)); extern void free_CalendarEvent PI_ARGS((CalendarEvent_t *event)); extern int unpack_CalendarEvent PI_ARGS((CalendarEvent_t *event, const pi_buffer_t *record, calendarType type)); extern int pack_CalendarEvent PI_ARGS((const CalendarEvent_t *event, pi_buffer_t *record, calendarType type)); extern int unpack_CalendarAppInfo PI_ARGS((CalendarAppInfo_t *appinfo, pi_buffer_t *buf)); extern int pack_CalendarAppInfo PI_ARGS((const CalendarAppInfo_t *appinfo, pi_buffer_t *buf)); extern int copy_CalendarEvent PI_ARGS((const CalendarEvent_t *source, CalendarEvent_t *dest)); #ifdef __cplusplus }; #endif #endif /* _PILOT_CALENDAR_H_ */ /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/include/pi-serial.h0000644000175000017500000000447310515154567020602 0ustar rousseaurousseau/* * $Id: pi-serial.h,v 1.30 2006/10/17 13:24:07 desrod Exp $ * * pi-serial.h: Palm serial protocol support * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_SERIAL_H_ #define _PILOT_SERIAL_H_ #include "pi-args.h" #include "pi-buffer.h" #ifdef __cplusplus extern "C" { #endif #define PI_SERIAL_DEV 1 struct pi_serial_impl { int (*open) PI_ARGS((pi_socket_t *ps, struct pi_sockaddr *addr, size_t addrlen)); int (*close) PI_ARGS((pi_socket_t *ps)); int (*changebaud) PI_ARGS((pi_socket_t *ps)); ssize_t (*write) PI_ARGS((pi_socket_t *ps, PI_CONST unsigned char *buf, size_t len, int flags)); ssize_t (*read) PI_ARGS((pi_socket_t *ps, pi_buffer_t *buf, size_t expect, int flags)); int (*flush) PI_ARGS((pi_socket_t *ps, int flags)); int (*poll) PI_ARGS((pi_socket_t *ps, int timeout)); }; struct pi_serial_data { struct pi_serial_impl impl; unsigned char buf[256]; size_t buf_size; /* IO options */ #ifndef OS2 # ifndef SGTTY struct termios tco; # else struct sgttyb tco; # endif #endif /* Baud rate info */ int rate; /**< Current port baud rate */ int establishrate; /**< Baud rate to use after link is established. If -1, will use the max speed advertised by the device */ int establishhighrate; /**< Boolean: try to establish rate higher than the device publishes*/ /* Time out */ int timeout; /* Statistics */ int rx_bytes; int rx_errors; int tx_bytes; int tx_errors; }; extern pi_device_t *pi_serial_device PI_ARGS((int type)); extern void pi_serial_impl_init PI_ARGS((struct pi_serial_impl *impl)); #ifdef __cplusplus } #endif #endif pilot-link-0.12.5-dfsg/include/pi-hinote.h0000644000175000017500000000336210635124120020566 0ustar rousseaurousseau/* * $Id: pi-hinote.h,v 1.9 2006/10/17 13:24:07 desrod Exp $ * * pi-hinote.h: HiNote application macros (deprecated) * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_HINOTE_H_ /* -*- C++ -*- */ #define _PILOT_HINOTE_H_ #include "pi-appinfo.h" #ifdef __cplusplus extern "C" { #endif typedef struct HiNoteNote { int flags; int level; char *text; } HiNoteNote_t; typedef struct HiNoteAppInfo { struct CategoryAppInfo category; unsigned char reserved[48]; } HiNoteAppInfo_t; extern void free_HiNoteNote PI_ARGS((struct HiNoteNote *)); extern int unpack_HiNoteNote PI_ARGS((struct HiNoteNote *, unsigned char *record, int len)); extern int pack_HiNoteNote PI_ARGS((struct HiNoteNote *, unsigned char *record, int len)); extern int unpack_HiNoteAppInfo PI_ARGS((struct HiNoteAppInfo *, unsigned char *AppInfo, size_t len)); extern int pack_HiNoteAppInfo PI_ARGS((struct HiNoteAppInfo *, unsigned char *AppInfo, size_t len)); #ifdef __cplusplus } #endif /*__cplusplus*/ #endif /* _PILOT_HINOTE_H_ */ pilot-link-0.12.5-dfsg/include/pi-debug.h0000644000175000017500000000552511104545315020376 0ustar rousseaurousseau/* * $Id: pi-debug.h,v 1.10 2008/11/06 10:45:33 desrod Exp $ * * pi-debug.h: Debugging utilities * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_DEBUG_H_ #define _PILOT_DEBUG_H_ #ifdef __cplusplus extern "C" { #endif #include "pi-args.h" #define PI_DBG_NONE 0x000 #define PI_DBG_SYS 0x001 #define PI_DBG_DEV 0x002 #define PI_DBG_SLP 0x004 #define PI_DBG_PADP 0x008 #define PI_DBG_DLP 0x010 #define PI_DBG_NET 0x020 #define PI_DBG_CMP 0x040 #define PI_DBG_SOCK 0x080 #define PI_DBG_API 0x100 #define PI_DBG_USER 0x200 #define PI_DBG_ALL 0x400 #define PI_DBG_LVL_NONE 0x00 #define PI_DBG_LVL_ERR 0x01 #define PI_DBG_LVL_WARN 0x02 #define PI_DBG_LVL_INFO 0x04 #define PI_DBG_LVL_DEBUG 0x08 extern int pi_debug_get_types PI_ARGS((void)); extern void pi_debug_set_types PI_ARGS((int types)); extern int pi_debug_get_level PI_ARGS((void)); extern void pi_debug_set_level PI_ARGS((int level)); extern void pi_debug_set_file PI_ARGS((const char *path)); extern void pi_log PI_ARGS((int type, int level, PI_CONST char *format, ...)); extern void pi_dumpline PI_ARGS((PI_CONST char *buf, size_t len, unsigned int addr)); extern void pi_dumpdata PI_ARGS((PI_CONST char *buf, size_t len)); #ifdef PI_DEBUG #define ASSERT(expr) \ do { \ if (!(expr)) { \ pi_log (PI_DBG_ALL, PI_DBG_LVL_NONE, \ "file %s: line %d: assertion failed: (%s)", \ __FILE__, \ __LINE__, \ #expr); \ } \ } while (0); #define CHECK(type, level, expr) \ do { \ if ((pi_debug_get_types () & type) \ && pi_debug_get_level () >= level) \ expr; \ } while (0); #define LOG(x) pi_log x #else #define ASSERT(expr) #define CHECK(type, level, expr) #define LOG(x) #endif #ifdef __cplusplus } #endif #endif pilot-link-0.12.5-dfsg/include/pi-blob.h0000644000175000017500000000414011150204033020204 0ustar rousseaurousseau/* * $Id: pi-blob.h,v 1.1 2009/02/22 08:08:59 nicholas Exp $ * * pi-blob.h - Support for blobs that appear in some palm databases. * * (c) 2008, Jon Schewe & Judd Montgomery * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_BLOB_H_ #define _PILOT_BLOB_H_ #include #include #include /* This is the blob that has the timezone data in it */ #define BLOB_TYPE_CALENDAR_TIMEZONE_ID "Bd00" /* Not sure what this blob type is, but it's just some extra data that appears in some calendar records, when it exists it is always 4 bytes long */ #define BLOB_TYPE_CALENDAR_UNKNOWN_ID "Bd01" /* Maximum number of blobs that can exist in a record, this is just a guess at the upper bound */ #define MAX_BLOBS 10 #ifdef __cplusplus extern "C" { #endif typedef struct { /* type ranges from "Bd00" - "Bd09" */ char type[4]; int16_t length; uint8_t *data; } Blob_t; extern void free_Blob PI_ARGS((Blob_t *blob)); extern int unpack_Blob_p PI_ARGS((Blob_t *blob, const unsigned char *data, const size_t position)); extern int pack_Blob PI_ARGS((const Blob_t *blob, pi_buffer_t *buf)); extern Blob_t *dup_Blob PI_ARGS((const Blob_t *blob)); #ifdef __cplusplus }; #endif #endif /* _PILOT_BLOB_H */ /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* ex: set tabstop=4 expandtab: */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/include/pi-sys.h0000644000175000017500000000301310515154567020126 0ustar rousseaurousseau/* * $Id: pi-sys.h,v 1.9 2006/10/17 13:24:07 desrod Exp $ * * pi-sys.h * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_SYS_H #define _PILOT_SYS_H #include "pi-args.h" #include "pi-buffer.h" #ifdef __cplusplus extern "C" { #endif #define PI_SYS_HEADER_LEN 0 typedef struct pi_sys_data { unsigned char txid; } pi_sys_data_t; extern pi_protocol_t *sys_protocol PI_ARGS((void)); extern ssize_t sys_tx PI_ARGS((pi_socket_t *ps, PI_CONST unsigned char *buf, size_t len, int flags)); extern ssize_t sys_rx PI_ARGS((pi_socket_t *ps, pi_buffer_t *buf, size_t len, int flags)); extern void sys_dump_header PI_ARGS((PI_CONST unsigned char *data, int rxtx)); extern void sys_dump PI_ARGS((PI_CONST unsigned char *data, size_t len)); #ifdef __cplusplus } #endif #endif /*_PILOT_SYSPKT_H_*/ pilot-link-0.12.5-dfsg/include/pi-veo.h0000644000175000017500000000420310515154567020103 0ustar rousseaurousseau/* * $Id: pi-veo.h,v 1.4 2006/10/17 13:24:07 desrod Exp $ * * pi-veo.h: Veo camera device support * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_VEO_H_ #define _PILOT_VEO_H_ #include "pi-appinfo.h" #ifdef __cplusplus extern "C" { #endif typedef struct VeoAppInfo { int dirty, sortByPriority; struct CategoryAppInfo category; } VeoAppInfo_t; /* Actions */ #define VEO_ACTION_OUTPUT 0x01 #define VEO_ACTION_LIST 0x02 #define VEO_ACTION_OUTPUT_ONE 0x04 /* Output type */ #define VEO_OUT_PPM 0x01 #define VEO_OUT_PNG 0x02 typedef struct Veo { unsigned char res1[1]; /* 0 = high, 1 = med, 2 = low this must mean something to the desktop conduit side, because it doesn't change anything on the Palm */ unsigned char quality; /* 0 = 640x480, 1 = 320x240 */ unsigned char resolution; unsigned char res2[12]; unsigned long picnum; unsigned short day, month, year; /* These are not in the Palm db header. They're used by the decoder */ unsigned short width, height; int sd, db; char name[32]; } Veo_t; void free_Veo(Veo_t *v ); int unpack_Veo(Veo_t *v, unsigned char *buffer, size_t len); int unpack_VeoAppInfo(VeoAppInfo_t *vai, unsigned char *record, size_t len); int pack_Veo(Veo_t *v, unsigned char *buffer, size_t len); int pack_VeoAppInfo(VeoAppInfo_t *vai, unsigned char *record, size_t len); #ifdef __cplusplus } #endif /*__cplusplus*/ #endif pilot-link-0.12.5-dfsg/include/pi-bluetooth.h0000644000175000017500000000400010561634205021303 0ustar rousseaurousseau/* * pi-bluetooth.h * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */ #ifndef _PILOT_BLUETOOTH_H_ #define _PILOT_BLUETOOTH_H_ #include "pi-args.h" #include "pi-buffer.h" #ifdef HAVE_BLUEZ #include #include #endif #ifdef __cplusplus extern "C" { #endif #define PI_BLUETOOTH_DEV 1 struct pi_bluetooth_impl { int (*open) PI_ARGS((pi_socket_t *ps, struct pi_sockaddr *addr, size_t addrlen)); int (*close) PI_ARGS((pi_socket_t *ps)); int (*changebaud) PI_ARGS((pi_socket_t *ps)); ssize_t (*write) PI_ARGS((pi_socket_t *ps, PI_CONST unsigned char *buf, size_t len, int flags)); ssize_t (*read) PI_ARGS((pi_socket_t *ps, pi_buffer_t *buf, size_t expect, int flags)); int (*flush) PI_ARGS((pi_socket_t *ps, int flags)); int (*poll) PI_ARGS((pi_socket_t *ps, int timeout)); }; struct pi_bluetooth_data { struct pi_bluetooth_impl impl; /* Device name passed from the front-ends */ char *device; /* Which channel we're listening on, the handle * for the SDP record as well as the SDP session */ int channel; #ifdef HAVE_BLUEZ uint32_t handle; sdp_session_t *sess; #endif /* Time out */ int timeout; }; extern pi_device_t *pi_bluetooth_device PI_ARGS((int type)); extern void pi_bluetooth_impl_init PI_ARGS((struct pi_bluetooth_impl *impl)); #ifdef __cplusplus } #endif #endif pilot-link-0.12.5-dfsg/include/pi-appinfo.h0000644000175000017500000000334710552545407020754 0ustar rousseaurousseau/* * $Id: pi-appinfo.h,v 1.15 2006/11/22 22:52:25 adridg Exp $ * * pi-appinfo.h: AppInfo header block definitions * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_APPINFO_H_ /* -*- C++ -*- */ #define _PILOT_APPINFO_H_ #include "pi-args.h" #ifdef __cplusplus extern "C" { #endif typedef struct CategoryAppInfo { unsigned int renamed[16]; /* Boolean array of categories with changed names */ char name[16][16]; /* 16 categories of 15 characters+nul each */ unsigned char ID[16]; /* Each category gets a unique ID, for sync tracking purposes. Those from the Palm are between 0 & 127. Those from the PC are between 128 & 255. I'm not sure what role lastUniqueID plays. */ unsigned char lastUniqueID; } CategoryAppInfo_t; extern int unpack_CategoryAppInfo PI_ARGS((CategoryAppInfo_t *, const unsigned char *AppInfo, size_t len)); extern int pack_CategoryAppInfo PI_ARGS((const CategoryAppInfo_t *, unsigned char *AppInfo, size_t len)); #ifdef __cplusplus }; #endif #endif /* _PILOT_APPINFO_H_ */ pilot-link-0.12.5-dfsg/include/pi-md5.h0000644000175000017500000000216711333433255017777 0ustar rousseaurousseau/* include/pi-md5.h. Generated from pi-md5.h.in by configure. */ /* * $Id: pi-md5.h.in,v 1.1 2008/11/06 01:14:13 judd Exp $ * * pi-md5.h: Header file for Colin Plumb's MD5 implementation. * Modified by Ian Jackson so as not to use Colin Plumb's * 'usuals.h'. * * Originally intended to be used for Palm password support * * This file is in the public domain. */ #ifndef MD5_H #define MD5_H #define HAVE_INTTYPES_H 1 #define HAVE_STDINT_H 1 #if HAVE_INTTYPES_H #include #endif #if HAVE_STDINT_H #include #endif #ifdef HAVE_INTTYPES_H || HAVE_STDINT_H #define UINT8 uint8_t #define UINT32 uint32_t #else #define UINT8 unsigned char #define UINT32 unsigned int #endif struct MD5Context { UINT32 buf[4]; UINT32 bytes[2]; UINT32 in[16]; }; void MD5Init(struct MD5Context *context); void MD5Update(struct MD5Context *context, UINT8 const *buf, unsigned len); void MD5Final(unsigned char digest[16], struct MD5Context *context); void MD5Transform(UINT32 buf[4], UINT32 const in[16]); void byteSwap(UINT32 * buf, unsigned words); #endif /* !MD5_H */ pilot-link-0.12.5-dfsg/include/pi-args.h0000644000175000017500000000235010515154566020246 0ustar rousseaurousseau/* * $Id: pi-args.h,v 1.7 2006/10/17 13:24:06 desrod Exp $ * * pi-args.h: Macros for prototype definitions * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __PILOT_ARGS_H__ #define __PILOT_ARGS_H__ /** @file pi-args.h * @brief Macros for prototype definitions * */ #if ((defined(__STDC__) || defined(SABER)) && !defined(NO_PROTOTYPE)) || defined(__cplusplus) || defined(USE_PROTOTYPE) || defined(CAN_PROTOTYPE) # define PI_ARGS(x) x # define PI_CONST const #else # define PI_ARGS(x) () # define PI_CONST #endif #endif pilot-link-0.12.5-dfsg/include/pi-net.h0000644000175000017500000000405610515154567020106 0ustar rousseaurousseau/* * $Id: pi-net.h,v 1.13 2006/10/17 13:24:07 desrod Exp $ * * pi-net.h: Palm-specific network macro definitions * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_NET_H_ #define _PILOT_NET_H_ #include "pi-args.h" #include "pi-buffer.h" #ifdef __cplusplus extern "C" { #endif #define PI_NET_HEADER_LEN 6 #define PI_NET_MTU 0xffff #define PI_NET_SIG_BYTE1 0x90 #define PI_NET_OFFSET_TYPE 0 #define PI_NET_OFFSET_TXID 1 #define PI_NET_OFFSET_SIZE 2 #define PI_NET_TYPE_DATA 0x01 #define PI_NET_TYPE_TCKL 0x02 typedef struct pi_net_data { int type; int split_writes; /* set to 0 or <> 0 (see net_tx() function) */ size_t write_chunksize; /* set to 0 or a chunk size value (i.e. 4096) (see net_tx() function) */ unsigned char txid; } pi_net_data_t; extern pi_protocol_t *net_protocol PI_ARGS((void)); extern int net_rx_handshake PI_ARGS((pi_socket_t *ps)); extern int net_tx_handshake PI_ARGS((pi_socket_t *ps)); extern ssize_t net_tx PI_ARGS((pi_socket_t *ps, PI_CONST unsigned char *buf, size_t len, int flags)); extern ssize_t net_rx PI_ARGS((pi_socket_t *ps, pi_buffer_t *buf, size_t expect, int flags)); extern void net_dump_header PI_ARGS((unsigned char *data, int rxtx, int sd)); extern void net_dump PI_ARGS((unsigned char *header, unsigned char *data)); #ifdef __cplusplus } #endif #endif pilot-link-0.12.5-dfsg/include/pi-syspkt.h0000644000175000017500000001017510515154567020654 0ustar rousseaurousseau/* * $Id: pi-syspkt.h,v 1.22 2006/10/17 13:24:07 desrod Exp $ * * pi-syspkt.h * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_SYSPKT_H #define _PILOT_SYSPKT_H #include "pi-args.h" #ifdef __cplusplus extern "C" { #endif struct Pilot_registers { unsigned long A[7]; unsigned long D[8]; unsigned long USP, SSP; unsigned long PC, SR; }; struct Pilot_breakpoint { unsigned long address; int enabled; }; struct Pilot_state { struct Pilot_registers regs; int reset; int exception; int instructions[30]; struct Pilot_breakpoint breakpoint[6]; unsigned long func_start, func_end; char func_name[32]; int trap_rev; }; struct Pilot_watch { unsigned long address; unsigned long length; unsigned long checksum; }; struct RPC_param { int byRef; size_t size; int invert; int arg; void *data; }; struct RPC_params { int trap; int reply; int args; struct RPC_param param[20]; }; extern int sys_UnpackState PI_ARGS((void *buffer, struct Pilot_state * s)); extern int sys_UnpackRegisters PI_ARGS((void *buffer, struct Pilot_registers * r)); extern int sys_Continue PI_ARGS((int sd, struct Pilot_registers * r, struct Pilot_watch * w)); extern int sys_Step PI_ARGS((int sd)); extern int sys_QueryState PI_ARGS((int sd)); extern int sys_ReadMemory PI_ARGS((int sd, unsigned long addr, unsigned long len, void *buf)); extern int sys_WriteMemory PI_ARGS((int sd, unsigned long addr, unsigned long len, void *buf)); extern int sys_ToggleDbgBreaks PI_ARGS((int sd)); extern int sys_SetTrapBreaks PI_ARGS((int sd, int *traps)); extern int sys_GetTrapBreaks PI_ARGS((int sd, int *traps)); extern int sys_SetBreakpoints PI_ARGS((int sd, struct Pilot_breakpoint * b)); extern int sys_Find PI_ARGS((int sd, unsigned long startaddr, unsigned long stopaddr, size_t len, int caseinsensitive, void *data, unsigned long *found)); extern int sys_RemoteEvent PI_ARGS((int sd, int penDown, int x, int y, int keypressed, int keymod, int keyasc, int keycode)); extern int sys_RPC PI_ARGS((int sd, int sock, int trap, long *D0, long *A0, int params, struct RPC_param * param, int rep)); #define RPC_Byte(data) (-2),((unsigned int)htons((data)<<8)) #define RPC_Short(data) (-2),((unsigned int)htons((data))) #define RPC_Long(data) (-4),((unsigned int)htonl((data))) #define RPC_Ptr(data,len) (len),((void*)(data)),0 #define RPC_LongPtr(ptr) (4),((void*)(ptr)),1 #define RPC_ShortPtr(ptr) (2),((void*)(ptr)),1 #define RPC_BytePtr(ptr) (2),((void*)(ptr)),2 #define RPC_LongRef(ref) (4),((void*)(&(ref))),1 #define RPC_ShortRef(ref) (2),((void*)(&(ref))),1 #define RPC_ByteRef(ref) (2),((void*)(&(ref))),2 #define RPC_NullPtr RPC_Long(0) #define RPC_End 0 #define RPC_IntReply 2 #define RPC_PtrReply 1 #define RPC_NoReply 0 extern int RPC PI_ARGS((int sd, int sock, int trap, int ret, ...)); extern void InvertRPC PI_ARGS((struct RPC_params * p)); extern void UninvertRPC PI_ARGS((struct RPC_params * p)); extern int PackRPC PI_ARGS((struct RPC_params * p, int trap, int reply, ...)); extern unsigned long DoRPC PI_ARGS((int sd, int sock, struct RPC_params * p, int *error)); extern int dlp_ProcessRPC PI_ARGS((int sd, int trap, int ret, ...)); extern int RPC_Int_Void PI_ARGS((int sd, int trap)); extern int RPC_Ptr_Void PI_ARGS((int sd, int trap)); #ifdef __cplusplus } #endif #endif /*_PILOT_SYSPKT_H_*/ pilot-link-0.12.5-dfsg/include/pi-datebook.h0000644000175000017500000000745510552545407021114 0ustar rousseaurousseau/* * $Id: pi-datebook.h,v 1.23 2006/11/22 22:52:25 adridg Exp $ * * pi-datebook.h - Support for Palm "Classic" Datebook application * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PILOT_DATEBOOK_H_ #define _PILOT_DATEBOOK_H_ #include #include "pi-appinfo.h" #include "pi-buffer.h" #ifdef __cplusplus extern "C" { #endif typedef enum { datebook_v1, } datebookType; extern char *DatebookAlarmTypeNames[]; extern char *DatebookRepeatTypeNames[]; enum alarmTypes { advMinutes, advHours, advDays }; enum repeatTypes { repeatNone, repeatDaily, repeatWeekly, repeatMonthlyByDay, repeatMonthlyByDate, repeatYearly }; /* This enumeration normally isn't of much use, as you can get just as useful results by taking the value mod 7 to get the day of the week, and div 7 to get the week value, with week 4 (of 0) meaning the last, be it fourth or fifth. */ enum DayOfMonthType { dom1stSun, dom1stMon, dom1stTue, dom1stWen, dom1stThu, dom1stFri, dom1stSat, dom2ndSun, dom2ndMon, dom2ndTue, dom2ndWen, dom2ndThu, dom2ndFri, dom2ndSat, dom3rdSun, dom3rdMon, dom3rdTue, dom3rdWen, dom3rdThu, dom3rdFri, dom3rdSat, dom4thSun, dom4thMon, dom4thTue, dom4thWen, dom4thThu, dom4thFri, dom4thSat, domLastSun, domLastMon, domLastTue, domLastWen, domLastThu, domLastFri, domLastSat }; typedef struct Appointment { int event; /* Is this a timeless event? */ struct tm begin, end; /* When does this appointment start and end? */ int alarm; /* Should an alarm go off? */ int advance; /* How far in advance should it be? */ int advanceUnits; /* What am I measuring the advance in? */ enum repeatTypes repeatType; /* How should I repeat this appointment, if at all? */ int repeatForever; /* Do repetitions end at some date? */ struct tm repeatEnd; /* What date do they end on? */ int repeatFrequency; /* Should I skip an interval for each repetition? */ enum DayOfMonthType repeatDay; /* for repeatMonthlyByDay */ int repeatDays[7]; /* for repeatWeekly */ int repeatWeekstart; /* What day did the user decide starts the week? */ int exceptions; /* How many repetitions are their to be ignored? */ struct tm *exception; /* What are they? */ char *description; /* What is the description of this appointment? */ char *note; /* Is there a note to go along with it? */ } Appointment_t; typedef struct AppointmentAppInfo { struct CategoryAppInfo category; int startOfWeek; } AppointmentAppInfo_t; extern void free_Appointment PI_ARGS((struct Appointment *)); extern int unpack_Appointment PI_ARGS((struct Appointment *, const pi_buffer_t *record, datebookType type)); extern int pack_Appointment PI_ARGS((const struct Appointment *, pi_buffer_t *record, datebookType type)); extern int unpack_AppointmentAppInfo PI_ARGS((struct AppointmentAppInfo *, const unsigned char *AppInfo, size_t len)); extern int pack_AppointmentAppInfo PI_ARGS((const struct AppointmentAppInfo *, unsigned char *AppInfo, size_t len)); #ifdef __cplusplus }; #endif #endif /* _PILOT_DATEBOOK_H_ */ pilot-link-0.12.5-dfsg/ltmain.sh0000755000175000017500000073341511333433237016742 0ustar rousseaurousseau# Generated from ltmain.m4sh. # ltmain.sh (GNU libtool) 2.2.6b # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 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. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print informational messages (default) # --version print version information # -h, --help print short or long help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . PROGRAM=ltmain.sh PACKAGE=libtool VERSION="2.2.6b Debian-2.2.6b-2ubuntu1" TIMESTAMP="" package_revision=1.3017 # Be Bourne compatible 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 BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # NLS nuisances: We save the old values to restore during execute mode. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done $lt_unset CDPATH : ${CP="cp -f"} : ${ECHO="echo"} : ${EGREP="/bin/grep -E"} : ${FGREP="/bin/grep -F"} : ${GREP="/bin/grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SED="/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # Generated shell functions inserted here. # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: # In the unlikely event $progname began with a '-', it would play havoc with # func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result case $progname in -*) progname=./$progname ;; esac # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=: for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname${mode+: }$mode: $*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` done my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "X$my_tmpdir" | $Xsed } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "X$1" | $Xsed \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_version # Echo version message to standard output and exit. func_version () { $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $SED -n '/^# Usage:/,/# -h/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" $ECHO $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help # Echo long help message to standard output and exit. func_help () { $SED -n '/^# Usage:/,/# Report bugs to/ { s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p }' < "$progpath" exit $? } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { func_error "missing argument for $1" exit_cmd=exit } exit_cmd=: # Check that we have a working $ECHO. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then # Yippee, $ECHO works! : else # Restart under the correct shell, and then maybe $ECHO will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # Parse options once, thoroughly. This comes as soon as possible in # the script to make things like `libtool --version' happen quickly. { # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Parse non-mode specific arguments: while test "$#" -gt 0; do opt="$1" shift case $opt in --config) func_config ;; --debug) preserve_args="$preserve_args $opt" func_echo "enabling shell trace mode" opt_debug='set -x' $opt_debug ;; -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break execute_dlfiles="$execute_dlfiles $1" shift ;; --dry-run | -n) opt_dry_run=: ;; --features) func_features ;; --finish) mode="finish" ;; --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break case $1 in # Valid mode arguments: clean) ;; compile) ;; execute) ;; finish) ;; install) ;; link) ;; relink) ;; uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac mode="$1" shift ;; --preserve-dup-deps) opt_duplicate_deps=: ;; --quiet|--silent) preserve_args="$preserve_args $opt" opt_silent=: ;; --verbose| -v) preserve_args="$preserve_args $opt" opt_silent=false ;; --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break preserve_args="$preserve_args $opt $1" func_enable_tag "$1" # tagname is set here shift ;; # Separate optargs to long options: -dlopen=*|--mode=*|--tag=*) func_opt_split "$opt" set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} shift ;; -\?|-h) func_usage ;; --help) opt_help=: ;; --version) func_version ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) nonopt="$opt" break ;; esac done case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_duplicate_deps ;; esac # Having warned about all mis-specified options, bail out if # anything was wrong. $exit_cmd $EXIT_FAILURE } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } ## ----------- ## ## Main. ## ## ----------- ## $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi test -z "$mode" && func_fatal_error "error: you must specify a MODE." # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$mode' for more information." } # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_ltwrapper_scriptname_result="" if func_ltwrapper_executable_p "$1"; then func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" fi } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case "$@ " in " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T <?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi removelist="$removelist $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist removelist="$removelist $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir command="$command -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$mode'" ;; esac $ECHO $ECHO "Try \`$progname --help' for more information about other modes." exit $? } # Now that we've collected a possible --mode arg, show help if necessary $opt_help && func_mode_help # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $execute_dlfiles; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_quote_for_eval "$file" args="$args $func_quote_for_eval_result" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" $ECHO "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS $ECHO "X----------------------------------------------------------------------" | $Xsed $ECHO "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done $ECHO $ECHO "If you ever happen to want to link against installed libraries" $ECHO "in a given directory, LIBDIR, you must either use libtool, and" $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" $ECHO "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" $ECHO " during execution" fi if test -n "$runpath_var"; then $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" $ECHO " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $ECHO $ECHO "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" $ECHO "pages." ;; *) $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac $ECHO "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS } test "$mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $ECHO "X$nonopt" | $GREP shtool >/dev/null; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" install_prog="$install_prog$func_quote_for_eval_result" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" install_prog="$install_prog $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for progfile in $progfiles; do func_verbose "extracting global C symbols from \`$progfile'" $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" } done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" fi $ECHO >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; " case $host in *cygwin* | *mingw* | *cegcc* ) $ECHO >> "$output_objdir/$my_dlsyms" "\ /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */" lt_dlsym_const= ;; *osf5*) echo >> "$output_objdir/$my_dlsyms" "\ /* This system does not cope well with relocations in const data */" lt_dlsym_const= ;; *) lt_dlsym_const=const ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ extern $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) symtab_cflags="$symtab_cflags $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper_part1 [arg=no] # # Emit the first part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part1 () { func_emit_wrapper_part1_arg1=no if test -n "$1" ; then func_emit_wrapper_part1_arg1=$1 fi $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible 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 BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then ECHO=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then # Yippee, \$ECHO works! : else # Restart under the correct shell, and then maybe \$ECHO will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $ECHO "\ # Find the directory that this script lives in. thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done " } # end: func_emit_wrapper_part1 # func_emit_wrapper_part2 [arg=no] # # Emit the second part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part2 () { func_emit_wrapper_part2_arg1=no if test -n "$1" ; then func_emit_wrapper_part2_arg1=$1 fi $ECHO "\ # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # end: func_emit_wrapper_part2 # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=no if test -n "$1" ; then func_emit_wrapper_arg1=$1 fi # split this up so that func_emit_cwrapperexe_src # can call each part independently. func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" } # func_to_host_path arg # # Convert paths to host format when used with build tools. # Intended for use with "native" mingw (where libtool itself # is running under the msys shell), or in the following cross- # build environments: # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # where wine is equipped with the `winepath' executable. # In the native mingw case, the (msys) shell automatically # converts paths for any non-msys applications it launches, # but that facility isn't available from inside the cwrapper. # Similar accommodations are necessary for $host mingw and # $build cygwin. Calling this function does no harm for other # $host/$build combinations not listed above. # # ARG is the path (on $build) that should be converted to # the proper representation for $host. The result is stored # in $func_to_host_path_result. func_to_host_path () { func_to_host_path_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' case $build in *mingw* ) # actually, msys # awkward: cmd appends spaces to result lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_path_tmp1=`( cmd //c echo "$1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_path_tmp1=`cygpath -w "$1"` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # Unfortunately, winepath does not exit with a non-zero # error code, so we are forced to check the contents of # stdout. On the other hand, if the command is not # found, the shell will set an exit code of 127 and print # *an error message* to stdout. So we must check for both # error code of zero AND non-empty stdout, which explains # the odd construction: func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` else # Allow warning below. func_to_host_path_result="" fi ;; esac if test -z "$func_to_host_path_result" ; then func_error "Could not determine host path corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_path_result="$1" fi ;; esac fi } # end: func_to_host_path # func_to_host_pathlist arg # # Convert pathlists to host format when used with build tools. # See func_to_host_path(), above. This function supports the # following $build/$host combinations (but does no harm for # combinations not listed here): # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # # Path separators are also converted from $build format to # $host format. If ARG begins or ends with a path separator # character, it is preserved (but converted to $host format) # on output. # # ARG is a pathlist (on $build) that should be converted to # the proper representation on $host. The result is stored # in $func_to_host_pathlist_result. func_to_host_pathlist () { func_to_host_pathlist_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_to_host_pathlist_tmp2="$1" # Once set for this call, this variable should not be # reassigned. It is used in tha fallback case. func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e 's|^:*||' -e 's|:*$||'` case $build in *mingw* ) # Actually, msys. # Awkward: cmd appends spaces to result. lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # unfortunately, winepath doesn't convert pathlists func_to_host_pathlist_result="" func_to_host_pathlist_oldIFS=$IFS IFS=: for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do IFS=$func_to_host_pathlist_oldIFS if test -n "$func_to_host_pathlist_f" ; then func_to_host_path "$func_to_host_pathlist_f" if test -n "$func_to_host_path_result" ; then if test -z "$func_to_host_pathlist_result" ; then func_to_host_pathlist_result="$func_to_host_path_result" else func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" fi fi fi IFS=: done IFS=$func_to_host_pathlist_oldIFS ;; esac if test -z "$func_to_host_pathlist_result" ; then func_error "Could not determine the host path(s) corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This may break if $1 contains DOS-style drive # specifications. The fix is not to complicate the expression # below, but for the user to provide a working wine installation # with winepath so that path translation in the cross-to-mingw # case works properly. lt_replace_pathsep_nix_to_dos="s|:|;|g" func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_replace_pathsep_nix_to_dos"` fi # Now, add the leading and trailing path separators back case "$1" in :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" ;; esac case "$1" in *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" ;; esac ;; esac fi } # end: func_to_host_pathlist # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include # define setmode _setmode #else # include # include # ifdef __CYGWIN__ # include # define HAVE_SETENV # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif # endif #endif #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif #ifdef _MSC_VER # define S_IXUSR _S_IEXEC # define stat _stat # ifndef _INTPTR_T_DEFINED # define intptr_t int # endif #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifdef __CYGWIN__ # define FOPEN_WB "wb" #endif #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #undef LTWRAPPER_DEBUGPRINTF #if defined DEBUGWRAPPER # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args static void ltwrapper_debugprintf (const char *fmt, ...) { va_list args; va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } #else # define LTWRAPPER_DEBUGPRINTF(args) #endif const char *program_name = NULL; void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_fatal (const char *message, ...); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_opt_process_env_set (const char *arg); void lt_opt_process_env_prepend (const char *arg); void lt_opt_process_env_append (const char *arg); int lt_split_name_value (const char *arg, char** name, char** value); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); static const char *script_text_part1 = EOF func_emit_wrapper_part1 yes | $SED -e 's/\([\\"]\)/\\\1/g' \ -e 's/^/ "/' -e 's/$/\\n"/' echo ";" cat <"))); for (i = 0; i < newargc; i++) { LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); } EOF case $host_os in mingw*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); return 127; } return rval; EOF ;; *) cat <<"EOF" execv (lt_argv_zero, newargz); return rval; /* =127, but avoids unused variable warning */ EOF ;; esac cat <<"EOF" } void * xmalloc (size_t num) { void *p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char) name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable (const char *path) { struct stat st; LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", tmp_pathspec)); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { char *errstr = strerror (errno); lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal ("Could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } void lt_setenv (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", (name ? name : ""), (value ? value : ""))); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } int lt_split_name_value (const char *arg, char** name, char** value) { const char *p; int len; if (!arg || !*arg) return 1; p = strchr (arg, (int)'='); if (!p) return 1; *value = xstrdup (++p); len = strlen (arg) - strlen (*value); *name = XMALLOC (char, len); strncpy (*name, arg, len-1); (*name)[len - 1] = '\0'; return 0; } void lt_opt_process_env_set (const char *arg) { char *name = NULL; char *value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); } lt_setenv (name, value); XFREE (name); XFREE (value); } void lt_opt_process_env_prepend (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); } new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_opt_process_env_append (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); } new_value = lt_extend_str (getenv (name), value, 1); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_update_exe_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? value : ""))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? value : ""))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF } # end: func_emit_cwrapperexe_src # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) deplibs="$deplibs $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) weak_libs="$weak_libs $arg" prev= continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname '-L' '' "$arg" dir=$func_stripname_result if test -z "$dir"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" linker_flags="$linker_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -F/path gives path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" compiler_flags="$compiler_flags $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_duplicate_deps ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= case $lib in *.la) func_source "$lib" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` case " $weak_libs " in *" $deplib_base "*) ;; *) deplibs="$deplibs $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" dir=$func_stripname_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $ECHO $ECHO "*** Warning: Trying to link with static lib archive $deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because the file extensions .$libext of this argument makes me believe" $ECHO "*** that it is just a static archive that I should not use here." else $ECHO $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) temp_rpath="$temp_rpath$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded notinst_deplibs="$notinst_deplibs $lib" need_relink=no ;; *) if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then $ECHO if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $ECHO $ECHO "*** And there doesn't seem to be a static archive available" $ECHO "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $ECHO $ECHO "*** Warning: This system can not link to static lib archive $lib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $ECHO "*** But as you try to build a module library, libtool will still create " $ECHO "*** a static module, that should work as long as the dlopening application" $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $ECHO $ECHO "*** However, this would only work if libtool was able to extract symbol" $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" $ECHO "*** not find such a program. So, this module is probably useless." $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_dirname "$deplib" "" "." dir="$func_dirname_result" # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else $ECHO $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" libobjs="$libobjs $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` done fi if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | $GREP . >/dev/null; then $ECHO if test "X$deplibs_check_method" = "Xnone"; then $ECHO "*** Warning: inter-library dependencies are not supported in this platform." else $ECHO "*** Warning: inter-library dependencies are not known to be supported." fi $ECHO "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $ECHO $ECHO "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" $ECHO "*** a static module, that should work as long as the dlopening" $ECHO "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $ECHO $ECHO "*** However, this would only work if libtool was able to extract symbol" $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" $ECHO "*** not find such a program. So, this module is probably useless." $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $ECHO "*** The inter-library dependencies that have been dropped here will be" $ECHO "*** automatically added whenever a program is linked with this library" $ECHO "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $ECHO $ECHO "*** Since this library must not contain undefined symbols," $ECHO "*** because either the platform does not support them or" $ECHO "*** it was explicitly requested with -no-undefined," $ECHO "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" delfiles="$delfiles $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" func_len " $cmd" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then func_show_eval "$cmd" 'exit $?' skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$ECHO "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" $ECHO 'INPUT (' > $output for obj in $save_libobjs do $ECHO "$obj" >> $output done $ECHO ')' >> $output delfiles="$delfiles $output" elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do $ECHO "$obj" >> $output done delfiles="$delfiles $output" output=$firstobj\"$file_list_spec$output\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=$obj func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi delfiles="$delfiles $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *cegcc) # Disable wrappers for cegcc, we are cross compiling anyway. wrappers_required=no ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $ECHO for shipping. if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then oldobjs="$oldobjs $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles oldobjs="$oldobjs $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else $ECHO "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlfiles="$newdlfiles $libdir/$name" ;; *) newdlfiles="$newdlfiles $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlprefiles="$newdlprefiles $libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$mode" = link || test "$mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) RM="$RM $arg"; rmforce=yes ;; -*) RM="$RM $arg" ;; *) files="$files $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then objdir="$origobjdir" else objdir="$dir/$origobjdir" fi func_basename "$file" name="$func_basename_result" test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result rmfiles="$rmfiles $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$mode" = uninstall || test "$mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 pilot-link-0.12.5-dfsg/depcomp0000755000175000017500000004426711331674343016477 0ustar rousseaurousseau#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see . # 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 cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u="sed s,\\\\\\\\,/,g" depmode=msvisualcpp 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. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" 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. 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 tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$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" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. 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 tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; 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 mechanism 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 $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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi 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. -arch) eat=yes ;; -*|$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 "X$1" != 'X--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. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # 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 ;; 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: pilot-link-0.12.5-dfsg/bindings/0000755000175000017500000000000011333433323016673 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/bindings/Makefile.in0000644000175000017500000005072511333433243020752 0ustar rousseaurousseau# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ target_triplet = @target@ subdir = bindings DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/bluez.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/tcl.m4 \ $(top_srcdir)/m4/threads.m4 \ $(top_srcdir)/m4/vl_lib_readline.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/include/pi-md5.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = Java Tcl DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLUEZ_CFLAGS = @BLUEZ_CFLAGS@ BLUEZ_LIBS = @BLUEZ_LIBS@ CAT_ENTRY_END = @CAT_ENTRY_END@ CAT_ENTRY_START = @CAT_ENTRY_START@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOCBOOK_ROOT = @DOCBOOK_ROOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVA = @JAVA@ JAVABASE = @JAVABASE@ JAVAC = @JAVAC@ JAVA_VERSION = @JAVA_VERSION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PIC_LIBS = @PIC_LIBS@ PILOT_LINK_MAJOR = @PILOT_LINK_MAJOR@ PILOT_LINK_MINOR = @PILOT_LINK_MINOR@ PILOT_LINK_PATCH = @PILOT_LINK_PATCH@ PILOT_LINK_VERS = @PILOT_LINK_VERS@ PISOCK_AGE = @PISOCK_AGE@ PISOCK_CURRENT = @PISOCK_CURRENT@ PISOCK_REVISION = @PISOCK_REVISION@ PISYNC_AGE = @PISYNC_AGE@ PISYNC_CURRENT = @PISYNC_CURRENT@ PISYNC_REVISION = @PISYNC_REVISION@ PKG_CONFIG = @PKG_CONFIG@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ POPT_INCLUDES = @POPT_INCLUDES@ POPT_LIBS = @POPT_LIBS@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_H = @PYTHON_H@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RL_LIBS = @RL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ XML_CATALOG = @XML_CATALOG@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ builddir = @builddir@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ usb_libs = @usb_libs@ @WITH_JAVA_FALSE@JAVA_DIR = @WITH_JAVA_TRUE@JAVA_DIR = Java @WITH_TCL_FALSE@TCL_DIR = @WITH_TCL_TRUE@TCL_DIR = Tcl SUBDIRS = $(JAVA_DIR) $(TCL_DIR) @WITH_PYTHON_FALSE@PYTHON_ALL = @WITH_PYTHON_TRUE@PYTHON_ALL = python-build @WITH_PYTHON_FALSE@PYTHON_INSTALL = @WITH_PYTHON_TRUE@PYTHON_INSTALL = python-install @WITH_PYTHON_FALSE@PYTHON_CLEAN = @WITH_PYTHON_TRUE@PYTHON_CLEAN = python-clean @WITH_PYTHON_FALSE@PYTHON_MCLEAN = @WITH_PERL_FALSE@PERL_ALL = @WITH_PERL_TRUE@PERL_ALL = perl-build @WITH_PERL_FALSE@PERL_INSTALL = @WITH_PERL_TRUE@PERL_INSTALL = perl-install @WITH_PERL_FALSE@PERL_CLEAN = @WITH_PERL_TRUE@PERL_CLEAN = perl-clean @WITH_PERL_FALSE@PERL_MCLEAN = EXTRA_DIST = Python Java Perl all: all-recursive .SUFFIXES: $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu bindings/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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): @fail= 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; \ ($(am__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" $(RECURSIVE_CLEAN_TARGETS): @fail= 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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 || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-recursive all-am: Makefile all-local installdirs: installdirs-recursive installdirs-am: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool clean-local mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-exec-local install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-local .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local ctags ctags-recursive dist-hook \ distclean distclean-generic distclean-libtool distclean-local \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-local \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-local mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am uninstall-local # # Python Building # python-build: Python/setup.py cd $(srcdir)/Python && $(PYTHON) setup.py build python-install: python-build cd $(srcdir)/Python && $(PYTHON) setup.py install --root=$(DESTDIR) --prefix=$(prefix) python-clean: Python/setup.py -cd $(srcdir)/Python && $(PYTHON) setup.py clean -cd $(srcdir)/Python && rm -rf build # # Perl Building # Perl/Makefile: Perl/Makefile.PL cd Perl && $(PERL) Makefile.PL perl-build: Perl/Makefile cd Perl && $(MAKE) PREFIX=$(DESTDIR)$(prefix) perl-install: cd Perl && $(MAKE) install perl-uninstall: Perl/Makefile cd Perl && $(MAKE) uninstall perl-clean: Perl/Makefile cd Perl && $(MAKE) realclean && rm Makefile.PL all-local: $(PERL_ALL) $(PYTHON_ALL) install-exec-local: $(PYTHON_INSTALL) $(PERL_INSTALL) uninstall-local: $(PYTHON_INSTALL) $(PERL_UNINSTALL) clean-local: $(PERL_CLEAN) $(PYTHON_CLEAN) distclean-local: $(PERL_CLEAN) $(PYTHON_CLEAN) maintainer-clean-local: $(PERL_CLEAN) $(PYTHON_CLEAN) dist-hook: rm -rf `find $(distdir) -name CVS` # 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: pilot-link-0.12.5-dfsg/bindings/Python/0000755000175000017500000000000011333433324020155 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/bindings/Python/setup-standalone.py.in0000644000175000017500000000365710465410413024434 0ustar rousseaurousseau#!/usr/bin/python # # Copyright (c) 2005, Florent Pillet. # # This library 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 of the License, or (at # your option) any later version. # # This 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 Library # General Public License for more details. # # You should have received a copy of the GNU Library General Public License # along with this library; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # $Id: setup-standalone.py.in,v 1.4 2006/05/31 17:59:55 desrod Exp $ from distutils.core import setup, Extension import sys if sys.platform.startswith('darwin'): # additional link options for Mac OS X link_options = ['-framework','Carbon','-framework','System','-framework','IOKit'] else: # TODO: test on other platforms and add options as appropriate link_options = None setup(name = "python-libpisock", version = "@PILOT_LINK_VERS@.@PILOT_LINK_MAJOR@.@PILOT_LINK_MINOR@", description = "Python bindings for the pisock library linked in a standalone module (not requiring the libpisock shared lib).", author = "Florent Pillet", author_email = "pilot-link@florentpillet.com", url = "http://www.pilot-link.org/", ext_modules = [Extension("_pisock", ["src/pisock_wrap.c"], include_dirs = ['../../include'], extra_objects = ['../../libpisock/.libs/libpisock.a'], extra_link_args = link_options ) ], package_dir = {'': 'src'}, py_modules = ["pisock","pisockextras"]) pilot-link-0.12.5-dfsg/bindings/Python/src/0000755000175000017500000000000011333433324020744 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/bindings/Python/src/helperfuncs.i0000644000175000017500000002244710465410413023444 0ustar rousseaurousseau/* * helperfuncs.i * * Factored-out functions to build return values from common structures * * Copyright (c) 2005, Florent Pillet. * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * * $Id: helperfuncs.i,v 1.4 2006/05/31 17:59:55 desrod Exp $ */ %{ static PyObject *ConvertFromEncoding(const char *data, const char *encoding, const char *errors, int allowErrors) { PyObject *buffer, *string = NULL; buffer = PyBuffer_FromMemory((void *)data, strlen(data)); if (buffer == NULL) { if (allowErrors) { PyErr_Clear(); Py_INCREF(Py_None); return Py_None; } return NULL; } string = PyUnicode_FromEncodedObject(buffer, encoding, errors); if (string == NULL) goto error; Py_DECREF(buffer); return string; error: Py_XDECREF(buffer); Py_XDECREF(string); if (allowErrors) { PyErr_Clear(); Py_INCREF(Py_None); return Py_None; } return NULL; } static int ConvertToEncoding(PyObject *object, const char *encoding, const char *errors, int allowErrors, char *buffer, int maxBufSize) { int len; char *s; PyObject *encoded = NULL; if (PyString_Check(object)) encoded = PyString_AsEncodedObject(object, encoding, errors); else if (PyUnicode_Check(object)) encoded = PyUnicode_AsEncodedString(object, encoding, errors); if (encoded == NULL) goto error; s = PyString_AsString(encoded); if (s == NULL) goto error; len = strlen(s); if (len) { if (len >= maxBufSize) len = maxBufSize - 1; memcpy(buffer, s, len); } buffer[len] = 0; Py_DECREF(encoded); return 1; error: Py_XDECREF(encoded); if (allowErrors) { PyErr_Clear(); memset(buffer, 0, maxBufSize); } return 0; } static PyObject *PyObjectFromDBInfo(const struct DBInfo *dbi) { PyObject *returnObj; PyObject *nameObj = ConvertFromEncoding(dbi->name, "palmos", "replace", 1); returnObj = Py_BuildValue("{sisisisOsOsislslslslsisOsisisisisisisisisisisisisisisi}", "more", dbi->more, "flags", dbi->flags, "miscFlags", dbi->miscFlags, "type", PyString_FromStringAndSize(printlong(dbi->type), 4), "creator", PyString_FromStringAndSize(printlong(dbi->creator), 4), "version", dbi->version, "modnum", dbi->modnum, "createDate", dbi->createDate, "modifyDate", dbi->modifyDate, "backupDate", dbi->backupDate, "index", dbi->index, "name", nameObj, "flagResource", !!(dbi->flags & dlpDBFlagResource), "flagReadOnly", !!(dbi->flags & dlpDBFlagReadOnly), "flagAppInfoDirty", !!(dbi->flags & dlpDBFlagAppInfoDirty), "flagBackup", !!(dbi->flags & dlpDBFlagBackup), "flagLaunchable", !!(dbi->flags & dlpDBFlagLaunchable), "flagOpen", !!(dbi->flags & dlpDBFlagOpen), "flagNewer", !!(dbi->flags & dlpDBFlagNewer), "flagReset", !!(dbi->flags & dlpDBFlagReset), "flagCopyPrevention", !!(dbi->flags & dlpDBFlagCopyPrevention), "flagStream", !!(dbi->flags & dlpDBFlagStream), "flagExcludeFromSync", !!(dbi->miscFlags & dlpDBMiscFlagExcludeFromSync), "flagSchema", !!(dbi->flags & dlpDBFlagSchema), "flagSecure", !!(dbi->flags & dlpDBFlagSecure), "flagExtended", !!(dbi->flags & dlpDBFlagExtended), "flagFixedUp", !!(dbi->flags & dlpDBFlagFixedUp)); Py_DECREF(nameObj); return returnObj; } /* unused at that time static int PyObjectToDBInfo(PyObject *o, struct DBInfo *di) { PyObject *nameObj; di->more = (int) DGETLONG(o, "more", 0); di->type = makelong(DGETSTR(o, "type", " ")); di->creator = makelong(DGETSTR(o, "creator", " ")); di->version = DGETLONG(o, "version", 0); di->modnum = DGETLONG(o, "modnum", 0); di->createDate = DGETLONG(o, "createDate", 0); di->modifyDate = DGETLONG(o, "modifyDate", 0); di->backupDate = DGETLONG(o, "backupDate", 0); di->index = DGETLONG(o, "index", 0); memset(di->name, 0, sizeof(di->name)); nameObj = PyDict_GetItemString(o,"name"); if (nameObj) { if (!ConvertToEncoding(nameObj, "palmos", "replace", 1, di->name, sizeof(di->name))) return 0; } di->flags = 0; if (DGETLONG(o,"flagResource",0)) di->flags |= dlpDBFlagResource; if (DGETLONG(o,"flagReadOnly",0)) di->flags |= dlpDBFlagReadOnly; if (DGETLONG(o,"flagAppInfoDirty",0)) di->flags |= dlpDBFlagAppInfoDirty; if (DGETLONG(o,"flagBackup",0)) di->flags |= dlpDBFlagBackup; if (DGETLONG(o,"flagLaunchable",0)) di->flags |= dlpDBFlagLaunchable; if (DGETLONG(o,"flagOpen",0)) di->flags |= dlpDBFlagOpen; if (DGETLONG(o,"flagNewer",0)) di->flags |= dlpDBFlagNewer; if (DGETLONG(o,"flagReset",0)) di->flags |= dlpDBFlagReset; if (DGETLONG(o,"flagCopyPrevention",0)) di->flags |= dlpDBFlagCopyPrevention; if (DGETLONG(o,"flagStream",0)) di->flags |= dlpDBFlagStream; if (DGETLONG(o,"flagSchema",0)) di->flags |= dlpDBFlagSchema; if (DGETLONG(o,"flagSecure",0)) di->flags |= dlpDBFlagSecure; if (DGETLONG(o,"flagExtended",0)) di->flags |= dlpDBFlagExtended; if (DGETLONG(o,"flagFixedUp",0)) di->flags |= dlpDBFlagFixedUp; di->miscFlags = 0; if (DGETLONG(o,"flagExcludeFromSync",0)) di->miscFlags |= dlpDBMiscFlagExcludeFromSync; return 1; } */ static PyObject* PyObjectFromDBSizeInfo(const struct DBSizeInfo *si) { return Py_BuildValue("{slslslslslsl}", "numRecords", si->numRecords, "totalBytes", si->totalBytes, "dataBytes", si->dataBytes, "appBlockSize", si->appBlockSize, "sortBlockSize", si->sortBlockSize, "maxRecSize", si->maxRecSize); } static PyObject* PyObjectFromCardInfo(const struct CardInfo *ci) { PyObject *returnObj, *nameObj, *manufacturerObj; nameObj = ConvertFromEncoding(ci->name, "cp1252", "replace", 1); manufacturerObj = ConvertFromEncoding(ci->manufacturer, "cp1252", "replace", 1); returnObj = Py_BuildValue("{sisislslslslsOsOsi}", "card", ci->card, "version", ci->version, "creation", ci->creation, "romSize", ci->romSize, "ramSize", ci->ramSize, "ramFree", ci->ramFree, "name", nameObj, "manufacturer", manufacturerObj, "more", ci->more); Py_DECREF(nameObj); Py_DECREF(manufacturerObj); return returnObj; } static PyObject* PyObjectFromSysInfo(const struct SysInfo *si) { return Py_BuildValue("{slslss#}", "romVersion", si->romVersion, "locale", si->locale, "name", si->prodID, si->prodIDLength); } static PyObject* PyObjectFromPilotUser(const struct PilotUser *pi) { PyObject *nameObj, *passwordObj, *returnObj; nameObj = ConvertFromEncoding(pi->username, "palmos", "replace", 1); passwordObj = ConvertFromEncoding(pi->password, "palmos", "strict", 1); returnObj = Py_BuildValue("{slslslslslsOsO}", "userID", pi->userID, "viewerID", pi->viewerID, "lastSyncPC", pi->lastSyncPC, "successfulSyncDate", pi->successfulSyncDate, "lastSyncDate", pi->lastSyncDate, "name", nameObj, "password", passwordObj); Py_DECREF(nameObj); Py_DECREF(passwordObj); return returnObj; } static int PyObjectToPilotUser(PyObject *o, struct PilotUser *pi) { /* return 0 if string conversion to palmos charset failed, otherwise return 1 */ PyObject *stringObj; pi->userID = DGETLONG(o,"userID",0); pi->viewerID = DGETLONG(o,"viewerID",0); pi->lastSyncPC = DGETLONG(o,"lastSyncPC",0); pi->successfulSyncDate = DGETLONG(o,"successfulSyncDate",0); pi->lastSyncDate = DGETLONG(o,"lastSyncDate",0); memset(pi->username, 0, sizeof(pi->username)); stringObj = PyDict_GetItemString(o,"name"); if (stringObj) { if (!ConvertToEncoding(stringObj, "palmos", "replace", 0, pi->username, sizeof(pi->username))) return 0; } memset(pi->password, 0, sizeof(pi->password)); stringObj = PyDict_GetItemString(o,"password"); if (stringObj) { if (!ConvertToEncoding(stringObj, "palmos", "strict", 0, pi->password, sizeof(pi->password))) return 0; } return 1; } static PyObject* PyObjectFromNetSyncInfo(const struct NetSyncInfo *ni) { return Py_BuildValue("{sissssss}", "lanSync", ni->lanSync, "hostName", ni->hostName, "hostAddress", ni->hostAddress, "hostSubnetMask", ni->hostSubnetMask); } static void PyObjectToNetSyncInfo(PyObject *o, struct NetSyncInfo *ni) { ni->lanSync = (int) DGETLONG(o,"lanSync",0); strncpy(ni->hostName, DGETSTR(o,"hostName",""), sizeof(ni->hostName)); strncpy(ni->hostAddress, DGETSTR(o,"hostAddress",""), sizeof(ni->hostAddress)); strncpy(ni->hostSubnetMask, DGETSTR(o,"hostSubnetMask",""), sizeof(ni->hostSubnetMask)); } %} pilot-link-0.12.5-dfsg/bindings/Python/src/pisock_wrap.c0000644000175000017500000143563410411050630023440 0ustar rousseaurousseau/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 1.3.27 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make * changes to this file unless you know what you are doing--modify the SWIG * interface file instead. * ----------------------------------------------------------------------------- */ #define SWIGPYTHON /*********************************************************************** * * This section contains generic SWIG labels for method/variable * declarations/attributes, and other compiler dependent labels. * ************************************************************************/ /* template workaround for compilers that cannot correctly implement the C++ standard */ #ifndef SWIGTEMPLATEDISAMBIGUATOR # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) # define SWIGTEMPLATEDISAMBIGUATOR template # else # define SWIGTEMPLATEDISAMBIGUATOR # endif #endif /* inline attribute */ #ifndef SWIGINLINE # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) # define SWIGINLINE inline # else # define SWIGINLINE # endif #endif /* attribute recognised by some compilers to avoid 'unused' warnings */ #ifndef SWIGUNUSED # if defined(__GNUC__) || defined(__ICC) # define SWIGUNUSED __attribute__ ((unused)) # else # define SWIGUNUSED # endif #endif /* internal SWIG method */ #ifndef SWIGINTERN # define SWIGINTERN static SWIGUNUSED #endif /* internal inline SWIG method */ #ifndef SWIGINTERNINLINE # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE #endif /* exporting methods for Windows DLLs */ #ifndef SWIGEXPORT # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # if defined(STATIC_LINKED) # define SWIGEXPORT # else # define SWIGEXPORT __declspec(dllexport) # endif # else # define SWIGEXPORT # endif #endif /* calling conventions for Windows */ #ifndef SWIGSTDCALL # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # define SWIGSTDCALL __stdcall # else # define SWIGSTDCALL # endif #endif #include /*********************************************************************** * swigrun.swg * * This file contains generic CAPI SWIG runtime support for pointer * type checking. * ************************************************************************/ /* This should only be incremented when either the layout of swig_type_info changes, or for whatever reason, the runtime changes incompatibly */ #define SWIG_RUNTIME_VERSION "2" /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ #ifdef SWIG_TYPE_TABLE # define SWIG_QUOTE_STRING(x) #x # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) #else # define SWIG_TYPE_TABLE_NAME #endif /* You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for creating a static or dynamic library from the swig runtime code. In 99.9% of the cases, swig just needs to declare them as 'static'. But only do this if is strictly necessary, ie, if you have problems with your compiler or so. */ #ifndef SWIGRUNTIME # define SWIGRUNTIME SWIGINTERN #endif #ifndef SWIGRUNTIMEINLINE # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE #endif #include #ifdef __cplusplus extern "C" { #endif typedef void *(*swig_converter_func)(void *); typedef struct swig_type_info *(*swig_dycast_func)(void **); /* Structure to store inforomation on one type */ typedef struct swig_type_info { const char *name; /* mangled name of this type */ const char *str; /* human readable name of this type */ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ struct swig_cast_info *cast; /* linked list of types that can cast into this type */ void *clientdata; /* language specific type data */ } swig_type_info; /* Structure to store a type and conversion function used for casting */ typedef struct swig_cast_info { swig_type_info *type; /* pointer to type that is equivalent to this type */ swig_converter_func converter; /* function to cast the void pointers */ struct swig_cast_info *next; /* pointer to next cast in linked list */ struct swig_cast_info *prev; /* pointer to the previous cast */ } swig_cast_info; /* Structure used to store module information * Each module generates one structure like this, and the runtime collects * all of these structures and stores them in a circularly linked list.*/ typedef struct swig_module_info { swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ size_t size; /* Number of types in this module */ struct swig_module_info *next; /* Pointer to next element in circularly linked list */ swig_type_info **type_initial; /* Array of initially generated type structures */ swig_cast_info **cast_initial; /* Array of initially generated casting structures */ void *clientdata; /* Language specific module data */ } swig_module_info; /* Compare two type names skipping the space characters, therefore "char*" == "char *" and "Class" == "Class", etc. Return 0 when the two name types are equivalent, as in strncmp, but skipping ' '. */ SWIGRUNTIME int SWIG_TypeNameComp(const char *f1, const char *l1, const char *f2, const char *l2) { for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { while ((*f1 == ' ') && (f1 != l1)) ++f1; while ((*f2 == ' ') && (f2 != l2)) ++f2; if (*f1 != *f2) return (int)(*f1 - *f2); } return (l1 - f1) - (l2 - f2); } /* Check type equivalence in a name list like ||... Return 0 if not equal, 1 if equal */ SWIGRUNTIME int SWIG_TypeEquiv(const char *nb, const char *tb) { int equiv = 0; const char* te = tb + strlen(tb); const char* ne = nb; while (!equiv && *ne) { for (nb = ne; *ne; ++ne) { if (*ne == '|') break; } equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; if (*ne) ++ne; } return equiv; } /* Check type equivalence in a name list like ||... Return 0 if equal, -1 if nb < tb, 1 if nb > tb */ SWIGRUNTIME int SWIG_TypeCompare(const char *nb, const char *tb) { int equiv = 0; const char* te = tb + strlen(tb); const char* ne = nb; while (!equiv && *ne) { for (nb = ne; *ne; ++ne) { if (*ne == '|') break; } equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; if (*ne) ++ne; } return equiv; } /* think of this as a c++ template<> or a scheme macro */ #define SWIG_TypeCheck_Template(comparison, ty) \ if (ty) { \ swig_cast_info *iter = ty->cast; \ while (iter) { \ if (comparison) { \ if (iter == ty->cast) return iter; \ /* Move iter to the top of the linked list */ \ iter->prev->next = iter->next; \ if (iter->next) \ iter->next->prev = iter->prev; \ iter->next = ty->cast; \ iter->prev = 0; \ if (ty->cast) ty->cast->prev = iter; \ ty->cast = iter; \ return iter; \ } \ iter = iter->next; \ } \ } \ return 0 /* Check the typename */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty) { SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); } /* Same as previous function, except strcmp is replaced with a pointer comparison */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { SWIG_TypeCheck_Template(iter->type == from, into); } /* Cast a pointer up an inheritance hierarchy */ SWIGRUNTIMEINLINE void * SWIG_TypeCast(swig_cast_info *ty, void *ptr) { return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); } /* Dynamic pointer casting. Down an inheritance hierarchy */ SWIGRUNTIME swig_type_info * SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { swig_type_info *lastty = ty; if (!ty || !ty->dcast) return ty; while (ty && (ty->dcast)) { ty = (*ty->dcast)(ptr); if (ty) lastty = ty; } return lastty; } /* Return the name associated with this type */ SWIGRUNTIMEINLINE const char * SWIG_TypeName(const swig_type_info *ty) { return ty->name; } /* Return the pretty name associated with this type, that is an unmangled type name in a form presentable to the user. */ SWIGRUNTIME const char * SWIG_TypePrettyName(const swig_type_info *type) { /* The "str" field contains the equivalent pretty names of the type, separated by vertical-bar characters. We choose to print the last name, as it is often (?) the most specific. */ if (type->str != NULL) { const char *last_name = type->str; const char *s; for (s = type->str; *s; s++) if (*s == '|') last_name = s+1; return last_name; } else return type->name; } /* Set the clientdata field for a type */ SWIGRUNTIME void SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { swig_cast_info *cast = ti->cast; /* if (ti->clientdata == clientdata) return; */ ti->clientdata = clientdata; while (cast) { if (!cast->converter) { swig_type_info *tc = cast->type; if (!tc->clientdata) { SWIG_TypeClientData(tc, clientdata); } } cast = cast->next; } } /* Search for a swig_type_info structure only by mangled name Search is a O(log #types) We start searching at module start, and finish searching when start == end. Note: if start == end at the beginning of the function, we go all the way around the circular list. */ SWIGRUNTIME swig_type_info * SWIG_MangledTypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name) { swig_module_info *iter = start; do { if (iter->size) { register size_t l = 0; register size_t r = iter->size - 1; do { /* since l+r >= 0, we can (>> 1) instead (/ 2) */ register size_t i = (l + r) >> 1; const char *iname = iter->types[i]->name; if (iname) { register int compare = strcmp(name, iname); if (compare == 0) { return iter->types[i]; } else if (compare < 0) { if (i) { r = i - 1; } else { break; } } else if (compare > 0) { l = i + 1; } } else { break; /* should never happen */ } } while (l <= r); } iter = iter->next; } while (iter != end); return 0; } /* Search for a swig_type_info structure for either a mangled name or a human readable name. It first searches the mangled names of the types, which is a O(log #types) If a type is not found it then searches the human readable names, which is O(#types). We start searching at module start, and finish searching when start == end. Note: if start == end at the beginning of the function, we go all the way around the circular list. */ SWIGRUNTIME swig_type_info * SWIG_TypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name) { /* STEP 1: Search the name field using binary search */ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); if (ret) { return ret; } else { /* STEP 2: If the type hasn't been found, do a complete search of the str field (the human readable name) */ swig_module_info *iter = start; do { register size_t i = 0; for (; i < iter->size; ++i) { if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) return iter->types[i]; } iter = iter->next; } while (iter != end); } /* neither found a match */ return 0; } /* Pack binary data into a string */ SWIGRUNTIME char * SWIG_PackData(char *c, void *ptr, size_t sz) { static const char hex[17] = "0123456789abcdef"; register const unsigned char *u = (unsigned char *) ptr; register const unsigned char *eu = u + sz; for (; u != eu; ++u) { register unsigned char uu = *u; *(c++) = hex[(uu & 0xf0) >> 4]; *(c++) = hex[uu & 0xf]; } return c; } /* Unpack binary data from a string */ SWIGRUNTIME const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { register unsigned char *u = (unsigned char *) ptr; register const unsigned char *eu = u + sz; for (; u != eu; ++u) { register char d = *(c++); register unsigned char uu = 0; if ((d >= '0') && (d <= '9')) uu = ((d - '0') << 4); else if ((d >= 'a') && (d <= 'f')) uu = ((d - ('a'-10)) << 4); else return (char *) 0; d = *(c++); if ((d >= '0') && (d <= '9')) uu |= (d - '0'); else if ((d >= 'a') && (d <= 'f')) uu |= (d - ('a'-10)); else return (char *) 0; *u = uu; } return c; } /* Pack 'void *' into a string buffer. */ SWIGRUNTIME char * SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { char *r = buff; if ((2*sizeof(void *) + 2) > bsz) return 0; *(r++) = '_'; r = SWIG_PackData(r,&ptr,sizeof(void *)); if (strlen(name) + 1 > (bsz - (r - buff))) return 0; strcpy(r,name); return buff; } SWIGRUNTIME const char * SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { if (*c != '_') { if (strcmp(c,"NULL") == 0) { *ptr = (void *) 0; return name; } else { return 0; } } return SWIG_UnpackData(++c,ptr,sizeof(void *)); } SWIGRUNTIME char * SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { char *r = buff; size_t lname = (name ? strlen(name) : 0); if ((2*sz + 2 + lname) > bsz) return 0; *(r++) = '_'; r = SWIG_PackData(r,ptr,sz); if (lname) { strncpy(r,name,lname+1); } else { *r = 0; } return buff; } SWIGRUNTIME const char * SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { if (*c != '_') { if (strcmp(c,"NULL") == 0) { memset(ptr,0,sz); return name; } else { return 0; } } return SWIG_UnpackData(++c,ptr,sz); } #ifdef __cplusplus } #endif /* ----------------------------------------------------------------------------- * SWIG API. Portion that goes into the runtime * ----------------------------------------------------------------------------- */ #ifdef __cplusplus extern "C" { #endif /* ----------------------------------------------------------------------------- * for internal method declarations * ----------------------------------------------------------------------------- */ #ifndef SWIGINTERN # define SWIGINTERN static SWIGUNUSED #endif #ifndef SWIGINTERNINLINE # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE #endif /* Exception handling in wrappers */ #define SWIG_fail goto fail #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) #define SWIG_append_errmsg(msg) SWIG_Python_AddErrMesg(msg,0) #define SWIG_preppend_errmsg(msg) SWIG_Python_AddErrMesg(msg,1) #define SWIG_type_error(type,obj) SWIG_Python_TypeError(type,obj) #define SWIG_null_ref(type) SWIG_Python_NullRef(type) /* Contract support */ #define SWIG_contract_assert(expr, msg) \ if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else /* ----------------------------------------------------------------------------- * Constant declarations * ----------------------------------------------------------------------------- */ /* Constant Types */ #define SWIG_PY_INT 1 #define SWIG_PY_FLOAT 2 #define SWIG_PY_STRING 3 #define SWIG_PY_POINTER 4 #define SWIG_PY_BINARY 5 /* Constant information structure */ typedef struct swig_const_info { int type; char *name; long lvalue; double dvalue; void *pvalue; swig_type_info **ptype; } swig_const_info; /* ----------------------------------------------------------------------------- * Alloc. memory flags * ----------------------------------------------------------------------------- */ #define SWIG_OLDOBJ 1 #define SWIG_NEWOBJ SWIG_OLDOBJ + 1 #define SWIG_PYSTR SWIG_NEWOBJ + 1 #ifdef __cplusplus } #endif /*********************************************************************** * pyrun.swg * * This file contains the runtime support for Python modules * and includes code for managing global variables and pointer * type checking. * * Author : David Beazley (beazley@cs.uchicago.edu) ************************************************************************/ /* Common SWIG API */ #define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Python_ConvertPtr(obj, pp, type, flags) #define SWIG_NewPointerObj(p, type, flags) SWIG_Python_NewPointerObj(p, type, flags) #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) /* Python-specific SWIG API */ #define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) SWIG_Python_ConvertPacked(obj, ptr, sz, ty, flags) #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) /* Runtime API */ #define SWIG_GetModule(clientdata) SWIG_Python_GetModule() #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) /* ----------------------------------------------------------------------------- * Pointer declarations * ----------------------------------------------------------------------------- */ /* Use SWIG_NO_COBJECT_TYPES to force the use of strings to represent C/C++ pointers in the python side. Very useful for debugging, but not always safe. */ #if !defined(SWIG_NO_COBJECT_TYPES) && !defined(SWIG_COBJECT_TYPES) # define SWIG_COBJECT_TYPES #endif /* Flags for pointer conversion */ #define SWIG_POINTER_EXCEPTION 0x1 #define SWIG_POINTER_DISOWN 0x2 /* Add PyOS_snprintf for old Pythons */ #if PY_VERSION_HEX < 0x02020000 #define PyOS_snprintf snprintf #endif #ifdef __cplusplus extern "C" { #endif /* ----------------------------------------------------------------------------- * Create a new pointer string * ----------------------------------------------------------------------------- */ #ifndef SWIG_BUFFER_SIZE #define SWIG_BUFFER_SIZE 1024 #endif /* A crude PyString_FromFormat implementation for old Pythons */ #if PY_VERSION_HEX < 0x02020000 static PyObject * PyString_FromFormat(const char *fmt, ...) { va_list ap; char buf[SWIG_BUFFER_SIZE * 2]; int res; va_start(ap, fmt); res = vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); return (res < 0 || res >= sizeof(buf)) ? 0 : PyString_FromString(buf); } #endif #if PY_VERSION_HEX < 0x01060000 #define PyObject_Del(op) PyMem_DEL((op)) #endif #if defined(SWIG_COBJECT_TYPES) #if !defined(SWIG_COBJECT_PYTHON) /* ----------------------------------------------------------------------------- * Implements a simple Swig Object type, and use it instead of PyCObject * ----------------------------------------------------------------------------- */ typedef struct { PyObject_HEAD void *ptr; const char *desc; } PySwigObject; /* Declarations for objects of type PySwigObject */ SWIGRUNTIME int PySwigObject_print(PySwigObject *v, FILE *fp, int flags) { char result[SWIG_BUFFER_SIZE]; flags = flags; if (SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result))) { fputs("", fp); return 0; } else { return 1; } } SWIGRUNTIME PyObject * PySwigObject_repr(PySwigObject *v) { char result[SWIG_BUFFER_SIZE]; return SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result)) ? PyString_FromFormat("", result) : 0; } SWIGRUNTIME PyObject * PySwigObject_str(PySwigObject *v) { char result[SWIG_BUFFER_SIZE]; return SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result)) ? PyString_FromString(result) : 0; } SWIGRUNTIME PyObject * PySwigObject_long(PySwigObject *v) { return PyLong_FromVoidPtr(v->ptr); } SWIGRUNTIME PyObject * PySwigObject_format(const char* fmt, PySwigObject *v) { PyObject *res = NULL; PyObject *args = PyTuple_New(1); if (args && (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0)) { PyObject *ofmt = PyString_FromString(fmt); if (ofmt) { res = PyString_Format(ofmt,args); Py_DECREF(ofmt); } Py_DECREF(args); } return res; } SWIGRUNTIME PyObject * PySwigObject_oct(PySwigObject *v) { return PySwigObject_format("%o",v); } SWIGRUNTIME PyObject * PySwigObject_hex(PySwigObject *v) { return PySwigObject_format("%x",v); } SWIGRUNTIME int PySwigObject_compare(PySwigObject *v, PySwigObject *w) { int c = strcmp(v->desc, w->desc); if (c) { return (c > 0) ? 1 : -1; } else { void *i = v->ptr; void *j = w->ptr; return (i < j) ? -1 : ((i > j) ? 1 : 0); } } SWIGRUNTIME void PySwigObject_dealloc(PySwigObject *self) { PyObject_Del(self); } SWIGRUNTIME PyTypeObject* PySwigObject_type(void) { static char pyswigobject_type__doc__[] = "Swig object carries a C/C++ instance pointer"; static PyNumberMethods PySwigObject_as_number = { (binaryfunc)0, /*nb_add*/ (binaryfunc)0, /*nb_subtract*/ (binaryfunc)0, /*nb_multiply*/ (binaryfunc)0, /*nb_divide*/ (binaryfunc)0, /*nb_remainder*/ (binaryfunc)0, /*nb_divmod*/ (ternaryfunc)0,/*nb_power*/ (unaryfunc)0, /*nb_negative*/ (unaryfunc)0, /*nb_positive*/ (unaryfunc)0, /*nb_absolute*/ (inquiry)0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ (coercion)0, /*nb_coerce*/ (unaryfunc)PySwigObject_long, /*nb_int*/ (unaryfunc)PySwigObject_long, /*nb_long*/ (unaryfunc)0, /*nb_float*/ (unaryfunc)PySwigObject_oct, /*nb_oct*/ (unaryfunc)PySwigObject_hex, /*nb_hex*/ #if PY_VERSION_HEX >= 0x02020000 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ #elif PY_VERSION_HEX >= 0x02000000 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ #endif }; static PyTypeObject pyswigobject_type #if !defined(__cplusplus) ; static int type_init = 0; if (!type_init) { PyTypeObject tmp #endif = { PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ (char *)"PySwigObject", /*tp_name*/ sizeof(PySwigObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ /* methods */ (destructor)PySwigObject_dealloc, /*tp_dealloc*/ (printfunc)PySwigObject_print, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)0, /*tp_setattr*/ (cmpfunc)PySwigObject_compare, /*tp_compare*/ (reprfunc)PySwigObject_repr, /*tp_repr*/ &PySwigObject_as_number, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ (hashfunc)0, /*tp_hash*/ (ternaryfunc)0, /*tp_call*/ (reprfunc)PySwigObject_str, /*tp_str*/ /* Space for future expansion */ 0,0,0,0, pyswigobject_type__doc__, /* Documentation string */ #if PY_VERSION_HEX >= 0x02000000 0, /* tp_traverse */ 0, /* tp_clear */ #endif #if PY_VERSION_HEX >= 0x02010000 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #endif #if PY_VERSION_HEX >= 0x02020000 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ #endif #ifdef COUNT_ALLOCS 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; #if !defined(__cplusplus) pyswigobject_type = tmp; type_init = 1; } #endif return &pyswigobject_type; } SWIGRUNTIME PyObject * PySwigObject_FromVoidPtrAndDesc(void *ptr, const char *desc) { PySwigObject *self = PyObject_NEW(PySwigObject, PySwigObject_type()); if (self) { self->ptr = ptr; self->desc = desc; } return (PyObject *)self; } SWIGRUNTIMEINLINE void * PySwigObject_AsVoidPtr(PyObject *self) { return ((PySwigObject *)self)->ptr; } SWIGRUNTIMEINLINE const char * PySwigObject_GetDesc(PyObject *self) { return ((PySwigObject *)self)->desc; } SWIGRUNTIMEINLINE int PySwigObject_Check(PyObject *op) { return ((op)->ob_type == PySwigObject_type()) || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0); } /* ----------------------------------------------------------------------------- * Implements a simple Swig Packed type, and use it instead of string * ----------------------------------------------------------------------------- */ typedef struct { PyObject_HEAD void *pack; const char *desc; size_t size; } PySwigPacked; SWIGRUNTIME int PySwigPacked_print(PySwigPacked *v, FILE *fp, int flags) { char result[SWIG_BUFFER_SIZE]; flags = flags; fputs("pack, v->size, 0, sizeof(result))) { fputs("at ", fp); fputs(result, fp); } fputs(v->desc,fp); fputs(">", fp); return 0; } SWIGRUNTIME PyObject * PySwigPacked_repr(PySwigPacked *v) { char result[SWIG_BUFFER_SIZE]; if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { return PyString_FromFormat("", result, v->desc); } else { return PyString_FromFormat("", v->desc); } } SWIGRUNTIME PyObject * PySwigPacked_str(PySwigPacked *v) { char result[SWIG_BUFFER_SIZE]; if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ return PyString_FromFormat("%s%s", result, v->desc); } else { return PyString_FromString(v->desc); } } SWIGRUNTIME int PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w) { int c = strcmp(v->desc, w->desc); if (c) { return (c > 0) ? 1 : -1; } else { size_t i = v->size; size_t j = w->size; int s = (i < j) ? -1 : ((i > j) ? 1 : 0); return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); } } SWIGRUNTIME void PySwigPacked_dealloc(PySwigPacked *self) { free(self->pack); PyObject_Del(self); } SWIGRUNTIME PyTypeObject* PySwigPacked_type(void) { static char pyswigpacked_type__doc__[] = "Swig object carries a C/C++ instance pointer"; static PyTypeObject pyswigpacked_type #if !defined(__cplusplus) ; static int type_init = 0; if (!type_init) { PyTypeObject tmp #endif = { PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ (char *)"PySwigPacked", /*tp_name*/ sizeof(PySwigPacked), /*tp_basicsize*/ 0, /*tp_itemsize*/ /* methods */ (destructor)PySwigPacked_dealloc, /*tp_dealloc*/ (printfunc)PySwigPacked_print, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)0, /*tp_setattr*/ (cmpfunc)PySwigPacked_compare, /*tp_compare*/ (reprfunc)PySwigPacked_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ (hashfunc)0, /*tp_hash*/ (ternaryfunc)0, /*tp_call*/ (reprfunc)PySwigPacked_str, /*tp_str*/ /* Space for future expansion */ 0,0,0,0, pyswigpacked_type__doc__, /* Documentation string */ #if PY_VERSION_HEX >= 0x02000000 0, /* tp_traverse */ 0, /* tp_clear */ #endif #if PY_VERSION_HEX >= 0x02010000 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #endif #if PY_VERSION_HEX >= 0x02020000 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ #endif #ifdef COUNT_ALLOCS 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; #if !defined(__cplusplus) pyswigpacked_type = tmp; type_init = 1; } #endif return &pyswigpacked_type; } SWIGRUNTIME PyObject * PySwigPacked_FromDataAndDesc(void *ptr, size_t size, const char *desc) { PySwigPacked *self = PyObject_NEW(PySwigPacked, PySwigPacked_type()); if (self == NULL) { return NULL; } else { void *pack = malloc(size); if (pack) { memcpy(pack, ptr, size); self->pack = pack; self->desc = desc; self->size = size; return (PyObject *) self; } return NULL; } } SWIGRUNTIMEINLINE const char * PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size) { PySwigPacked *self = (PySwigPacked *)obj; if (self->size != size) return 0; memcpy(ptr, self->pack, size); return self->desc; } SWIGRUNTIMEINLINE const char * PySwigPacked_GetDesc(PyObject *self) { return ((PySwigPacked *)self)->desc; } SWIGRUNTIMEINLINE int PySwigPacked_Check(PyObject *op) { return ((op)->ob_type == PySwigPacked_type()) || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0); } #else /* ----------------------------------------------------------------------------- * Use the old Python PyCObject instead of PySwigObject * ----------------------------------------------------------------------------- */ #define PySwigObject_GetDesc(obj) PyCObject_GetDesc(obj) #define PySwigObject_Check(obj) PyCObject_Check(obj) #define PySwigObject_AsVoidPtr(obj) PyCObject_AsVoidPtr(obj) #define PySwigObject_FromVoidPtrAndDesc(p, d) PyCObject_FromVoidPtrAndDesc(p, d, NULL) #endif #endif /* ----------------------------------------------------------------------------- * errors manipulation * ----------------------------------------------------------------------------- */ SWIGRUNTIME void SWIG_Python_TypeError(const char *type, PyObject *obj) { if (type) { #if defined(SWIG_COBJECT_TYPES) if (obj && PySwigObject_Check(obj)) { const char *otype = (const char *) PySwigObject_GetDesc(obj); if (otype) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received", type, otype); return; } } else #endif { const char *otype = (obj ? obj->ob_type->tp_name : 0); if (otype) { PyObject *str = PyObject_Str(obj); const char *cstr = str ? PyString_AsString(str) : 0; if (cstr) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", type, otype, cstr); } else { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } Py_XDECREF(str); return; } } PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); } else { PyErr_Format(PyExc_TypeError, "unexpected type is received"); } } SWIGRUNTIMEINLINE void SWIG_Python_NullRef(const char *type) { if (type) { PyErr_Format(PyExc_TypeError, "null reference of type '%s' was received",type); } else { PyErr_Format(PyExc_TypeError, "null reference was received"); } } SWIGRUNTIME int SWIG_Python_AddErrMesg(const char* mesg, int infront) { if (PyErr_Occurred()) { PyObject *type = 0; PyObject *value = 0; PyObject *traceback = 0; PyErr_Fetch(&type, &value, &traceback); if (value) { PyObject *old_str = PyObject_Str(value); Py_XINCREF(type); PyErr_Clear(); if (infront) { PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str)); } else { PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); } Py_DECREF(old_str); } return 1; } else { return 0; } } SWIGRUNTIME int SWIG_Python_ArgFail(int argnum) { if (PyErr_Occurred()) { /* add information about failing argument */ char mesg[256]; PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); return SWIG_Python_AddErrMesg(mesg, 1); } else { return 0; } } /* ----------------------------------------------------------------------------- * pointers/data manipulation * ----------------------------------------------------------------------------- */ /* Convert a pointer value */ SWIGRUNTIME int SWIG_Python_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) { swig_cast_info *tc; const char *c = 0; static PyObject *SWIG_this = 0; int newref = 0; PyObject *pyobj = 0; void *vptr; if (!obj) return 0; if (obj == Py_None) { *ptr = 0; return 0; } #ifdef SWIG_COBJECT_TYPES if (!(PySwigObject_Check(obj))) { if (!SWIG_this) SWIG_this = PyString_FromString("this"); pyobj = obj; obj = PyObject_GetAttr(obj,SWIG_this); newref = 1; if (!obj) goto type_error; if (!PySwigObject_Check(obj)) { Py_DECREF(obj); goto type_error; } } vptr = PySwigObject_AsVoidPtr(obj); c = (const char *) PySwigObject_GetDesc(obj); if (newref) { Py_DECREF(obj); } goto type_check; #else if (!(PyString_Check(obj))) { if (!SWIG_this) SWIG_this = PyString_FromString("this"); pyobj = obj; obj = PyObject_GetAttr(obj,SWIG_this); newref = 1; if (!obj) goto type_error; if (!PyString_Check(obj)) { Py_DECREF(obj); goto type_error; } } c = PyString_AsString(obj); /* Pointer values must start with leading underscore */ c = SWIG_UnpackVoidPtr(c, &vptr, ty->name); if (newref) { Py_DECREF(obj); } if (!c) goto type_error; #endif type_check: if (ty) { tc = SWIG_TypeCheck(c,ty); if (!tc) goto type_error; *ptr = SWIG_TypeCast(tc,vptr); } else { *ptr = vptr; } if ((pyobj) && (flags & SWIG_POINTER_DISOWN)) { PyObject_SetAttrString(pyobj,(char*)"thisown",Py_False); } return 0; type_error: PyErr_Clear(); if (pyobj && !obj) { obj = pyobj; if (PyCFunction_Check(obj)) { /* here we get the method pointer for callbacks */ char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); c = doc ? strstr(doc, "swig_ptr: ") : 0; if (c) { c = ty ? SWIG_UnpackVoidPtr(c + 10, &vptr, ty->name) : 0; if (!c) goto type_error; goto type_check; } } } if (flags & SWIG_POINTER_EXCEPTION) { if (ty) { SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); } else { SWIG_Python_TypeError("C/C++ pointer", obj); } } return -1; } /* Convert a pointer value, signal an exception on a type mismatch */ SWIGRUNTIME void * SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) { void *result; if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { PyErr_Clear(); if (flags & SWIG_POINTER_EXCEPTION) { SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); SWIG_Python_ArgFail(argnum); } } return result; } /* Convert a packed value value */ SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty, int flags) { swig_cast_info *tc; const char *c = 0; #if defined(SWIG_COBJECT_TYPES) && !defined(SWIG_COBJECT_PYTHON) c = PySwigPacked_UnpackData(obj, ptr, sz); #else if ((!obj) || (!PyString_Check(obj))) goto type_error; c = PyString_AsString(obj); /* Pointer values must start with leading underscore */ c = SWIG_UnpackDataName(c, ptr, sz, ty->name); #endif if (!c) goto type_error; if (ty) { tc = SWIG_TypeCheck(c,ty); if (!tc) goto type_error; } return 0; type_error: PyErr_Clear(); if (flags & SWIG_POINTER_EXCEPTION) { if (ty) { SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); } else { SWIG_Python_TypeError("C/C++ packed data", obj); } } return -1; } /* Create a new array object */ SWIGRUNTIME PyObject * SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) { PyObject *robj = 0; if (!type) { if (!PyErr_Occurred()) { PyErr_Format(PyExc_TypeError, "Swig: null type passed to NewPointerObj"); } return robj; } if (!ptr) { Py_INCREF(Py_None); return Py_None; } #ifdef SWIG_COBJECT_TYPES robj = PySwigObject_FromVoidPtrAndDesc((void *) ptr, (char *)type->name); #else { char result[SWIG_BUFFER_SIZE]; robj = SWIG_PackVoidPtr(result, ptr, type->name, sizeof(result)) ? PyString_FromString(result) : 0; } #endif if (!robj || (robj == Py_None)) return robj; if (type->clientdata) { PyObject *inst; PyObject *args = Py_BuildValue((char*)"(O)", robj); Py_DECREF(robj); inst = PyObject_CallObject((PyObject *) type->clientdata, args); Py_DECREF(args); if (inst) { if (own) { PyObject_SetAttrString(inst,(char*)"thisown",Py_True); } robj = inst; } } return robj; } SWIGRUNTIME PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { PyObject *robj = 0; if (!ptr) { Py_INCREF(Py_None); return Py_None; } #if defined(SWIG_COBJECT_TYPES) && !defined(SWIG_COBJECT_PYTHON) robj = PySwigPacked_FromDataAndDesc((void *) ptr, sz, (char *)type->name); #else { char result[SWIG_BUFFER_SIZE]; robj = SWIG_PackDataName(result, ptr, sz, type->name, sizeof(result)) ? PyString_FromString(result) : 0; } #endif return robj; } /* -----------------------------------------------------------------------------* * Get type list * -----------------------------------------------------------------------------*/ #ifdef SWIG_LINK_RUNTIME void *SWIG_ReturnGlobalTypeList(void *); #endif SWIGRUNTIME swig_module_info * SWIG_Python_GetModule(void) { static void *type_pointer = (void *)0; /* first check if module already created */ if (!type_pointer) { #ifdef SWIG_LINK_RUNTIME type_pointer = SWIG_ReturnGlobalTypeList((void *)0); #else type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); if (PyErr_Occurred()) { PyErr_Clear(); type_pointer = (void *)0; } #endif } return (swig_module_info *) type_pointer; } #if PY_MAJOR_VERSION < 2 /* PyModule_AddObject function was introduced in Python 2.0. The following function is copied out of Python/modsupport.c in python version 2.3.4 */ SWIGINTERN int PyModule_AddObject(PyObject *m, char *name, PyObject *o) { PyObject *dict; if (!PyModule_Check(m)) { PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg"); return -1; } if (!o) { PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value"); return -1; } dict = PyModule_GetDict(m); if (dict == NULL) { /* Internal error -- modules must have a dict! */ PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", PyModule_GetName(m)); return -1; } if (PyDict_SetItemString(dict, name, o)) return -1; Py_DECREF(o); return 0; } #endif SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info *swig_module) { static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */ PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, NULL); if (pointer && module) { PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); } } #ifdef __cplusplus } #endif /* -------- TYPES TABLE (BEGIN) -------- */ #define SWIGTYPE_p_CardInfo swig_types[0] #define SWIGTYPE_p_DBInfo swig_types[1] #define SWIGTYPE_p_DBSizeInfo swig_types[2] #define SWIGTYPE_p_NetSyncInfo swig_types[3] #define SWIGTYPE_p_PilotUser swig_types[4] #define SWIGTYPE_p_SysInfo swig_types[5] #define SWIGTYPE_p_VFSAnyMountParam swig_types[6] #define SWIGTYPE_p_VFSDirInfo swig_types[7] #define SWIGTYPE_p_VFSInfo swig_types[8] #define SWIGTYPE_p_VFSSlotMountParam swig_types[9] #define SWIGTYPE_p_char swig_types[10] #define SWIGTYPE_p_int swig_types[11] #define SWIGTYPE_p_long swig_types[12] #define SWIGTYPE_p_p_char swig_types[13] #define SWIGTYPE_p_p_pi_protocol swig_types[14] #define SWIGTYPE_p_pi_buffer_t swig_types[15] #define SWIGTYPE_p_pi_device swig_types[16] #define SWIGTYPE_p_pi_protocol swig_types[17] #define SWIGTYPE_p_pi_socket swig_types[18] #define SWIGTYPE_p_pi_socket_list swig_types[19] #define SWIGTYPE_p_recordid_t swig_types[20] #define SWIGTYPE_p_size_t swig_types[21] #define SWIGTYPE_p_sockaddr swig_types[22] #define SWIGTYPE_p_ssize_t swig_types[23] #define SWIGTYPE_p_time_t swig_types[24] #define SWIGTYPE_p_unsigned_char swig_types[25] #define SWIGTYPE_p_unsigned_long swig_types[26] #define SWIGTYPE_ptrdiff_t swig_types[27] #define SWIGTYPE_size_t swig_types[28] static swig_type_info *swig_types[30]; static swig_module_info swig_module = {swig_types, 29, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) /* -------- TYPES TABLE (END) -------- */ /*----------------------------------------------- @(target):= _pisock.so ------------------------------------------------*/ #define SWIG_init init_pisock #define SWIG_name "_pisock" #include #include "pi-header.h" #include "pi-source.h" #include "pi-error.h" #include "pi-socket.h" #include "pi-dlp.h" #include "pi-file.h" #include "pi-util.h" #define DGETLONG(src,key,default) (PyDict_GetItemString(src,key) ? \ PyInt_AsLong(PyDict_GetItemString(src,key)) : default) #define DGETSTR(src,key,default) (PyDict_GetItemString(src,key) ? \ PyString_AsString(PyDict_GetItemString(src,key)) : default) static PyObject *PIError = NULL; static PyObject *ConvertFromEncoding(const char *data, const char *encoding, const char *errors, int allowErrors) { PyObject *buffer, *string = NULL; buffer = PyBuffer_FromMemory((void *)data, strlen(data)); if (buffer == NULL) { if (allowErrors) { PyErr_Clear(); Py_INCREF(Py_None); return Py_None; } return NULL; } string = PyUnicode_FromEncodedObject(buffer, encoding, errors); if (string == NULL) goto error; Py_DECREF(buffer); return string; error: Py_XDECREF(buffer); Py_XDECREF(string); if (allowErrors) { PyErr_Clear(); Py_INCREF(Py_None); return Py_None; } return NULL; } static int ConvertToEncoding(PyObject *object, const char *encoding, const char *errors, int allowErrors, char *buffer, int maxBufSize) { int len; char *s; PyObject *encoded = NULL; if (PyString_Check(object)) encoded = PyString_AsEncodedObject(object, encoding, errors); else if (PyUnicode_Check(object)) encoded = PyUnicode_AsEncodedString(object, encoding, errors); if (encoded == NULL) goto error; s = PyString_AsString(encoded); if (s == NULL) goto error; len = strlen(s); if (len) { if (len >= maxBufSize) len = maxBufSize - 1; memcpy(buffer, s, len); } buffer[len] = 0; Py_DECREF(encoded); return 1; error: Py_XDECREF(encoded); if (allowErrors) { PyErr_Clear(); memset(buffer, 0, maxBufSize); } return 0; } static PyObject *PyObjectFromDBInfo(const struct DBInfo *dbi) { PyObject *returnObj; PyObject *nameObj = ConvertFromEncoding(dbi->name, "palmos", "replace", 1); returnObj = Py_BuildValue("{sisisisOsOsislslslslsisOsisisisisisisisisisisisisisisi}", "more", dbi->more, "flags", dbi->flags, "miscFlags", dbi->miscFlags, "type", PyString_FromStringAndSize(printlong(dbi->type), 4), "creator", PyString_FromStringAndSize(printlong(dbi->creator), 4), "version", dbi->version, "modnum", dbi->modnum, "createDate", dbi->createDate, "modifyDate", dbi->modifyDate, "backupDate", dbi->backupDate, "index", dbi->index, "name", nameObj, "flagResource", !!(dbi->flags & dlpDBFlagResource), "flagReadOnly", !!(dbi->flags & dlpDBFlagReadOnly), "flagAppInfoDirty", !!(dbi->flags & dlpDBFlagAppInfoDirty), "flagBackup", !!(dbi->flags & dlpDBFlagBackup), "flagLaunchable", !!(dbi->flags & dlpDBFlagLaunchable), "flagOpen", !!(dbi->flags & dlpDBFlagOpen), "flagNewer", !!(dbi->flags & dlpDBFlagNewer), "flagReset", !!(dbi->flags & dlpDBFlagReset), "flagCopyPrevention", !!(dbi->flags & dlpDBFlagCopyPrevention), "flagStream", !!(dbi->flags & dlpDBFlagStream), "flagExcludeFromSync", !!(dbi->miscFlags & dlpDBMiscFlagExcludeFromSync), "flagSchema", !!(dbi->flags & dlpDBFlagSchema), "flagSecure", !!(dbi->flags & dlpDBFlagSecure), "flagExtended", !!(dbi->flags & dlpDBFlagExtended), "flagFixedUp", !!(dbi->flags & dlpDBFlagFixedUp)); Py_DECREF(nameObj); return returnObj; } /* unused at that time static int PyObjectToDBInfo(PyObject *o, struct DBInfo *di) { PyObject *nameObj; di->more = (int) DGETLONG(o, "more", 0); di->type = makelong(DGETSTR(o, "type", " ")); di->creator = makelong(DGETSTR(o, "creator", " ")); di->version = DGETLONG(o, "version", 0); di->modnum = DGETLONG(o, "modnum", 0); di->createDate = DGETLONG(o, "createDate", 0); di->modifyDate = DGETLONG(o, "modifyDate", 0); di->backupDate = DGETLONG(o, "backupDate", 0); di->index = DGETLONG(o, "index", 0); memset(di->name, 0, sizeof(di->name)); nameObj = PyDict_GetItemString(o,"name"); if (nameObj) { if (!ConvertToEncoding(nameObj, "palmos", "replace", 1, di->name, sizeof(di->name))) return 0; } di->flags = 0; if (DGETLONG(o,"flagResource",0)) di->flags |= dlpDBFlagResource; if (DGETLONG(o,"flagReadOnly",0)) di->flags |= dlpDBFlagReadOnly; if (DGETLONG(o,"flagAppInfoDirty",0)) di->flags |= dlpDBFlagAppInfoDirty; if (DGETLONG(o,"flagBackup",0)) di->flags |= dlpDBFlagBackup; if (DGETLONG(o,"flagLaunchable",0)) di->flags |= dlpDBFlagLaunchable; if (DGETLONG(o,"flagOpen",0)) di->flags |= dlpDBFlagOpen; if (DGETLONG(o,"flagNewer",0)) di->flags |= dlpDBFlagNewer; if (DGETLONG(o,"flagReset",0)) di->flags |= dlpDBFlagReset; if (DGETLONG(o,"flagCopyPrevention",0)) di->flags |= dlpDBFlagCopyPrevention; if (DGETLONG(o,"flagStream",0)) di->flags |= dlpDBFlagStream; if (DGETLONG(o,"flagSchema",0)) di->flags |= dlpDBFlagSchema; if (DGETLONG(o,"flagSecure",0)) di->flags |= dlpDBFlagSecure; if (DGETLONG(o,"flagExtended",0)) di->flags |= dlpDBFlagExtended; if (DGETLONG(o,"flagFixedUp",0)) di->flags |= dlpDBFlagFixedUp; di->miscFlags = 0; if (DGETLONG(o,"flagExcludeFromSync",0)) di->miscFlags |= dlpDBMiscFlagExcludeFromSync; return 1; } */ static PyObject* PyObjectFromDBSizeInfo(const struct DBSizeInfo *si) { return Py_BuildValue("{slslslslslsl}", "numRecords", si->numRecords, "totalBytes", si->totalBytes, "dataBytes", si->dataBytes, "appBlockSize", si->appBlockSize, "sortBlockSize", si->sortBlockSize, "maxRecSize", si->maxRecSize); } static PyObject* PyObjectFromCardInfo(const struct CardInfo *ci) { PyObject *returnObj, *nameObj, *manufacturerObj; nameObj = ConvertFromEncoding(ci->name, "cp1252", "replace", 1); manufacturerObj = ConvertFromEncoding(ci->manufacturer, "cp1252", "replace", 1); returnObj = Py_BuildValue("{sisislslslslsOsOsi}", "card", ci->card, "version", ci->version, "creation", ci->creation, "romSize", ci->romSize, "ramSize", ci->ramSize, "ramFree", ci->ramFree, "name", nameObj, "manufacturer", manufacturerObj, "more", ci->more); Py_DECREF(nameObj); Py_DECREF(manufacturerObj); return returnObj; } static PyObject* PyObjectFromSysInfo(const struct SysInfo *si) { return Py_BuildValue("{slslss#}", "romVersion", si->romVersion, "locale", si->locale, "name", si->prodID, si->prodIDLength); } static PyObject* PyObjectFromPilotUser(const struct PilotUser *pi) { PyObject *nameObj, *passwordObj, *returnObj; nameObj = ConvertFromEncoding(pi->username, "palmos", "replace", 1); passwordObj = ConvertFromEncoding(pi->password, "palmos", "strict", 1); returnObj = Py_BuildValue("{slslslslslsOsO}", "userID", pi->userID, "viewerID", pi->viewerID, "lastSyncPC", pi->lastSyncPC, "successfulSyncDate", pi->successfulSyncDate, "lastSyncDate", pi->lastSyncDate, "name", nameObj, "password", passwordObj); Py_DECREF(nameObj); Py_DECREF(passwordObj); return returnObj; } static int PyObjectToPilotUser(PyObject *o, struct PilotUser *pi) { /* return 0 if string conversion to palmos charset failed, otherwise return 1 */ PyObject *stringObj; pi->userID = DGETLONG(o,"userID",0); pi->viewerID = DGETLONG(o,"viewerID",0); pi->lastSyncPC = DGETLONG(o,"lastSyncPC",0); pi->successfulSyncDate = DGETLONG(o,"successfulSyncDate",0); pi->lastSyncDate = DGETLONG(o,"lastSyncDate",0); memset(pi->username, 0, sizeof(pi->username)); stringObj = PyDict_GetItemString(o,"name"); if (stringObj) { if (!ConvertToEncoding(stringObj, "palmos", "replace", 0, pi->username, sizeof(pi->username))) return 0; } memset(pi->password, 0, sizeof(pi->password)); stringObj = PyDict_GetItemString(o,"password"); if (stringObj) { if (!ConvertToEncoding(stringObj, "palmos", "strict", 0, pi->password, sizeof(pi->password))) return 0; } return 1; } static PyObject* PyObjectFromNetSyncInfo(const struct NetSyncInfo *ni) { return Py_BuildValue("{sissssss}", "lanSync", ni->lanSync, "hostName", ni->hostName, "hostAddress", ni->hostAddress, "hostSubnetMask", ni->hostSubnetMask); } static void PyObjectToNetSyncInfo(PyObject *o, struct NetSyncInfo *ni) { ni->lanSync = (int) DGETLONG(o,"lanSync",0); strncpy(ni->hostName, DGETSTR(o,"hostName",""), sizeof(ni->hostName)); strncpy(ni->hostAddress, DGETSTR(o,"hostAddress",""), sizeof(ni->hostAddress)); strncpy(ni->hostSubnetMask, DGETSTR(o,"hostSubnetMask",""), sizeof(ni->hostSubnetMask)); } static int pythonWrapper_handlePiErr(int sd, int err) { /* This function is called by each function * which receives a PI_ERR return code */ if (err == PI_ERR_DLP_PALMOS) { int palmerr = pi_palmos_error(sd); if (palmerr == dlpErrNoError) return 0; if (palmerr > dlpErrNoError && palmerr <= dlpErrUnknown) { PyErr_SetObject(PIError, Py_BuildValue("(is)", palmerr, dlp_strerror(palmerr))); return err; } } if (IS_PROT_ERR(err)) PyErr_SetObject(PIError, Py_BuildValue("(is)", err, "protocol error")); else if (IS_SOCK_ERR(err)) PyErr_SetObject(PIError, Py_BuildValue("(is)", err, "socket error")); else if (IS_DLP_ERR(err)) PyErr_SetObject(PIError, Py_BuildValue("(is)", err, "DLP error")); else if (IS_FILE_ERR(err)) PyErr_SetObject(PIError, Py_BuildValue("(is)", err, "file error")); else if (IS_GENERIC_ERR(err)) PyErr_SetObject(PIError, Py_BuildValue("(is)", err, "generic error")); else PyErr_SetObject(PIError, Py_BuildValue("(is)", err, "pisock error")); return err; } static PyObject *_wrap_dlp_ReadRecordIDList (PyObject *self, PyObject *args) { int sd, dbhandle, sort, start, max; int ret; recordid_t *buf; int count, i; PyObject *list; buf = (recordid_t *)PyMem_Malloc(0xFFFF); if (!PyArg_ParseTuple(args, "iiiii", &sd, &dbhandle, &sort, &start, &max)) return NULL; /* this is a rather simplistic wrapper. if max is too big, we just * refuse to do it; we don't loop, figuring that that is the job of * the python wrapper. */ if (max > (0xFFFF/sizeof(recordid_t))) { PyErr_SetString(PyExc_ValueError, "can only return about 64k worth of ids at once"); return NULL; } { PyThreadState *save = PyEval_SaveThread(); ret = dlp_ReadRecordIDList(sd, dbhandle, sort, start, max, buf, &count); PyEval_RestoreThread(save); } if (ret < 0) { PyErr_SetObject(PIError, Py_BuildValue("(is)", ret, dlp_strerror(ret))); PyMem_Free(buf); return NULL; } list = PyList_New(0); for (i=0; i SWIGINTERN int SWIG_CheckLongInRange(long value, long min_value, long max_value, const char *errmsg) { if (value < min_value) { if (errmsg) { PyErr_Format(PyExc_OverflowError, "value %ld is less than '%s' minimum %ld", value, errmsg, min_value); } return 0; } else if (value > max_value) { if (errmsg) { PyErr_Format(PyExc_OverflowError, "value %ld is greater than '%s' maximum %ld", value, errmsg, max_value); } return 0; } return 1; } SWIGINTERN int SWIG_AsVal_long(PyObject * obj, long* val) { if (PyLong_Check(obj)) { long v = PyLong_AsLong(obj); if (!PyErr_Occurred()) { if (val) *val = v; return 1; } else { if (!val) PyErr_Clear(); return 0; } } if (PyInt_Check(obj)) { if (val) *val = PyInt_AsLong(obj); return 1; } if (val) { SWIG_type_error("long", obj); } return 0; } #if INT_MAX != LONG_MAX SWIGINTERN int SWIG_AsVal_int(PyObject *obj, int *val) { const char* errmsg = val ? "int" : (char*)0; long v; if (SWIG_AsVal_long(obj, &v)) { if (SWIG_CheckLongInRange(v, INT_MIN,INT_MAX, errmsg)) { if (val) *val = (int)(v); return 1; } else { return 0; } } else { PyErr_Clear(); } if (val) { SWIG_type_error(errmsg, obj); } return 0; } #else SWIGINTERNINLINE int SWIG_AsVal_int(PyObject *obj, int *val) { return SWIG_AsVal_long(obj,(long*)val); } #endif SWIGINTERNINLINE int SWIG_As_int(PyObject* obj) { int v; if (!SWIG_AsVal_int(obj, &v)) { /* this is needed to make valgrind/purify happier. */ memset((void*)&v, 0, sizeof(int)); } return v; } SWIGINTERNINLINE int SWIG_Check_int(PyObject* obj) { return SWIG_AsVal_int(obj, (int*)0); } SWIGINTERN int SWIG_AsVal_unsigned_SS_long(PyObject *obj, unsigned long *val) { if (PyLong_Check(obj)) { unsigned long v = PyLong_AsUnsignedLong(obj); if (!PyErr_Occurred()) { if (val) *val = v; return 1; } else { if (!val) PyErr_Clear(); return 0; } } if (PyInt_Check(obj)) { long v = PyInt_AsLong(obj); if (v >= 0) { if (val) *val = v; return 1; } } if (val) { SWIG_type_error("unsigned long", obj); } return 0; } SWIGINTERNINLINE unsigned long SWIG_As_unsigned_SS_long(PyObject* obj) { unsigned long v; if (!SWIG_AsVal_unsigned_SS_long(obj, &v)) { /* this is needed to make valgrind/purify happier. */ memset((void*)&v, 0, sizeof(unsigned long)); } return v; } SWIGINTERNINLINE int SWIG_Check_unsigned_SS_long(PyObject* obj) { return SWIG_AsVal_unsigned_SS_long(obj, (unsigned long*)0); } SWIGINTERNINLINE PyObject* SWIG_From_unsigned_SS_long(unsigned long value) { return (value > LONG_MAX) ? PyLong_FromUnsignedLong(value) : PyInt_FromLong((long)(value)); } SWIGINTERN PyObject* t_output_helper(PyObject* target, PyObject* o) { if (!target) { target = o; } else if (target == Py_None) { Py_DECREF(target); target = o; } else { if (!PyList_Check(target)) { PyObject *o2 = target; target = PyList_New(1); PyList_SetItem(target, 0, o2); } PyList_Append(target,o); Py_DECREF(o); } return target; } /* returns SWIG_OLDOBJ if the input is a raw char*, SWIG_PYSTR if is a PyString */ SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize) { static swig_type_info* pchar_info = 0; char* vptr = 0; if (!pchar_info) pchar_info = SWIG_TypeQuery("char *"); if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_info, 0) != -1) { if (cptr) *cptr = vptr; if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0; return SWIG_OLDOBJ; } else { PyErr_Clear(); if (PyString_Check(obj)) { if (cptr) { *cptr = PyString_AS_STRING(obj); if (psize) { *psize = PyString_GET_SIZE(obj) + 1; } } return SWIG_PYSTR; } } if (cptr) { SWIG_type_error("char *", obj); } return 0; } SWIGINTERNINLINE int SWIG_AsCharPtr(PyObject *obj, char **val) { if (SWIG_AsCharPtrAndSize(obj, val, (size_t*)(0))) { return 1; } if (val) { PyErr_Clear(); SWIG_type_error("char *", obj); } return 0; } /*@/usr/share/swig1.3/python/pymacros.swg,72,SWIG_define@*/ #define SWIG_From_long PyInt_FromLong /*@@*/ SWIGINTERN int SWIG_AsCharArray(PyObject *obj, char *val, size_t size) { char* cptr; size_t csize; if (SWIG_AsCharPtrAndSize(obj, &cptr, &csize)) { /* in C you can do: char x[5] = "hello"; ie, assing the array using an extra '0' char. */ if ((csize == size + 1) && !(cptr[csize-1])) --csize; if (csize <= size) { if (val) { if (csize) memcpy(val, cptr, csize); if (csize < size) memset(val + csize, 0, size - csize); } return 1; } } if (val) { PyErr_Format(PyExc_TypeError, "a char array of maximum size %lu is expected", (unsigned long) size); } return 0; } SWIGINTERNINLINE PyObject * SWIG_FromCharArray(const char* carray, size_t size) { if (size > INT_MAX) { return SWIG_NewPointerObj((char *)(carray), SWIG_TypeQuery("char *"), 0); } else { return PyString_FromStringAndSize(carray, (int)(size)); } } SWIGINTERNINLINE int SWIG_CheckUnsignedLongInRange(unsigned long value, unsigned long max_value, const char *errmsg) { if (value > max_value) { if (errmsg) { PyErr_Format(PyExc_OverflowError, "value %lu is greater than '%s' minimum %lu", value, errmsg, max_value); } return 0; } return 1; } SWIGINTERN int SWIG_AsVal_unsigned_SS_short(PyObject *obj, unsigned short *val) { const char* errmsg = val ? "unsigned short" : (char*)0; unsigned long v; if (SWIG_AsVal_unsigned_SS_long(obj, &v)) { if (SWIG_CheckUnsignedLongInRange(v, USHRT_MAX, errmsg)) { if (val) *val = (unsigned short)(v); return 1; } else { return 0; } } else { PyErr_Clear(); } if (val) { SWIG_type_error(errmsg, obj); } return 0; } SWIGINTERNINLINE unsigned short SWIG_As_unsigned_SS_short(PyObject* obj) { unsigned short v; if (!SWIG_AsVal_unsigned_SS_short(obj, &v)) { /* this is needed to make valgrind/purify happier. */ memset((void*)&v, 0, sizeof(unsigned short)); } return v; } SWIGINTERNINLINE int SWIG_Check_unsigned_SS_short(PyObject* obj) { return SWIG_AsVal_unsigned_SS_short(obj, (unsigned short*)0); } /*@/usr/share/swig1.3/python/pymacros.swg,72,SWIG_define@*/ #define SWIG_From_unsigned_SS_short PyInt_FromLong /*@@*/ SWIGINTERNINLINE long SWIG_As_long(PyObject* obj) { long v; if (!SWIG_AsVal_long(obj, &v)) { /* this is needed to make valgrind/purify happier. */ memset((void*)&v, 0, sizeof(long)); } return v; } SWIGINTERNINLINE int SWIG_Check_long(PyObject* obj) { return SWIG_AsVal_long(obj, (long*)0); } SWIGINTERN int SWIG_AsVal_unsigned_SS_char(PyObject *obj, unsigned char *val) { const char* errmsg = val ? "unsigned char" : (char*)0; unsigned long v; if (SWIG_AsVal_unsigned_SS_long(obj, &v)) { if (SWIG_CheckUnsignedLongInRange(v, UCHAR_MAX,errmsg)) { if (val) *val = (unsigned char)(v); return 1; } else { return 0; } } else { PyErr_Clear(); } if (val) { SWIG_type_error(errmsg, obj); } return 0; } SWIGINTERNINLINE unsigned char SWIG_As_unsigned_SS_char(PyObject* obj) { unsigned char v; if (!SWIG_AsVal_unsigned_SS_char(obj, &v)) { /* this is needed to make valgrind/purify happier. */ memset((void*)&v, 0, sizeof(unsigned char)); } return v; } SWIGINTERNINLINE int SWIG_Check_unsigned_SS_char(PyObject* obj) { return SWIG_AsVal_unsigned_SS_char(obj, (unsigned char*)0); } /*@/usr/share/swig1.3/python/pymacros.swg,72,SWIG_define@*/ #define SWIG_From_unsigned_SS_char PyInt_FromLong /*@@*/ #if UINT_MAX != ULONG_MAX SWIGINTERN int SWIG_AsVal_unsigned_SS_int(PyObject *obj, unsigned int *val) { const char* errmsg = val ? "unsigned int" : (char*)0; unsigned long v; if (SWIG_AsVal_unsigned_SS_long(obj, &v)) { if (SWIG_CheckUnsignedLongInRange(v, INT_MAX, errmsg)) { if (val) *val = (unsigned int)(v); return 1; } } else { PyErr_Clear(); } if (val) { SWIG_type_error(errmsg, obj); } return 0; } #else SWIGINTERNINLINE unsigned int SWIG_AsVal_unsigned_SS_int(PyObject *obj, unsigned int *val) { return SWIG_AsVal_unsigned_SS_long(obj,(unsigned long *)val); } #endif SWIGINTERNINLINE unsigned int SWIG_As_unsigned_SS_int(PyObject* obj) { unsigned int v; if (!SWIG_AsVal_unsigned_SS_int(obj, &v)) { /* this is needed to make valgrind/purify happier. */ memset((void*)&v, 0, sizeof(unsigned int)); } return v; } SWIGINTERNINLINE int SWIG_Check_unsigned_SS_int(PyObject* obj) { return SWIG_AsVal_unsigned_SS_int(obj, (unsigned int*)0); } #if UINT_MAX < LONG_MAX /*@/usr/share/swig1.3/python/pymacros.swg,72,SWIG_define@*/ #define SWIG_From_unsigned_SS_int SWIG_From_long /*@@*/ #else /*@/usr/share/swig1.3/python/pymacros.swg,72,SWIG_define@*/ #define SWIG_From_unsigned_SS_int SWIG_From_unsigned_SS_long /*@@*/ #endif #ifdef __cplusplus extern "C" { #endif /* * Python syntax: pi_file_install(sd, cardno, filename, callback) */ static PyObject *_wrap_pi_file_install (PyObject *self, PyObject *args) { PyObject *obj1 = NULL; PyObject *obj2 = NULL; PyObject *obj3 = NULL; PyObject *cback = NULL; int sd, cardno, result; char *path = NULL; pi_file_t *pf = NULL; if (!PyArg_ParseTuple(args,(char *)"OOOO:pi_file_install",&obj1, &obj2, &obj3, &cback)) return NULL; sd = (int)SWIG_As_int(obj1); cardno = (int)SWIG_As_int(obj2); if (!SWIG_AsCharPtr(obj3, (char**)&path)) { SWIG_arg_fail(3); return NULL; } pf = pi_file_open(path); if (pf == NULL) { PyErr_SetObject(PIError, Py_BuildValue("(is)", PI_ERR_FILE_INVALID, "invalid file")); return NULL; } { PyThreadState *save = PyEval_SaveThread(); result = pi_file_install(pf, sd, cardno, NULL); PyEval_RestoreThread(save); } pi_file_close(pf); if (result < 0) { pythonWrapper_handlePiErr(sd, result); return NULL; } Py_INCREF(Py_None); return Py_None; } /* * Python syntax: pi_file_retrieve(sd, cardno, dbname, storagepath, callback) */ static PyObject *_wrap_pi_file_retrieve (PyObject *self, PyObject *args) { PyObject *obj1 = NULL; PyObject *obj2 = NULL; PyObject *obj3 = NULL; PyObject *obj4 = NULL; PyObject *cback = NULL; int sd, cardno, result; char *dbname = NULL; char *path = NULL; struct DBInfo dbi; pi_file_t *pf = NULL; PyThreadState *save; if (!PyArg_ParseTuple(args, (char *)"OOOOO:pi_file_retrieve",&obj1,&obj2,&obj3,&obj4,&cback)) return NULL; sd = SWIG_As_int(obj1); cardno = SWIG_As_int(obj2); if (!SWIG_AsCharPtr(obj3, (char**)&dbname)) { SWIG_arg_fail(3); return NULL; } if (!SWIG_AsCharPtr(obj4, (char **)&path)) { SWIG_arg_fail(4); return NULL; } /* let other threads run */ save = PyEval_SaveThread(); memset(&dbi, 0, sizeof(dbi)); result = dlp_FindDBByName(sd, cardno, dbname, NULL, NULL, &dbi, NULL); if (result < 0) { PyEval_RestoreThread(save); pythonWrapper_handlePiErr(sd, result); return NULL; } pf = pi_file_create(path, &dbi); if (pf == NULL) { PyEval_RestoreThread(save); PyErr_SetObject(PIError, Py_BuildValue("(is)", PI_ERR_FILE_INVALID, "invalid file")); return NULL; } result = pi_file_retrieve(pf, sd, cardno, NULL); if (result < 0) { PyEval_RestoreThread(save); pythonWrapper_handlePiErr(sd, result); return NULL; } result = pi_file_close(pf); PyEval_RestoreThread(save); if (result < 0) { pythonWrapper_handlePiErr(sd, result); return NULL; } Py_INCREF(Py_None); return Py_None; } static PyObject *_wrap_pi_socket_t_sd_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_sd_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->sd = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_sd_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_sd_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->sd); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_type_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_type_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->type = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_type_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_type_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->type); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_protocol_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_protocol_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->protocol = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_protocol_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_protocol_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->protocol); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_cmd_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_cmd_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->cmd = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_cmd_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_cmd_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->cmd); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_laddr_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; struct sockaddr *arg2 = (struct sockaddr *) 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_laddr_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_sockaddr, SWIG_POINTER_EXCEPTION | SWIG_POINTER_DISOWN); if (SWIG_arg_fail(2)) SWIG_fail; if (arg1) (arg1)->laddr = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_laddr_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; struct sockaddr *result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_laddr_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (struct sockaddr *) ((arg1)->laddr); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_sockaddr, 0); return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_laddrlen_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; size_t arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_laddrlen_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (size_t)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->laddrlen = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_laddrlen_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; size_t result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_laddrlen_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = ((arg1)->laddrlen); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_raddr_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; struct sockaddr *arg2 = (struct sockaddr *) 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_raddr_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_sockaddr, SWIG_POINTER_EXCEPTION | SWIG_POINTER_DISOWN); if (SWIG_arg_fail(2)) SWIG_fail; if (arg1) (arg1)->raddr = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_raddr_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; struct sockaddr *result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_raddr_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (struct sockaddr *) ((arg1)->raddr); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_sockaddr, 0); return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_raddrlen_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; size_t arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_raddrlen_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (size_t)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->raddrlen = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_raddrlen_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; size_t result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_raddrlen_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = ((arg1)->raddrlen); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_protocol_queue_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; struct pi_protocol **arg2 = (struct pi_protocol **) 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_protocol_queue_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_p_pi_protocol, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(2)) SWIG_fail; if (arg1) (arg1)->protocol_queue = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_protocol_queue_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; struct pi_protocol **result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_protocol_queue_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (struct pi_protocol **) ((arg1)->protocol_queue); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_p_pi_protocol, 0); return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_queue_len_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_queue_len_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->queue_len = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_queue_len_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_queue_len_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->queue_len); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_cmd_queue_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; struct pi_protocol **arg2 = (struct pi_protocol **) 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_cmd_queue_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_p_pi_protocol, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(2)) SWIG_fail; if (arg1) (arg1)->cmd_queue = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_cmd_queue_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; struct pi_protocol **result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_cmd_queue_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (struct pi_protocol **) ((arg1)->cmd_queue); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_p_pi_protocol, 0); return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_cmd_len_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_cmd_len_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->cmd_len = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_cmd_len_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_cmd_len_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->cmd_len); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_device_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; struct pi_device *arg2 = (struct pi_device *) 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_device_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_pi_device, SWIG_POINTER_EXCEPTION | SWIG_POINTER_DISOWN); if (SWIG_arg_fail(2)) SWIG_fail; if (arg1) (arg1)->device = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_device_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; struct pi_device *result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_device_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (struct pi_device *) ((arg1)->device); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_pi_device, 0); return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_state_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_state_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->state = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_state_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_state_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->state); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_honor_rx_to_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_honor_rx_to_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->honor_rx_to = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_honor_rx_to_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_honor_rx_to_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->honor_rx_to); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_command_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_command_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->command = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_command_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_command_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->command); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_accept_to_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_accept_to_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->accept_to = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_accept_to_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_accept_to_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->accept_to); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_dlprecord_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_dlprecord_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->dlprecord = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_dlprecord_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_dlprecord_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->dlprecord); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_dlpversion_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_dlpversion_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->dlpversion = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_dlpversion_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_dlpversion_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->dlpversion); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_maxrecsize_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_maxrecsize_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->maxrecsize = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_maxrecsize_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_maxrecsize_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->maxrecsize); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_last_error_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_last_error_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->last_error = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_last_error_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_last_error_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->last_error); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_palmos_error_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_t_palmos_error_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->palmos_error = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_t_palmos_error_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_t_palmos_error_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->palmos_error); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_new_pi_socket_t(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *result; if(!PyArg_ParseTuple(args,(char *)":new_pi_socket_t")) goto fail; result = (pi_socket_t *)(pi_socket_t *) calloc(1, sizeof(pi_socket_t)); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_pi_socket, 1); return resultobj; fail: return NULL; } static PyObject *_wrap_delete_pi_socket_t(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:delete_pi_socket_t",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; free((char *) arg1); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject * pi_socket_t_swigregister(PyObject *self, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_pi_socket, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_pi_socket_list_t_ps_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_list_t *arg1 = (pi_socket_list_t *) 0 ; pi_socket_t *arg2 = (pi_socket_t *) 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_list_t_ps_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket_list, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | SWIG_POINTER_DISOWN); if (SWIG_arg_fail(2)) SWIG_fail; if (arg1) (arg1)->ps = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_list_t_ps_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_list_t *arg1 = (pi_socket_list_t *) 0 ; pi_socket_t *result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_list_t_ps_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket_list, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (pi_socket_t *) ((arg1)->ps); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_pi_socket, 0); return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_list_t_next_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_list_t *arg1 = (pi_socket_list_t *) 0 ; struct pi_socket_list *arg2 = (struct pi_socket_list *) 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_list_t_next_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket_list, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_pi_socket_list, SWIG_POINTER_EXCEPTION | SWIG_POINTER_DISOWN); if (SWIG_arg_fail(2)) SWIG_fail; if (arg1) (arg1)->next = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_list_t_next_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_list_t *arg1 = (pi_socket_list_t *) 0 ; struct pi_socket_list *result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_list_t_next_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket_list, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (struct pi_socket_list *) ((arg1)->next); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_pi_socket_list, 0); return resultobj; fail: return NULL; } static PyObject *_wrap_new_pi_socket_list_t(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_list_t *result; if(!PyArg_ParseTuple(args,(char *)":new_pi_socket_list_t")) goto fail; result = (pi_socket_list_t *)(pi_socket_list_t *) calloc(1, sizeof(pi_socket_list_t)); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_pi_socket_list, 1); return resultobj; fail: return NULL; } static PyObject *_wrap_delete_pi_socket_list_t(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_list_t *arg1 = (pi_socket_list_t *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:delete_pi_socket_list_t",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket_list, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; free((char *) arg1); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject * pi_socket_list_t_swigregister(PyObject *self, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_pi_socket_list, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_pi_socket(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int arg3 ; int result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:pi_socket",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (int)pi_socket(arg1,arg2,arg3); PyEval_RestoreThread(__save); } { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_setsd(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; pi_socket_t *arg1 = (pi_socket_t *) 0 ; int arg2 ; int result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_socket_setsd",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_pi_socket, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (int)pi_socket_setsd(arg1,arg2); PyEval_RestoreThread(__save); } { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_getsockname(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; struct sockaddr *arg2 = (struct sockaddr *) 0 ; size_t *arg3 = (size_t *) 0 ; int result; struct pi_sockaddr temp2 ; size_t temp3 ; PyObject * obj0 = 0 ; { arg2 = (struct sockaddr *)&temp2; } { arg3 = (size_t *)&temp3; } if(!PyArg_ParseTuple(args,(char *)"O:pi_getsockname",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (int)pi_getsockname(arg1,arg2,arg3); PyEval_RestoreThread(__save); } { resultobj = SWIG_From_int((int)(result)); } { PyObject *o; if (arg2) { o = Py_BuildValue("(is)", (int)((struct pi_sockaddr *)arg2)->pi_family, ((struct pi_sockaddr *)arg2)->pi_device); resultobj = t_output_helper(resultobj, o); } } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_getsockpeer(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; struct sockaddr *arg2 = (struct sockaddr *) 0 ; size_t *arg3 = (size_t *) 0 ; int result; struct pi_sockaddr temp2 ; size_t temp3 ; PyObject * obj0 = 0 ; { arg2 = (struct sockaddr *)&temp2; } { arg3 = (size_t *)&temp3; } if(!PyArg_ParseTuple(args,(char *)"O:pi_getsockpeer",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (int)pi_getsockpeer(arg1,arg2,arg3); PyEval_RestoreThread(__save); } { resultobj = SWIG_From_int((int)(result)); } { PyObject *o; if (arg2) { o = Py_BuildValue("(is)", (int)((struct pi_sockaddr *)arg2)->pi_family, ((struct pi_sockaddr *)arg2)->pi_device); resultobj = t_output_helper(resultobj, o); } } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_getsockopt(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int arg3 ; void *arg4 = (void *) 0 ; size_t *arg5 = (size_t *) 0 ; int result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOO:pi_getsockopt",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { if ((SWIG_ConvertPtr(obj3,(void **)(&arg4),0,SWIG_POINTER_EXCEPTION|0))== -1) { SWIG_arg_fail(4);SWIG_fail; } } SWIG_Python_ConvertPtr(obj4, (void **)&arg5, SWIGTYPE_p_size_t, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(5)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = (int)pi_getsockopt(arg1,arg2,arg3,arg4,arg5); PyEval_RestoreThread(__save); } { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_setsockopt(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int arg3 ; void *arg4 = (void *) 0 ; size_t *arg5 = (size_t *) 0 ; int result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOO:pi_setsockopt",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { if ((SWIG_ConvertPtr(obj3,(void **)(&arg4),0,SWIG_POINTER_EXCEPTION|0))== -1) { SWIG_arg_fail(4);SWIG_fail; } } SWIG_Python_ConvertPtr(obj4, (void **)&arg5, SWIGTYPE_p_size_t, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(5)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = (int)pi_setsockopt(arg1,arg2,arg3,(void const *)arg4,arg5); PyEval_RestoreThread(__save); } { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_protocol(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; struct pi_protocol *result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_protocol",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (struct pi_protocol *)pi_protocol(arg1,arg2); PyEval_RestoreThread(__save); } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_pi_protocol, 0); return resultobj; fail: return NULL; } static PyObject *_wrap_pi_protocol_next(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; struct pi_protocol *result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_protocol_next",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (struct pi_protocol *)pi_protocol_next(arg1,arg2); PyEval_RestoreThread(__save); } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_pi_protocol, 0); return resultobj; fail: return NULL; } static PyObject *_wrap_pi_socket_connected(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_socket_connected",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (int)pi_socket_connected(arg1); PyEval_RestoreThread(__save); } { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_connect(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; char *arg2 = (char *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_connect",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) { SWIG_arg_fail(2);SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)pi_connect(arg1,(char const *)arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_pi_bind(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; char *arg2 = (char *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_bind",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) { SWIG_arg_fail(2);SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)pi_bind(arg1,(char const *)arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_pi_listen(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_listen",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)pi_listen(arg1,arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_pi_accept(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; struct sockaddr *arg2 = (struct sockaddr *) 0 ; size_t *arg3 = (size_t *) 0 ; PI_ERR result; struct pi_sockaddr temp2 ; size_t temp3 ; PyObject * obj0 = 0 ; { arg2 = (struct sockaddr *)&temp2; } { arg3 = (size_t *)&temp3; } if(!PyArg_ParseTuple(args,(char *)"O:pi_accept",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)pi_accept(arg1,arg2,arg3); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); { PyObject *o; if (arg2) { o = Py_BuildValue("(is)", (int)((struct pi_sockaddr *)arg2)->pi_family, ((struct pi_sockaddr *)arg2)->pi_device); resultobj = t_output_helper(resultobj, o); } } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_accept_to(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; struct sockaddr *arg2 = (struct sockaddr *) 0 ; size_t *arg3 = (size_t *) 0 ; int arg4 ; PI_ERR result; struct pi_sockaddr temp2 ; size_t temp3 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; { arg2 = (struct sockaddr *)&temp2; } { arg3 = (size_t *)&temp3; } if(!PyArg_ParseTuple(args,(char *)"OO:pi_accept_to",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(4)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)pi_accept_to(arg1,arg2,arg3,arg4); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); { PyObject *o; if (arg2) { o = Py_BuildValue("(is)", (int)((struct pi_sockaddr *)arg2)->pi_family, ((struct pi_sockaddr *)arg2)->pi_device); resultobj = t_output_helper(resultobj, o); } } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_close(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_close",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (int)pi_close(arg1); PyEval_RestoreThread(__save); } { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_send(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; void *arg2 = (void *) 0 ; size_t arg3 ; int arg4 ; int result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOO:pi_send",&obj0,&obj1,&obj2,&obj3)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { if ((SWIG_ConvertPtr(obj1,(void **)(&arg2),0,SWIG_POINTER_EXCEPTION|0))== -1) { SWIG_arg_fail(2);SWIG_fail; } } { arg3 = (size_t)(SWIG_As_unsigned_SS_long(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (int)pi_send(arg1,(void const *)arg2,arg3,arg4); PyEval_RestoreThread(__save); } { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_recv(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; pi_buffer_t *arg2 = (pi_buffer_t *) 0 ; size_t arg3 ; int arg4 ; ssize_t result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; { arg2 = pi_buffer_new(0xFFFF); } if(!PyArg_ParseTuple(args,(char *)"OOO:pi_recv",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg3 = (size_t)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(4)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = pi_recv(arg1,arg2,arg3,arg4); PyEval_RestoreThread(__save); } { ssize_t * resultptr; resultptr = (ssize_t *) malloc(sizeof(ssize_t)); if (resultptr) memcpy(resultptr, &result, sizeof(ssize_t)); resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_ssize_t, 1); } { if (arg2) { PyObject *o1 = Py_BuildValue("s#", arg2->data, arg2->used); resultobj = t_output_helper(resultobj, o1); } } { if (arg2) { pi_buffer_free(arg2); } } return resultobj; fail: { if (arg2) { pi_buffer_free(arg2); } } return NULL; } static PyObject *_wrap_pi_read(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; pi_buffer_t *arg2 = (pi_buffer_t *) 0 ; size_t arg3 ; ssize_t result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; { arg2 = pi_buffer_new(0xFFFF); } if(!PyArg_ParseTuple(args,(char *)"OO:pi_read",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg3 = (size_t)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(3)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = pi_read(arg1,arg2,arg3); PyEval_RestoreThread(__save); } { ssize_t * resultptr; resultptr = (ssize_t *) malloc(sizeof(ssize_t)); if (resultptr) memcpy(resultptr, &result, sizeof(ssize_t)); resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_ssize_t, 1); } { if (arg2) { PyObject *o1 = Py_BuildValue("s#", arg2->data, arg2->used); resultobj = t_output_helper(resultobj, o1); } } { if (arg2) { pi_buffer_free(arg2); } } return resultobj; fail: { if (arg2) { pi_buffer_free(arg2); } } return NULL; } static PyObject *_wrap_pi_write(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; void *arg2 = (void *) 0 ; size_t arg3 ; ssize_t result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_write",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } arg2 = (void *)PyString_AsString(obj1); arg3 = PyString_Size(obj1); { PyThreadState *__save = PyEval_SaveThread(); result = pi_write(arg1,(void const *)arg2,arg3); PyEval_RestoreThread(__save); } { ssize_t * resultptr; resultptr = (ssize_t *) malloc(sizeof(ssize_t)); if (resultptr) memcpy(resultptr, &result, sizeof(ssize_t)); resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_ssize_t, 1); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_flush(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_flush",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); pi_flush(arg1,arg2); PyEval_RestoreThread(__save); } Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_error(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_error",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (int)pi_error(arg1); PyEval_RestoreThread(__save); } { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_set_error(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_set_error",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (int)pi_set_error(arg1,arg2); PyEval_RestoreThread(__save); } { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_palmos_error(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_palmos_error",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (int)pi_palmos_error(arg1); PyEval_RestoreThread(__save); } { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_set_palmos_error(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_set_palmos_error",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (int)pi_set_palmos_error(arg1,arg2); PyEval_RestoreThread(__save); } { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_reset_errors(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_reset_errors",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); pi_reset_errors(arg1); PyEval_RestoreThread(__save); } Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_pi_version(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; PI_ERR result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_version",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)pi_version(arg1); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_pi_maxrecsize(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_maxrecsize",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (unsigned long)pi_maxrecsize(arg1); PyEval_RestoreThread(__save); } { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_pi_tickle(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; PI_ERR result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:pi_tickle",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)pi_tickle(arg1); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_pi_watchdog(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:pi_watchdog",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (int)pi_watchdog(arg1,arg2); PyEval_RestoreThread(__save); } { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_VFSDirInfo_attr_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSDirInfo *arg1 = (struct VFSDirInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:VFSDirInfo_attr_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSDirInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->attr = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_VFSDirInfo_attr_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSDirInfo *arg1 = (struct VFSDirInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:VFSDirInfo_attr_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSDirInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->attr); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_VFSDirInfo_name_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSDirInfo *arg1 = (struct VFSDirInfo *) 0 ; char *arg2 ; char temp2[256] ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:VFSDirInfo_name_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSDirInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { if (!SWIG_AsCharArray(obj1, temp2, 256)) { SWIG_arg_fail(2);SWIG_fail; } arg2 = temp2; } { if (arg2) memcpy(arg1->name,arg2,256*sizeof(char)); else memset(arg1->name,0,256*sizeof(char)); } Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_VFSDirInfo_name_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSDirInfo *arg1 = (struct VFSDirInfo *) 0 ; char *result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:VFSDirInfo_name_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSDirInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (char *)(char *) ((arg1)->name); { size_t size = 256; #ifndef SWIG_PRESERVE_CARRAY_SIZE while (size && (result[size - 1] == '\0')) --size; #endif resultobj = SWIG_FromCharArray(result, size); } return resultobj; fail: return NULL; } static PyObject *_wrap_new_VFSDirInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSDirInfo *result; if(!PyArg_ParseTuple(args,(char *)":new_VFSDirInfo")) goto fail; result = (struct VFSDirInfo *)(struct VFSDirInfo *) calloc(1, sizeof(struct VFSDirInfo)); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_VFSDirInfo, 1); return resultobj; fail: return NULL; } static PyObject *_wrap_delete_VFSDirInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSDirInfo *arg1 = (struct VFSDirInfo *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:delete_VFSDirInfo",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSDirInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; free((char *) arg1); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject * VFSDirInfo_swigregister(PyObject *self, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_VFSDirInfo, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_VFSAnyMountParam_volRefNum_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSAnyMountParam *arg1 = (struct VFSAnyMountParam *) 0 ; unsigned short arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:VFSAnyMountParam_volRefNum_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSAnyMountParam, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned short)(SWIG_As_unsigned_SS_short(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->volRefNum = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_VFSAnyMountParam_volRefNum_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSAnyMountParam *arg1 = (struct VFSAnyMountParam *) 0 ; unsigned short result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:VFSAnyMountParam_volRefNum_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSAnyMountParam, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned short) ((arg1)->volRefNum); { resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_VFSAnyMountParam_reserved_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSAnyMountParam *arg1 = (struct VFSAnyMountParam *) 0 ; unsigned short arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:VFSAnyMountParam_reserved_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSAnyMountParam, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned short)(SWIG_As_unsigned_SS_short(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->reserved = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_VFSAnyMountParam_reserved_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSAnyMountParam *arg1 = (struct VFSAnyMountParam *) 0 ; unsigned short result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:VFSAnyMountParam_reserved_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSAnyMountParam, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned short) ((arg1)->reserved); { resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_VFSAnyMountParam_mountClass_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSAnyMountParam *arg1 = (struct VFSAnyMountParam *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:VFSAnyMountParam_mountClass_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSAnyMountParam, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->mountClass = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_VFSAnyMountParam_mountClass_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSAnyMountParam *arg1 = (struct VFSAnyMountParam *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:VFSAnyMountParam_mountClass_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSAnyMountParam, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->mountClass); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_new_VFSAnyMountParam(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSAnyMountParam *result; if(!PyArg_ParseTuple(args,(char *)":new_VFSAnyMountParam")) goto fail; result = (struct VFSAnyMountParam *)(struct VFSAnyMountParam *) calloc(1, sizeof(struct VFSAnyMountParam)); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_VFSAnyMountParam, 1); return resultobj; fail: return NULL; } static PyObject *_wrap_delete_VFSAnyMountParam(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSAnyMountParam *arg1 = (struct VFSAnyMountParam *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:delete_VFSAnyMountParam",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSAnyMountParam, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; free((char *) arg1); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject * VFSAnyMountParam_swigregister(PyObject *self, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_VFSAnyMountParam, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_VFSSlotMountParam_vfsMountParam_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSSlotMountParam *arg1 = (struct VFSSlotMountParam *) 0 ; struct VFSAnyMountParam *arg2 = (struct VFSAnyMountParam *) 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:VFSSlotMountParam_vfsMountParam_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSSlotMountParam, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_VFSAnyMountParam, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(2)) SWIG_fail; if (arg1) (arg1)->vfsMountParam = *arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_VFSSlotMountParam_vfsMountParam_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSSlotMountParam *arg1 = (struct VFSSlotMountParam *) 0 ; struct VFSAnyMountParam *result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:VFSSlotMountParam_vfsMountParam_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSSlotMountParam, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (struct VFSAnyMountParam *)& ((arg1)->vfsMountParam); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_VFSAnyMountParam, 0); return resultobj; fail: return NULL; } static PyObject *_wrap_VFSSlotMountParam_slotLibRefNum_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSSlotMountParam *arg1 = (struct VFSSlotMountParam *) 0 ; unsigned short arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:VFSSlotMountParam_slotLibRefNum_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSSlotMountParam, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned short)(SWIG_As_unsigned_SS_short(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->slotLibRefNum = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_VFSSlotMountParam_slotLibRefNum_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSSlotMountParam *arg1 = (struct VFSSlotMountParam *) 0 ; unsigned short result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:VFSSlotMountParam_slotLibRefNum_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSSlotMountParam, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned short) ((arg1)->slotLibRefNum); { resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_VFSSlotMountParam_slotRefNum_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSSlotMountParam *arg1 = (struct VFSSlotMountParam *) 0 ; unsigned short arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:VFSSlotMountParam_slotRefNum_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSSlotMountParam, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned short)(SWIG_As_unsigned_SS_short(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->slotRefNum = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_VFSSlotMountParam_slotRefNum_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSSlotMountParam *arg1 = (struct VFSSlotMountParam *) 0 ; unsigned short result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:VFSSlotMountParam_slotRefNum_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSSlotMountParam, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned short) ((arg1)->slotRefNum); { resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_new_VFSSlotMountParam(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSSlotMountParam *result; if(!PyArg_ParseTuple(args,(char *)":new_VFSSlotMountParam")) goto fail; result = (struct VFSSlotMountParam *)(struct VFSSlotMountParam *) calloc(1, sizeof(struct VFSSlotMountParam)); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_VFSSlotMountParam, 1); return resultobj; fail: return NULL; } static PyObject *_wrap_delete_VFSSlotMountParam(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSSlotMountParam *arg1 = (struct VFSSlotMountParam *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:delete_VFSSlotMountParam",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSSlotMountParam, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; free((char *) arg1); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject * VFSSlotMountParam_swigregister(PyObject *self, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_VFSSlotMountParam, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_VFSInfo_attributes_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSInfo *arg1 = (struct VFSInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:VFSInfo_attributes_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->attributes = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_VFSInfo_attributes_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSInfo *arg1 = (struct VFSInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:VFSInfo_attributes_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->attributes); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_VFSInfo_fsType_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSInfo *arg1 = (struct VFSInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:VFSInfo_fsType_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->fsType = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_VFSInfo_fsType_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSInfo *arg1 = (struct VFSInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:VFSInfo_fsType_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->fsType); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_VFSInfo_fsCreator_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSInfo *arg1 = (struct VFSInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:VFSInfo_fsCreator_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->fsCreator = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_VFSInfo_fsCreator_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSInfo *arg1 = (struct VFSInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:VFSInfo_fsCreator_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->fsCreator); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_VFSInfo_mountClass_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSInfo *arg1 = (struct VFSInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:VFSInfo_mountClass_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->mountClass = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_VFSInfo_mountClass_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSInfo *arg1 = (struct VFSInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:VFSInfo_mountClass_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->mountClass); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_VFSInfo_slotLibRefNum_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSInfo *arg1 = (struct VFSInfo *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:VFSInfo_slotLibRefNum_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->slotLibRefNum = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_VFSInfo_slotLibRefNum_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSInfo *arg1 = (struct VFSInfo *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:VFSInfo_slotLibRefNum_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->slotLibRefNum); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_VFSInfo_slotRefNum_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSInfo *arg1 = (struct VFSInfo *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:VFSInfo_slotRefNum_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->slotRefNum = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_VFSInfo_slotRefNum_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSInfo *arg1 = (struct VFSInfo *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:VFSInfo_slotRefNum_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->slotRefNum); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_VFSInfo_mediaType_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSInfo *arg1 = (struct VFSInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:VFSInfo_mediaType_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->mediaType = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_VFSInfo_mediaType_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSInfo *arg1 = (struct VFSInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:VFSInfo_mediaType_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->mediaType); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_VFSInfo_reserved_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSInfo *arg1 = (struct VFSInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:VFSInfo_reserved_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->reserved = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_VFSInfo_reserved_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSInfo *arg1 = (struct VFSInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:VFSInfo_reserved_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->reserved); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_new_VFSInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSInfo *result; if(!PyArg_ParseTuple(args,(char *)":new_VFSInfo")) goto fail; result = (struct VFSInfo *)(struct VFSInfo *) calloc(1, sizeof(struct VFSInfo)); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_VFSInfo, 1); return resultobj; fail: return NULL; } static PyObject *_wrap_delete_VFSInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct VFSInfo *arg1 = (struct VFSInfo *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:delete_VFSInfo",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_VFSInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; free((char *) arg1); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject * VFSInfo_swigregister(PyObject *self, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_VFSInfo, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_PilotUser_passwordLength_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct PilotUser *arg1 = (struct PilotUser *) 0 ; size_t arg2 ; struct PilotUser temp1 ; PyObject * obj0 = 0 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)"O:PilotUser_passwordLength_set",&obj0)) goto fail; { arg2 = (size_t)(SWIG_As_unsigned_SS_long(obj0)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->passwordLength = arg2; Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_PilotUser_passwordLength_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct PilotUser *arg1 = (struct PilotUser *) 0 ; size_t result; struct PilotUser temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":PilotUser_passwordLength_get")) goto fail; result = ((arg1)->passwordLength); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_PilotUser_username_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct PilotUser *arg1 = (struct PilotUser *) 0 ; char *arg2 ; struct PilotUser temp1 ; char temp2[128] ; PyObject * obj0 = 0 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)"O:PilotUser_username_set",&obj0)) goto fail; { if (!SWIG_AsCharArray(obj0, temp2, 128)) { SWIG_arg_fail(2);SWIG_fail; } arg2 = temp2; } { if (arg2) memcpy(arg1->username,arg2,128*sizeof(char)); else memset(arg1->username,0,128*sizeof(char)); } Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_PilotUser_username_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct PilotUser *arg1 = (struct PilotUser *) 0 ; char *result; struct PilotUser temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":PilotUser_username_get")) goto fail; result = (char *)(char *) ((arg1)->username); { size_t size = 128; #ifndef SWIG_PRESERVE_CARRAY_SIZE while (size && (result[size - 1] == '\0')) --size; #endif resultobj = SWIG_FromCharArray(result, size); } if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_PilotUser_password_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct PilotUser *arg1 = (struct PilotUser *) 0 ; char *arg2 ; struct PilotUser temp1 ; char temp2[128] ; PyObject * obj0 = 0 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)"O:PilotUser_password_set",&obj0)) goto fail; { if (!SWIG_AsCharArray(obj0, temp2, 128)) { SWIG_arg_fail(2);SWIG_fail; } arg2 = temp2; } { if (arg2) memcpy(arg1->password,arg2,128*sizeof(char)); else memset(arg1->password,0,128*sizeof(char)); } Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_PilotUser_password_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct PilotUser *arg1 = (struct PilotUser *) 0 ; char *result; struct PilotUser temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":PilotUser_password_get")) goto fail; result = (char *)(char *) ((arg1)->password); { size_t size = 128; #ifndef SWIG_PRESERVE_CARRAY_SIZE while (size && (result[size - 1] == '\0')) --size; #endif resultobj = SWIG_FromCharArray(result, size); } if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_PilotUser_userID_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct PilotUser *arg1 = (struct PilotUser *) 0 ; unsigned long arg2 ; struct PilotUser temp1 ; PyObject * obj0 = 0 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)"O:PilotUser_userID_set",&obj0)) goto fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj0)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->userID = arg2; Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_PilotUser_userID_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct PilotUser *arg1 = (struct PilotUser *) 0 ; unsigned long result; struct PilotUser temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":PilotUser_userID_get")) goto fail; result = (unsigned long) ((arg1)->userID); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_PilotUser_viewerID_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct PilotUser *arg1 = (struct PilotUser *) 0 ; unsigned long arg2 ; struct PilotUser temp1 ; PyObject * obj0 = 0 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)"O:PilotUser_viewerID_set",&obj0)) goto fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj0)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->viewerID = arg2; Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_PilotUser_viewerID_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct PilotUser *arg1 = (struct PilotUser *) 0 ; unsigned long result; struct PilotUser temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":PilotUser_viewerID_get")) goto fail; result = (unsigned long) ((arg1)->viewerID); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_PilotUser_lastSyncPC_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct PilotUser *arg1 = (struct PilotUser *) 0 ; unsigned long arg2 ; struct PilotUser temp1 ; PyObject * obj0 = 0 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)"O:PilotUser_lastSyncPC_set",&obj0)) goto fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj0)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->lastSyncPC = arg2; Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_PilotUser_lastSyncPC_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct PilotUser *arg1 = (struct PilotUser *) 0 ; unsigned long result; struct PilotUser temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":PilotUser_lastSyncPC_get")) goto fail; result = (unsigned long) ((arg1)->lastSyncPC); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_PilotUser_successfulSyncDate_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct PilotUser *arg1 = (struct PilotUser *) 0 ; time_t arg2 ; struct PilotUser temp1 ; PyObject * obj0 = 0 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)"O:PilotUser_successfulSyncDate_set",&obj0)) goto fail; { arg2 = (time_t)(SWIG_As_long(obj0)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->successfulSyncDate = arg2; Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_PilotUser_successfulSyncDate_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct PilotUser *arg1 = (struct PilotUser *) 0 ; time_t result; struct PilotUser temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":PilotUser_successfulSyncDate_get")) goto fail; result = ((arg1)->successfulSyncDate); { resultobj = SWIG_From_long((long)(result)); } if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_PilotUser_lastSyncDate_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct PilotUser *arg1 = (struct PilotUser *) 0 ; time_t arg2 ; struct PilotUser temp1 ; PyObject * obj0 = 0 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)"O:PilotUser_lastSyncDate_set",&obj0)) goto fail; { arg2 = (time_t)(SWIG_As_long(obj0)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->lastSyncDate = arg2; Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_PilotUser_lastSyncDate_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct PilotUser *arg1 = (struct PilotUser *) 0 ; time_t result; struct PilotUser temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":PilotUser_lastSyncDate_get")) goto fail; result = ((arg1)->lastSyncDate); { resultobj = SWIG_From_long((long)(result)); } if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_new_PilotUser(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct PilotUser *result; if(!PyArg_ParseTuple(args,(char *)":new_PilotUser")) goto fail; result = (struct PilotUser *)(struct PilotUser *) calloc(1, sizeof(struct PilotUser)); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_PilotUser, 1); return resultobj; fail: return NULL; } static PyObject *_wrap_delete_PilotUser(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct PilotUser *arg1 = (struct PilotUser *) 0 ; struct PilotUser temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":delete_PilotUser")) goto fail; free((char *) arg1); Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg1)); return resultobj; fail: return NULL; } static PyObject * PilotUser_swigregister(PyObject *self, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_PilotUser, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_SysInfo_romVersion_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; unsigned long arg2 ; struct SysInfo temp1 ; PyObject * obj0 = 0 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)"O:SysInfo_romVersion_set",&obj0)) goto fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj0)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->romVersion = arg2; Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_SysInfo_romVersion_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; unsigned long result; struct SysInfo temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":SysInfo_romVersion_get")) goto fail; result = (unsigned long) ((arg1)->romVersion); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_SysInfo_locale_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; unsigned long arg2 ; struct SysInfo temp1 ; PyObject * obj0 = 0 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)"O:SysInfo_locale_set",&obj0)) goto fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj0)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->locale = arg2; Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_SysInfo_locale_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; unsigned long result; struct SysInfo temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":SysInfo_locale_get")) goto fail; result = (unsigned long) ((arg1)->locale); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_SysInfo_prodIDLength_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; unsigned char arg2 ; struct SysInfo temp1 ; PyObject * obj0 = 0 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)"O:SysInfo_prodIDLength_set",&obj0)) goto fail; { arg2 = (unsigned char)(SWIG_As_unsigned_SS_char(obj0)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->prodIDLength = arg2; Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_SysInfo_prodIDLength_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; unsigned char result; struct SysInfo temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":SysInfo_prodIDLength_get")) goto fail; result = (unsigned char) ((arg1)->prodIDLength); { resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); } if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_SysInfo_prodID_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; char *arg2 ; struct SysInfo temp1 ; char temp2[128] ; PyObject * obj0 = 0 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)"O:SysInfo_prodID_set",&obj0)) goto fail; { if (!SWIG_AsCharArray(obj0, temp2, 128)) { SWIG_arg_fail(2);SWIG_fail; } arg2 = temp2; } { if (arg2) memcpy(arg1->prodID,arg2,128*sizeof(char)); else memset(arg1->prodID,0,128*sizeof(char)); } Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_SysInfo_prodID_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; char *result; struct SysInfo temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":SysInfo_prodID_get")) goto fail; result = (char *)(char *) ((arg1)->prodID); { size_t size = 128; #ifndef SWIG_PRESERVE_CARRAY_SIZE while (size && (result[size - 1] == '\0')) --size; #endif resultobj = SWIG_FromCharArray(result, size); } if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_SysInfo_dlpMajorVersion_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; unsigned short arg2 ; struct SysInfo temp1 ; PyObject * obj0 = 0 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)"O:SysInfo_dlpMajorVersion_set",&obj0)) goto fail; { arg2 = (unsigned short)(SWIG_As_unsigned_SS_short(obj0)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->dlpMajorVersion = arg2; Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_SysInfo_dlpMajorVersion_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; unsigned short result; struct SysInfo temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":SysInfo_dlpMajorVersion_get")) goto fail; result = (unsigned short) ((arg1)->dlpMajorVersion); { resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); } if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_SysInfo_dlpMinorVersion_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; unsigned short arg2 ; struct SysInfo temp1 ; PyObject * obj0 = 0 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)"O:SysInfo_dlpMinorVersion_set",&obj0)) goto fail; { arg2 = (unsigned short)(SWIG_As_unsigned_SS_short(obj0)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->dlpMinorVersion = arg2; Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_SysInfo_dlpMinorVersion_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; unsigned short result; struct SysInfo temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":SysInfo_dlpMinorVersion_get")) goto fail; result = (unsigned short) ((arg1)->dlpMinorVersion); { resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); } if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_SysInfo_compatMajorVersion_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; unsigned short arg2 ; struct SysInfo temp1 ; PyObject * obj0 = 0 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)"O:SysInfo_compatMajorVersion_set",&obj0)) goto fail; { arg2 = (unsigned short)(SWIG_As_unsigned_SS_short(obj0)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->compatMajorVersion = arg2; Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_SysInfo_compatMajorVersion_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; unsigned short result; struct SysInfo temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":SysInfo_compatMajorVersion_get")) goto fail; result = (unsigned short) ((arg1)->compatMajorVersion); { resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); } if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_SysInfo_compatMinorVersion_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; unsigned short arg2 ; struct SysInfo temp1 ; PyObject * obj0 = 0 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)"O:SysInfo_compatMinorVersion_set",&obj0)) goto fail; { arg2 = (unsigned short)(SWIG_As_unsigned_SS_short(obj0)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->compatMinorVersion = arg2; Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_SysInfo_compatMinorVersion_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; unsigned short result; struct SysInfo temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":SysInfo_compatMinorVersion_get")) goto fail; result = (unsigned short) ((arg1)->compatMinorVersion); { resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); } if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_SysInfo_maxRecSize_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; unsigned long arg2 ; struct SysInfo temp1 ; PyObject * obj0 = 0 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)"O:SysInfo_maxRecSize_set",&obj0)) goto fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj0)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->maxRecSize = arg2; Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_SysInfo_maxRecSize_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; unsigned long result; struct SysInfo temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":SysInfo_maxRecSize_get")) goto fail; result = (unsigned long) ((arg1)->maxRecSize); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject *_wrap_new_SysInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *result; if(!PyArg_ParseTuple(args,(char *)":new_SysInfo")) goto fail; result = (struct SysInfo *)(struct SysInfo *) calloc(1, sizeof(struct SysInfo)); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_SysInfo, 1); return resultobj; fail: return NULL; } static PyObject *_wrap_delete_SysInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct SysInfo *arg1 = (struct SysInfo *) 0 ; struct SysInfo temp1 ; arg1 = &temp1; if(!PyArg_ParseTuple(args,(char *)":delete_SysInfo")) goto fail; free((char *) arg1); Py_INCREF(Py_None); resultobj = Py_None; if (arg1) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg1)); return resultobj; fail: return NULL; } static PyObject * SysInfo_swigregister(PyObject *self, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_SysInfo, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_DBInfo_more_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:DBInfo_more_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->more = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_more_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:DBInfo_more_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->more); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_name_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; char *arg2 ; char temp2[34] ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:DBInfo_name_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { if (!SWIG_AsCharArray(obj1, temp2, 34)) { SWIG_arg_fail(2);SWIG_fail; } arg2 = temp2; } { if (arg2) memcpy(arg1->name,arg2,34*sizeof(char)); else memset(arg1->name,0,34*sizeof(char)); } Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_name_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; char *result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:DBInfo_name_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (char *)(char *) ((arg1)->name); { size_t size = 34; #ifndef SWIG_PRESERVE_CARRAY_SIZE while (size && (result[size - 1] == '\0')) --size; #endif resultobj = SWIG_FromCharArray(result, size); } return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_flags_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; unsigned int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:DBInfo_flags_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned int)(SWIG_As_unsigned_SS_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->flags = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_flags_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; unsigned int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:DBInfo_flags_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned int) ((arg1)->flags); { resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_miscFlags_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; unsigned int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:DBInfo_miscFlags_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned int)(SWIG_As_unsigned_SS_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->miscFlags = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_miscFlags_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; unsigned int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:DBInfo_miscFlags_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned int) ((arg1)->miscFlags); { resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_version_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; unsigned int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:DBInfo_version_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned int)(SWIG_As_unsigned_SS_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->version = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_version_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; unsigned int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:DBInfo_version_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned int) ((arg1)->version); { resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_type_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:DBInfo_type_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { if (PyString_Check(obj1)) arg2 = makelong(PyString_AS_STRING(obj1)); else if (PyInt_Check(obj1)) arg2 = PyInt_AsLong(obj1); else { PyErr_SetString(PyExc_TypeError,"You must specify a type/creator"); SWIG_fail; } } if (arg1) (arg1)->type = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_type_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:DBInfo_type_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->type); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_creator_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:DBInfo_creator_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { if (PyString_Check(obj1)) arg2 = makelong(PyString_AS_STRING(obj1)); else if (PyInt_Check(obj1)) arg2 = PyInt_AsLong(obj1); else { PyErr_SetString(PyExc_TypeError,"You must specify a type/creator"); SWIG_fail; } } if (arg1) (arg1)->creator = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_creator_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:DBInfo_creator_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->creator); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_modnum_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:DBInfo_modnum_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->modnum = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_modnum_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:DBInfo_modnum_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->modnum); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_index_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; unsigned int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:DBInfo_index_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned int)(SWIG_As_unsigned_SS_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->index = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_index_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; unsigned int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:DBInfo_index_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned int) ((arg1)->index); { resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_createDate_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; time_t arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:DBInfo_createDate_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (time_t)(SWIG_As_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->createDate = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_createDate_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; time_t result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:DBInfo_createDate_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = ((arg1)->createDate); { resultobj = SWIG_From_long((long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_modifyDate_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; time_t arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:DBInfo_modifyDate_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (time_t)(SWIG_As_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->modifyDate = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_modifyDate_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; time_t result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:DBInfo_modifyDate_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = ((arg1)->modifyDate); { resultobj = SWIG_From_long((long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_backupDate_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; time_t arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:DBInfo_backupDate_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (time_t)(SWIG_As_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->backupDate = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_DBInfo_backupDate_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; time_t result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:DBInfo_backupDate_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = ((arg1)->backupDate); { resultobj = SWIG_From_long((long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_new_DBInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *result; if(!PyArg_ParseTuple(args,(char *)":new_DBInfo")) goto fail; result = (struct DBInfo *)(struct DBInfo *) calloc(1, sizeof(struct DBInfo)); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_DBInfo, 1); return resultobj; fail: return NULL; } static PyObject *_wrap_delete_DBInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBInfo *arg1 = (struct DBInfo *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:delete_DBInfo",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; free((char *) arg1); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject * DBInfo_swigregister(PyObject *self, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_DBInfo, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_DBSizeInfo_numRecords_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBSizeInfo *arg1 = (struct DBSizeInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:DBSizeInfo_numRecords_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBSizeInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->numRecords = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_DBSizeInfo_numRecords_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBSizeInfo *arg1 = (struct DBSizeInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:DBSizeInfo_numRecords_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBSizeInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->numRecords); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_DBSizeInfo_totalBytes_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBSizeInfo *arg1 = (struct DBSizeInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:DBSizeInfo_totalBytes_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBSizeInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->totalBytes = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_DBSizeInfo_totalBytes_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBSizeInfo *arg1 = (struct DBSizeInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:DBSizeInfo_totalBytes_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBSizeInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->totalBytes); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_DBSizeInfo_dataBytes_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBSizeInfo *arg1 = (struct DBSizeInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:DBSizeInfo_dataBytes_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBSizeInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->dataBytes = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_DBSizeInfo_dataBytes_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBSizeInfo *arg1 = (struct DBSizeInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:DBSizeInfo_dataBytes_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBSizeInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->dataBytes); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_DBSizeInfo_appBlockSize_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBSizeInfo *arg1 = (struct DBSizeInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:DBSizeInfo_appBlockSize_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBSizeInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->appBlockSize = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_DBSizeInfo_appBlockSize_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBSizeInfo *arg1 = (struct DBSizeInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:DBSizeInfo_appBlockSize_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBSizeInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->appBlockSize); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_DBSizeInfo_sortBlockSize_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBSizeInfo *arg1 = (struct DBSizeInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:DBSizeInfo_sortBlockSize_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBSizeInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->sortBlockSize = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_DBSizeInfo_sortBlockSize_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBSizeInfo *arg1 = (struct DBSizeInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:DBSizeInfo_sortBlockSize_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBSizeInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->sortBlockSize); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_DBSizeInfo_maxRecSize_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBSizeInfo *arg1 = (struct DBSizeInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:DBSizeInfo_maxRecSize_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBSizeInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->maxRecSize = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_DBSizeInfo_maxRecSize_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBSizeInfo *arg1 = (struct DBSizeInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:DBSizeInfo_maxRecSize_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBSizeInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->maxRecSize); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_new_DBSizeInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBSizeInfo *result; if(!PyArg_ParseTuple(args,(char *)":new_DBSizeInfo")) goto fail; result = (struct DBSizeInfo *)(struct DBSizeInfo *) calloc(1, sizeof(struct DBSizeInfo)); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_DBSizeInfo, 1); return resultobj; fail: return NULL; } static PyObject *_wrap_delete_DBSizeInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct DBSizeInfo *arg1 = (struct DBSizeInfo *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:delete_DBSizeInfo",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_DBSizeInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; free((char *) arg1); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject * DBSizeInfo_swigregister(PyObject *self, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_DBSizeInfo, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_CardInfo_card_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:CardInfo_card_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->card = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_CardInfo_card_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:CardInfo_card_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->card); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_CardInfo_version_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:CardInfo_version_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->version = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_CardInfo_version_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:CardInfo_version_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->version); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_CardInfo_more_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:CardInfo_more_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->more = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_CardInfo_more_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:CardInfo_more_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->more); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_CardInfo_creation_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; time_t arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:CardInfo_creation_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (time_t)(SWIG_As_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->creation = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_CardInfo_creation_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; time_t result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:CardInfo_creation_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = ((arg1)->creation); { resultobj = SWIG_From_long((long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_CardInfo_romSize_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:CardInfo_romSize_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->romSize = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_CardInfo_romSize_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:CardInfo_romSize_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->romSize); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_CardInfo_ramSize_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:CardInfo_ramSize_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->ramSize = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_CardInfo_ramSize_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:CardInfo_ramSize_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->ramSize); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_CardInfo_ramFree_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; unsigned long arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:CardInfo_ramFree_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->ramFree = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_CardInfo_ramFree_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; unsigned long result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:CardInfo_ramFree_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (unsigned long) ((arg1)->ramFree); { resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_CardInfo_name_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; char *arg2 ; char temp2[128] ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:CardInfo_name_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { if (!SWIG_AsCharArray(obj1, temp2, 128)) { SWIG_arg_fail(2);SWIG_fail; } arg2 = temp2; } { if (arg2) memcpy(arg1->name,arg2,128*sizeof(char)); else memset(arg1->name,0,128*sizeof(char)); } Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_CardInfo_name_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; char *result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:CardInfo_name_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (char *)(char *) ((arg1)->name); { size_t size = 128; #ifndef SWIG_PRESERVE_CARRAY_SIZE while (size && (result[size - 1] == '\0')) --size; #endif resultobj = SWIG_FromCharArray(result, size); } return resultobj; fail: return NULL; } static PyObject *_wrap_CardInfo_manufacturer_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; char *arg2 ; char temp2[128] ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:CardInfo_manufacturer_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { if (!SWIG_AsCharArray(obj1, temp2, 128)) { SWIG_arg_fail(2);SWIG_fail; } arg2 = temp2; } { if (arg2) memcpy(arg1->manufacturer,arg2,128*sizeof(char)); else memset(arg1->manufacturer,0,128*sizeof(char)); } Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_CardInfo_manufacturer_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; char *result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:CardInfo_manufacturer_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (char *)(char *) ((arg1)->manufacturer); { size_t size = 128; #ifndef SWIG_PRESERVE_CARRAY_SIZE while (size && (result[size - 1] == '\0')) --size; #endif resultobj = SWIG_FromCharArray(result, size); } return resultobj; fail: return NULL; } static PyObject *_wrap_new_CardInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *result; if(!PyArg_ParseTuple(args,(char *)":new_CardInfo")) goto fail; result = (struct CardInfo *)(struct CardInfo *) calloc(1, sizeof(struct CardInfo)); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_CardInfo, 1); return resultobj; fail: return NULL; } static PyObject *_wrap_delete_CardInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct CardInfo *arg1 = (struct CardInfo *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:delete_CardInfo",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CardInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; free((char *) arg1); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject * CardInfo_swigregister(PyObject *self, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_CardInfo, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_NetSyncInfo_lanSync_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct NetSyncInfo *arg1 = (struct NetSyncInfo *) 0 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:NetSyncInfo_lanSync_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_NetSyncInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (arg1) (arg1)->lanSync = arg2; Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_NetSyncInfo_lanSync_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct NetSyncInfo *arg1 = (struct NetSyncInfo *) 0 ; int result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:NetSyncInfo_lanSync_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_NetSyncInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (int) ((arg1)->lanSync); { resultobj = SWIG_From_int((int)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_NetSyncInfo_hostName_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct NetSyncInfo *arg1 = (struct NetSyncInfo *) 0 ; char *arg2 ; char temp2[256] ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:NetSyncInfo_hostName_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_NetSyncInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { if (!SWIG_AsCharArray(obj1, temp2, 256)) { SWIG_arg_fail(2);SWIG_fail; } arg2 = temp2; } { if (arg2) memcpy(arg1->hostName,arg2,256*sizeof(char)); else memset(arg1->hostName,0,256*sizeof(char)); } Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_NetSyncInfo_hostName_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct NetSyncInfo *arg1 = (struct NetSyncInfo *) 0 ; char *result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:NetSyncInfo_hostName_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_NetSyncInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (char *)(char *) ((arg1)->hostName); { size_t size = 256; #ifndef SWIG_PRESERVE_CARRAY_SIZE while (size && (result[size - 1] == '\0')) --size; #endif resultobj = SWIG_FromCharArray(result, size); } return resultobj; fail: return NULL; } static PyObject *_wrap_NetSyncInfo_hostAddress_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct NetSyncInfo *arg1 = (struct NetSyncInfo *) 0 ; char *arg2 ; char temp2[40] ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:NetSyncInfo_hostAddress_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_NetSyncInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { if (!SWIG_AsCharArray(obj1, temp2, 40)) { SWIG_arg_fail(2);SWIG_fail; } arg2 = temp2; } { if (arg2) memcpy(arg1->hostAddress,arg2,40*sizeof(char)); else memset(arg1->hostAddress,0,40*sizeof(char)); } Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_NetSyncInfo_hostAddress_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct NetSyncInfo *arg1 = (struct NetSyncInfo *) 0 ; char *result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:NetSyncInfo_hostAddress_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_NetSyncInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (char *)(char *) ((arg1)->hostAddress); { size_t size = 40; #ifndef SWIG_PRESERVE_CARRAY_SIZE while (size && (result[size - 1] == '\0')) --size; #endif resultobj = SWIG_FromCharArray(result, size); } return resultobj; fail: return NULL; } static PyObject *_wrap_NetSyncInfo_hostSubnetMask_set(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct NetSyncInfo *arg1 = (struct NetSyncInfo *) 0 ; char *arg2 ; char temp2[40] ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:NetSyncInfo_hostSubnetMask_set",&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_NetSyncInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { if (!SWIG_AsCharArray(obj1, temp2, 40)) { SWIG_arg_fail(2);SWIG_fail; } arg2 = temp2; } { if (arg2) memcpy(arg1->hostSubnetMask,arg2,40*sizeof(char)); else memset(arg1->hostSubnetMask,0,40*sizeof(char)); } Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_NetSyncInfo_hostSubnetMask_get(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct NetSyncInfo *arg1 = (struct NetSyncInfo *) 0 ; char *result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:NetSyncInfo_hostSubnetMask_get",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_NetSyncInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; result = (char *)(char *) ((arg1)->hostSubnetMask); { size_t size = 40; #ifndef SWIG_PRESERVE_CARRAY_SIZE while (size && (result[size - 1] == '\0')) --size; #endif resultobj = SWIG_FromCharArray(result, size); } return resultobj; fail: return NULL; } static PyObject *_wrap_new_NetSyncInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct NetSyncInfo *result; if(!PyArg_ParseTuple(args,(char *)":new_NetSyncInfo")) goto fail; result = (struct NetSyncInfo *)(struct NetSyncInfo *) calloc(1, sizeof(struct NetSyncInfo)); resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_NetSyncInfo, 1); return resultobj; fail: return NULL; } static PyObject *_wrap_delete_NetSyncInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; struct NetSyncInfo *arg1 = (struct NetSyncInfo *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:delete_NetSyncInfo",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_NetSyncInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; free((char *) arg1); Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject * NetSyncInfo_swigregister(PyObject *self, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; SWIG_TypeClientData(SWIGTYPE_p_NetSyncInfo, obj); Py_INCREF(obj); return Py_BuildValue((char *)""); } static PyObject *_wrap_dlp_set_protocol_version(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_set_protocol_version",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); dlp_set_protocol_version(arg1,arg2); PyEval_RestoreThread(__save); } Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ptohdate(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; unsigned char *arg1 = (unsigned char *) 0 ; time_t result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:dlp_ptohdate",&obj0)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_unsigned_char, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = dlp_ptohdate((unsigned char const *)arg1); PyEval_RestoreThread(__save); } { resultobj = SWIG_From_long((long)(result)); } return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_htopdate(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; time_t arg1 ; unsigned char *arg2 = (unsigned char *) 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_htopdate",&obj0,&obj1)) goto fail; { arg1 = (time_t)(SWIG_As_long(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_unsigned_char, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(2)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); dlp_htopdate(arg1,arg2); PyEval_RestoreThread(__save); } Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_GetSysDateTime_(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; time_t *arg2 = (time_t *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_GetSysDateTime_",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_time_t, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(2)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_GetSysDateTime(arg1,arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_SetSysDateTime(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; time_t arg2 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_SetSysDateTime",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (time_t)(SWIG_As_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_SetSysDateTime(arg1,arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ReadSysInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; struct SysInfo *arg2 = (struct SysInfo *) 0 ; PI_ERR result; struct SysInfo temp2 ; PyObject * obj0 = 0 ; arg2 = &temp2; if(!PyArg_ParseTuple(args,(char *)"O:dlp_ReadSysInfo",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ReadSysInfo(arg1,arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); if (arg2) resultobj = t_output_helper(resultobj, PyObjectFromSysInfo(arg2)); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ReadStorageInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; struct CardInfo *arg3 = (struct CardInfo *) 0 ; PI_ERR result; struct CardInfo temp3 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; arg3 = &temp3; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_ReadStorageInfo",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ReadStorageInfo(arg1,arg2,arg3); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); if (arg3) resultobj = t_output_helper(resultobj, PyObjectFromCardInfo(arg3)); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ReadUserInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; struct PilotUser *arg2 = (struct PilotUser *) 0 ; PI_ERR result; struct PilotUser temp2 ; PyObject * obj0 = 0 ; arg2 = &temp2; if(!PyArg_ParseTuple(args,(char *)"O:dlp_ReadUserInfo",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ReadUserInfo(arg1,arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); if (arg2) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg2)); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_WriteUserInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; struct PilotUser *arg2 = (struct PilotUser *) 0 ; PI_ERR result; struct PilotUser temp2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_WriteUserInfo",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } if (!PyObjectToPilotUser(obj1, &temp2)) SWIG_fail; arg2 = &temp2; { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_WriteUserInfo(arg1,(struct PilotUser const *)arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); if (arg2) resultobj = t_output_helper(resultobj, PyObjectFromPilotUser(arg2)); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ResetLastSyncPC(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; PI_ERR result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:dlp_ResetLastSyncPC",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ResetLastSyncPC(arg1); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ReadNetSyncInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; struct NetSyncInfo *arg2 = (struct NetSyncInfo *) 0 ; PI_ERR result; struct NetSyncInfo temp2 ; PyObject * obj0 = 0 ; { arg2 = &temp2; } if(!PyArg_ParseTuple(args,(char *)"O:dlp_ReadNetSyncInfo",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ReadNetSyncInfo(arg1,arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); if (arg2) resultobj = t_output_helper(resultobj, PyObjectFromNetSyncInfo(arg2)); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_WriteNetSyncInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; struct NetSyncInfo *arg2 = (struct NetSyncInfo *) 0 ; PI_ERR result; struct NetSyncInfo temp2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_WriteNetSyncInfo",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } PyObjectToNetSyncInfo(obj1, &temp2); arg2 = &temp2; { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_WriteNetSyncInfo(arg1,(struct NetSyncInfo const *)arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_OpenConduit(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; PI_ERR result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:dlp_OpenConduit",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_OpenConduit(arg1); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_EndOfSync(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_EndOfSync",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_EndOfSync(arg1,arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_AbortSync(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; PI_ERR result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:dlp_AbortSync",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_AbortSync(arg1); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ReadFeature(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; unsigned long arg2 ; int arg3 ; unsigned long *arg4 = (unsigned long *) 0 ; PI_ERR result; unsigned long temp4 ; int res4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; arg4 = &temp4; res4 = SWIG_NEWOBJ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_ReadFeature",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { if (PyString_Check(obj1)) arg2 = makelong(PyString_AS_STRING(obj1)); else if (PyInt_Check(obj1)) arg2 = PyInt_AsLong(obj1); else { PyErr_SetString(PyExc_TypeError,"You must specify a type/creator"); SWIG_fail; } } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ReadFeature(arg1,arg2,arg3,arg4); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); resultobj = t_output_helper(resultobj, ((res4 == SWIG_NEWOBJ) ? SWIG_From_unsigned_SS_long((*arg4)) : SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_unsigned_long, 0))); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_GetROMToken(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; unsigned long arg2 ; void *arg3 = (void *) 0 ; size_t *arg4 = (size_t *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOO:dlp_GetROMToken",&obj0,&obj1,&obj2,&obj3)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (unsigned long)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { if ((SWIG_ConvertPtr(obj2,(void **)(&arg3),0,SWIG_POINTER_EXCEPTION|0))== -1) { SWIG_arg_fail(3);SWIG_fail; } } SWIG_Python_ConvertPtr(obj3, (void **)&arg4, SWIGTYPE_p_size_t, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(4)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_GetROMToken(arg1,arg2,arg3,arg4); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_AddSyncLogEntry(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; char *arg2 = (char *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_AddSyncLogEntry",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) { SWIG_arg_fail(2);SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_AddSyncLogEntry(arg1,arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_CallApplication(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; unsigned long arg2 ; unsigned long arg3 ; int arg4 ; size_t arg5 ; void *arg6 = (void *) 0 ; unsigned long *arg7 = (unsigned long *) 0 ; pi_buffer_t *arg8 = (pi_buffer_t *) 0 ; PI_ERR result; unsigned long temp7 ; int res7 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; arg7 = &temp7; res7 = SWIG_NEWOBJ; { arg8 = pi_buffer_new(0xFFFF); } if(!PyArg_ParseTuple(args,(char *)"OOOOO:dlp_CallApplication",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { if (PyString_Check(obj1)) arg2 = makelong(PyString_AS_STRING(obj1)); else if (PyInt_Check(obj1)) arg2 = PyInt_AsLong(obj1); else { PyErr_SetString(PyExc_TypeError,"You must specify a type/creator"); SWIG_fail; } } { if (PyString_Check(obj2)) arg3 = makelong(PyString_AS_STRING(obj2)); else if (PyInt_Check(obj2)) arg3 = PyInt_AsLong(obj2); else { PyErr_SetString(PyExc_TypeError,"You must specify a type/creator"); SWIG_fail; } } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } arg5 = PyString_Size(obj4); arg6 = (void *)PyString_AsString(obj4); { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_CallApplication(arg1,arg2,arg3,arg4,arg5,(void const *)arg6,arg7,arg8); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); resultobj = t_output_helper(resultobj, ((res7 == SWIG_NEWOBJ) ? SWIG_From_unsigned_SS_long((*arg7)) : SWIG_NewPointerObj((void*)(arg7), SWIGTYPE_p_unsigned_long, 0))); { if (arg8) { PyObject *o1 = Py_BuildValue("s#", arg8->data, arg8->used); resultobj = t_output_helper(resultobj, o1); } } { if (arg8) { pi_buffer_free(arg8); } } return resultobj; fail: { if (arg8) { pi_buffer_free(arg8); } } return NULL; } static PyObject *_wrap_dlp_ReadAppPreference(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; unsigned long arg2 ; int arg3 ; int arg4 ; int arg5 ; void *arg6 = (void *) 0 ; size_t *arg7 = (size_t *) 0 ; int *arg8 = (int *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOOOOO:dlp_ReadAppPreference",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { if (PyString_Check(obj1)) arg2 = makelong(PyString_AS_STRING(obj1)); else if (PyInt_Check(obj1)) arg2 = PyInt_AsLong(obj1); else { PyErr_SetString(PyExc_TypeError,"You must specify a type/creator"); SWIG_fail; } } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (int)(SWIG_As_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { if ((SWIG_ConvertPtr(obj5,(void **)(&arg6),0,SWIG_POINTER_EXCEPTION|0))== -1) { SWIG_arg_fail(6);SWIG_fail; } } SWIG_Python_ConvertPtr(obj6, (void **)&arg7, SWIGTYPE_p_size_t, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(7)) SWIG_fail; SWIG_Python_ConvertPtr(obj7, (void **)&arg8, SWIGTYPE_p_int, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(8)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ReadAppPreference(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); if (arg6) resultobj = t_output_helper(resultobj, Py_BuildValue("is#", arg8, arg6, arg7)); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_WriteAppPreference(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; unsigned long arg2 ; int arg3 ; int arg4 ; int arg5 ; void *arg6 = (void *) 0 ; size_t arg7 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOOO:dlp_WriteAppPreference",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { if (PyString_Check(obj1)) arg2 = makelong(PyString_AS_STRING(obj1)); else if (PyInt_Check(obj1)) arg2 = PyInt_AsLong(obj1); else { PyErr_SetString(PyExc_TypeError,"You must specify a type/creator"); SWIG_fail; } } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (int)(SWIG_As_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } arg6 = (void *)PyString_AsString(obj5); arg7 = PyString_Size(obj5); { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_WriteAppPreference(arg1,arg2,arg3,arg4,arg5,(void const *)arg6,arg7); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ResetSystem(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; PI_ERR result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:dlp_ResetSystem",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ResetSystem(arg1); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ReadDBList_(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int arg3 ; int arg4 ; pi_buffer_t *arg5 = (pi_buffer_t *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; { arg5 = pi_buffer_new(0xFFFF); } if(!PyArg_ParseTuple(args,(char *)"OOOO:dlp_ReadDBList_",&obj0,&obj1,&obj2,&obj3)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ReadDBList(arg1,arg2,arg3,arg4,arg5); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); if (arg5) { int j; struct DBInfo info; resultobj = PyList_New((arg5->used / sizeof(struct DBInfo))); for (j=0; j < (arg5->used / sizeof(struct DBInfo)); j++) { memcpy(&info, arg5->data + j * sizeof(struct DBInfo), sizeof(struct DBInfo)); PyObject *o = PyObjectFromDBInfo(&info); Py_INCREF(o); PyList_SET_ITEM(resultobj, j, o); } } { if (arg5) { pi_buffer_free(arg5); } } return resultobj; fail: { if (arg5) { pi_buffer_free(arg5); } } return NULL; } static PyObject *_wrap_dlp_FindDBByName(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; char *arg3 = (char *) 0 ; unsigned long *arg4 = (unsigned long *) 0 ; int *arg5 = (int *) 0 ; struct DBInfo *arg6 = (struct DBInfo *) 0 ; struct DBSizeInfo *arg7 = (struct DBSizeInfo *) 0 ; PI_ERR result; unsigned long temp4 ; int res4 = 0 ; int temp5 ; int res5 = 0 ; struct DBInfo temp16 ; struct DBSizeInfo temp26 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; arg4 = &temp4; res4 = SWIG_NEWOBJ; arg5 = &temp5; res5 = SWIG_NEWOBJ; arg6 = &temp16; arg7 = &temp26; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_FindDBByName",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) { SWIG_arg_fail(3);SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_FindDBByName(arg1,arg2,(char const *)arg3,arg4,arg5,arg6,arg7); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); resultobj = t_output_helper(resultobj, ((res4 == SWIG_NEWOBJ) ? SWIG_From_unsigned_SS_long((*arg4)) : SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_unsigned_long, 0))); resultobj = t_output_helper(resultobj, ((res5 == SWIG_NEWOBJ) ? SWIG_From_int((*arg5)) : SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_int, 0))); if (arg6) resultobj = t_output_helper(resultobj, PyObjectFromDBInfo(arg6)); if (arg7) resultobj = t_output_helper(resultobj, PyObjectFromDBSizeInfo(arg7)); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_FindDBByOpenHandle(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int *arg3 = (int *) 0 ; unsigned long *arg4 = (unsigned long *) 0 ; struct DBInfo *arg5 = (struct DBInfo *) 0 ; struct DBSizeInfo *arg6 = (struct DBSizeInfo *) 0 ; PI_ERR result; int temp3 ; int res3 = 0 ; unsigned long temp4 ; int res4 = 0 ; struct DBInfo temp15 ; struct DBSizeInfo temp25 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; arg3 = &temp3; res3 = SWIG_NEWOBJ; arg4 = &temp4; res4 = SWIG_NEWOBJ; arg5 = &temp15; arg6 = &temp25; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_FindDBByOpenHandle",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_FindDBByOpenHandle(arg1,arg2,arg3,arg4,arg5,arg6); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); resultobj = t_output_helper(resultobj, ((res3 == SWIG_NEWOBJ) ? SWIG_From_int((*arg3)) : SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_int, 0))); resultobj = t_output_helper(resultobj, ((res4 == SWIG_NEWOBJ) ? SWIG_From_unsigned_SS_long((*arg4)) : SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_unsigned_long, 0))); if (arg5) resultobj = t_output_helper(resultobj, PyObjectFromDBInfo(arg5)); if (arg6) resultobj = t_output_helper(resultobj, PyObjectFromDBSizeInfo(arg6)); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_FindDBByTypeCreator(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; unsigned long arg2 ; unsigned long arg3 ; int arg4 ; int arg5 ; int *arg6 = (int *) 0 ; unsigned long *arg7 = (unsigned long *) 0 ; int *arg8 = (int *) 0 ; struct DBInfo *arg9 = (struct DBInfo *) 0 ; struct DBSizeInfo *arg10 = (struct DBSizeInfo *) 0 ; PI_ERR result; int temp6 ; int res6 = 0 ; unsigned long temp7 ; int res7 = 0 ; int temp8 ; int res8 = 0 ; struct DBInfo temp19 ; struct DBSizeInfo temp29 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; arg6 = &temp6; res6 = SWIG_NEWOBJ; arg7 = &temp7; res7 = SWIG_NEWOBJ; arg8 = &temp8; res8 = SWIG_NEWOBJ; arg9 = &temp19; arg10 = &temp29; if(!PyArg_ParseTuple(args,(char *)"OOOOO:dlp_FindDBByTypeCreator",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { if (PyString_Check(obj1)) arg2 = makelong(PyString_AS_STRING(obj1)); else if (PyInt_Check(obj1)) arg2 = PyInt_AsLong(obj1); else { PyErr_SetString(PyExc_TypeError,"You must specify a type/creator"); SWIG_fail; } } { if (PyString_Check(obj2)) arg3 = makelong(PyString_AS_STRING(obj2)); else if (PyInt_Check(obj2)) arg3 = PyInt_AsLong(obj2); else { PyErr_SetString(PyExc_TypeError,"You must specify a type/creator"); SWIG_fail; } } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (int)(SWIG_As_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_FindDBByTypeCreator(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); resultobj = t_output_helper(resultobj, ((res6 == SWIG_NEWOBJ) ? SWIG_From_int((*arg6)) : SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_int, 0))); resultobj = t_output_helper(resultobj, ((res7 == SWIG_NEWOBJ) ? SWIG_From_unsigned_SS_long((*arg7)) : SWIG_NewPointerObj((void*)(arg7), SWIGTYPE_p_unsigned_long, 0))); resultobj = t_output_helper(resultobj, ((res8 == SWIG_NEWOBJ) ? SWIG_From_int((*arg8)) : SWIG_NewPointerObj((void*)(arg8), SWIGTYPE_p_int, 0))); if (arg9) resultobj = t_output_helper(resultobj, PyObjectFromDBInfo(arg9)); if (arg10) resultobj = t_output_helper(resultobj, PyObjectFromDBSizeInfo(arg10)); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_FindDBInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int arg3 ; char *arg4 = (char *) 0 ; unsigned long arg5 ; unsigned long arg6 ; struct DBInfo *arg7 = (struct DBInfo *) 0 ; PI_ERR result; struct DBInfo temp7 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; arg7 = &temp7; if(!PyArg_ParseTuple(args,(char *)"OOOOOO:dlp_FindDBInfo",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } if (!SWIG_AsCharPtr(obj3, (char**)&arg4)) { SWIG_arg_fail(4);SWIG_fail; } { if (PyString_Check(obj4)) arg5 = makelong(PyString_AS_STRING(obj4)); else if (PyInt_Check(obj4)) arg5 = PyInt_AsLong(obj4); else { PyErr_SetString(PyExc_TypeError,"You must specify a type/creator"); SWIG_fail; } } { if (PyString_Check(obj5)) arg6 = makelong(PyString_AS_STRING(obj5)); else if (PyInt_Check(obj5)) arg6 = PyInt_AsLong(obj5); else { PyErr_SetString(PyExc_TypeError,"You must specify a type/creator"); SWIG_fail; } } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_FindDBInfo(arg1,arg2,arg3,(char const *)arg4,arg5,arg6,arg7); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); if (arg7) resultobj = t_output_helper(resultobj, PyObjectFromDBInfo(arg7)); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_OpenDB(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int arg3 ; char *arg4 = (char *) 0 ; int *arg5 = (int *) 0 ; PI_ERR result; int temp5 ; int res5 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; arg5 = &temp5; res5 = SWIG_NEWOBJ; if(!PyArg_ParseTuple(args,(char *)"OOOO:dlp_OpenDB",&obj0,&obj1,&obj2,&obj3)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } if (!SWIG_AsCharPtr(obj3, (char**)&arg4)) { SWIG_arg_fail(4);SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_OpenDB(arg1,arg2,arg3,(char const *)arg4,arg5); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); resultobj = t_output_helper(resultobj, ((res5 == SWIG_NEWOBJ) ? SWIG_From_int((*arg5)) : SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_int, 0))); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_CloseDB(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_CloseDB",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_CloseDB(arg1,arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_CloseDB_All(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; PI_ERR result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:dlp_CloseDB_All",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_CloseDB_All(arg1); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_DeleteDB(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; char *arg3 = (char *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_DeleteDB",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) { SWIG_arg_fail(3);SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_DeleteDB(arg1,arg2,(char const *)arg3); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_CreateDB(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; unsigned long arg2 ; unsigned long arg3 ; int arg4 ; int arg5 ; unsigned int arg6 ; char *arg7 = (char *) 0 ; int *arg8 = (int *) 0 ; PI_ERR result; int temp8 ; int res8 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; arg8 = &temp8; res8 = SWIG_NEWOBJ; if(!PyArg_ParseTuple(args,(char *)"OOOOOOO:dlp_CreateDB",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { if (PyString_Check(obj1)) arg2 = makelong(PyString_AS_STRING(obj1)); else if (PyInt_Check(obj1)) arg2 = PyInt_AsLong(obj1); else { PyErr_SetString(PyExc_TypeError,"You must specify a type/creator"); SWIG_fail; } } { if (PyString_Check(obj2)) arg3 = makelong(PyString_AS_STRING(obj2)); else if (PyInt_Check(obj2)) arg3 = PyInt_AsLong(obj2); else { PyErr_SetString(PyExc_TypeError,"You must specify a type/creator"); SWIG_fail; } } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (int)(SWIG_As_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { arg6 = (unsigned int)(SWIG_As_unsigned_SS_int(obj5)); if (SWIG_arg_fail(6)) SWIG_fail; } if (!SWIG_AsCharPtr(obj6, (char**)&arg7)) { SWIG_arg_fail(7);SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_CreateDB(arg1,arg2,arg3,arg4,arg5,arg6,(char const *)arg7,arg8); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); resultobj = t_output_helper(resultobj, ((res8 == SWIG_NEWOBJ) ? SWIG_From_int((*arg8)) : SWIG_NewPointerObj((void*)(arg8), SWIGTYPE_p_int, 0))); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ReadOpenDBInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int *arg3 = (int *) 0 ; PI_ERR result; int temp3 ; int res3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; arg3 = &temp3; res3 = SWIG_NEWOBJ; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_ReadOpenDBInfo",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ReadOpenDBInfo(arg1,arg2,arg3); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); resultobj = t_output_helper(resultobj, ((res3 == SWIG_NEWOBJ) ? SWIG_From_int((*arg3)) : SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_int, 0))); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_SetDBInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int arg3 ; int arg4 ; unsigned int arg5 ; time_t arg6 ; time_t arg7 ; time_t arg8 ; unsigned long arg9 ; unsigned long arg10 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; PyObject * obj8 = 0 ; PyObject * obj9 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:dlp_SetDBInfo",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (unsigned int)(SWIG_As_unsigned_SS_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { arg6 = (time_t)(SWIG_As_long(obj5)); if (SWIG_arg_fail(6)) SWIG_fail; } { arg7 = (time_t)(SWIG_As_long(obj6)); if (SWIG_arg_fail(7)) SWIG_fail; } { arg8 = (time_t)(SWIG_As_long(obj7)); if (SWIG_arg_fail(8)) SWIG_fail; } { if (PyString_Check(obj8)) arg9 = makelong(PyString_AS_STRING(obj8)); else if (PyInt_Check(obj8)) arg9 = PyInt_AsLong(obj8); else { PyErr_SetString(PyExc_TypeError,"You must specify a type/creator"); SWIG_fail; } } { if (PyString_Check(obj9)) arg10 = makelong(PyString_AS_STRING(obj9)); else if (PyInt_Check(obj9)) arg10 = PyInt_AsLong(obj9); else { PyErr_SetString(PyExc_TypeError,"You must specify a type/creator"); SWIG_fail; } } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_SetDBInfo(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_DeleteCategory(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int arg3 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_DeleteCategory",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_DeleteCategory(arg1,arg2,arg3); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_MoveCategory(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int arg3 ; int arg4 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOO:dlp_MoveCategory",&obj0,&obj1,&obj2,&obj3)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_MoveCategory(arg1,arg2,arg3,arg4); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ReadAppBlock(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int arg3 ; int arg4 ; pi_buffer_t *arg5 = (pi_buffer_t *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; { arg5 = pi_buffer_new(0xFFFF); } if(!PyArg_ParseTuple(args,(char *)"OOOO:dlp_ReadAppBlock",&obj0,&obj1,&obj2,&obj3)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ReadAppBlock(arg1,arg2,arg3,arg4,arg5); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); { if (arg5) { PyObject *o1 = Py_BuildValue("s#", arg5->data, arg5->used); resultobj = t_output_helper(resultobj, o1); } } { if (arg5) { pi_buffer_free(arg5); } } return resultobj; fail: { if (arg5) { pi_buffer_free(arg5); } } return NULL; } static PyObject *_wrap_dlp_WriteAppBlock(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; void *arg3 = (void *) 0 ; size_t arg4 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_WriteAppBlock",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } arg3 = (void *)PyString_AsString(obj2); arg4 = PyString_Size(obj2); { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_WriteAppBlock(arg1,arg2,(void const *)arg3,arg4); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ReadSortBlock(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int arg3 ; int arg4 ; pi_buffer_t *arg5 = (pi_buffer_t *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; { arg5 = pi_buffer_new(0xFFFF); } if(!PyArg_ParseTuple(args,(char *)"OOOO:dlp_ReadSortBlock",&obj0,&obj1,&obj2,&obj3)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ReadSortBlock(arg1,arg2,arg3,arg4,arg5); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); { if (arg5) { PyObject *o1 = Py_BuildValue("s#", arg5->data, arg5->used); resultobj = t_output_helper(resultobj, o1); } } { if (arg5) { pi_buffer_free(arg5); } } return resultobj; fail: { if (arg5) { pi_buffer_free(arg5); } } return NULL; } static PyObject *_wrap_dlp_WriteSortBlock(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; void *arg3 = (void *) 0 ; size_t arg4 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_WriteSortBlock",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } arg3 = (void *)PyString_AsString(obj2); arg4 = PyString_Size(obj2); { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_WriteSortBlock(arg1,arg2,(void const *)arg3,arg4); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_CleanUpDatabase(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_CleanUpDatabase",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_CleanUpDatabase(arg1,arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ResetSyncFlags(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_ResetSyncFlags",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ResetSyncFlags(arg1,arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ResetDBIndex(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_ResetDBIndex",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ResetDBIndex(arg1,arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ReadRecordById(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; recordid_t arg3 ; pi_buffer_t *arg4 = (pi_buffer_t *) 0 ; int *arg5 = (int *) 0 ; int *arg6 = (int *) 0 ; int *arg7 = (int *) 0 ; PI_ERR result; int temp5 ; int res5 = 0 ; int temp6 ; int res6 = 0 ; int temp7 ; int res7 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; { arg4 = pi_buffer_new(0xFFFF); } arg5 = &temp5; res5 = SWIG_NEWOBJ; arg6 = &temp6; res6 = SWIG_NEWOBJ; arg7 = &temp7; res7 = SWIG_NEWOBJ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_ReadRecordById",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (recordid_t)(SWIG_As_unsigned_SS_long(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ReadRecordById(arg1,arg2,arg3,arg4,arg5,arg6,arg7); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); { if (arg4) { PyObject *o1 = Py_BuildValue("s#", arg4->data, arg4->used); resultobj = t_output_helper(resultobj, o1); } } resultobj = t_output_helper(resultobj, ((res5 == SWIG_NEWOBJ) ? SWIG_From_int((*arg5)) : SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_int, 0))); resultobj = t_output_helper(resultobj, ((res6 == SWIG_NEWOBJ) ? SWIG_From_int((*arg6)) : SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_int, 0))); resultobj = t_output_helper(resultobj, ((res7 == SWIG_NEWOBJ) ? SWIG_From_int((*arg7)) : SWIG_NewPointerObj((void*)(arg7), SWIGTYPE_p_int, 0))); { if (arg4) { pi_buffer_free(arg4); } } return resultobj; fail: { if (arg4) { pi_buffer_free(arg4); } } return NULL; } static PyObject *_wrap_dlp_ReadRecordByIndex(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int arg3 ; pi_buffer_t *arg4 = (pi_buffer_t *) 0 ; recordid_t *arg5 = (recordid_t *) 0 ; int *arg6 = (int *) 0 ; int *arg7 = (int *) 0 ; PI_ERR result; recordid_t temp5 ; int res5 = 0 ; int temp6 ; int res6 = 0 ; int temp7 ; int res7 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; { arg4 = pi_buffer_new(0xFFFF); } arg5 = &temp5; res5 = SWIG_NEWOBJ; arg6 = &temp6; res6 = SWIG_NEWOBJ; arg7 = &temp7; res7 = SWIG_NEWOBJ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_ReadRecordByIndex",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ReadRecordByIndex(arg1,arg2,arg3,arg4,arg5,arg6,arg7); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); { if (arg4) { PyObject *o1 = Py_BuildValue("s#", arg4->data, arg4->used); resultobj = t_output_helper(resultobj, o1); } } resultobj = t_output_helper(resultobj, ((res5 == SWIG_NEWOBJ) ? SWIG_From_unsigned_SS_long((*arg5)) : SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_recordid_t, 0))); resultobj = t_output_helper(resultobj, ((res6 == SWIG_NEWOBJ) ? SWIG_From_int((*arg6)) : SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_int, 0))); resultobj = t_output_helper(resultobj, ((res7 == SWIG_NEWOBJ) ? SWIG_From_int((*arg7)) : SWIG_NewPointerObj((void*)(arg7), SWIGTYPE_p_int, 0))); { if (arg4) { pi_buffer_free(arg4); } } return resultobj; fail: { if (arg4) { pi_buffer_free(arg4); } } return NULL; } static PyObject *_wrap_dlp_ReadNextModifiedRec(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; pi_buffer_t *arg3 = (pi_buffer_t *) 0 ; recordid_t *arg4 = (recordid_t *) 0 ; int *arg5 = (int *) 0 ; int *arg6 = (int *) 0 ; int *arg7 = (int *) 0 ; PI_ERR result; recordid_t temp4 ; int res4 = 0 ; int temp5 ; int res5 = 0 ; int temp6 ; int res6 = 0 ; int temp7 ; int res7 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; { arg3 = pi_buffer_new(0xFFFF); } arg4 = &temp4; res4 = SWIG_NEWOBJ; arg5 = &temp5; res5 = SWIG_NEWOBJ; arg6 = &temp6; res6 = SWIG_NEWOBJ; arg7 = &temp7; res7 = SWIG_NEWOBJ; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_ReadNextModifiedRec",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ReadNextModifiedRec(arg1,arg2,arg3,arg4,arg5,arg6,arg7); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); { if (arg3) { PyObject *o1 = Py_BuildValue("s#", arg3->data, arg3->used); resultobj = t_output_helper(resultobj, o1); } } resultobj = t_output_helper(resultobj, ((res4 == SWIG_NEWOBJ) ? SWIG_From_unsigned_SS_long((*arg4)) : SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_recordid_t, 0))); resultobj = t_output_helper(resultobj, ((res5 == SWIG_NEWOBJ) ? SWIG_From_int((*arg5)) : SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_int, 0))); resultobj = t_output_helper(resultobj, ((res6 == SWIG_NEWOBJ) ? SWIG_From_int((*arg6)) : SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_int, 0))); resultobj = t_output_helper(resultobj, ((res7 == SWIG_NEWOBJ) ? SWIG_From_int((*arg7)) : SWIG_NewPointerObj((void*)(arg7), SWIGTYPE_p_int, 0))); { if (arg3) { pi_buffer_free(arg3); } } return resultobj; fail: { if (arg3) { pi_buffer_free(arg3); } } return NULL; } static PyObject *_wrap_dlp_ReadNextModifiedRecInCategory(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int arg3 ; pi_buffer_t *arg4 = (pi_buffer_t *) 0 ; recordid_t *arg5 = (recordid_t *) 0 ; int *arg6 = (int *) 0 ; int *arg7 = (int *) 0 ; PI_ERR result; recordid_t temp5 ; int res5 = 0 ; int temp6 ; int res6 = 0 ; int temp7 ; int res7 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; { arg4 = pi_buffer_new(0xFFFF); } arg5 = &temp5; res5 = SWIG_NEWOBJ; arg6 = &temp6; res6 = SWIG_NEWOBJ; arg7 = &temp7; res7 = SWIG_NEWOBJ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_ReadNextModifiedRecInCategory",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ReadNextModifiedRecInCategory(arg1,arg2,arg3,arg4,arg5,arg6,arg7); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); { if (arg4) { PyObject *o1 = Py_BuildValue("s#", arg4->data, arg4->used); resultobj = t_output_helper(resultobj, o1); } } resultobj = t_output_helper(resultobj, ((res5 == SWIG_NEWOBJ) ? SWIG_From_unsigned_SS_long((*arg5)) : SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_recordid_t, 0))); resultobj = t_output_helper(resultobj, ((res6 == SWIG_NEWOBJ) ? SWIG_From_int((*arg6)) : SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_int, 0))); resultobj = t_output_helper(resultobj, ((res7 == SWIG_NEWOBJ) ? SWIG_From_int((*arg7)) : SWIG_NewPointerObj((void*)(arg7), SWIGTYPE_p_int, 0))); { if (arg4) { pi_buffer_free(arg4); } } return resultobj; fail: { if (arg4) { pi_buffer_free(arg4); } } return NULL; } static PyObject *_wrap_dlp_ReadNextRecInCategory(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int arg3 ; pi_buffer_t *arg4 = (pi_buffer_t *) 0 ; recordid_t *arg5 = (recordid_t *) 0 ; int *arg6 = (int *) 0 ; int *arg7 = (int *) 0 ; PI_ERR result; recordid_t temp5 ; int res5 = 0 ; int temp6 ; int res6 = 0 ; int temp7 ; int res7 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; { arg4 = pi_buffer_new(0xFFFF); } arg5 = &temp5; res5 = SWIG_NEWOBJ; arg6 = &temp6; res6 = SWIG_NEWOBJ; arg7 = &temp7; res7 = SWIG_NEWOBJ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_ReadNextRecInCategory",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ReadNextRecInCategory(arg1,arg2,arg3,arg4,arg5,arg6,arg7); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); { if (arg4) { PyObject *o1 = Py_BuildValue("s#", arg4->data, arg4->used); resultobj = t_output_helper(resultobj, o1); } } resultobj = t_output_helper(resultobj, ((res5 == SWIG_NEWOBJ) ? SWIG_From_unsigned_SS_long((*arg5)) : SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_recordid_t, 0))); resultobj = t_output_helper(resultobj, ((res6 == SWIG_NEWOBJ) ? SWIG_From_int((*arg6)) : SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_int, 0))); resultobj = t_output_helper(resultobj, ((res7 == SWIG_NEWOBJ) ? SWIG_From_int((*arg7)) : SWIG_NewPointerObj((void*)(arg7), SWIGTYPE_p_int, 0))); { if (arg4) { pi_buffer_free(arg4); } } return resultobj; fail: { if (arg4) { pi_buffer_free(arg4); } } return NULL; } static PyObject *_wrap_dlp_WriteRecord(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int arg3 ; recordid_t arg4 ; int arg5 ; void *arg6 = (void *) 0 ; size_t arg7 ; recordid_t *arg8 = (recordid_t *) 0 ; PI_ERR result; recordid_t temp8 ; int res8 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; arg8 = &temp8; res8 = SWIG_NEWOBJ; if(!PyArg_ParseTuple(args,(char *)"OOOOOO:dlp_WriteRecord",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (recordid_t)(SWIG_As_unsigned_SS_long(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (int)(SWIG_As_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } arg6 = (void *)PyString_AsString(obj5); arg7 = PyString_Size(obj5); { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_WriteRecord(arg1,arg2,arg3,arg4,arg5,(void const *)arg6,arg7,arg8); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); resultobj = t_output_helper(resultobj, ((res8 == SWIG_NEWOBJ) ? SWIG_From_unsigned_SS_long((*arg8)) : SWIG_NewPointerObj((void*)(arg8), SWIGTYPE_p_recordid_t, 0))); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_DeleteRecord(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int arg3 ; recordid_t arg4 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOO:dlp_DeleteRecord",&obj0,&obj1,&obj2,&obj3)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (recordid_t)(SWIG_As_unsigned_SS_long(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_DeleteRecord(arg1,arg2,arg3,arg4); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ReadResourceByType(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; unsigned long arg3 ; int arg4 ; pi_buffer_t *arg5 = (pi_buffer_t *) 0 ; int *arg6 = (int *) 0 ; PI_ERR result; int temp6 ; int res6 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; { arg5 = pi_buffer_new(0xFFFF); } arg6 = &temp6; res6 = SWIG_NEWOBJ; if(!PyArg_ParseTuple(args,(char *)"OOOO:dlp_ReadResourceByType",&obj0,&obj1,&obj2,&obj3)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { if (PyString_Check(obj2)) arg3 = makelong(PyString_AS_STRING(obj2)); else if (PyInt_Check(obj2)) arg3 = PyInt_AsLong(obj2); else { PyErr_SetString(PyExc_TypeError,"You must specify a type/creator"); SWIG_fail; } } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ReadResourceByType(arg1,arg2,arg3,arg4,arg5,arg6); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); { if (arg5) { PyObject *o1 = Py_BuildValue("s#", arg5->data, arg5->used); resultobj = t_output_helper(resultobj, o1); } } resultobj = t_output_helper(resultobj, ((res6 == SWIG_NEWOBJ) ? SWIG_From_int((*arg6)) : SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_int, 0))); { if (arg5) { pi_buffer_free(arg5); } } return resultobj; fail: { if (arg5) { pi_buffer_free(arg5); } } return NULL; } static PyObject *_wrap_dlp_ReadResourceByIndex(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int arg3 ; pi_buffer_t *arg4 = (pi_buffer_t *) 0 ; unsigned long *arg5 = (unsigned long *) 0 ; int *arg6 = (int *) 0 ; PI_ERR result; int temp6 ; int res6 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; { arg4 = pi_buffer_new(0xFFFF); } arg6 = &temp6; res6 = SWIG_NEWOBJ; if(!PyArg_ParseTuple(args,(char *)"OOOO:dlp_ReadResourceByIndex",&obj0,&obj1,&obj2,&obj3)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } SWIG_Python_ConvertPtr(obj3, (void **)&arg5, SWIGTYPE_p_unsigned_long, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(5)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ReadResourceByIndex(arg1,arg2,arg3,arg4,arg5,arg6); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); { if (arg4) { PyObject *o1 = Py_BuildValue("s#", arg4->data, arg4->used); resultobj = t_output_helper(resultobj, o1); } } resultobj = t_output_helper(resultobj, ((res6 == SWIG_NEWOBJ) ? SWIG_From_int((*arg6)) : SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_int, 0))); { if (arg4) { pi_buffer_free(arg4); } } return resultobj; fail: { if (arg4) { pi_buffer_free(arg4); } } return NULL; } static PyObject *_wrap_dlp_WriteResource(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; unsigned long arg3 ; int arg4 ; void *arg5 = (void *) 0 ; size_t arg6 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOO:dlp_WriteResource",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (unsigned long)(SWIG_As_unsigned_SS_long(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } arg5 = (void *)PyString_AsString(obj4); arg6 = PyString_Size(obj4); { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_WriteResource(arg1,arg2,arg3,arg4,(void const *)arg5,arg6); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_DeleteResource(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int arg3 ; unsigned long arg4 ; int arg5 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOO:dlp_DeleteResource",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (unsigned long)(SWIG_As_unsigned_SS_long(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (int)(SWIG_As_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_DeleteResource(arg1,arg2,arg3,arg4,arg5); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ExpSlotEnumerate(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int *arg2 = (int *) 0 ; int *arg3 = (int *) 0 ; PI_ERR result; int numSlots2 ; int slotRefs2[16] ; PyObject * obj0 = 0 ; numSlots2 = sizeof(slotRefs2) / sizeof(slotRefs2[0]); arg2 = &numSlots2; arg3 = &slotRefs2[0]; if(!PyArg_ParseTuple(args,(char *)"O:dlp_ExpSlotEnumerate",&obj0)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ExpSlotEnumerate(arg1,arg2,arg3); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); if (arg2 && arg3) { int slotIndex; for (slotIndex=0; slotIndex < *arg2; slotIndex++) t_output_helper(resultobj, PyInt_FromLong(arg3[slotIndex])); } return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ExpCardPresent(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_ExpCardPresent",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ExpCardPresent(arg1,arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ExpCardInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; unsigned long *arg3 = (unsigned long *) 0 ; int *arg4 = (int *) 0 ; char **arg5 = (char **) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOO:dlp_ExpCardInfo",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } SWIG_Python_ConvertPtr(obj2, (void **)&arg3, SWIGTYPE_p_unsigned_long, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(3)) SWIG_fail; SWIG_Python_ConvertPtr(obj3, (void **)&arg4, SWIGTYPE_p_int, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(4)) SWIG_fail; SWIG_Python_ConvertPtr(obj4, (void **)&arg5, SWIGTYPE_p_p_char, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(5)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ExpCardInfo(arg1,arg2,arg3,arg4,arg5); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_ExpSlotMediaType(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; unsigned long *arg3 = (unsigned long *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_ExpSlotMediaType",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } SWIG_Python_ConvertPtr(obj2, (void **)&arg3, SWIGTYPE_p_unsigned_long, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(3)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_ExpSlotMediaType(arg1,arg2,arg3); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSVolumeEnumerate(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int *arg2 = (int *) 0 ; int *arg3 = (int *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_VFSVolumeEnumerate",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_int, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(2)) SWIG_fail; SWIG_Python_ConvertPtr(obj2, (void **)&arg3, SWIGTYPE_p_int, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(3)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSVolumeEnumerate(arg1,arg2,arg3); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSVolumeInfo(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; struct VFSInfo *arg3 = (struct VFSInfo *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_VFSVolumeInfo",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } SWIG_Python_ConvertPtr(obj2, (void **)&arg3, SWIGTYPE_p_VFSInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(3)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSVolumeInfo(arg1,arg2,arg3); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSVolumeGetLabel(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; int *arg3 = (int *) 0 ; char *arg4 = (char *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOO:dlp_VFSVolumeGetLabel",&obj0,&obj1,&obj2,&obj3)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } SWIG_Python_ConvertPtr(obj2, (void **)&arg3, SWIGTYPE_p_int, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(3)) SWIG_fail; if (!SWIG_AsCharPtr(obj3, (char**)&arg4)) { SWIG_arg_fail(4);SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSVolumeGetLabel(arg1,arg2,arg3,arg4); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSVolumeSetLabel(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; char *arg3 = (char *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_VFSVolumeSetLabel",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) { SWIG_arg_fail(3);SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSVolumeSetLabel(arg1,arg2,(char const *)arg3); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSVolumeSize(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; long *arg3 = (long *) 0 ; long *arg4 = (long *) 0 ; PI_ERR result; long temp3 ; int res3 = 0 ; long temp4 ; int res4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; arg3 = &temp3; res3 = SWIG_NEWOBJ; arg4 = &temp4; res4 = SWIG_NEWOBJ; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_VFSVolumeSize",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSVolumeSize(arg1,arg2,arg3,arg4); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); resultobj = t_output_helper(resultobj, ((res3 == SWIG_NEWOBJ) ? SWIG_From_long((*arg3)) : SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_long, 0))); resultobj = t_output_helper(resultobj, ((res4 == SWIG_NEWOBJ) ? SWIG_From_long((*arg4)) : SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_long, 0))); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSVolumeFormat(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; unsigned char arg2 ; int arg3 ; struct VFSSlotMountParam *arg4 = (struct VFSSlotMountParam *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOO:dlp_VFSVolumeFormat",&obj0,&obj1,&obj2,&obj3)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (unsigned char)(SWIG_As_unsigned_SS_char(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } SWIG_Python_ConvertPtr(obj3, (void **)&arg4, SWIGTYPE_p_VFSSlotMountParam, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(4)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSVolumeFormat(arg1,arg2,arg3,arg4); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSGetDefaultDir(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; char *arg3 = (char *) 0 ; char *arg4 = (char *) 0 ; int *arg5 = (int *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOO:dlp_VFSGetDefaultDir",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) { SWIG_arg_fail(3);SWIG_fail; } if (!SWIG_AsCharPtr(obj3, (char**)&arg4)) { SWIG_arg_fail(4);SWIG_fail; } SWIG_Python_ConvertPtr(obj4, (void **)&arg5, SWIGTYPE_p_int, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(5)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSGetDefaultDir(arg1,arg2,(char const *)arg3,arg4,arg5); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSDirEntryEnumerate(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; FileRef arg2 ; unsigned long *arg3 = (unsigned long *) 0 ; int *arg4 = (int *) 0 ; struct VFSDirInfo *arg5 = (struct VFSDirInfo *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOO:dlp_VFSDirEntryEnumerate",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (FileRef)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } SWIG_Python_ConvertPtr(obj2, (void **)&arg3, SWIGTYPE_p_unsigned_long, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(3)) SWIG_fail; SWIG_Python_ConvertPtr(obj3, (void **)&arg4, SWIGTYPE_p_int, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(4)) SWIG_fail; SWIG_Python_ConvertPtr(obj4, (void **)&arg5, SWIGTYPE_p_VFSDirInfo, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(5)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSDirEntryEnumerate(arg1,arg2,arg3,arg4,arg5); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSDirCreate(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; char *arg3 = (char *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_VFSDirCreate",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) { SWIG_arg_fail(3);SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSDirCreate(arg1,arg2,(char const *)arg3); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSImportDatabaseFromFile(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; char *arg3 = (char *) 0 ; int *arg4 = (int *) 0 ; unsigned long *arg5 = (unsigned long *) 0 ; PI_ERR result; int temp4 ; int res4 = 0 ; unsigned long temp5 ; int res5 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; arg4 = &temp4; res4 = SWIG_NEWOBJ; arg5 = &temp5; res5 = SWIG_NEWOBJ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_VFSImportDatabaseFromFile",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) { SWIG_arg_fail(3);SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSImportDatabaseFromFile(arg1,arg2,(char const *)arg3,arg4,arg5); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); resultobj = t_output_helper(resultobj, ((res4 == SWIG_NEWOBJ) ? SWIG_From_int((*arg4)) : SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, 0))); resultobj = t_output_helper(resultobj, ((res5 == SWIG_NEWOBJ) ? SWIG_From_unsigned_SS_long((*arg5)) : SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_unsigned_long, 0))); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSExportDatabaseToFile(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; char *arg3 = (char *) 0 ; int arg4 ; unsigned int arg5 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOO:dlp_VFSExportDatabaseToFile",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) { SWIG_arg_fail(3);SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { arg5 = (unsigned int)(SWIG_As_unsigned_SS_int(obj4)); if (SWIG_arg_fail(5)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSExportDatabaseToFile(arg1,arg2,(char const *)arg3,arg4,arg5); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSFileCreate(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; char *arg3 = (char *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_VFSFileCreate",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) { SWIG_arg_fail(3);SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSFileCreate(arg1,arg2,(char const *)arg3); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSFileOpen(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; char *arg3 = (char *) 0 ; int arg4 ; FileRef *arg5 = (FileRef *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOOO:dlp_VFSFileOpen",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) { SWIG_arg_fail(3);SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } SWIG_Python_ConvertPtr(obj4, (void **)&arg5, SWIGTYPE_p_unsigned_long, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(5)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSFileOpen(arg1,arg2,(char const *)arg3,arg4,arg5); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSFileClose(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; FileRef arg2 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_VFSFileClose",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (FileRef)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSFileClose(arg1,arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSFileWrite(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; FileRef arg2 ; void *arg3 = (void *) 0 ; size_t arg4 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_VFSFileWrite",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (FileRef)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } arg3 = (void *)PyString_AsString(obj2); arg4 = PyString_Size(obj2); { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSFileWrite(arg1,arg2,(void const *)arg3,arg4); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSFileRead(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; FileRef arg2 ; pi_buffer_t *arg3 = (pi_buffer_t *) 0 ; size_t arg4 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; { arg3 = pi_buffer_new(0xFFFF); } if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_VFSFileRead",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (FileRef)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg4 = (size_t)(SWIG_As_unsigned_SS_long(obj2)); if (SWIG_arg_fail(4)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSFileRead(arg1,arg2,arg3,arg4); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); { if (arg3) { PyObject *o1 = Py_BuildValue("s#", arg3->data, arg3->used); resultobj = t_output_helper(resultobj, o1); } } { if (arg3) { pi_buffer_free(arg3); } } return resultobj; fail: { if (arg3) { pi_buffer_free(arg3); } } return NULL; } static PyObject *_wrap_dlp_VFSFileDelete(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; char *arg3 = (char *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_VFSFileDelete",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) { SWIG_arg_fail(3);SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSFileDelete(arg1,arg2,(char const *)arg3); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSFileRename(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; int arg2 ; char *arg3 = (char *) 0 ; char *arg4 = (char *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOO:dlp_VFSFileRename",&obj0,&obj1,&obj2,&obj3)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (int)(SWIG_As_int(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) { SWIG_arg_fail(3);SWIG_fail; } if (!SWIG_AsCharPtr(obj3, (char**)&arg4)) { SWIG_arg_fail(4);SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSFileRename(arg1,arg2,(char const *)arg3,(char const *)arg4); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSFileEOF(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; FileRef arg2 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:dlp_VFSFileEOF",&obj0,&obj1)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (FileRef)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSFileEOF(arg1,arg2); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSFileTell(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; FileRef arg2 ; int *arg3 = (int *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_VFSFileTell",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (FileRef)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } SWIG_Python_ConvertPtr(obj2, (void **)&arg3, SWIGTYPE_p_int, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(3)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSFileTell(arg1,arg2,arg3); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSFileGetAttributes(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; FileRef arg2 ; unsigned long *arg3 = (unsigned long *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_VFSFileGetAttributes",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (FileRef)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } SWIG_Python_ConvertPtr(obj2, (void **)&arg3, SWIGTYPE_p_unsigned_long, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(3)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSFileGetAttributes(arg1,arg2,arg3); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSFileSetAttributes(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; FileRef arg2 ; unsigned long arg3 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_VFSFileSetAttributes",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (FileRef)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (unsigned long)(SWIG_As_unsigned_SS_long(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSFileSetAttributes(arg1,arg2,arg3); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSFileGetDate(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; FileRef arg2 ; int arg3 ; time_t *arg4 = (time_t *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOO:dlp_VFSFileGetDate",&obj0,&obj1,&obj2,&obj3)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (FileRef)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } SWIG_Python_ConvertPtr(obj3, (void **)&arg4, SWIGTYPE_p_time_t, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(4)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSFileGetDate(arg1,arg2,arg3,arg4); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSFileSetDate(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; FileRef arg2 ; int arg3 ; time_t arg4 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOO:dlp_VFSFileSetDate",&obj0,&obj1,&obj2,&obj3)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (FileRef)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (time_t)(SWIG_As_long(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSFileSetDate(arg1,arg2,arg3,arg4); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSFileSeek(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; FileRef arg2 ; int arg3 ; int arg4 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOOO:dlp_VFSFileSeek",&obj0,&obj1,&obj2,&obj3)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (FileRef)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { arg4 = (int)(SWIG_As_int(obj3)); if (SWIG_arg_fail(4)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSFileSeek(arg1,arg2,arg3,arg4); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSFileResize(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; FileRef arg2 ; int arg3 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_VFSFileResize",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (FileRef)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } { arg3 = (int)(SWIG_As_int(obj2)); if (SWIG_arg_fail(3)) SWIG_fail; } { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSFileResize(arg1,arg2,arg3); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyObject *_wrap_dlp_VFSFileSize(PyObject *self, PyObject *args) { PyObject *resultobj = NULL; int arg1 ; FileRef arg2 ; int *arg3 = (int *) 0 ; PI_ERR result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OOO:dlp_VFSFileSize",&obj0,&obj1,&obj2)) goto fail; { arg1 = (int)(SWIG_As_int(obj0)); if (SWIG_arg_fail(1)) SWIG_fail; } { arg2 = (FileRef)(SWIG_As_unsigned_SS_long(obj1)); if (SWIG_arg_fail(2)) SWIG_fail; } SWIG_Python_ConvertPtr(obj2, (void **)&arg3, SWIGTYPE_p_int, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(3)) SWIG_fail; { PyThreadState *__save = PyEval_SaveThread(); result = (PI_ERR)dlp_VFSFileSize(arg1,arg2,arg3); PyEval_RestoreThread(__save); } if (result < 0 && pythonWrapper_handlePiErr(arg1, result) != 0) SWIG_fail; resultobj = Py_None; Py_INCREF(Py_None); return resultobj; fail: return NULL; } static PyMethodDef SwigMethods[] = { { (char *)"dlp_ReadRecordIDList", _wrap_dlp_ReadRecordIDList, METH_VARARGS, NULL}, { (char *)"pi_file_install", _wrap_pi_file_install, METH_VARARGS, NULL}, { (char *)"pi_file_retrieve", _wrap_pi_file_retrieve, METH_VARARGS, NULL}, { (char *)"pi_socket_t_sd_set", _wrap_pi_socket_t_sd_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_sd_get", _wrap_pi_socket_t_sd_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_type_set", _wrap_pi_socket_t_type_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_type_get", _wrap_pi_socket_t_type_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_protocol_set", _wrap_pi_socket_t_protocol_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_protocol_get", _wrap_pi_socket_t_protocol_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_cmd_set", _wrap_pi_socket_t_cmd_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_cmd_get", _wrap_pi_socket_t_cmd_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_laddr_set", _wrap_pi_socket_t_laddr_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_laddr_get", _wrap_pi_socket_t_laddr_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_laddrlen_set", _wrap_pi_socket_t_laddrlen_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_laddrlen_get", _wrap_pi_socket_t_laddrlen_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_raddr_set", _wrap_pi_socket_t_raddr_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_raddr_get", _wrap_pi_socket_t_raddr_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_raddrlen_set", _wrap_pi_socket_t_raddrlen_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_raddrlen_get", _wrap_pi_socket_t_raddrlen_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_protocol_queue_set", _wrap_pi_socket_t_protocol_queue_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_protocol_queue_get", _wrap_pi_socket_t_protocol_queue_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_queue_len_set", _wrap_pi_socket_t_queue_len_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_queue_len_get", _wrap_pi_socket_t_queue_len_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_cmd_queue_set", _wrap_pi_socket_t_cmd_queue_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_cmd_queue_get", _wrap_pi_socket_t_cmd_queue_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_cmd_len_set", _wrap_pi_socket_t_cmd_len_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_cmd_len_get", _wrap_pi_socket_t_cmd_len_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_device_set", _wrap_pi_socket_t_device_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_device_get", _wrap_pi_socket_t_device_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_state_set", _wrap_pi_socket_t_state_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_state_get", _wrap_pi_socket_t_state_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_honor_rx_to_set", _wrap_pi_socket_t_honor_rx_to_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_honor_rx_to_get", _wrap_pi_socket_t_honor_rx_to_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_command_set", _wrap_pi_socket_t_command_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_command_get", _wrap_pi_socket_t_command_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_accept_to_set", _wrap_pi_socket_t_accept_to_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_accept_to_get", _wrap_pi_socket_t_accept_to_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_dlprecord_set", _wrap_pi_socket_t_dlprecord_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_dlprecord_get", _wrap_pi_socket_t_dlprecord_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_dlpversion_set", _wrap_pi_socket_t_dlpversion_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_dlpversion_get", _wrap_pi_socket_t_dlpversion_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_maxrecsize_set", _wrap_pi_socket_t_maxrecsize_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_maxrecsize_get", _wrap_pi_socket_t_maxrecsize_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_last_error_set", _wrap_pi_socket_t_last_error_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_last_error_get", _wrap_pi_socket_t_last_error_get, METH_VARARGS, NULL}, { (char *)"pi_socket_t_palmos_error_set", _wrap_pi_socket_t_palmos_error_set, METH_VARARGS, NULL}, { (char *)"pi_socket_t_palmos_error_get", _wrap_pi_socket_t_palmos_error_get, METH_VARARGS, NULL}, { (char *)"new_pi_socket_t", _wrap_new_pi_socket_t, METH_VARARGS, NULL}, { (char *)"delete_pi_socket_t", _wrap_delete_pi_socket_t, METH_VARARGS, NULL}, { (char *)"pi_socket_t_swigregister", pi_socket_t_swigregister, METH_VARARGS, NULL}, { (char *)"pi_socket_list_t_ps_set", _wrap_pi_socket_list_t_ps_set, METH_VARARGS, NULL}, { (char *)"pi_socket_list_t_ps_get", _wrap_pi_socket_list_t_ps_get, METH_VARARGS, NULL}, { (char *)"pi_socket_list_t_next_set", _wrap_pi_socket_list_t_next_set, METH_VARARGS, NULL}, { (char *)"pi_socket_list_t_next_get", _wrap_pi_socket_list_t_next_get, METH_VARARGS, NULL}, { (char *)"new_pi_socket_list_t", _wrap_new_pi_socket_list_t, METH_VARARGS, NULL}, { (char *)"delete_pi_socket_list_t", _wrap_delete_pi_socket_list_t, METH_VARARGS, NULL}, { (char *)"pi_socket_list_t_swigregister", pi_socket_list_t_swigregister, METH_VARARGS, NULL}, { (char *)"pi_socket", _wrap_pi_socket, METH_VARARGS, NULL}, { (char *)"pi_socket_setsd", _wrap_pi_socket_setsd, METH_VARARGS, NULL}, { (char *)"pi_getsockname", _wrap_pi_getsockname, METH_VARARGS, NULL}, { (char *)"pi_getsockpeer", _wrap_pi_getsockpeer, METH_VARARGS, NULL}, { (char *)"pi_getsockopt", _wrap_pi_getsockopt, METH_VARARGS, NULL}, { (char *)"pi_setsockopt", _wrap_pi_setsockopt, METH_VARARGS, NULL}, { (char *)"pi_protocol", _wrap_pi_protocol, METH_VARARGS, NULL}, { (char *)"pi_protocol_next", _wrap_pi_protocol_next, METH_VARARGS, NULL}, { (char *)"pi_socket_connected", _wrap_pi_socket_connected, METH_VARARGS, NULL}, { (char *)"pi_connect", _wrap_pi_connect, METH_VARARGS, NULL}, { (char *)"pi_bind", _wrap_pi_bind, METH_VARARGS, NULL}, { (char *)"pi_listen", _wrap_pi_listen, METH_VARARGS, NULL}, { (char *)"pi_accept", _wrap_pi_accept, METH_VARARGS, NULL}, { (char *)"pi_accept_to", _wrap_pi_accept_to, METH_VARARGS, NULL}, { (char *)"pi_close", _wrap_pi_close, METH_VARARGS, NULL}, { (char *)"pi_send", _wrap_pi_send, METH_VARARGS, NULL}, { (char *)"pi_recv", _wrap_pi_recv, METH_VARARGS, NULL}, { (char *)"pi_read", _wrap_pi_read, METH_VARARGS, NULL}, { (char *)"pi_write", _wrap_pi_write, METH_VARARGS, NULL}, { (char *)"pi_flush", _wrap_pi_flush, METH_VARARGS, NULL}, { (char *)"pi_error", _wrap_pi_error, METH_VARARGS, NULL}, { (char *)"pi_set_error", _wrap_pi_set_error, METH_VARARGS, NULL}, { (char *)"pi_palmos_error", _wrap_pi_palmos_error, METH_VARARGS, NULL}, { (char *)"pi_set_palmos_error", _wrap_pi_set_palmos_error, METH_VARARGS, NULL}, { (char *)"pi_reset_errors", _wrap_pi_reset_errors, METH_VARARGS, NULL}, { (char *)"pi_version", _wrap_pi_version, METH_VARARGS, NULL}, { (char *)"pi_maxrecsize", _wrap_pi_maxrecsize, METH_VARARGS, NULL}, { (char *)"pi_tickle", _wrap_pi_tickle, METH_VARARGS, NULL}, { (char *)"pi_watchdog", _wrap_pi_watchdog, METH_VARARGS, NULL}, { (char *)"VFSDirInfo_attr_set", _wrap_VFSDirInfo_attr_set, METH_VARARGS, NULL}, { (char *)"VFSDirInfo_attr_get", _wrap_VFSDirInfo_attr_get, METH_VARARGS, NULL}, { (char *)"VFSDirInfo_name_set", _wrap_VFSDirInfo_name_set, METH_VARARGS, NULL}, { (char *)"VFSDirInfo_name_get", _wrap_VFSDirInfo_name_get, METH_VARARGS, NULL}, { (char *)"new_VFSDirInfo", _wrap_new_VFSDirInfo, METH_VARARGS, NULL}, { (char *)"delete_VFSDirInfo", _wrap_delete_VFSDirInfo, METH_VARARGS, NULL}, { (char *)"VFSDirInfo_swigregister", VFSDirInfo_swigregister, METH_VARARGS, NULL}, { (char *)"VFSAnyMountParam_volRefNum_set", _wrap_VFSAnyMountParam_volRefNum_set, METH_VARARGS, NULL}, { (char *)"VFSAnyMountParam_volRefNum_get", _wrap_VFSAnyMountParam_volRefNum_get, METH_VARARGS, NULL}, { (char *)"VFSAnyMountParam_reserved_set", _wrap_VFSAnyMountParam_reserved_set, METH_VARARGS, NULL}, { (char *)"VFSAnyMountParam_reserved_get", _wrap_VFSAnyMountParam_reserved_get, METH_VARARGS, NULL}, { (char *)"VFSAnyMountParam_mountClass_set", _wrap_VFSAnyMountParam_mountClass_set, METH_VARARGS, NULL}, { (char *)"VFSAnyMountParam_mountClass_get", _wrap_VFSAnyMountParam_mountClass_get, METH_VARARGS, NULL}, { (char *)"new_VFSAnyMountParam", _wrap_new_VFSAnyMountParam, METH_VARARGS, NULL}, { (char *)"delete_VFSAnyMountParam", _wrap_delete_VFSAnyMountParam, METH_VARARGS, NULL}, { (char *)"VFSAnyMountParam_swigregister", VFSAnyMountParam_swigregister, METH_VARARGS, NULL}, { (char *)"VFSSlotMountParam_vfsMountParam_set", _wrap_VFSSlotMountParam_vfsMountParam_set, METH_VARARGS, NULL}, { (char *)"VFSSlotMountParam_vfsMountParam_get", _wrap_VFSSlotMountParam_vfsMountParam_get, METH_VARARGS, NULL}, { (char *)"VFSSlotMountParam_slotLibRefNum_set", _wrap_VFSSlotMountParam_slotLibRefNum_set, METH_VARARGS, NULL}, { (char *)"VFSSlotMountParam_slotLibRefNum_get", _wrap_VFSSlotMountParam_slotLibRefNum_get, METH_VARARGS, NULL}, { (char *)"VFSSlotMountParam_slotRefNum_set", _wrap_VFSSlotMountParam_slotRefNum_set, METH_VARARGS, NULL}, { (char *)"VFSSlotMountParam_slotRefNum_get", _wrap_VFSSlotMountParam_slotRefNum_get, METH_VARARGS, NULL}, { (char *)"new_VFSSlotMountParam", _wrap_new_VFSSlotMountParam, METH_VARARGS, NULL}, { (char *)"delete_VFSSlotMountParam", _wrap_delete_VFSSlotMountParam, METH_VARARGS, NULL}, { (char *)"VFSSlotMountParam_swigregister", VFSSlotMountParam_swigregister, METH_VARARGS, NULL}, { (char *)"VFSInfo_attributes_set", _wrap_VFSInfo_attributes_set, METH_VARARGS, NULL}, { (char *)"VFSInfo_attributes_get", _wrap_VFSInfo_attributes_get, METH_VARARGS, NULL}, { (char *)"VFSInfo_fsType_set", _wrap_VFSInfo_fsType_set, METH_VARARGS, NULL}, { (char *)"VFSInfo_fsType_get", _wrap_VFSInfo_fsType_get, METH_VARARGS, NULL}, { (char *)"VFSInfo_fsCreator_set", _wrap_VFSInfo_fsCreator_set, METH_VARARGS, NULL}, { (char *)"VFSInfo_fsCreator_get", _wrap_VFSInfo_fsCreator_get, METH_VARARGS, NULL}, { (char *)"VFSInfo_mountClass_set", _wrap_VFSInfo_mountClass_set, METH_VARARGS, NULL}, { (char *)"VFSInfo_mountClass_get", _wrap_VFSInfo_mountClass_get, METH_VARARGS, NULL}, { (char *)"VFSInfo_slotLibRefNum_set", _wrap_VFSInfo_slotLibRefNum_set, METH_VARARGS, NULL}, { (char *)"VFSInfo_slotLibRefNum_get", _wrap_VFSInfo_slotLibRefNum_get, METH_VARARGS, NULL}, { (char *)"VFSInfo_slotRefNum_set", _wrap_VFSInfo_slotRefNum_set, METH_VARARGS, NULL}, { (char *)"VFSInfo_slotRefNum_get", _wrap_VFSInfo_slotRefNum_get, METH_VARARGS, NULL}, { (char *)"VFSInfo_mediaType_set", _wrap_VFSInfo_mediaType_set, METH_VARARGS, NULL}, { (char *)"VFSInfo_mediaType_get", _wrap_VFSInfo_mediaType_get, METH_VARARGS, NULL}, { (char *)"VFSInfo_reserved_set", _wrap_VFSInfo_reserved_set, METH_VARARGS, NULL}, { (char *)"VFSInfo_reserved_get", _wrap_VFSInfo_reserved_get, METH_VARARGS, NULL}, { (char *)"new_VFSInfo", _wrap_new_VFSInfo, METH_VARARGS, NULL}, { (char *)"delete_VFSInfo", _wrap_delete_VFSInfo, METH_VARARGS, NULL}, { (char *)"VFSInfo_swigregister", VFSInfo_swigregister, METH_VARARGS, NULL}, { (char *)"PilotUser_passwordLength_set", _wrap_PilotUser_passwordLength_set, METH_VARARGS, NULL}, { (char *)"PilotUser_passwordLength_get", _wrap_PilotUser_passwordLength_get, METH_VARARGS, NULL}, { (char *)"PilotUser_username_set", _wrap_PilotUser_username_set, METH_VARARGS, NULL}, { (char *)"PilotUser_username_get", _wrap_PilotUser_username_get, METH_VARARGS, NULL}, { (char *)"PilotUser_password_set", _wrap_PilotUser_password_set, METH_VARARGS, NULL}, { (char *)"PilotUser_password_get", _wrap_PilotUser_password_get, METH_VARARGS, NULL}, { (char *)"PilotUser_userID_set", _wrap_PilotUser_userID_set, METH_VARARGS, NULL}, { (char *)"PilotUser_userID_get", _wrap_PilotUser_userID_get, METH_VARARGS, NULL}, { (char *)"PilotUser_viewerID_set", _wrap_PilotUser_viewerID_set, METH_VARARGS, NULL}, { (char *)"PilotUser_viewerID_get", _wrap_PilotUser_viewerID_get, METH_VARARGS, NULL}, { (char *)"PilotUser_lastSyncPC_set", _wrap_PilotUser_lastSyncPC_set, METH_VARARGS, NULL}, { (char *)"PilotUser_lastSyncPC_get", _wrap_PilotUser_lastSyncPC_get, METH_VARARGS, NULL}, { (char *)"PilotUser_successfulSyncDate_set", _wrap_PilotUser_successfulSyncDate_set, METH_VARARGS, NULL}, { (char *)"PilotUser_successfulSyncDate_get", _wrap_PilotUser_successfulSyncDate_get, METH_VARARGS, NULL}, { (char *)"PilotUser_lastSyncDate_set", _wrap_PilotUser_lastSyncDate_set, METH_VARARGS, NULL}, { (char *)"PilotUser_lastSyncDate_get", _wrap_PilotUser_lastSyncDate_get, METH_VARARGS, NULL}, { (char *)"new_PilotUser", _wrap_new_PilotUser, METH_VARARGS, NULL}, { (char *)"delete_PilotUser", _wrap_delete_PilotUser, METH_VARARGS, NULL}, { (char *)"PilotUser_swigregister", PilotUser_swigregister, METH_VARARGS, NULL}, { (char *)"SysInfo_romVersion_set", _wrap_SysInfo_romVersion_set, METH_VARARGS, NULL}, { (char *)"SysInfo_romVersion_get", _wrap_SysInfo_romVersion_get, METH_VARARGS, NULL}, { (char *)"SysInfo_locale_set", _wrap_SysInfo_locale_set, METH_VARARGS, NULL}, { (char *)"SysInfo_locale_get", _wrap_SysInfo_locale_get, METH_VARARGS, NULL}, { (char *)"SysInfo_prodIDLength_set", _wrap_SysInfo_prodIDLength_set, METH_VARARGS, NULL}, { (char *)"SysInfo_prodIDLength_get", _wrap_SysInfo_prodIDLength_get, METH_VARARGS, NULL}, { (char *)"SysInfo_prodID_set", _wrap_SysInfo_prodID_set, METH_VARARGS, NULL}, { (char *)"SysInfo_prodID_get", _wrap_SysInfo_prodID_get, METH_VARARGS, NULL}, { (char *)"SysInfo_dlpMajorVersion_set", _wrap_SysInfo_dlpMajorVersion_set, METH_VARARGS, NULL}, { (char *)"SysInfo_dlpMajorVersion_get", _wrap_SysInfo_dlpMajorVersion_get, METH_VARARGS, NULL}, { (char *)"SysInfo_dlpMinorVersion_set", _wrap_SysInfo_dlpMinorVersion_set, METH_VARARGS, NULL}, { (char *)"SysInfo_dlpMinorVersion_get", _wrap_SysInfo_dlpMinorVersion_get, METH_VARARGS, NULL}, { (char *)"SysInfo_compatMajorVersion_set", _wrap_SysInfo_compatMajorVersion_set, METH_VARARGS, NULL}, { (char *)"SysInfo_compatMajorVersion_get", _wrap_SysInfo_compatMajorVersion_get, METH_VARARGS, NULL}, { (char *)"SysInfo_compatMinorVersion_set", _wrap_SysInfo_compatMinorVersion_set, METH_VARARGS, NULL}, { (char *)"SysInfo_compatMinorVersion_get", _wrap_SysInfo_compatMinorVersion_get, METH_VARARGS, NULL}, { (char *)"SysInfo_maxRecSize_set", _wrap_SysInfo_maxRecSize_set, METH_VARARGS, NULL}, { (char *)"SysInfo_maxRecSize_get", _wrap_SysInfo_maxRecSize_get, METH_VARARGS, NULL}, { (char *)"new_SysInfo", _wrap_new_SysInfo, METH_VARARGS, NULL}, { (char *)"delete_SysInfo", _wrap_delete_SysInfo, METH_VARARGS, NULL}, { (char *)"SysInfo_swigregister", SysInfo_swigregister, METH_VARARGS, NULL}, { (char *)"DBInfo_more_set", _wrap_DBInfo_more_set, METH_VARARGS, NULL}, { (char *)"DBInfo_more_get", _wrap_DBInfo_more_get, METH_VARARGS, NULL}, { (char *)"DBInfo_name_set", _wrap_DBInfo_name_set, METH_VARARGS, NULL}, { (char *)"DBInfo_name_get", _wrap_DBInfo_name_get, METH_VARARGS, NULL}, { (char *)"DBInfo_flags_set", _wrap_DBInfo_flags_set, METH_VARARGS, NULL}, { (char *)"DBInfo_flags_get", _wrap_DBInfo_flags_get, METH_VARARGS, NULL}, { (char *)"DBInfo_miscFlags_set", _wrap_DBInfo_miscFlags_set, METH_VARARGS, NULL}, { (char *)"DBInfo_miscFlags_get", _wrap_DBInfo_miscFlags_get, METH_VARARGS, NULL}, { (char *)"DBInfo_version_set", _wrap_DBInfo_version_set, METH_VARARGS, NULL}, { (char *)"DBInfo_version_get", _wrap_DBInfo_version_get, METH_VARARGS, NULL}, { (char *)"DBInfo_type_set", _wrap_DBInfo_type_set, METH_VARARGS, NULL}, { (char *)"DBInfo_type_get", _wrap_DBInfo_type_get, METH_VARARGS, NULL}, { (char *)"DBInfo_creator_set", _wrap_DBInfo_creator_set, METH_VARARGS, NULL}, { (char *)"DBInfo_creator_get", _wrap_DBInfo_creator_get, METH_VARARGS, NULL}, { (char *)"DBInfo_modnum_set", _wrap_DBInfo_modnum_set, METH_VARARGS, NULL}, { (char *)"DBInfo_modnum_get", _wrap_DBInfo_modnum_get, METH_VARARGS, NULL}, { (char *)"DBInfo_index_set", _wrap_DBInfo_index_set, METH_VARARGS, NULL}, { (char *)"DBInfo_index_get", _wrap_DBInfo_index_get, METH_VARARGS, NULL}, { (char *)"DBInfo_createDate_set", _wrap_DBInfo_createDate_set, METH_VARARGS, NULL}, { (char *)"DBInfo_createDate_get", _wrap_DBInfo_createDate_get, METH_VARARGS, NULL}, { (char *)"DBInfo_modifyDate_set", _wrap_DBInfo_modifyDate_set, METH_VARARGS, NULL}, { (char *)"DBInfo_modifyDate_get", _wrap_DBInfo_modifyDate_get, METH_VARARGS, NULL}, { (char *)"DBInfo_backupDate_set", _wrap_DBInfo_backupDate_set, METH_VARARGS, NULL}, { (char *)"DBInfo_backupDate_get", _wrap_DBInfo_backupDate_get, METH_VARARGS, NULL}, { (char *)"new_DBInfo", _wrap_new_DBInfo, METH_VARARGS, NULL}, { (char *)"delete_DBInfo", _wrap_delete_DBInfo, METH_VARARGS, NULL}, { (char *)"DBInfo_swigregister", DBInfo_swigregister, METH_VARARGS, NULL}, { (char *)"DBSizeInfo_numRecords_set", _wrap_DBSizeInfo_numRecords_set, METH_VARARGS, NULL}, { (char *)"DBSizeInfo_numRecords_get", _wrap_DBSizeInfo_numRecords_get, METH_VARARGS, NULL}, { (char *)"DBSizeInfo_totalBytes_set", _wrap_DBSizeInfo_totalBytes_set, METH_VARARGS, NULL}, { (char *)"DBSizeInfo_totalBytes_get", _wrap_DBSizeInfo_totalBytes_get, METH_VARARGS, NULL}, { (char *)"DBSizeInfo_dataBytes_set", _wrap_DBSizeInfo_dataBytes_set, METH_VARARGS, NULL}, { (char *)"DBSizeInfo_dataBytes_get", _wrap_DBSizeInfo_dataBytes_get, METH_VARARGS, NULL}, { (char *)"DBSizeInfo_appBlockSize_set", _wrap_DBSizeInfo_appBlockSize_set, METH_VARARGS, NULL}, { (char *)"DBSizeInfo_appBlockSize_get", _wrap_DBSizeInfo_appBlockSize_get, METH_VARARGS, NULL}, { (char *)"DBSizeInfo_sortBlockSize_set", _wrap_DBSizeInfo_sortBlockSize_set, METH_VARARGS, NULL}, { (char *)"DBSizeInfo_sortBlockSize_get", _wrap_DBSizeInfo_sortBlockSize_get, METH_VARARGS, NULL}, { (char *)"DBSizeInfo_maxRecSize_set", _wrap_DBSizeInfo_maxRecSize_set, METH_VARARGS, NULL}, { (char *)"DBSizeInfo_maxRecSize_get", _wrap_DBSizeInfo_maxRecSize_get, METH_VARARGS, NULL}, { (char *)"new_DBSizeInfo", _wrap_new_DBSizeInfo, METH_VARARGS, NULL}, { (char *)"delete_DBSizeInfo", _wrap_delete_DBSizeInfo, METH_VARARGS, NULL}, { (char *)"DBSizeInfo_swigregister", DBSizeInfo_swigregister, METH_VARARGS, NULL}, { (char *)"CardInfo_card_set", _wrap_CardInfo_card_set, METH_VARARGS, NULL}, { (char *)"CardInfo_card_get", _wrap_CardInfo_card_get, METH_VARARGS, NULL}, { (char *)"CardInfo_version_set", _wrap_CardInfo_version_set, METH_VARARGS, NULL}, { (char *)"CardInfo_version_get", _wrap_CardInfo_version_get, METH_VARARGS, NULL}, { (char *)"CardInfo_more_set", _wrap_CardInfo_more_set, METH_VARARGS, NULL}, { (char *)"CardInfo_more_get", _wrap_CardInfo_more_get, METH_VARARGS, NULL}, { (char *)"CardInfo_creation_set", _wrap_CardInfo_creation_set, METH_VARARGS, NULL}, { (char *)"CardInfo_creation_get", _wrap_CardInfo_creation_get, METH_VARARGS, NULL}, { (char *)"CardInfo_romSize_set", _wrap_CardInfo_romSize_set, METH_VARARGS, NULL}, { (char *)"CardInfo_romSize_get", _wrap_CardInfo_romSize_get, METH_VARARGS, NULL}, { (char *)"CardInfo_ramSize_set", _wrap_CardInfo_ramSize_set, METH_VARARGS, NULL}, { (char *)"CardInfo_ramSize_get", _wrap_CardInfo_ramSize_get, METH_VARARGS, NULL}, { (char *)"CardInfo_ramFree_set", _wrap_CardInfo_ramFree_set, METH_VARARGS, NULL}, { (char *)"CardInfo_ramFree_get", _wrap_CardInfo_ramFree_get, METH_VARARGS, NULL}, { (char *)"CardInfo_name_set", _wrap_CardInfo_name_set, METH_VARARGS, NULL}, { (char *)"CardInfo_name_get", _wrap_CardInfo_name_get, METH_VARARGS, NULL}, { (char *)"CardInfo_manufacturer_set", _wrap_CardInfo_manufacturer_set, METH_VARARGS, NULL}, { (char *)"CardInfo_manufacturer_get", _wrap_CardInfo_manufacturer_get, METH_VARARGS, NULL}, { (char *)"new_CardInfo", _wrap_new_CardInfo, METH_VARARGS, NULL}, { (char *)"delete_CardInfo", _wrap_delete_CardInfo, METH_VARARGS, NULL}, { (char *)"CardInfo_swigregister", CardInfo_swigregister, METH_VARARGS, NULL}, { (char *)"NetSyncInfo_lanSync_set", _wrap_NetSyncInfo_lanSync_set, METH_VARARGS, NULL}, { (char *)"NetSyncInfo_lanSync_get", _wrap_NetSyncInfo_lanSync_get, METH_VARARGS, NULL}, { (char *)"NetSyncInfo_hostName_set", _wrap_NetSyncInfo_hostName_set, METH_VARARGS, NULL}, { (char *)"NetSyncInfo_hostName_get", _wrap_NetSyncInfo_hostName_get, METH_VARARGS, NULL}, { (char *)"NetSyncInfo_hostAddress_set", _wrap_NetSyncInfo_hostAddress_set, METH_VARARGS, NULL}, { (char *)"NetSyncInfo_hostAddress_get", _wrap_NetSyncInfo_hostAddress_get, METH_VARARGS, NULL}, { (char *)"NetSyncInfo_hostSubnetMask_set", _wrap_NetSyncInfo_hostSubnetMask_set, METH_VARARGS, NULL}, { (char *)"NetSyncInfo_hostSubnetMask_get", _wrap_NetSyncInfo_hostSubnetMask_get, METH_VARARGS, NULL}, { (char *)"new_NetSyncInfo", _wrap_new_NetSyncInfo, METH_VARARGS, NULL}, { (char *)"delete_NetSyncInfo", _wrap_delete_NetSyncInfo, METH_VARARGS, NULL}, { (char *)"NetSyncInfo_swigregister", NetSyncInfo_swigregister, METH_VARARGS, NULL}, { (char *)"dlp_set_protocol_version", _wrap_dlp_set_protocol_version, METH_VARARGS, NULL}, { (char *)"dlp_ptohdate", _wrap_dlp_ptohdate, METH_VARARGS, NULL}, { (char *)"dlp_htopdate", _wrap_dlp_htopdate, METH_VARARGS, NULL}, { (char *)"dlp_GetSysDateTime_", _wrap_dlp_GetSysDateTime_, METH_VARARGS, NULL}, { (char *)"dlp_SetSysDateTime", _wrap_dlp_SetSysDateTime, METH_VARARGS, NULL}, { (char *)"dlp_ReadSysInfo", _wrap_dlp_ReadSysInfo, METH_VARARGS, NULL}, { (char *)"dlp_ReadStorageInfo", _wrap_dlp_ReadStorageInfo, METH_VARARGS, NULL}, { (char *)"dlp_ReadUserInfo", _wrap_dlp_ReadUserInfo, METH_VARARGS, NULL}, { (char *)"dlp_WriteUserInfo", _wrap_dlp_WriteUserInfo, METH_VARARGS, NULL}, { (char *)"dlp_ResetLastSyncPC", _wrap_dlp_ResetLastSyncPC, METH_VARARGS, NULL}, { (char *)"dlp_ReadNetSyncInfo", _wrap_dlp_ReadNetSyncInfo, METH_VARARGS, NULL}, { (char *)"dlp_WriteNetSyncInfo", _wrap_dlp_WriteNetSyncInfo, METH_VARARGS, NULL}, { (char *)"dlp_OpenConduit", _wrap_dlp_OpenConduit, METH_VARARGS, NULL}, { (char *)"dlp_EndOfSync", _wrap_dlp_EndOfSync, METH_VARARGS, NULL}, { (char *)"dlp_AbortSync", _wrap_dlp_AbortSync, METH_VARARGS, NULL}, { (char *)"dlp_ReadFeature", _wrap_dlp_ReadFeature, METH_VARARGS, NULL}, { (char *)"dlp_GetROMToken", _wrap_dlp_GetROMToken, METH_VARARGS, NULL}, { (char *)"dlp_AddSyncLogEntry", _wrap_dlp_AddSyncLogEntry, METH_VARARGS, NULL}, { (char *)"dlp_CallApplication", _wrap_dlp_CallApplication, METH_VARARGS, NULL}, { (char *)"dlp_ReadAppPreference", _wrap_dlp_ReadAppPreference, METH_VARARGS, NULL}, { (char *)"dlp_WriteAppPreference", _wrap_dlp_WriteAppPreference, METH_VARARGS, NULL}, { (char *)"dlp_ResetSystem", _wrap_dlp_ResetSystem, METH_VARARGS, NULL}, { (char *)"dlp_ReadDBList_", _wrap_dlp_ReadDBList_, METH_VARARGS, NULL}, { (char *)"dlp_FindDBByName", _wrap_dlp_FindDBByName, METH_VARARGS, NULL}, { (char *)"dlp_FindDBByOpenHandle", _wrap_dlp_FindDBByOpenHandle, METH_VARARGS, NULL}, { (char *)"dlp_FindDBByTypeCreator", _wrap_dlp_FindDBByTypeCreator, METH_VARARGS, NULL}, { (char *)"dlp_FindDBInfo", _wrap_dlp_FindDBInfo, METH_VARARGS, NULL}, { (char *)"dlp_OpenDB", _wrap_dlp_OpenDB, METH_VARARGS, NULL}, { (char *)"dlp_CloseDB", _wrap_dlp_CloseDB, METH_VARARGS, NULL}, { (char *)"dlp_CloseDB_All", _wrap_dlp_CloseDB_All, METH_VARARGS, NULL}, { (char *)"dlp_DeleteDB", _wrap_dlp_DeleteDB, METH_VARARGS, NULL}, { (char *)"dlp_CreateDB", _wrap_dlp_CreateDB, METH_VARARGS, NULL}, { (char *)"dlp_ReadOpenDBInfo", _wrap_dlp_ReadOpenDBInfo, METH_VARARGS, NULL}, { (char *)"dlp_SetDBInfo", _wrap_dlp_SetDBInfo, METH_VARARGS, NULL}, { (char *)"dlp_DeleteCategory", _wrap_dlp_DeleteCategory, METH_VARARGS, NULL}, { (char *)"dlp_MoveCategory", _wrap_dlp_MoveCategory, METH_VARARGS, NULL}, { (char *)"dlp_ReadAppBlock", _wrap_dlp_ReadAppBlock, METH_VARARGS, NULL}, { (char *)"dlp_WriteAppBlock", _wrap_dlp_WriteAppBlock, METH_VARARGS, NULL}, { (char *)"dlp_ReadSortBlock", _wrap_dlp_ReadSortBlock, METH_VARARGS, NULL}, { (char *)"dlp_WriteSortBlock", _wrap_dlp_WriteSortBlock, METH_VARARGS, NULL}, { (char *)"dlp_CleanUpDatabase", _wrap_dlp_CleanUpDatabase, METH_VARARGS, NULL}, { (char *)"dlp_ResetSyncFlags", _wrap_dlp_ResetSyncFlags, METH_VARARGS, NULL}, { (char *)"dlp_ResetDBIndex", _wrap_dlp_ResetDBIndex, METH_VARARGS, NULL}, { (char *)"dlp_ReadRecordById", _wrap_dlp_ReadRecordById, METH_VARARGS, NULL}, { (char *)"dlp_ReadRecordByIndex", _wrap_dlp_ReadRecordByIndex, METH_VARARGS, NULL}, { (char *)"dlp_ReadNextModifiedRec", _wrap_dlp_ReadNextModifiedRec, METH_VARARGS, NULL}, { (char *)"dlp_ReadNextModifiedRecInCategory", _wrap_dlp_ReadNextModifiedRecInCategory, METH_VARARGS, NULL}, { (char *)"dlp_ReadNextRecInCategory", _wrap_dlp_ReadNextRecInCategory, METH_VARARGS, NULL}, { (char *)"dlp_WriteRecord", _wrap_dlp_WriteRecord, METH_VARARGS, NULL}, { (char *)"dlp_DeleteRecord", _wrap_dlp_DeleteRecord, METH_VARARGS, NULL}, { (char *)"dlp_ReadResourceByType", _wrap_dlp_ReadResourceByType, METH_VARARGS, NULL}, { (char *)"dlp_ReadResourceByIndex", _wrap_dlp_ReadResourceByIndex, METH_VARARGS, NULL}, { (char *)"dlp_WriteResource", _wrap_dlp_WriteResource, METH_VARARGS, NULL}, { (char *)"dlp_DeleteResource", _wrap_dlp_DeleteResource, METH_VARARGS, NULL}, { (char *)"dlp_ExpSlotEnumerate", _wrap_dlp_ExpSlotEnumerate, METH_VARARGS, NULL}, { (char *)"dlp_ExpCardPresent", _wrap_dlp_ExpCardPresent, METH_VARARGS, NULL}, { (char *)"dlp_ExpCardInfo", _wrap_dlp_ExpCardInfo, METH_VARARGS, NULL}, { (char *)"dlp_ExpSlotMediaType", _wrap_dlp_ExpSlotMediaType, METH_VARARGS, NULL}, { (char *)"dlp_VFSVolumeEnumerate", _wrap_dlp_VFSVolumeEnumerate, METH_VARARGS, NULL}, { (char *)"dlp_VFSVolumeInfo", _wrap_dlp_VFSVolumeInfo, METH_VARARGS, NULL}, { (char *)"dlp_VFSVolumeGetLabel", _wrap_dlp_VFSVolumeGetLabel, METH_VARARGS, NULL}, { (char *)"dlp_VFSVolumeSetLabel", _wrap_dlp_VFSVolumeSetLabel, METH_VARARGS, NULL}, { (char *)"dlp_VFSVolumeSize", _wrap_dlp_VFSVolumeSize, METH_VARARGS, NULL}, { (char *)"dlp_VFSVolumeFormat", _wrap_dlp_VFSVolumeFormat, METH_VARARGS, NULL}, { (char *)"dlp_VFSGetDefaultDir", _wrap_dlp_VFSGetDefaultDir, METH_VARARGS, NULL}, { (char *)"dlp_VFSDirEntryEnumerate", _wrap_dlp_VFSDirEntryEnumerate, METH_VARARGS, NULL}, { (char *)"dlp_VFSDirCreate", _wrap_dlp_VFSDirCreate, METH_VARARGS, NULL}, { (char *)"dlp_VFSImportDatabaseFromFile", _wrap_dlp_VFSImportDatabaseFromFile, METH_VARARGS, NULL}, { (char *)"dlp_VFSExportDatabaseToFile", _wrap_dlp_VFSExportDatabaseToFile, METH_VARARGS, NULL}, { (char *)"dlp_VFSFileCreate", _wrap_dlp_VFSFileCreate, METH_VARARGS, NULL}, { (char *)"dlp_VFSFileOpen", _wrap_dlp_VFSFileOpen, METH_VARARGS, NULL}, { (char *)"dlp_VFSFileClose", _wrap_dlp_VFSFileClose, METH_VARARGS, NULL}, { (char *)"dlp_VFSFileWrite", _wrap_dlp_VFSFileWrite, METH_VARARGS, NULL}, { (char *)"dlp_VFSFileRead", _wrap_dlp_VFSFileRead, METH_VARARGS, NULL}, { (char *)"dlp_VFSFileDelete", _wrap_dlp_VFSFileDelete, METH_VARARGS, NULL}, { (char *)"dlp_VFSFileRename", _wrap_dlp_VFSFileRename, METH_VARARGS, NULL}, { (char *)"dlp_VFSFileEOF", _wrap_dlp_VFSFileEOF, METH_VARARGS, NULL}, { (char *)"dlp_VFSFileTell", _wrap_dlp_VFSFileTell, METH_VARARGS, NULL}, { (char *)"dlp_VFSFileGetAttributes", _wrap_dlp_VFSFileGetAttributes, METH_VARARGS, NULL}, { (char *)"dlp_VFSFileSetAttributes", _wrap_dlp_VFSFileSetAttributes, METH_VARARGS, NULL}, { (char *)"dlp_VFSFileGetDate", _wrap_dlp_VFSFileGetDate, METH_VARARGS, NULL}, { (char *)"dlp_VFSFileSetDate", _wrap_dlp_VFSFileSetDate, METH_VARARGS, NULL}, { (char *)"dlp_VFSFileSeek", _wrap_dlp_VFSFileSeek, METH_VARARGS, NULL}, { (char *)"dlp_VFSFileResize", _wrap_dlp_VFSFileResize, METH_VARARGS, NULL}, { (char *)"dlp_VFSFileSize", _wrap_dlp_VFSFileSize, METH_VARARGS, NULL}, { NULL, NULL, 0, NULL } }; /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ static swig_type_info _swigt__p_CardInfo = {"_p_CardInfo", "struct CardInfo *", 0, 0, 0}; static swig_type_info _swigt__p_DBInfo = {"_p_DBInfo", "struct DBInfo *", 0, 0, 0}; static swig_type_info _swigt__p_DBSizeInfo = {"_p_DBSizeInfo", "struct DBSizeInfo *", 0, 0, 0}; static swig_type_info _swigt__p_NetSyncInfo = {"_p_NetSyncInfo", "struct NetSyncInfo *", 0, 0, 0}; static swig_type_info _swigt__p_PilotUser = {"_p_PilotUser", "struct PilotUser *", 0, 0, 0}; static swig_type_info _swigt__p_SysInfo = {"_p_SysInfo", "struct SysInfo *", 0, 0, 0}; static swig_type_info _swigt__p_VFSAnyMountParam = {"_p_VFSAnyMountParam", "struct VFSAnyMountParam *", 0, 0, 0}; static swig_type_info _swigt__p_VFSDirInfo = {"_p_VFSDirInfo", "struct VFSDirInfo *", 0, 0, 0}; static swig_type_info _swigt__p_VFSInfo = {"_p_VFSInfo", "struct VFSInfo *", 0, 0, 0}; static swig_type_info _swigt__p_VFSSlotMountParam = {"_p_VFSSlotMountParam", "struct VFSSlotMountParam *", 0, 0, 0}; static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, 0}; static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, 0}; static swig_type_info _swigt__p_long = {"_p_long", "long *", 0, 0, 0}; static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, 0}; static swig_type_info _swigt__p_p_pi_protocol = {"_p_p_pi_protocol", "struct pi_protocol **", 0, 0, 0}; static swig_type_info _swigt__p_pi_buffer_t = {"_p_pi_buffer_t", "pi_buffer_t *", 0, 0, 0}; static swig_type_info _swigt__p_pi_device = {"_p_pi_device", "struct pi_device *", 0, 0, 0}; static swig_type_info _swigt__p_pi_protocol = {"_p_pi_protocol", "struct pi_protocol *", 0, 0, 0}; static swig_type_info _swigt__p_pi_socket = {"_p_pi_socket", "struct pi_socket *|pi_socket_t *", 0, 0, 0}; static swig_type_info _swigt__p_pi_socket_list = {"_p_pi_socket_list", "struct pi_socket_list *|pi_socket_list_t *", 0, 0, 0}; static swig_type_info _swigt__p_recordid_t = {"_p_recordid_t", "recordid_t *", 0, 0, 0}; static swig_type_info _swigt__p_size_t = {"_p_size_t", "size_t *", 0, 0, 0}; static swig_type_info _swigt__p_sockaddr = {"_p_sockaddr", "struct sockaddr *", 0, 0, 0}; static swig_type_info _swigt__p_ssize_t = {"_p_ssize_t", "ssize_t *", 0, 0, 0}; static swig_type_info _swigt__p_time_t = {"_p_time_t", "time_t *", 0, 0, 0}; static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *", 0, 0, 0}; static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "unsigned long *", 0, 0, 0}; static swig_type_info _swigt__ptrdiff_t = {"_ptrdiff_t", "ptrdiff_t", 0, 0, 0}; static swig_type_info _swigt__size_t = {"_size_t", "size_t", 0, 0, 0}; static swig_type_info *swig_type_initial[] = { &_swigt__p_CardInfo, &_swigt__p_DBInfo, &_swigt__p_DBSizeInfo, &_swigt__p_NetSyncInfo, &_swigt__p_PilotUser, &_swigt__p_SysInfo, &_swigt__p_VFSAnyMountParam, &_swigt__p_VFSDirInfo, &_swigt__p_VFSInfo, &_swigt__p_VFSSlotMountParam, &_swigt__p_char, &_swigt__p_int, &_swigt__p_long, &_swigt__p_p_char, &_swigt__p_p_pi_protocol, &_swigt__p_pi_buffer_t, &_swigt__p_pi_device, &_swigt__p_pi_protocol, &_swigt__p_pi_socket, &_swigt__p_pi_socket_list, &_swigt__p_recordid_t, &_swigt__p_size_t, &_swigt__p_sockaddr, &_swigt__p_ssize_t, &_swigt__p_time_t, &_swigt__p_unsigned_char, &_swigt__p_unsigned_long, &_swigt__ptrdiff_t, &_swigt__size_t, }; static swig_cast_info _swigc__p_CardInfo[] = { {&_swigt__p_CardInfo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_DBInfo[] = { {&_swigt__p_DBInfo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_DBSizeInfo[] = { {&_swigt__p_DBSizeInfo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_NetSyncInfo[] = { {&_swigt__p_NetSyncInfo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_PilotUser[] = { {&_swigt__p_PilotUser, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_SysInfo[] = { {&_swigt__p_SysInfo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_VFSAnyMountParam[] = { {&_swigt__p_VFSAnyMountParam, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_VFSDirInfo[] = { {&_swigt__p_VFSDirInfo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_VFSInfo[] = { {&_swigt__p_VFSInfo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_VFSSlotMountParam[] = { {&_swigt__p_VFSSlotMountParam, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_long[] = { {&_swigt__p_long, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_pi_protocol[] = { {&_swigt__p_p_pi_protocol, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_pi_buffer_t[] = { {&_swigt__p_pi_buffer_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_pi_device[] = { {&_swigt__p_pi_device, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_pi_protocol[] = { {&_swigt__p_pi_protocol, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_pi_socket[] = { {&_swigt__p_pi_socket, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_pi_socket_list[] = { {&_swigt__p_pi_socket_list, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_recordid_t[] = { {&_swigt__p_recordid_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_size_t[] = { {&_swigt__p_size_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_sockaddr[] = { {&_swigt__p_sockaddr, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ssize_t[] = { {&_swigt__p_ssize_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_time_t[] = { {&_swigt__p_time_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__ptrdiff_t[] = { {&_swigt__ptrdiff_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__size_t[] = { {&_swigt__size_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info *swig_cast_initial[] = { _swigc__p_CardInfo, _swigc__p_DBInfo, _swigc__p_DBSizeInfo, _swigc__p_NetSyncInfo, _swigc__p_PilotUser, _swigc__p_SysInfo, _swigc__p_VFSAnyMountParam, _swigc__p_VFSDirInfo, _swigc__p_VFSInfo, _swigc__p_VFSSlotMountParam, _swigc__p_char, _swigc__p_int, _swigc__p_long, _swigc__p_p_char, _swigc__p_p_pi_protocol, _swigc__p_pi_buffer_t, _swigc__p_pi_device, _swigc__p_pi_protocol, _swigc__p_pi_socket, _swigc__p_pi_socket_list, _swigc__p_recordid_t, _swigc__p_size_t, _swigc__p_sockaddr, _swigc__p_ssize_t, _swigc__p_time_t, _swigc__p_unsigned_char, _swigc__p_unsigned_long, _swigc__ptrdiff_t, _swigc__size_t, }; /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ static swig_const_info swig_const_table[] = { {0, 0, 0, 0.0, 0, 0}}; #ifdef __cplusplus } #endif /************************************************************************* * Type initialization: * This problem is tough by the requirement that no dynamic * memory is used. Also, since swig_type_info structures store pointers to * swig_cast_info structures and swig_cast_info structures store pointers back * to swig_type_info structures, we need some lookup code at initialization. * The idea is that swig generates all the structures that are needed. * The runtime then collects these partially filled structures. * The SWIG_InitializeModule function takes these initial arrays out of * swig_module, and does all the lookup, filling in the swig_module.types * array with the correct data and linking the correct swig_cast_info * structures together. * The generated swig_type_info structures are assigned staticly to an initial * array. We just loop though that array, and handle each type individually. * First we lookup if this type has been already loaded, and if so, use the * loaded structure instead of the generated one. Then we have to fill in the * cast linked list. The cast data is initially stored in something like a * two-dimensional array. Each row corresponds to a type (there are the same * number of rows as there are in the swig_type_initial array). Each entry in * a column is one of the swig_cast_info structures for that type. * The cast_initial array is actually an array of arrays, because each row has * a variable number of columns. So to actually build the cast linked list, * we find the array of casts associated with the type, and loop through it * adding the casts to the list. The one last trick we need to do is making * sure the type pointer in the swig_cast_info struct is correct. * First off, we lookup the cast->type name to see if it is already loaded. * There are three cases to handle: * 1) If the cast->type has already been loaded AND the type we are adding * casting info to has not been loaded (it is in this module), THEN we * replace the cast->type pointer with the type pointer that has already * been loaded. * 2) If BOTH types (the one we are adding casting info to, and the * cast->type) are loaded, THEN the cast info has already been loaded by * the previous module so we just ignore it. * 3) Finally, if cast->type has not already been loaded, then we add that * swig_cast_info to the linked list (because the cast->type) pointer will * be correct. **/ #ifdef __cplusplus extern "C" { #endif SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { swig_type_info *type, *ret; swig_cast_info *cast; size_t i; swig_module_info *module_head; static int init_run = 0; clientdata = clientdata; if (init_run) return; init_run = 1; /* Initialize the swig_module */ swig_module.type_initial = swig_type_initial; swig_module.cast_initial = swig_cast_initial; /* Try and load any already created modules */ module_head = SWIG_GetModule(clientdata); if (module_head) { swig_module.next = module_head->next; module_head->next = &swig_module; } else { /* This is the first module loaded */ swig_module.next = &swig_module; SWIG_SetModule(clientdata, &swig_module); } /* Now work on filling in swig_module.types */ for (i = 0; i < swig_module.size; ++i) { type = 0; /* if there is another module already loaded */ if (swig_module.next != &swig_module) { type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); } if (type) { /* Overwrite clientdata field */ if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata; } else { type = swig_module.type_initial[i]; } /* Insert casting types */ cast = swig_module.cast_initial[i]; while (cast->type) { /* Don't need to add information already in the list */ ret = 0; if (swig_module.next != &swig_module) { ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); } if (ret && type == swig_module.type_initial[i]) { cast->type = ret; ret = 0; } if (!ret) { if (type->cast) { type->cast->prev = cast; cast->next = type->cast; } type->cast = cast; } cast++; } /* Set entry in modules->types array equal to the type */ swig_module.types[i] = type; } swig_module.types[i] = 0; } /* This function will propagate the clientdata field of type to * any new swig_type_info structures that have been added into the list * of equivalent types. It is like calling * SWIG_TypeClientData(type, clientdata) a second time. */ SWIGRUNTIME void SWIG_PropagateClientData(void) { size_t i; swig_cast_info *equiv; static int init_run = 0; if (init_run) return; init_run = 1; for (i = 0; i < swig_module.size; i++) { if (swig_module.types[i]->clientdata) { equiv = swig_module.types[i]->cast; while (equiv) { if (!equiv->converter) { if (equiv->type && !equiv->type->clientdata) SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); } equiv = equiv->next; } } } } #ifdef __cplusplus } #endif #ifdef __cplusplus extern "C" { #endif /* Python-specific SWIG API */ #define SWIG_newvarlink() SWIG_Python_newvarlink() #define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) #define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) /* ----------------------------------------------------------------------------- * global variable support code. * ----------------------------------------------------------------------------- */ typedef struct swig_globalvar { char *name; /* Name of global variable */ PyObject *(*get_attr)(void); /* Return the current value */ int (*set_attr)(PyObject *); /* Set the value */ struct swig_globalvar *next; } swig_globalvar; typedef struct swig_varlinkobject { PyObject_HEAD swig_globalvar *vars; } swig_varlinkobject; SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *v) { v = v; return PyString_FromString(""); } SWIGINTERN int swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) { swig_globalvar *var; flags = flags; fprintf(fp,"Swig global variables { "); for (var = v->vars; var; var=var->next) { fprintf(fp,"%s", var->name); if (var->next) fprintf(fp,", "); } fprintf(fp," }\n"); return 0; } SWIGINTERN PyObject * swig_varlink_getattr(swig_varlinkobject *v, char *n) { swig_globalvar *var = v->vars; while (var) { if (strcmp(var->name,n) == 0) { return (*var->get_attr)(); } var = var->next; } PyErr_SetString(PyExc_NameError,"Unknown C global variable"); return NULL; } SWIGINTERN int swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { swig_globalvar *var = v->vars; while (var) { if (strcmp(var->name,n) == 0) { return (*var->set_attr)(p); } var = var->next; } PyErr_SetString(PyExc_NameError,"Unknown C global variable"); return 1; } SWIGINTERN PyTypeObject* swig_varlink_type(void) { static char varlink__doc__[] = "Swig var link object"; static PyTypeObject varlink_type #if !defined(__cplusplus) ; static int type_init = 0; if (!type_init) { PyTypeObject tmp #endif = { PyObject_HEAD_INIT(&PyType_Type) 0, /* Number of items in variable part (ob_size) */ (char *)"swigvarlink", /* Type name (tp_name) */ sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ 0, /* Itemsize (tp_itemsize) */ 0, /* Deallocator (tp_dealloc) */ (printfunc) swig_varlink_print, /* Print (tp_print) */ (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ 0, /* tp_compare */ (reprfunc) swig_varlink_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ 0, /* tp_flags */ varlink__doc__, /* tp_doc */ #if PY_VERSION_HEX >= 0x02000000 0, /* tp_traverse */ 0, /* tp_clear */ #endif #if PY_VERSION_HEX >= 0x02010000 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #endif #if PY_VERSION_HEX >= 0x02020000 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ #endif #ifdef COUNT_ALLOCS 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; #if !defined(__cplusplus) varlink_type = tmp; type_init = 1; } #endif return &varlink_type; } /* Create a variable linking object for use later */ SWIGINTERN PyObject * SWIG_Python_newvarlink(void) { swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); if (result) { result->vars = 0; } return ((PyObject*) result); } SWIGINTERN void SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { swig_varlinkobject *v = (swig_varlinkobject *) p; swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); if (gv) { size_t size = strlen(name)+1; gv->name = (char *)malloc(size); if (gv->name) { strncpy(gv->name,name,size); gv->get_attr = get_attr; gv->set_attr = set_attr; gv->next = v->vars; } } v->vars = gv; } /* ----------------------------------------------------------------------------- * constants/methods manipulation * ----------------------------------------------------------------------------- */ /* Install Constants */ SWIGINTERN void SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { PyObject *obj = 0; size_t i; for (i = 0; constants[i].type; ++i) { switch(constants[i].type) { case SWIG_PY_INT: obj = PyInt_FromLong(constants[i].lvalue); break; case SWIG_PY_FLOAT: obj = PyFloat_FromDouble(constants[i].dvalue); break; case SWIG_PY_STRING: if (constants[i].pvalue) { obj = PyString_FromString((char *) constants[i].pvalue); } else { Py_INCREF(Py_None); obj = Py_None; } break; case SWIG_PY_POINTER: obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); break; case SWIG_PY_BINARY: obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); break; default: obj = 0; break; } if (obj) { PyDict_SetItemString(d,constants[i].name,obj); Py_DECREF(obj); } } } /* -----------------------------------------------------------------------------*/ /* Fix SwigMethods to carry the callback ptrs when needed */ /* -----------------------------------------------------------------------------*/ SWIGINTERN void SWIG_Python_FixMethods(PyMethodDef *methods, swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial) { size_t i; for (i = 0; methods[i].ml_name; ++i) { char *c = methods[i].ml_doc; if (c && (c = strstr(c, "swig_ptr: "))) { int j; swig_const_info *ci = 0; char *name = c + 10; for (j = 0; const_table[j].type; ++j) { if (strncmp(const_table[j].name, name, strlen(const_table[j].name)) == 0) { ci = &(const_table[j]); break; } } if (ci) { size_t shift = (ci->ptype) - types; swig_type_info *ty = types_initial[shift]; size_t ldoc = (c - methods[i].ml_doc); size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; char *ndoc = (char*)malloc(ldoc + lptr + 10); if (ndoc) { char *buff = ndoc; void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; if (ptr) { strncpy(buff, methods[i].ml_doc, ldoc); buff += ldoc; strncpy(buff, "swig_ptr: ", 10); buff += 10; SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); methods[i].ml_doc = ndoc; } } } } } } /* -----------------------------------------------------------------------------* * Initialize type list * -----------------------------------------------------------------------------*/ #ifdef __cplusplus } #endif /* -----------------------------------------------------------------------------* * Partial Init method * -----------------------------------------------------------------------------*/ #ifdef __cplusplus extern "C" #endif SWIGEXPORT void SWIG_init(void) { static PyObject *SWIG_globals = 0; PyObject *m, *d; if (!SWIG_globals) SWIG_globals = SWIG_newvarlink(); /* Fix SwigMethods to carry the callback ptrs when needed */ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); m = Py_InitModule((char *) SWIG_name, SwigMethods); d = PyModule_GetDict(m); SWIG_InitializeModule(0); SWIG_InstallConstants(d,swig_const_table); PIError = PyErr_NewException("pisock.error", NULL, NULL); Py_INCREF(PIError); PyDict_SetItemString(d, "error", PIError); { PyDict_SetItemString(d,"PI_ERR_PROT_ABORTED", SWIG_From_int((int)(PI_ERR_PROT_ABORTED))); } { PyDict_SetItemString(d,"PI_ERR_PROT_INCOMPATIBLE", SWIG_From_int((int)(PI_ERR_PROT_INCOMPATIBLE))); } { PyDict_SetItemString(d,"PI_ERR_PROT_BADPACKET", SWIG_From_int((int)(PI_ERR_PROT_BADPACKET))); } { PyDict_SetItemString(d,"PI_ERR_SOCK_DISCONNECTED", SWIG_From_int((int)(PI_ERR_SOCK_DISCONNECTED))); } { PyDict_SetItemString(d,"PI_ERR_SOCK_INVALID", SWIG_From_int((int)(PI_ERR_SOCK_INVALID))); } { PyDict_SetItemString(d,"PI_ERR_SOCK_TIMEOUT", SWIG_From_int((int)(PI_ERR_SOCK_TIMEOUT))); } { PyDict_SetItemString(d,"PI_ERR_SOCK_CANCELED", SWIG_From_int((int)(PI_ERR_SOCK_CANCELED))); } { PyDict_SetItemString(d,"PI_ERR_SOCK_IO", SWIG_From_int((int)(PI_ERR_SOCK_IO))); } { PyDict_SetItemString(d,"PI_ERR_SOCK_LISTENER", SWIG_From_int((int)(PI_ERR_SOCK_LISTENER))); } { PyDict_SetItemString(d,"PI_ERR_DLP_BUFSIZE", SWIG_From_int((int)(PI_ERR_DLP_BUFSIZE))); } { PyDict_SetItemString(d,"PI_ERR_DLP_PALMOS", SWIG_From_int((int)(PI_ERR_DLP_PALMOS))); } { PyDict_SetItemString(d,"PI_ERR_DLP_UNSUPPORTED", SWIG_From_int((int)(PI_ERR_DLP_UNSUPPORTED))); } { PyDict_SetItemString(d,"PI_ERR_DLP_SOCKET", SWIG_From_int((int)(PI_ERR_DLP_SOCKET))); } { PyDict_SetItemString(d,"PI_ERR_DLP_DATASIZE", SWIG_From_int((int)(PI_ERR_DLP_DATASIZE))); } { PyDict_SetItemString(d,"PI_ERR_DLP_COMMAND", SWIG_From_int((int)(PI_ERR_DLP_COMMAND))); } { PyDict_SetItemString(d,"PI_ERR_FILE_INVALID", SWIG_From_int((int)(PI_ERR_FILE_INVALID))); } { PyDict_SetItemString(d,"PI_ERR_FILE_ERROR", SWIG_From_int((int)(PI_ERR_FILE_ERROR))); } { PyDict_SetItemString(d,"PI_ERR_FILE_ABORTED", SWIG_From_int((int)(PI_ERR_FILE_ABORTED))); } { PyDict_SetItemString(d,"PI_ERR_FILE_NOT_FOUND", SWIG_From_int((int)(PI_ERR_FILE_NOT_FOUND))); } { PyDict_SetItemString(d,"PI_ERR_FILE_ALREADY_EXISTS", SWIG_From_int((int)(PI_ERR_FILE_ALREADY_EXISTS))); } { PyDict_SetItemString(d,"PI_ERR_GENERIC_MEMORY", SWIG_From_int((int)(PI_ERR_GENERIC_MEMORY))); } { PyDict_SetItemString(d,"PI_ERR_GENERIC_ARGUMENT", SWIG_From_int((int)(PI_ERR_GENERIC_ARGUMENT))); } { PyDict_SetItemString(d,"PI_ERR_GENERIC_SYSTEM", SWIG_From_int((int)(PI_ERR_GENERIC_SYSTEM))); } { PyDict_SetItemString(d,"PI_AF_PILOT", SWIG_From_int((int)(0x00))); } { PyDict_SetItemString(d,"PI_SOCK_STREAM", SWIG_From_int((int)(0x0010))); } { PyDict_SetItemString(d,"PI_SOCK_RAW", SWIG_From_int((int)(0x0030))); } { PyDict_SetItemString(d,"PI_CMD_CMP", SWIG_From_int((int)(0x01))); } { PyDict_SetItemString(d,"PI_CMD_NET", SWIG_From_int((int)(0x02))); } { PyDict_SetItemString(d,"PI_CMD_SYS", SWIG_From_int((int)(0x03))); } { PyDict_SetItemString(d,"PI_MSG_PEEK", SWIG_From_int((int)(0x01))); } { PyDict_SetItemString(d,"PI_PF_DEV", SWIG_From_int((int)(PI_PF_DEV))); } { PyDict_SetItemString(d,"PI_PF_SLP", SWIG_From_int((int)(PI_PF_SLP))); } { PyDict_SetItemString(d,"PI_PF_SYS", SWIG_From_int((int)(PI_PF_SYS))); } { PyDict_SetItemString(d,"PI_PF_PADP", SWIG_From_int((int)(PI_PF_PADP))); } { PyDict_SetItemString(d,"PI_PF_NET", SWIG_From_int((int)(PI_PF_NET))); } { PyDict_SetItemString(d,"PI_PF_DLP", SWIG_From_int((int)(PI_PF_DLP))); } { PyDict_SetItemString(d,"PI_LEVEL_DEV", SWIG_From_int((int)(PI_LEVEL_DEV))); } { PyDict_SetItemString(d,"PI_LEVEL_SLP", SWIG_From_int((int)(PI_LEVEL_SLP))); } { PyDict_SetItemString(d,"PI_LEVEL_PADP", SWIG_From_int((int)(PI_LEVEL_PADP))); } { PyDict_SetItemString(d,"PI_LEVEL_NET", SWIG_From_int((int)(PI_LEVEL_NET))); } { PyDict_SetItemString(d,"PI_LEVEL_SYS", SWIG_From_int((int)(PI_LEVEL_SYS))); } { PyDict_SetItemString(d,"PI_LEVEL_CMP", SWIG_From_int((int)(PI_LEVEL_CMP))); } { PyDict_SetItemString(d,"PI_LEVEL_DLP", SWIG_From_int((int)(PI_LEVEL_DLP))); } { PyDict_SetItemString(d,"PI_LEVEL_SOCK", SWIG_From_int((int)(PI_LEVEL_SOCK))); } { PyDict_SetItemString(d,"PI_DEV_RATE", SWIG_From_int((int)(PI_DEV_RATE))); } { PyDict_SetItemString(d,"PI_DEV_ESTRATE", SWIG_From_int((int)(PI_DEV_ESTRATE))); } { PyDict_SetItemString(d,"PI_DEV_HIGHRATE", SWIG_From_int((int)(PI_DEV_HIGHRATE))); } { PyDict_SetItemString(d,"PI_DEV_TIMEOUT", SWIG_From_int((int)(PI_DEV_TIMEOUT))); } { PyDict_SetItemString(d,"PI_SLP_DEST", SWIG_From_int((int)(PI_SLP_DEST))); } { PyDict_SetItemString(d,"PI_SLP_LASTDEST", SWIG_From_int((int)(PI_SLP_LASTDEST))); } { PyDict_SetItemString(d,"PI_SLP_SRC", SWIG_From_int((int)(PI_SLP_SRC))); } { PyDict_SetItemString(d,"PI_SLP_LASTSRC", SWIG_From_int((int)(PI_SLP_LASTSRC))); } { PyDict_SetItemString(d,"PI_SLP_TYPE", SWIG_From_int((int)(PI_SLP_TYPE))); } { PyDict_SetItemString(d,"PI_SLP_LASTTYPE", SWIG_From_int((int)(PI_SLP_LASTTYPE))); } { PyDict_SetItemString(d,"PI_SLP_TXID", SWIG_From_int((int)(PI_SLP_TXID))); } { PyDict_SetItemString(d,"PI_SLP_LASTTXID", SWIG_From_int((int)(PI_SLP_LASTTXID))); } { PyDict_SetItemString(d,"PI_PADP_TYPE", SWIG_From_int((int)(PI_PADP_TYPE))); } { PyDict_SetItemString(d,"PI_PADP_LASTTYPE", SWIG_From_int((int)(PI_PADP_LASTTYPE))); } { PyDict_SetItemString(d,"PI_PADP_FREEZE_TXID", SWIG_From_int((int)(PI_PADP_FREEZE_TXID))); } { PyDict_SetItemString(d,"PI_PADP_USE_LONG_FORMAT", SWIG_From_int((int)(PI_PADP_USE_LONG_FORMAT))); } { PyDict_SetItemString(d,"PI_CMP_TYPE", SWIG_From_int((int)(PI_CMP_TYPE))); } { PyDict_SetItemString(d,"PI_CMP_FLAGS", SWIG_From_int((int)(PI_CMP_FLAGS))); } { PyDict_SetItemString(d,"PI_CMP_VERS", SWIG_From_int((int)(PI_CMP_VERS))); } { PyDict_SetItemString(d,"PI_CMP_BAUD", SWIG_From_int((int)(PI_CMP_BAUD))); } { PyDict_SetItemString(d,"PI_NET_TYPE", SWIG_From_int((int)(PI_NET_TYPE))); } { PyDict_SetItemString(d,"PI_NET_SPLIT_WRITES", SWIG_From_int((int)(PI_NET_SPLIT_WRITES))); } { PyDict_SetItemString(d,"PI_NET_WRITE_CHUNKSIZE", SWIG_From_int((int)(PI_NET_WRITE_CHUNKSIZE))); } { PyDict_SetItemString(d,"PI_SOCK_STATE", SWIG_From_int((int)(PI_SOCK_STATE))); } { PyDict_SetItemString(d,"PI_SOCK_HONOR_RX_TIMEOUT", SWIG_From_int((int)(PI_SOCK_HONOR_RX_TIMEOUT))); } { PyDict_SetItemString(d,"PI_DLP_VERSION_MAJOR", SWIG_From_int((int)(1))); } { PyDict_SetItemString(d,"PI_DLP_VERSION_MINOR", SWIG_From_int((int)(4))); } { PyDict_SetItemString(d,"vfsMountFlagsUseThisFileSystem", SWIG_From_int((int)(0x01))); } { PyDict_SetItemString(d,"vfsMAXFILENAME", SWIG_From_int((int)(256))); } { PyDict_SetItemString(d,"vfsInvalidVolRef", SWIG_From_int((int)(0))); } { PyDict_SetItemString(d,"vfsInvalidFileRef", SWIG_From_long((long)(0L))); } { PyDict_SetItemString(d,"dlpDBFlagResource", SWIG_From_int((int)(dlpDBFlagResource))); } { PyDict_SetItemString(d,"dlpDBFlagReadOnly", SWIG_From_int((int)(dlpDBFlagReadOnly))); } { PyDict_SetItemString(d,"dlpDBFlagAppInfoDirty", SWIG_From_int((int)(dlpDBFlagAppInfoDirty))); } { PyDict_SetItemString(d,"dlpDBFlagBackup", SWIG_From_int((int)(dlpDBFlagBackup))); } { PyDict_SetItemString(d,"dlpDBFlagHidden", SWIG_From_int((int)(dlpDBFlagHidden))); } { PyDict_SetItemString(d,"dlpDBFlagLaunchable", SWIG_From_int((int)(dlpDBFlagLaunchable))); } { PyDict_SetItemString(d,"dlpDBFlagRecyclable", SWIG_From_int((int)(dlpDBFlagRecyclable))); } { PyDict_SetItemString(d,"dlpDBFlagBundle", SWIG_From_int((int)(dlpDBFlagBundle))); } { PyDict_SetItemString(d,"dlpDBFlagOpen", SWIG_From_int((int)(dlpDBFlagOpen))); } { PyDict_SetItemString(d,"dlpDBFlagNewer", SWIG_From_int((int)(dlpDBFlagNewer))); } { PyDict_SetItemString(d,"dlpDBFlagReset", SWIG_From_int((int)(dlpDBFlagReset))); } { PyDict_SetItemString(d,"dlpDBFlagCopyPrevention", SWIG_From_int((int)(dlpDBFlagCopyPrevention))); } { PyDict_SetItemString(d,"dlpDBFlagStream", SWIG_From_int((int)(dlpDBFlagStream))); } { PyDict_SetItemString(d,"dlpDBFlagSchema", SWIG_From_int((int)(dlpDBFlagSchema))); } { PyDict_SetItemString(d,"dlpDBFlagSecure", SWIG_From_int((int)(dlpDBFlagSecure))); } { PyDict_SetItemString(d,"dlpDBFlagExtended", SWIG_From_int((int)(dlpDBFlagExtended))); } { PyDict_SetItemString(d,"dlpDBFlagFixedUp", SWIG_From_int((int)(dlpDBFlagFixedUp))); } { PyDict_SetItemString(d,"dlpDBMiscFlagExcludeFromSync", SWIG_From_int((int)(dlpDBMiscFlagExcludeFromSync))); } { PyDict_SetItemString(d,"dlpDBMiscFlagRamBased", SWIG_From_int((int)(dlpDBMiscFlagRamBased))); } { PyDict_SetItemString(d,"dlpRecAttrDeleted", SWIG_From_int((int)(dlpRecAttrDeleted))); } { PyDict_SetItemString(d,"dlpRecAttrDirty", SWIG_From_int((int)(dlpRecAttrDirty))); } { PyDict_SetItemString(d,"dlpRecAttrBusy", SWIG_From_int((int)(dlpRecAttrBusy))); } { PyDict_SetItemString(d,"dlpRecAttrSecret", SWIG_From_int((int)(dlpRecAttrSecret))); } { PyDict_SetItemString(d,"dlpRecAttrArchived", SWIG_From_int((int)(dlpRecAttrArchived))); } { PyDict_SetItemString(d,"dlpOpenRead", SWIG_From_int((int)(dlpOpenRead))); } { PyDict_SetItemString(d,"dlpOpenWrite", SWIG_From_int((int)(dlpOpenWrite))); } { PyDict_SetItemString(d,"dlpOpenExclusive", SWIG_From_int((int)(dlpOpenExclusive))); } { PyDict_SetItemString(d,"dlpOpenSecret", SWIG_From_int((int)(dlpOpenSecret))); } { PyDict_SetItemString(d,"dlpOpenReadWrite", SWIG_From_int((int)(dlpOpenReadWrite))); } { PyDict_SetItemString(d,"dlpDBListRAM", SWIG_From_int((int)(dlpDBListRAM))); } { PyDict_SetItemString(d,"dlpDBListROM", SWIG_From_int((int)(dlpDBListROM))); } { PyDict_SetItemString(d,"dlpDBListMultiple", SWIG_From_int((int)(dlpDBListMultiple))); } { PyDict_SetItemString(d,"dlpFindDBOptFlagGetAttributes", SWIG_From_int((int)(dlpFindDBOptFlagGetAttributes))); } { PyDict_SetItemString(d,"dlpFindDBOptFlagGetSize", SWIG_From_int((int)(dlpFindDBOptFlagGetSize))); } { PyDict_SetItemString(d,"dlpFindDBOptFlagMaxRecSize", SWIG_From_int((int)(dlpFindDBOptFlagMaxRecSize))); } { PyDict_SetItemString(d,"dlpFindDBSrchFlagNewSearch", SWIG_From_int((int)(dlpFindDBSrchFlagNewSearch))); } { PyDict_SetItemString(d,"dlpFindDBSrchFlagOnlyLatest", SWIG_From_int((int)(dlpFindDBSrchFlagOnlyLatest))); } { PyDict_SetItemString(d,"dlpEndCodeNormal", SWIG_From_int((int)(dlpEndCodeNormal))); } { PyDict_SetItemString(d,"dlpEndCodeOutOfMemory", SWIG_From_int((int)(dlpEndCodeOutOfMemory))); } { PyDict_SetItemString(d,"dlpEndCodeUserCan", SWIG_From_int((int)(dlpEndCodeUserCan))); } { PyDict_SetItemString(d,"dlpEndCodeOther", SWIG_From_int((int)(dlpEndCodeOther))); } { PyDict_SetItemString(d,"dlpExpCapabilityHasStorage", SWIG_From_int((int)(dlpExpCapabilityHasStorage))); } { PyDict_SetItemString(d,"dlpExpCapabilityReadOnly", SWIG_From_int((int)(dlpExpCapabilityReadOnly))); } { PyDict_SetItemString(d,"dlpExpCapabilitySerial", SWIG_From_int((int)(dlpExpCapabilitySerial))); } { PyDict_SetItemString(d,"vfsVolAttrSlotBased", SWIG_From_int((int)(vfsVolAttrSlotBased))); } { PyDict_SetItemString(d,"vfsVolAttrReadOnly", SWIG_From_int((int)(vfsVolAttrReadOnly))); } { PyDict_SetItemString(d,"vfsVolAttrHidden", SWIG_From_int((int)(vfsVolAttrHidden))); } { PyDict_SetItemString(d,"vfsOriginBeginning", SWIG_From_int((int)(vfsOriginBeginning))); } { PyDict_SetItemString(d,"vfsOriginCurrent", SWIG_From_int((int)(vfsOriginCurrent))); } { PyDict_SetItemString(d,"vfsOriginEnd", SWIG_From_int((int)(vfsOriginEnd))); } { PyDict_SetItemString(d,"dlpVFSOpenExclusive", SWIG_From_int((int)(dlpVFSOpenExclusive))); } { PyDict_SetItemString(d,"dlpVFSOpenRead", SWIG_From_int((int)(dlpVFSOpenRead))); } { PyDict_SetItemString(d,"dlpVFSOpenWrite", SWIG_From_int((int)(dlpVFSOpenWrite))); } { PyDict_SetItemString(d,"dlpVFSOpenReadWrite", SWIG_From_int((int)(dlpVFSOpenReadWrite))); } { PyDict_SetItemString(d,"vfsModeExclusive", SWIG_From_int((int)(vfsModeExclusive))); } { PyDict_SetItemString(d,"vfsModeRead", SWIG_From_int((int)(vfsModeRead))); } { PyDict_SetItemString(d,"vfsModeWrite", SWIG_From_int((int)(vfsModeWrite))); } { PyDict_SetItemString(d,"vfsModeReadWrite", SWIG_From_int((int)(vfsModeReadWrite))); } { PyDict_SetItemString(d,"vfsModeCreate", SWIG_From_int((int)(vfsModeCreate))); } { PyDict_SetItemString(d,"vfsModeTruncate", SWIG_From_int((int)(vfsModeTruncate))); } { PyDict_SetItemString(d,"vfsModeLeaveOpen", SWIG_From_int((int)(vfsModeLeaveOpen))); } { PyDict_SetItemString(d,"vfsFileAttrReadOnly", SWIG_From_int((int)(vfsFileAttrReadOnly))); } { PyDict_SetItemString(d,"vfsFileAttrHidden", SWIG_From_int((int)(vfsFileAttrHidden))); } { PyDict_SetItemString(d,"vfsFileAttrSystem", SWIG_From_int((int)(vfsFileAttrSystem))); } { PyDict_SetItemString(d,"vfsFileAttrVolumeLabel", SWIG_From_int((int)(vfsFileAttrVolumeLabel))); } { PyDict_SetItemString(d,"vfsFileAttrDirectory", SWIG_From_int((int)(vfsFileAttrDirectory))); } { PyDict_SetItemString(d,"vfsFileAttrArchive", SWIG_From_int((int)(vfsFileAttrArchive))); } { PyDict_SetItemString(d,"vfsFileAttrLink", SWIG_From_int((int)(vfsFileAttrLink))); } { PyDict_SetItemString(d,"vfsFileDateCreated", SWIG_From_int((int)(vfsFileDateCreated))); } { PyDict_SetItemString(d,"vfsFileDateModified", SWIG_From_int((int)(vfsFileDateModified))); } { PyDict_SetItemString(d,"vfsFileDateAccessed", SWIG_From_int((int)(vfsFileDateAccessed))); } { PyDict_SetItemString(d,"vfsIteratorStart", SWIG_From_int((int)(vfsIteratorStart))); } { PyDict_SetItemString(d,"vfsIteratorStop", SWIG_From_int((int)(vfsIteratorStop))); } { PyDict_SetItemString(d,"dlpErrNoError", SWIG_From_int((int)(dlpErrNoError))); } { PyDict_SetItemString(d,"dlpErrSystem", SWIG_From_int((int)(dlpErrSystem))); } { PyDict_SetItemString(d,"dlpErrIllegalReq", SWIG_From_int((int)(dlpErrIllegalReq))); } { PyDict_SetItemString(d,"dlpErrMemory", SWIG_From_int((int)(dlpErrMemory))); } { PyDict_SetItemString(d,"dlpErrParam", SWIG_From_int((int)(dlpErrParam))); } { PyDict_SetItemString(d,"dlpErrNotFound", SWIG_From_int((int)(dlpErrNotFound))); } { PyDict_SetItemString(d,"dlpErrNoneOpen", SWIG_From_int((int)(dlpErrNoneOpen))); } { PyDict_SetItemString(d,"dlpErrAlreadyOpen", SWIG_From_int((int)(dlpErrAlreadyOpen))); } { PyDict_SetItemString(d,"dlpErrTooManyOpen", SWIG_From_int((int)(dlpErrTooManyOpen))); } { PyDict_SetItemString(d,"dlpErrExists", SWIG_From_int((int)(dlpErrExists))); } { PyDict_SetItemString(d,"dlpErrOpen", SWIG_From_int((int)(dlpErrOpen))); } { PyDict_SetItemString(d,"dlpErrDeleted", SWIG_From_int((int)(dlpErrDeleted))); } { PyDict_SetItemString(d,"dlpErrBusy", SWIG_From_int((int)(dlpErrBusy))); } { PyDict_SetItemString(d,"dlpErrNotSupp", SWIG_From_int((int)(dlpErrNotSupp))); } { PyDict_SetItemString(d,"dlpErrUnused1", SWIG_From_int((int)(dlpErrUnused1))); } { PyDict_SetItemString(d,"dlpErrReadOnly", SWIG_From_int((int)(dlpErrReadOnly))); } { PyDict_SetItemString(d,"dlpErrSpace", SWIG_From_int((int)(dlpErrSpace))); } { PyDict_SetItemString(d,"dlpErrLimit", SWIG_From_int((int)(dlpErrLimit))); } { PyDict_SetItemString(d,"dlpErrSync", SWIG_From_int((int)(dlpErrSync))); } { PyDict_SetItemString(d,"dlpErrWrapper", SWIG_From_int((int)(dlpErrWrapper))); } { PyDict_SetItemString(d,"dlpErrArgument", SWIG_From_int((int)(dlpErrArgument))); } { PyDict_SetItemString(d,"dlpErrSize", SWIG_From_int((int)(dlpErrSize))); } { PyDict_SetItemString(d,"dlpErrUnknown", SWIG_From_int((int)(dlpErrUnknown))); } } pilot-link-0.12.5-dfsg/bindings/Python/src/pi-dlp-maps.i0000644000175000017500000002075010465410413023244 0ustar rousseaurousseau/* * pi-dlp-maps.i * * Maps for the DLP function arguments, as well as some custom implementations * * Copyright (c) 2005, Florent Pillet. * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * */ // TODO: convert PI_CONST char *dbname parameters using the ConvertToEncoding() function // TODO: map output parameters for dlp_ExpCardInfo() // TODO: map output parameters for dlp_ExpSlotMediaType() // TODO: map output parameters for VFS functions // TODO: map 'unsigned long *restype' output parameter // ----------------------------------------------- // a char value that allows None for a null value. // ----------------------------------------------- %typemap (python,in) char *ALLOWNULL { if (!($input) || ($input == Py_None)) $1 = NULL; else $1 = PyString_AsString($input); } // ------------------------------------- // type/creator pair // ------------------------------------- %typemap (python,in) unsigned long creator, unsigned long type { if (PyString_Check($input)) $1 = makelong(PyString_AS_STRING($input)); else if (PyInt_Check($input)) $1 = PyInt_AsLong($input); else { PyErr_SetString(PyExc_TypeError,"You must specify a type/creator"); SWIG_fail; } } // ---------------------------------------------------------- // output parameters. Output parameters should be ommitted // when writing Python code, the result is either a single // value or a list (depending on whether there is one or more // output parameters) containing the output values // ---------------------------------------------------------- %apply int *OUTPUT { int *dbhandle }; %apply int *OUTPUT { int *numrecs }; %apply int *OUTPUT { int *recattrs }; %apply int *OUTPUT { int *category }; %apply int *OUTPUT { int *cardno }; %apply int *OUTPUT { int *recindex }; %apply int *OUTPUT { int *resindex }; %apply int *OUTPUT { int *resid }; %apply long *OUTPUT { long *usedbytes }; %apply long *OUTPUT { long *totalbytes }; %apply unsigned long *OUTPUT { unsigned long *feature }; %apply unsigned long *OUTPUT { recordid_t *recuid }; %apply unsigned long *OUTPUT { recordid_t *newrecuid }; %apply unsigned long *OUTPUT { unsigned long *localid }; %apply unsigned long *OUTPUT { unsigned long *retcode }; // ------------------------------------- // time_t *time // ------------------------------------- %rename(dlp_GetSysDateTime_) dlp_GetSysDateTime; %typemap (python,in,numinputs=0) time_t *time (time_t time) { $1 = (time_t *)&time; } %typemap (python,argout) time_t *time (time_t time) { if ($1) $result = PyInt_FromLong((unsigned long ) $1); } // ------------------------------------- // struct PilotUser // ------------------------------------- %typemap (python,in) const struct PilotUser* (struct PilotUser temp) %{ if (!PyObjectToPilotUser($input, &temp)) SWIG_fail; $1 = &temp; %} %typemap (python,in,numinputs=0) struct PilotUser* (struct PilotUser temp) %{ $1 = &temp; %} %typemap (python,argout) struct PilotUser* %{ if ($1) $result = t_output_helper($result, PyObjectFromPilotUser($1)); %} // ------------------------------------- // struct SysInfo // ------------------------------------- %typemap (in,numinputs=0) struct SysInfo* (struct SysInfo temp) %{ $1 = &temp; %} %typemap (python,argout) struct SysInfo * %{ if ($1) $result = t_output_helper($result, PyObjectFromSysInfo($1)); %} // ------------------------------------- // struct CardInfo // ------------------------------------- %typemap (python,argout) (struct CardInfo *cardinfo) %{ if ($1) $result = t_output_helper($result, PyObjectFromCardInfo($1)); %} %typemap (python,in,numinputs=0) struct CardInfo *cardinfo (struct CardInfo temp) %{ $1 = &temp; %} // ------------------------------------- // struct NetSyncInfo // ------------------------------------- %typemap (python,in,numinputs=0) struct NetSyncInfo *OUTPUT (struct NetSyncInfo temp) { $1 = &temp; } %typemap (python,argout) struct NetSyncInfo *OUTPUT %{ if ($1) $result = t_output_helper($result, PyObjectFromNetSyncInfo($1)); %} %typemap (python,in) struct NetSyncInfo *INPUT (struct NetSyncInfo temp) %{ PyObjectToNetSyncInfo($input, &temp); $1 = &temp; %} // ------------------------------------- // Passing data as parameter // ------------------------------------- %typemap (python,in) (const void *databuf, size_t datasize) %{ $1 = (void *)PyString_AsString($input); $2 = PyString_Size($input); %} %typemap (python,in) (size_t datasize, const void *databuf) %{ $1 = PyString_Size($input); $2 = (void *)PyString_AsString($input); %} // ------------------------------------- // Used by dlp_ReadAppPreference // ------------------------------------- %typemap (python,argout) (void *databuf, size_t *datasize, int *version) %{ if ($1) $result = t_output_helper($result, Py_BuildValue("is#", $3, $1, $2)); %} // --------------------------------------------------------- // Finding databases: proper wrapping of dlp_Find* functions // so that they do not need to be passed a pointer // --------------------------------------------------------- %typemap (python,in,numinputs=0) (struct DBInfo *dbInfo, struct DBSizeInfo *dbSize) (struct DBInfo temp1, struct DBSizeInfo temp2) %{ $1 = &temp1; $2 = &temp2; %} %typemap (python,argout) (struct DBInfo *dbInfo, struct DBSizeInfo *dbSize) %{ if ($1) $result = t_output_helper($result, PyObjectFromDBInfo($1)); if ($2) $result = t_output_helper($result, PyObjectFromDBSizeInfo($2)); %} // ------------------------------------- // Processing of a buffer containing a // database list // ------------------------------------- // we provide a python implementation for dlp_ReadDBList (see ../pisockextras.py) %rename(dlp_ReadDBList_) dlp_ReadDBList; %typemap (python,argout) (pi_buffer_t *dblist) %{ if ($1) { int j; struct DBInfo info; $result = PyList_New(($1->used / sizeof(struct DBInfo))); for (j=0; j < ($1->used / sizeof(struct DBInfo)); j++) { memcpy(&info, $1->data + j * sizeof(struct DBInfo), sizeof(struct DBInfo)); PyObject *o = PyObjectFromDBInfo(&info); Py_INCREF(o); PyList_SET_ITEM($result, j, o); } } %} // ----------------------------------------- // Mapping for dlp_ExpSlotEnumerate // ----------------------------------------- %typemap (python,in,numinputs=0) (int *numslots, int *slotrefs) (int numSlots, int slotRefs[16]) %{ numSlots = sizeof(slotRefs) / sizeof(slotRefs[0]); $1 = &numSlots; $2 = &slotRefs[0]; %} %typemap (python,argout) (int *numslots, int *slotrefs) %{ if ($1 && $2) { int slotIndex; for (slotIndex=0; slotIndex < *$1; slotIndex++) t_output_helper($result, PyInt_FromLong($2[slotIndex])); } %} // ----------------------------------------- // Custom wrappers for some of the functions // ----------------------------------------- %native(dlp_ReadRecordIDList) PyObject *_wrap_dlp_ReadRecordIDList(PyObject *, PyObject *); %{ static PyObject *_wrap_dlp_ReadRecordIDList (PyObject *self, PyObject *args) { int sd, dbhandle, sort, start, max; int ret; recordid_t *buf; int count, i; PyObject *list; buf = (recordid_t *)PyMem_Malloc(0xFFFF); if (!PyArg_ParseTuple(args, "iiiii", &sd, &dbhandle, &sort, &start, &max)) return NULL; /* this is a rather simplistic wrapper. if max is too big, we just * refuse to do it; we don't loop, figuring that that is the job of * the python wrapper. */ if (max > (0xFFFF/sizeof(recordid_t))) { PyErr_SetString(PyExc_ValueError, "can only return about 64k worth of ids at once"); return NULL; } { PyThreadState *save = PyEval_SaveThread(); ret = dlp_ReadRecordIDList(sd, dbhandle, sort, start, max, buf, &count); PyEval_RestoreThread(save); } if (ret < 0) { PyErr_SetObject(PIError, Py_BuildValue("(is)", ret, dlp_strerror(ret))); PyMem_Free(buf); return NULL; } list = PyList_New(0); for (i=0; i // All Rights Reserved // Copyright (c) 2005 Florent Pillet, Nick Piper // // Permission to use, copy, modify, and distribute this software and // its documentation for any purpose and without fee or royalty is // hereby granted, provided that the above copyright notice appear in // all copies and that both the copyright notice and this permission // notice appear in supporting documentation or portions thereof, // including modifications, that you you make. // // THE AUTHOR ROB TILLOTSON DISCLAIMS ALL WARRANTIES WITH REGARD TO // THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY // AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY // SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER // RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF // CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN // CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE! // // This is an attempt at using SWIG to generate wrappers for the // pilot-link library. As one look at this source should tell you, it // turned out to be a non-trivial amount of work (but less than doing // it by hand). The semantics of the resulting module are not all // that different from the original Python interface to pilot-link, // but function names and arguments are closer to those in the raw // pilot-link library. In particular, no attempt is made to create // Python types for connections, databases, etc.; if you want object // structure, shadow classes should be easy to create. // // All of the dlp_* functions will throw an exception when the library // returns a negative status; the value of this exception will be a // tuple of the numeric error code and a message. %module pisock %pythoncode %{ from pisockextras import * %} %{ #include #include "pi-header.h" #include "pi-source.h" #include "pi-error.h" #include "pi-socket.h" #include "pi-dlp.h" #include "pi-file.h" #include "pi-util.h" #define DGETLONG(src,key,default) (PyDict_GetItemString(src,key) ? \ PyInt_AsLong(PyDict_GetItemString(src,key)) : default) #define DGETSTR(src,key,default) (PyDict_GetItemString(src,key) ? \ PyString_AsString(PyDict_GetItemString(src,key)) : default) static PyObject *PIError = NULL; %} %init %{ PIError = PyErr_NewException("pisock.error", NULL, NULL); Py_INCREF(PIError); PyDict_SetItemString(d, "error", PIError); %} %pythoncode %{ error = _pisock.error %} %include typemaps.i #define PI_DEPRECATED %include helperfuncs.i %include pi-error.i %include general-maps.i %include pi-socket-maps.i %include pi-dlp-maps.i %include pi-file-maps.i %include ../../../include/pi-args.h %include ../../../include/pi-header.h %include ../../../include/pi-error.h /* Put thread control around all those declarations that follow * we use the exception mechanism to plug our code just around * the C function call */ %feature("except") { PyThreadState *__save = PyEval_SaveThread(); $action PyEval_RestoreThread(__save); } %include ../../../include/pi-socket.h %include ../../../include/pi-dlp.h /* Stop putting thread control around all those declarations that follow. */ %feature("except"); pilot-link-0.12.5-dfsg/bindings/Python/src/general-maps.i0000644000175000017500000000577310465410413023504 0ustar rousseaurousseau/* * general-maps.i * Map types used throughout libpisock * * Copyright (c) 2005, Florent Pillet. * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * */ /* It would be nice to use python time types ? NCP */ %apply long { time_t }; %apply unsigned long { recordid_t }; // ------------------------------------------------------ // Proper pi_buffer_t management, specifically designed // as to not leak in case of early termination (hence the // freearg part) // ------------------------------------------------------ %typemap (in,numinputs=0) (pi_buffer_t *) { $1 = pi_buffer_new(0xFFFF); } %typemap (freearg) (pi_buffer_t *) { if ($1) { pi_buffer_free($1); } } %typemap (python,argout) (pi_buffer_t *) { if ($1) { PyObject *o1 = Py_BuildValue("s#", $1->data, $1->used); $result = t_output_helper($result, o1); } } %typemap (in,numinputs=0) (size_t *OUTBUFLEN) (size_t outbuflen) { outbuflen = 0xFFFF; $1 = &outbuflen; } // ------------------------------------- // struct DBInfo // ------------------------------------- %typemap (in,numinputs=0) struct DBInfo *OUTPUT (struct DBInfo temp) %{ $1 = &temp; %} %typemap (python,argout) struct DBInfo *OUTPUT %{ if ($1) $result = t_output_helper($result, PyObjectFromDBInfo($1)); %} // ------------------------------------------------------------------ // Type/creator strings // a generic 4-character string type, for use as a type or creator ID // ------------------------------------------------------------------ %typemap (python,in) unsigned long STR4 { if (!($input) || ($input == Py_None)) { $1 = 0; } else { if (!PyString_Check($input) || (PyString_Size($input) != 4)) { PyErr_SetString(PyExc_ValueError, "argument must be a 4-character string"); return 0; } $1 = makelong(PyString_AsString($input)); } } %typemap (python,in) long STR4 { if (!($input) || ($input == Py_None)) { $1 = 0; } else { if (!PyString_Check($input) || (PyString_Size($input) != 4)) { PyErr_SetString(PyExc_ValueError, "argument must be a 4-character string"); return 0; } $1 = makelong(PyString_AsString($input)); } } %typemap (python,argout) unsigned long *OUTSTR4 { if ($1) { PyObject *o = PyString_FromStringAndSize(printlong(*$1), 4); $result = t_output_helper($result, o); } } %typemap (in,numinputs=0) unsigned long *OUTSTR4 (unsigned long temp) { $1 = &temp; } pilot-link-0.12.5-dfsg/bindings/Python/src/pisockextras.py0000644000175000017500000000127510241171735024044 0ustar rousseaurousseauimport pisock import datetime def dlp_ReadDBList(sd, cardno=0, flags=None): ret = [] i = 0 if flags is None: flags = pisock.dlpDBListRAM while True: try: lst = pisock.dlp_ReadDBList_(sd, cardno, pisock.dlpDBListMultiple | flags, i) if (lst is None) or (len(lst) == 0): return ret for db in lst: i = db['index'] + 1 ret.append(db) except pisock.error: if pisock.pi_palmos_error(sd)==pisock.dlpErrNotFound: return ret raise def dlp_GetSysDateTime(sd): r = pisock.dlp_GetSysDateTime_(sd) return datetime.datetime.fromtimestamp(r) pilot-link-0.12.5-dfsg/bindings/Python/src/pi-error.i0000644000175000017500000000470010465410413022655 0ustar rousseaurousseau/* * pi-error.i * * Error handling. Every function that returns a PI_ERR takes a socket * descriptor as first argument. It is therefore easy to just use * the first arg to query the sd about the error. * * Copyright (c) 2005, Florent Pillet. * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * * $Id: pi-error.i,v 1.8 2006/05/31 17:59:55 desrod Exp $ */ %{ static int pythonWrapper_handlePiErr(int sd, int err) { /* This function is called by each function * which receives a PI_ERR return code */ if (err == PI_ERR_DLP_PALMOS) { int palmerr = pi_palmos_error(sd); if (palmerr == dlpErrNoError) return 0; if (palmerr > dlpErrNoError && palmerr <= dlpErrUnknown) { PyErr_SetObject(PIError, Py_BuildValue("(is)", palmerr, dlp_strerror(palmerr))); return err; } } if (IS_PROT_ERR(err)) PyErr_SetObject(PIError, Py_BuildValue("(is)", err, "protocol error")); else if (IS_SOCK_ERR(err)) PyErr_SetObject(PIError, Py_BuildValue("(is)", err, "socket error")); else if (IS_DLP_ERR(err)) PyErr_SetObject(PIError, Py_BuildValue("(is)", err, "DLP error")); else if (IS_FILE_ERR(err)) PyErr_SetObject(PIError, Py_BuildValue("(is)", err, "file error")); else if (IS_GENERIC_ERR(err)) PyErr_SetObject(PIError, Py_BuildValue("(is)", err, "generic error")); else PyErr_SetObject(PIError, Py_BuildValue("(is)", err, "pisock error")); return err; } %} // ----------------------------------------------------------------- // Returned errors: we pass them to our static function for handling // (reduces the total wrapper code size) // ----------------------------------------------------------------- %typemap (python,out) PI_ERR %{ if ($1 < 0 && pythonWrapper_handlePiErr(arg1, $1) != 0) SWIG_fail; $result = Py_None; Py_INCREF(Py_None); %} pilot-link-0.12.5-dfsg/bindings/Python/src/pi-socket-maps.i0000644000175000017500000000366710465410413023765 0ustar rousseaurousseau/* * pi-socket-maps.i * * Provide our own wrappers for pi_file_install and pi_file_retrieve * * Copyright (c) 2004, Rob Tillotson * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * * $Id: pi-socket-maps.i,v 1.7 2006/05/31 17:59:55 desrod Exp $ */ // // pi-sockaddr... the real structure might be defined in one of two // different ways, but luckily SWIG doesnt really care. // %typemap (python,in) struct sockaddr *INPUT { static struct pi_sockaddr temp; char *dev; int len; if (!PyArg_ParseTuple($input, "is#", &temp.pi_family, &dev, &len)) return NULL; if (len > 255) { // Should really raise an exception len = 255; } strncpy(temp.pi_device, dev, len); temp.pi_device[len] = 0; $1 = (struct sockaddr *)&temp; } %typemap (python, argout,fragment="t_output_helper") struct sockaddr *remote_addr { PyObject *o; if ($1) { o = Py_BuildValue("(is)", (int)((struct pi_sockaddr *)$1)->pi_family, ((struct pi_sockaddr *)$1)->pi_device); $result = t_output_helper($result, o); } } %typemap (python,in,numinputs=0) struct sockaddr *remote_addr (struct pi_sockaddr temp) { $1 = (struct sockaddr *)&temp; } %typemap (python,in,numinputs=0) size_t *namelen (size_t temp) { $1 = (size_t *)&temp; } pilot-link-0.12.5-dfsg/bindings/Python/src/pi-file-maps.i0000644000175000017500000000721510465410413023405 0ustar rousseaurousseau/* * pi-file-maps.i * * Provide our own wrappers for pi_file_install and pi_file_retrieve * * Copyright (c) 2005, Florent Pillet. * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * * $Id: pi-file-maps.i,v 1.7 2006/05/31 17:59:55 desrod Exp $ */ // TODO: handle callback functions (ignored for now) %native(pi_file_install) PyObject *_wrap_pi_file_install(PyObject *, PyObject *); %native(pi_file_retrieve) PyObject *_wrap_pi_file_retrieve(PyObject *, PyObject *); %wrapper %{ /* * Python syntax: pi_file_install(sd, cardno, filename, callback) */ static PyObject *_wrap_pi_file_install (PyObject *self, PyObject *args) { PyObject *obj1 = NULL; PyObject *obj2 = NULL; PyObject *obj3 = NULL; PyObject *cback = NULL; int sd, cardno, result; char *path = NULL; pi_file_t *pf = NULL; if (!PyArg_ParseTuple(args,(char *)"OOOO:pi_file_install",&obj1, &obj2, &obj3, &cback)) return NULL; sd = (int)SWIG_As_int(obj1); cardno = (int)SWIG_As_int(obj2); if (!SWIG_AsCharPtr(obj3, (char**)&path)) { SWIG_arg_fail(3); return NULL; } pf = pi_file_open(path); if (pf == NULL) { PyErr_SetObject(PIError, Py_BuildValue("(is)", PI_ERR_FILE_INVALID, "invalid file")); return NULL; } { PyThreadState *save = PyEval_SaveThread(); result = pi_file_install(pf, sd, cardno, NULL); PyEval_RestoreThread(save); } pi_file_close(pf); if (result < 0) { pythonWrapper_handlePiErr(sd, result); return NULL; } Py_INCREF(Py_None); return Py_None; } /* * Python syntax: pi_file_retrieve(sd, cardno, dbname, storagepath, callback) */ static PyObject *_wrap_pi_file_retrieve (PyObject *self, PyObject *args) { PyObject *obj1 = NULL; PyObject *obj2 = NULL; PyObject *obj3 = NULL; PyObject *obj4 = NULL; PyObject *cback = NULL; int sd, cardno, result; char *dbname = NULL; char *path = NULL; struct DBInfo dbi; pi_file_t *pf = NULL; PyThreadState *save; if (!PyArg_ParseTuple(args, (char *)"OOOOO:pi_file_retrieve",&obj1,&obj2,&obj3,&obj4,&cback)) return NULL; sd = SWIG_As_int(obj1); cardno = SWIG_As_int(obj2); if (!SWIG_AsCharPtr(obj3, (char**)&dbname)) { SWIG_arg_fail(3); return NULL; } if (!SWIG_AsCharPtr(obj4, (char **)&path)) { SWIG_arg_fail(4); return NULL; } /* let other threads run */ save = PyEval_SaveThread(); memset(&dbi, 0, sizeof(dbi)); result = dlp_FindDBByName(sd, cardno, dbname, NULL, NULL, &dbi, NULL); if (result < 0) { PyEval_RestoreThread(save); pythonWrapper_handlePiErr(sd, result); return NULL; } pf = pi_file_create(path, &dbi); if (pf == NULL) { PyEval_RestoreThread(save); PyErr_SetObject(PIError, Py_BuildValue("(is)", PI_ERR_FILE_INVALID, "invalid file")); return NULL; } result = pi_file_retrieve(pf, sd, cardno, NULL); if (result < 0) { PyEval_RestoreThread(save); pythonWrapper_handlePiErr(sd, result); return NULL; } result = pi_file_close(pf); PyEval_RestoreThread(save); if (result < 0) { pythonWrapper_handlePiErr(sd, result); return NULL; } Py_INCREF(Py_None); return Py_None; } %} pilot-link-0.12.5-dfsg/bindings/Python/src/pisock.py0000644000175000017500000013514310411050630022604 0ustar rousseaurousseau# This file was created automatically by SWIG 1.3.27. # Don't modify this file, modify the SWIG interface instead. import _pisock # This file is compatible with both classic and new-style classes. def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static) or hasattr(self,name) or (name == "thisown"): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name import types try: _object = types.ObjectType _newclass = 1 except AttributeError: class _object : pass _newclass = 0 del types from pisockextras import * error = _pisock.error PI_ERR_PROT_ABORTED = _pisock.PI_ERR_PROT_ABORTED PI_ERR_PROT_INCOMPATIBLE = _pisock.PI_ERR_PROT_INCOMPATIBLE PI_ERR_PROT_BADPACKET = _pisock.PI_ERR_PROT_BADPACKET PI_ERR_SOCK_DISCONNECTED = _pisock.PI_ERR_SOCK_DISCONNECTED PI_ERR_SOCK_INVALID = _pisock.PI_ERR_SOCK_INVALID PI_ERR_SOCK_TIMEOUT = _pisock.PI_ERR_SOCK_TIMEOUT PI_ERR_SOCK_CANCELED = _pisock.PI_ERR_SOCK_CANCELED PI_ERR_SOCK_IO = _pisock.PI_ERR_SOCK_IO PI_ERR_SOCK_LISTENER = _pisock.PI_ERR_SOCK_LISTENER PI_ERR_DLP_BUFSIZE = _pisock.PI_ERR_DLP_BUFSIZE PI_ERR_DLP_PALMOS = _pisock.PI_ERR_DLP_PALMOS PI_ERR_DLP_UNSUPPORTED = _pisock.PI_ERR_DLP_UNSUPPORTED PI_ERR_DLP_SOCKET = _pisock.PI_ERR_DLP_SOCKET PI_ERR_DLP_DATASIZE = _pisock.PI_ERR_DLP_DATASIZE PI_ERR_DLP_COMMAND = _pisock.PI_ERR_DLP_COMMAND PI_ERR_FILE_INVALID = _pisock.PI_ERR_FILE_INVALID PI_ERR_FILE_ERROR = _pisock.PI_ERR_FILE_ERROR PI_ERR_FILE_ABORTED = _pisock.PI_ERR_FILE_ABORTED PI_ERR_FILE_NOT_FOUND = _pisock.PI_ERR_FILE_NOT_FOUND PI_ERR_FILE_ALREADY_EXISTS = _pisock.PI_ERR_FILE_ALREADY_EXISTS PI_ERR_GENERIC_MEMORY = _pisock.PI_ERR_GENERIC_MEMORY PI_ERR_GENERIC_ARGUMENT = _pisock.PI_ERR_GENERIC_ARGUMENT PI_ERR_GENERIC_SYSTEM = _pisock.PI_ERR_GENERIC_SYSTEM PI_AF_PILOT = _pisock.PI_AF_PILOT PI_SOCK_STREAM = _pisock.PI_SOCK_STREAM PI_SOCK_RAW = _pisock.PI_SOCK_RAW PI_CMD_CMP = _pisock.PI_CMD_CMP PI_CMD_NET = _pisock.PI_CMD_NET PI_CMD_SYS = _pisock.PI_CMD_SYS PI_MSG_PEEK = _pisock.PI_MSG_PEEK PI_PF_DEV = _pisock.PI_PF_DEV PI_PF_SLP = _pisock.PI_PF_SLP PI_PF_SYS = _pisock.PI_PF_SYS PI_PF_PADP = _pisock.PI_PF_PADP PI_PF_NET = _pisock.PI_PF_NET PI_PF_DLP = _pisock.PI_PF_DLP PI_LEVEL_DEV = _pisock.PI_LEVEL_DEV PI_LEVEL_SLP = _pisock.PI_LEVEL_SLP PI_LEVEL_PADP = _pisock.PI_LEVEL_PADP PI_LEVEL_NET = _pisock.PI_LEVEL_NET PI_LEVEL_SYS = _pisock.PI_LEVEL_SYS PI_LEVEL_CMP = _pisock.PI_LEVEL_CMP PI_LEVEL_DLP = _pisock.PI_LEVEL_DLP PI_LEVEL_SOCK = _pisock.PI_LEVEL_SOCK PI_DEV_RATE = _pisock.PI_DEV_RATE PI_DEV_ESTRATE = _pisock.PI_DEV_ESTRATE PI_DEV_HIGHRATE = _pisock.PI_DEV_HIGHRATE PI_DEV_TIMEOUT = _pisock.PI_DEV_TIMEOUT PI_SLP_DEST = _pisock.PI_SLP_DEST PI_SLP_LASTDEST = _pisock.PI_SLP_LASTDEST PI_SLP_SRC = _pisock.PI_SLP_SRC PI_SLP_LASTSRC = _pisock.PI_SLP_LASTSRC PI_SLP_TYPE = _pisock.PI_SLP_TYPE PI_SLP_LASTTYPE = _pisock.PI_SLP_LASTTYPE PI_SLP_TXID = _pisock.PI_SLP_TXID PI_SLP_LASTTXID = _pisock.PI_SLP_LASTTXID PI_PADP_TYPE = _pisock.PI_PADP_TYPE PI_PADP_LASTTYPE = _pisock.PI_PADP_LASTTYPE PI_PADP_FREEZE_TXID = _pisock.PI_PADP_FREEZE_TXID PI_PADP_USE_LONG_FORMAT = _pisock.PI_PADP_USE_LONG_FORMAT PI_CMP_TYPE = _pisock.PI_CMP_TYPE PI_CMP_FLAGS = _pisock.PI_CMP_FLAGS PI_CMP_VERS = _pisock.PI_CMP_VERS PI_CMP_BAUD = _pisock.PI_CMP_BAUD PI_NET_TYPE = _pisock.PI_NET_TYPE PI_NET_SPLIT_WRITES = _pisock.PI_NET_SPLIT_WRITES PI_NET_WRITE_CHUNKSIZE = _pisock.PI_NET_WRITE_CHUNKSIZE PI_SOCK_STATE = _pisock.PI_SOCK_STATE PI_SOCK_HONOR_RX_TIMEOUT = _pisock.PI_SOCK_HONOR_RX_TIMEOUT class pi_socket_t(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, pi_socket_t, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, pi_socket_t, name) def __repr__(self): return "<%s.%s; proxy of C pi_socket_t instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) __swig_setmethods__["sd"] = _pisock.pi_socket_t_sd_set __swig_getmethods__["sd"] = _pisock.pi_socket_t_sd_get if _newclass:sd = property(_pisock.pi_socket_t_sd_get, _pisock.pi_socket_t_sd_set) __swig_setmethods__["type"] = _pisock.pi_socket_t_type_set __swig_getmethods__["type"] = _pisock.pi_socket_t_type_get if _newclass:type = property(_pisock.pi_socket_t_type_get, _pisock.pi_socket_t_type_set) __swig_setmethods__["protocol"] = _pisock.pi_socket_t_protocol_set __swig_getmethods__["protocol"] = _pisock.pi_socket_t_protocol_get if _newclass:protocol = property(_pisock.pi_socket_t_protocol_get, _pisock.pi_socket_t_protocol_set) __swig_setmethods__["cmd"] = _pisock.pi_socket_t_cmd_set __swig_getmethods__["cmd"] = _pisock.pi_socket_t_cmd_get if _newclass:cmd = property(_pisock.pi_socket_t_cmd_get, _pisock.pi_socket_t_cmd_set) __swig_setmethods__["laddr"] = _pisock.pi_socket_t_laddr_set __swig_getmethods__["laddr"] = _pisock.pi_socket_t_laddr_get if _newclass:laddr = property(_pisock.pi_socket_t_laddr_get, _pisock.pi_socket_t_laddr_set) __swig_setmethods__["laddrlen"] = _pisock.pi_socket_t_laddrlen_set __swig_getmethods__["laddrlen"] = _pisock.pi_socket_t_laddrlen_get if _newclass:laddrlen = property(_pisock.pi_socket_t_laddrlen_get, _pisock.pi_socket_t_laddrlen_set) __swig_setmethods__["raddr"] = _pisock.pi_socket_t_raddr_set __swig_getmethods__["raddr"] = _pisock.pi_socket_t_raddr_get if _newclass:raddr = property(_pisock.pi_socket_t_raddr_get, _pisock.pi_socket_t_raddr_set) __swig_setmethods__["raddrlen"] = _pisock.pi_socket_t_raddrlen_set __swig_getmethods__["raddrlen"] = _pisock.pi_socket_t_raddrlen_get if _newclass:raddrlen = property(_pisock.pi_socket_t_raddrlen_get, _pisock.pi_socket_t_raddrlen_set) __swig_setmethods__["protocol_queue"] = _pisock.pi_socket_t_protocol_queue_set __swig_getmethods__["protocol_queue"] = _pisock.pi_socket_t_protocol_queue_get if _newclass:protocol_queue = property(_pisock.pi_socket_t_protocol_queue_get, _pisock.pi_socket_t_protocol_queue_set) __swig_setmethods__["queue_len"] = _pisock.pi_socket_t_queue_len_set __swig_getmethods__["queue_len"] = _pisock.pi_socket_t_queue_len_get if _newclass:queue_len = property(_pisock.pi_socket_t_queue_len_get, _pisock.pi_socket_t_queue_len_set) __swig_setmethods__["cmd_queue"] = _pisock.pi_socket_t_cmd_queue_set __swig_getmethods__["cmd_queue"] = _pisock.pi_socket_t_cmd_queue_get if _newclass:cmd_queue = property(_pisock.pi_socket_t_cmd_queue_get, _pisock.pi_socket_t_cmd_queue_set) __swig_setmethods__["cmd_len"] = _pisock.pi_socket_t_cmd_len_set __swig_getmethods__["cmd_len"] = _pisock.pi_socket_t_cmd_len_get if _newclass:cmd_len = property(_pisock.pi_socket_t_cmd_len_get, _pisock.pi_socket_t_cmd_len_set) __swig_setmethods__["device"] = _pisock.pi_socket_t_device_set __swig_getmethods__["device"] = _pisock.pi_socket_t_device_get if _newclass:device = property(_pisock.pi_socket_t_device_get, _pisock.pi_socket_t_device_set) __swig_setmethods__["state"] = _pisock.pi_socket_t_state_set __swig_getmethods__["state"] = _pisock.pi_socket_t_state_get if _newclass:state = property(_pisock.pi_socket_t_state_get, _pisock.pi_socket_t_state_set) __swig_setmethods__["honor_rx_to"] = _pisock.pi_socket_t_honor_rx_to_set __swig_getmethods__["honor_rx_to"] = _pisock.pi_socket_t_honor_rx_to_get if _newclass:honor_rx_to = property(_pisock.pi_socket_t_honor_rx_to_get, _pisock.pi_socket_t_honor_rx_to_set) __swig_setmethods__["command"] = _pisock.pi_socket_t_command_set __swig_getmethods__["command"] = _pisock.pi_socket_t_command_get if _newclass:command = property(_pisock.pi_socket_t_command_get, _pisock.pi_socket_t_command_set) __swig_setmethods__["accept_to"] = _pisock.pi_socket_t_accept_to_set __swig_getmethods__["accept_to"] = _pisock.pi_socket_t_accept_to_get if _newclass:accept_to = property(_pisock.pi_socket_t_accept_to_get, _pisock.pi_socket_t_accept_to_set) __swig_setmethods__["dlprecord"] = _pisock.pi_socket_t_dlprecord_set __swig_getmethods__["dlprecord"] = _pisock.pi_socket_t_dlprecord_get if _newclass:dlprecord = property(_pisock.pi_socket_t_dlprecord_get, _pisock.pi_socket_t_dlprecord_set) __swig_setmethods__["dlpversion"] = _pisock.pi_socket_t_dlpversion_set __swig_getmethods__["dlpversion"] = _pisock.pi_socket_t_dlpversion_get if _newclass:dlpversion = property(_pisock.pi_socket_t_dlpversion_get, _pisock.pi_socket_t_dlpversion_set) __swig_setmethods__["maxrecsize"] = _pisock.pi_socket_t_maxrecsize_set __swig_getmethods__["maxrecsize"] = _pisock.pi_socket_t_maxrecsize_get if _newclass:maxrecsize = property(_pisock.pi_socket_t_maxrecsize_get, _pisock.pi_socket_t_maxrecsize_set) __swig_setmethods__["last_error"] = _pisock.pi_socket_t_last_error_set __swig_getmethods__["last_error"] = _pisock.pi_socket_t_last_error_get if _newclass:last_error = property(_pisock.pi_socket_t_last_error_get, _pisock.pi_socket_t_last_error_set) __swig_setmethods__["palmos_error"] = _pisock.pi_socket_t_palmos_error_set __swig_getmethods__["palmos_error"] = _pisock.pi_socket_t_palmos_error_get if _newclass:palmos_error = property(_pisock.pi_socket_t_palmos_error_get, _pisock.pi_socket_t_palmos_error_set) def __init__(self, *args): _swig_setattr(self, pi_socket_t, 'this', _pisock.new_pi_socket_t(*args)) _swig_setattr(self, pi_socket_t, 'thisown', 1) def __del__(self, destroy=_pisock.delete_pi_socket_t): try: if self.thisown: destroy(self) except: pass class pi_socket_tPtr(pi_socket_t): def __init__(self, this): _swig_setattr(self, pi_socket_t, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, pi_socket_t, 'thisown', 0) self.__class__ = pi_socket_t _pisock.pi_socket_t_swigregister(pi_socket_tPtr) dlp_ReadRecordIDList = _pisock.dlp_ReadRecordIDList pi_file_install = _pisock.pi_file_install pi_file_retrieve = _pisock.pi_file_retrieve class pi_socket_list_t(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, pi_socket_list_t, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, pi_socket_list_t, name) def __repr__(self): return "<%s.%s; proxy of C pi_socket_list_t instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) __swig_setmethods__["ps"] = _pisock.pi_socket_list_t_ps_set __swig_getmethods__["ps"] = _pisock.pi_socket_list_t_ps_get if _newclass:ps = property(_pisock.pi_socket_list_t_ps_get, _pisock.pi_socket_list_t_ps_set) __swig_setmethods__["next"] = _pisock.pi_socket_list_t_next_set __swig_getmethods__["next"] = _pisock.pi_socket_list_t_next_get if _newclass:next = property(_pisock.pi_socket_list_t_next_get, _pisock.pi_socket_list_t_next_set) def __init__(self, *args): _swig_setattr(self, pi_socket_list_t, 'this', _pisock.new_pi_socket_list_t(*args)) _swig_setattr(self, pi_socket_list_t, 'thisown', 1) def __del__(self, destroy=_pisock.delete_pi_socket_list_t): try: if self.thisown: destroy(self) except: pass class pi_socket_list_tPtr(pi_socket_list_t): def __init__(self, this): _swig_setattr(self, pi_socket_list_t, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, pi_socket_list_t, 'thisown', 0) self.__class__ = pi_socket_list_t _pisock.pi_socket_list_t_swigregister(pi_socket_list_tPtr) pi_socket = _pisock.pi_socket pi_socket_setsd = _pisock.pi_socket_setsd pi_getsockname = _pisock.pi_getsockname pi_getsockpeer = _pisock.pi_getsockpeer pi_getsockopt = _pisock.pi_getsockopt pi_setsockopt = _pisock.pi_setsockopt pi_protocol = _pisock.pi_protocol pi_protocol_next = _pisock.pi_protocol_next pi_socket_connected = _pisock.pi_socket_connected pi_connect = _pisock.pi_connect pi_bind = _pisock.pi_bind pi_listen = _pisock.pi_listen pi_accept = _pisock.pi_accept pi_accept_to = _pisock.pi_accept_to pi_close = _pisock.pi_close pi_send = _pisock.pi_send pi_recv = _pisock.pi_recv pi_read = _pisock.pi_read pi_write = _pisock.pi_write pi_flush = _pisock.pi_flush pi_error = _pisock.pi_error pi_set_error = _pisock.pi_set_error pi_palmos_error = _pisock.pi_palmos_error pi_set_palmos_error = _pisock.pi_set_palmos_error pi_reset_errors = _pisock.pi_reset_errors pi_version = _pisock.pi_version pi_maxrecsize = _pisock.pi_maxrecsize pi_tickle = _pisock.pi_tickle pi_watchdog = _pisock.pi_watchdog PI_DLP_VERSION_MAJOR = _pisock.PI_DLP_VERSION_MAJOR PI_DLP_VERSION_MINOR = _pisock.PI_DLP_VERSION_MINOR vfsMountFlagsUseThisFileSystem = _pisock.vfsMountFlagsUseThisFileSystem vfsMAXFILENAME = _pisock.vfsMAXFILENAME vfsInvalidVolRef = _pisock.vfsInvalidVolRef vfsInvalidFileRef = _pisock.vfsInvalidFileRef class VFSDirInfo(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, VFSDirInfo, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, VFSDirInfo, name) def __repr__(self): return "<%s.%s; proxy of C VFSDirInfo instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) __swig_setmethods__["attr"] = _pisock.VFSDirInfo_attr_set __swig_getmethods__["attr"] = _pisock.VFSDirInfo_attr_get if _newclass:attr = property(_pisock.VFSDirInfo_attr_get, _pisock.VFSDirInfo_attr_set) __swig_setmethods__["name"] = _pisock.VFSDirInfo_name_set __swig_getmethods__["name"] = _pisock.VFSDirInfo_name_get if _newclass:name = property(_pisock.VFSDirInfo_name_get, _pisock.VFSDirInfo_name_set) def __init__(self, *args): _swig_setattr(self, VFSDirInfo, 'this', _pisock.new_VFSDirInfo(*args)) _swig_setattr(self, VFSDirInfo, 'thisown', 1) def __del__(self, destroy=_pisock.delete_VFSDirInfo): try: if self.thisown: destroy(self) except: pass class VFSDirInfoPtr(VFSDirInfo): def __init__(self, this): _swig_setattr(self, VFSDirInfo, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, VFSDirInfo, 'thisown', 0) self.__class__ = VFSDirInfo _pisock.VFSDirInfo_swigregister(VFSDirInfoPtr) class VFSAnyMountParam(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, VFSAnyMountParam, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, VFSAnyMountParam, name) def __repr__(self): return "<%s.%s; proxy of C VFSAnyMountParam instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) __swig_setmethods__["volRefNum"] = _pisock.VFSAnyMountParam_volRefNum_set __swig_getmethods__["volRefNum"] = _pisock.VFSAnyMountParam_volRefNum_get if _newclass:volRefNum = property(_pisock.VFSAnyMountParam_volRefNum_get, _pisock.VFSAnyMountParam_volRefNum_set) __swig_setmethods__["reserved"] = _pisock.VFSAnyMountParam_reserved_set __swig_getmethods__["reserved"] = _pisock.VFSAnyMountParam_reserved_get if _newclass:reserved = property(_pisock.VFSAnyMountParam_reserved_get, _pisock.VFSAnyMountParam_reserved_set) __swig_setmethods__["mountClass"] = _pisock.VFSAnyMountParam_mountClass_set __swig_getmethods__["mountClass"] = _pisock.VFSAnyMountParam_mountClass_get if _newclass:mountClass = property(_pisock.VFSAnyMountParam_mountClass_get, _pisock.VFSAnyMountParam_mountClass_set) def __init__(self, *args): _swig_setattr(self, VFSAnyMountParam, 'this', _pisock.new_VFSAnyMountParam(*args)) _swig_setattr(self, VFSAnyMountParam, 'thisown', 1) def __del__(self, destroy=_pisock.delete_VFSAnyMountParam): try: if self.thisown: destroy(self) except: pass class VFSAnyMountParamPtr(VFSAnyMountParam): def __init__(self, this): _swig_setattr(self, VFSAnyMountParam, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, VFSAnyMountParam, 'thisown', 0) self.__class__ = VFSAnyMountParam _pisock.VFSAnyMountParam_swigregister(VFSAnyMountParamPtr) class VFSSlotMountParam(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, VFSSlotMountParam, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, VFSSlotMountParam, name) def __repr__(self): return "<%s.%s; proxy of C VFSSlotMountParam instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) __swig_setmethods__["vfsMountParam"] = _pisock.VFSSlotMountParam_vfsMountParam_set __swig_getmethods__["vfsMountParam"] = _pisock.VFSSlotMountParam_vfsMountParam_get if _newclass:vfsMountParam = property(_pisock.VFSSlotMountParam_vfsMountParam_get, _pisock.VFSSlotMountParam_vfsMountParam_set) __swig_setmethods__["slotLibRefNum"] = _pisock.VFSSlotMountParam_slotLibRefNum_set __swig_getmethods__["slotLibRefNum"] = _pisock.VFSSlotMountParam_slotLibRefNum_get if _newclass:slotLibRefNum = property(_pisock.VFSSlotMountParam_slotLibRefNum_get, _pisock.VFSSlotMountParam_slotLibRefNum_set) __swig_setmethods__["slotRefNum"] = _pisock.VFSSlotMountParam_slotRefNum_set __swig_getmethods__["slotRefNum"] = _pisock.VFSSlotMountParam_slotRefNum_get if _newclass:slotRefNum = property(_pisock.VFSSlotMountParam_slotRefNum_get, _pisock.VFSSlotMountParam_slotRefNum_set) def __init__(self, *args): _swig_setattr(self, VFSSlotMountParam, 'this', _pisock.new_VFSSlotMountParam(*args)) _swig_setattr(self, VFSSlotMountParam, 'thisown', 1) def __del__(self, destroy=_pisock.delete_VFSSlotMountParam): try: if self.thisown: destroy(self) except: pass class VFSSlotMountParamPtr(VFSSlotMountParam): def __init__(self, this): _swig_setattr(self, VFSSlotMountParam, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, VFSSlotMountParam, 'thisown', 0) self.__class__ = VFSSlotMountParam _pisock.VFSSlotMountParam_swigregister(VFSSlotMountParamPtr) class VFSInfo(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, VFSInfo, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, VFSInfo, name) def __repr__(self): return "<%s.%s; proxy of C VFSInfo instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) __swig_setmethods__["attributes"] = _pisock.VFSInfo_attributes_set __swig_getmethods__["attributes"] = _pisock.VFSInfo_attributes_get if _newclass:attributes = property(_pisock.VFSInfo_attributes_get, _pisock.VFSInfo_attributes_set) __swig_setmethods__["fsType"] = _pisock.VFSInfo_fsType_set __swig_getmethods__["fsType"] = _pisock.VFSInfo_fsType_get if _newclass:fsType = property(_pisock.VFSInfo_fsType_get, _pisock.VFSInfo_fsType_set) __swig_setmethods__["fsCreator"] = _pisock.VFSInfo_fsCreator_set __swig_getmethods__["fsCreator"] = _pisock.VFSInfo_fsCreator_get if _newclass:fsCreator = property(_pisock.VFSInfo_fsCreator_get, _pisock.VFSInfo_fsCreator_set) __swig_setmethods__["mountClass"] = _pisock.VFSInfo_mountClass_set __swig_getmethods__["mountClass"] = _pisock.VFSInfo_mountClass_get if _newclass:mountClass = property(_pisock.VFSInfo_mountClass_get, _pisock.VFSInfo_mountClass_set) __swig_setmethods__["slotLibRefNum"] = _pisock.VFSInfo_slotLibRefNum_set __swig_getmethods__["slotLibRefNum"] = _pisock.VFSInfo_slotLibRefNum_get if _newclass:slotLibRefNum = property(_pisock.VFSInfo_slotLibRefNum_get, _pisock.VFSInfo_slotLibRefNum_set) __swig_setmethods__["slotRefNum"] = _pisock.VFSInfo_slotRefNum_set __swig_getmethods__["slotRefNum"] = _pisock.VFSInfo_slotRefNum_get if _newclass:slotRefNum = property(_pisock.VFSInfo_slotRefNum_get, _pisock.VFSInfo_slotRefNum_set) __swig_setmethods__["mediaType"] = _pisock.VFSInfo_mediaType_set __swig_getmethods__["mediaType"] = _pisock.VFSInfo_mediaType_get if _newclass:mediaType = property(_pisock.VFSInfo_mediaType_get, _pisock.VFSInfo_mediaType_set) __swig_setmethods__["reserved"] = _pisock.VFSInfo_reserved_set __swig_getmethods__["reserved"] = _pisock.VFSInfo_reserved_get if _newclass:reserved = property(_pisock.VFSInfo_reserved_get, _pisock.VFSInfo_reserved_set) def __init__(self, *args): _swig_setattr(self, VFSInfo, 'this', _pisock.new_VFSInfo(*args)) _swig_setattr(self, VFSInfo, 'thisown', 1) def __del__(self, destroy=_pisock.delete_VFSInfo): try: if self.thisown: destroy(self) except: pass class VFSInfoPtr(VFSInfo): def __init__(self, this): _swig_setattr(self, VFSInfo, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, VFSInfo, 'thisown', 0) self.__class__ = VFSInfo _pisock.VFSInfo_swigregister(VFSInfoPtr) class PilotUser(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, PilotUser, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, PilotUser, name) def __repr__(self): return "<%s.%s; proxy of C PilotUser instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) __swig_setmethods__["passwordLength"] = _pisock.PilotUser_passwordLength_set __swig_getmethods__["passwordLength"] = _pisock.PilotUser_passwordLength_get if _newclass:passwordLength = property(_pisock.PilotUser_passwordLength_get, _pisock.PilotUser_passwordLength_set) __swig_setmethods__["username"] = _pisock.PilotUser_username_set __swig_getmethods__["username"] = _pisock.PilotUser_username_get if _newclass:username = property(_pisock.PilotUser_username_get, _pisock.PilotUser_username_set) __swig_setmethods__["password"] = _pisock.PilotUser_password_set __swig_getmethods__["password"] = _pisock.PilotUser_password_get if _newclass:password = property(_pisock.PilotUser_password_get, _pisock.PilotUser_password_set) __swig_setmethods__["userID"] = _pisock.PilotUser_userID_set __swig_getmethods__["userID"] = _pisock.PilotUser_userID_get if _newclass:userID = property(_pisock.PilotUser_userID_get, _pisock.PilotUser_userID_set) __swig_setmethods__["viewerID"] = _pisock.PilotUser_viewerID_set __swig_getmethods__["viewerID"] = _pisock.PilotUser_viewerID_get if _newclass:viewerID = property(_pisock.PilotUser_viewerID_get, _pisock.PilotUser_viewerID_set) __swig_setmethods__["lastSyncPC"] = _pisock.PilotUser_lastSyncPC_set __swig_getmethods__["lastSyncPC"] = _pisock.PilotUser_lastSyncPC_get if _newclass:lastSyncPC = property(_pisock.PilotUser_lastSyncPC_get, _pisock.PilotUser_lastSyncPC_set) __swig_setmethods__["successfulSyncDate"] = _pisock.PilotUser_successfulSyncDate_set __swig_getmethods__["successfulSyncDate"] = _pisock.PilotUser_successfulSyncDate_get if _newclass:successfulSyncDate = property(_pisock.PilotUser_successfulSyncDate_get, _pisock.PilotUser_successfulSyncDate_set) __swig_setmethods__["lastSyncDate"] = _pisock.PilotUser_lastSyncDate_set __swig_getmethods__["lastSyncDate"] = _pisock.PilotUser_lastSyncDate_get if _newclass:lastSyncDate = property(_pisock.PilotUser_lastSyncDate_get, _pisock.PilotUser_lastSyncDate_set) def __init__(self, *args): _swig_setattr(self, PilotUser, 'this', _pisock.new_PilotUser(*args)) _swig_setattr(self, PilotUser, 'thisown', 1) def __del__(self, destroy=_pisock.delete_PilotUser): try: if self.thisown: destroy(self) except: pass class PilotUserPtr(PilotUser): def __init__(self, this): _swig_setattr(self, PilotUser, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, PilotUser, 'thisown', 0) self.__class__ = PilotUser _pisock.PilotUser_swigregister(PilotUserPtr) class SysInfo(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, SysInfo, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, SysInfo, name) def __repr__(self): return "<%s.%s; proxy of C SysInfo instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) __swig_setmethods__["romVersion"] = _pisock.SysInfo_romVersion_set __swig_getmethods__["romVersion"] = _pisock.SysInfo_romVersion_get if _newclass:romVersion = property(_pisock.SysInfo_romVersion_get, _pisock.SysInfo_romVersion_set) __swig_setmethods__["locale"] = _pisock.SysInfo_locale_set __swig_getmethods__["locale"] = _pisock.SysInfo_locale_get if _newclass:locale = property(_pisock.SysInfo_locale_get, _pisock.SysInfo_locale_set) __swig_setmethods__["prodIDLength"] = _pisock.SysInfo_prodIDLength_set __swig_getmethods__["prodIDLength"] = _pisock.SysInfo_prodIDLength_get if _newclass:prodIDLength = property(_pisock.SysInfo_prodIDLength_get, _pisock.SysInfo_prodIDLength_set) __swig_setmethods__["prodID"] = _pisock.SysInfo_prodID_set __swig_getmethods__["prodID"] = _pisock.SysInfo_prodID_get if _newclass:prodID = property(_pisock.SysInfo_prodID_get, _pisock.SysInfo_prodID_set) __swig_setmethods__["dlpMajorVersion"] = _pisock.SysInfo_dlpMajorVersion_set __swig_getmethods__["dlpMajorVersion"] = _pisock.SysInfo_dlpMajorVersion_get if _newclass:dlpMajorVersion = property(_pisock.SysInfo_dlpMajorVersion_get, _pisock.SysInfo_dlpMajorVersion_set) __swig_setmethods__["dlpMinorVersion"] = _pisock.SysInfo_dlpMinorVersion_set __swig_getmethods__["dlpMinorVersion"] = _pisock.SysInfo_dlpMinorVersion_get if _newclass:dlpMinorVersion = property(_pisock.SysInfo_dlpMinorVersion_get, _pisock.SysInfo_dlpMinorVersion_set) __swig_setmethods__["compatMajorVersion"] = _pisock.SysInfo_compatMajorVersion_set __swig_getmethods__["compatMajorVersion"] = _pisock.SysInfo_compatMajorVersion_get if _newclass:compatMajorVersion = property(_pisock.SysInfo_compatMajorVersion_get, _pisock.SysInfo_compatMajorVersion_set) __swig_setmethods__["compatMinorVersion"] = _pisock.SysInfo_compatMinorVersion_set __swig_getmethods__["compatMinorVersion"] = _pisock.SysInfo_compatMinorVersion_get if _newclass:compatMinorVersion = property(_pisock.SysInfo_compatMinorVersion_get, _pisock.SysInfo_compatMinorVersion_set) __swig_setmethods__["maxRecSize"] = _pisock.SysInfo_maxRecSize_set __swig_getmethods__["maxRecSize"] = _pisock.SysInfo_maxRecSize_get if _newclass:maxRecSize = property(_pisock.SysInfo_maxRecSize_get, _pisock.SysInfo_maxRecSize_set) def __init__(self, *args): _swig_setattr(self, SysInfo, 'this', _pisock.new_SysInfo(*args)) _swig_setattr(self, SysInfo, 'thisown', 1) def __del__(self, destroy=_pisock.delete_SysInfo): try: if self.thisown: destroy(self) except: pass class SysInfoPtr(SysInfo): def __init__(self, this): _swig_setattr(self, SysInfo, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, SysInfo, 'thisown', 0) self.__class__ = SysInfo _pisock.SysInfo_swigregister(SysInfoPtr) class DBInfo(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, DBInfo, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, DBInfo, name) def __repr__(self): return "<%s.%s; proxy of C DBInfo instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) __swig_setmethods__["more"] = _pisock.DBInfo_more_set __swig_getmethods__["more"] = _pisock.DBInfo_more_get if _newclass:more = property(_pisock.DBInfo_more_get, _pisock.DBInfo_more_set) __swig_setmethods__["name"] = _pisock.DBInfo_name_set __swig_getmethods__["name"] = _pisock.DBInfo_name_get if _newclass:name = property(_pisock.DBInfo_name_get, _pisock.DBInfo_name_set) __swig_setmethods__["flags"] = _pisock.DBInfo_flags_set __swig_getmethods__["flags"] = _pisock.DBInfo_flags_get if _newclass:flags = property(_pisock.DBInfo_flags_get, _pisock.DBInfo_flags_set) __swig_setmethods__["miscFlags"] = _pisock.DBInfo_miscFlags_set __swig_getmethods__["miscFlags"] = _pisock.DBInfo_miscFlags_get if _newclass:miscFlags = property(_pisock.DBInfo_miscFlags_get, _pisock.DBInfo_miscFlags_set) __swig_setmethods__["version"] = _pisock.DBInfo_version_set __swig_getmethods__["version"] = _pisock.DBInfo_version_get if _newclass:version = property(_pisock.DBInfo_version_get, _pisock.DBInfo_version_set) __swig_setmethods__["type"] = _pisock.DBInfo_type_set __swig_getmethods__["type"] = _pisock.DBInfo_type_get if _newclass:type = property(_pisock.DBInfo_type_get, _pisock.DBInfo_type_set) __swig_setmethods__["creator"] = _pisock.DBInfo_creator_set __swig_getmethods__["creator"] = _pisock.DBInfo_creator_get if _newclass:creator = property(_pisock.DBInfo_creator_get, _pisock.DBInfo_creator_set) __swig_setmethods__["modnum"] = _pisock.DBInfo_modnum_set __swig_getmethods__["modnum"] = _pisock.DBInfo_modnum_get if _newclass:modnum = property(_pisock.DBInfo_modnum_get, _pisock.DBInfo_modnum_set) __swig_setmethods__["index"] = _pisock.DBInfo_index_set __swig_getmethods__["index"] = _pisock.DBInfo_index_get if _newclass:index = property(_pisock.DBInfo_index_get, _pisock.DBInfo_index_set) __swig_setmethods__["createDate"] = _pisock.DBInfo_createDate_set __swig_getmethods__["createDate"] = _pisock.DBInfo_createDate_get if _newclass:createDate = property(_pisock.DBInfo_createDate_get, _pisock.DBInfo_createDate_set) __swig_setmethods__["modifyDate"] = _pisock.DBInfo_modifyDate_set __swig_getmethods__["modifyDate"] = _pisock.DBInfo_modifyDate_get if _newclass:modifyDate = property(_pisock.DBInfo_modifyDate_get, _pisock.DBInfo_modifyDate_set) __swig_setmethods__["backupDate"] = _pisock.DBInfo_backupDate_set __swig_getmethods__["backupDate"] = _pisock.DBInfo_backupDate_get if _newclass:backupDate = property(_pisock.DBInfo_backupDate_get, _pisock.DBInfo_backupDate_set) def __init__(self, *args): _swig_setattr(self, DBInfo, 'this', _pisock.new_DBInfo(*args)) _swig_setattr(self, DBInfo, 'thisown', 1) def __del__(self, destroy=_pisock.delete_DBInfo): try: if self.thisown: destroy(self) except: pass class DBInfoPtr(DBInfo): def __init__(self, this): _swig_setattr(self, DBInfo, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, DBInfo, 'thisown', 0) self.__class__ = DBInfo _pisock.DBInfo_swigregister(DBInfoPtr) class DBSizeInfo(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, DBSizeInfo, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, DBSizeInfo, name) def __repr__(self): return "<%s.%s; proxy of C DBSizeInfo instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) __swig_setmethods__["numRecords"] = _pisock.DBSizeInfo_numRecords_set __swig_getmethods__["numRecords"] = _pisock.DBSizeInfo_numRecords_get if _newclass:numRecords = property(_pisock.DBSizeInfo_numRecords_get, _pisock.DBSizeInfo_numRecords_set) __swig_setmethods__["totalBytes"] = _pisock.DBSizeInfo_totalBytes_set __swig_getmethods__["totalBytes"] = _pisock.DBSizeInfo_totalBytes_get if _newclass:totalBytes = property(_pisock.DBSizeInfo_totalBytes_get, _pisock.DBSizeInfo_totalBytes_set) __swig_setmethods__["dataBytes"] = _pisock.DBSizeInfo_dataBytes_set __swig_getmethods__["dataBytes"] = _pisock.DBSizeInfo_dataBytes_get if _newclass:dataBytes = property(_pisock.DBSizeInfo_dataBytes_get, _pisock.DBSizeInfo_dataBytes_set) __swig_setmethods__["appBlockSize"] = _pisock.DBSizeInfo_appBlockSize_set __swig_getmethods__["appBlockSize"] = _pisock.DBSizeInfo_appBlockSize_get if _newclass:appBlockSize = property(_pisock.DBSizeInfo_appBlockSize_get, _pisock.DBSizeInfo_appBlockSize_set) __swig_setmethods__["sortBlockSize"] = _pisock.DBSizeInfo_sortBlockSize_set __swig_getmethods__["sortBlockSize"] = _pisock.DBSizeInfo_sortBlockSize_get if _newclass:sortBlockSize = property(_pisock.DBSizeInfo_sortBlockSize_get, _pisock.DBSizeInfo_sortBlockSize_set) __swig_setmethods__["maxRecSize"] = _pisock.DBSizeInfo_maxRecSize_set __swig_getmethods__["maxRecSize"] = _pisock.DBSizeInfo_maxRecSize_get if _newclass:maxRecSize = property(_pisock.DBSizeInfo_maxRecSize_get, _pisock.DBSizeInfo_maxRecSize_set) def __init__(self, *args): _swig_setattr(self, DBSizeInfo, 'this', _pisock.new_DBSizeInfo(*args)) _swig_setattr(self, DBSizeInfo, 'thisown', 1) def __del__(self, destroy=_pisock.delete_DBSizeInfo): try: if self.thisown: destroy(self) except: pass class DBSizeInfoPtr(DBSizeInfo): def __init__(self, this): _swig_setattr(self, DBSizeInfo, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, DBSizeInfo, 'thisown', 0) self.__class__ = DBSizeInfo _pisock.DBSizeInfo_swigregister(DBSizeInfoPtr) class CardInfo(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, CardInfo, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, CardInfo, name) def __repr__(self): return "<%s.%s; proxy of C CardInfo instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) __swig_setmethods__["card"] = _pisock.CardInfo_card_set __swig_getmethods__["card"] = _pisock.CardInfo_card_get if _newclass:card = property(_pisock.CardInfo_card_get, _pisock.CardInfo_card_set) __swig_setmethods__["version"] = _pisock.CardInfo_version_set __swig_getmethods__["version"] = _pisock.CardInfo_version_get if _newclass:version = property(_pisock.CardInfo_version_get, _pisock.CardInfo_version_set) __swig_setmethods__["more"] = _pisock.CardInfo_more_set __swig_getmethods__["more"] = _pisock.CardInfo_more_get if _newclass:more = property(_pisock.CardInfo_more_get, _pisock.CardInfo_more_set) __swig_setmethods__["creation"] = _pisock.CardInfo_creation_set __swig_getmethods__["creation"] = _pisock.CardInfo_creation_get if _newclass:creation = property(_pisock.CardInfo_creation_get, _pisock.CardInfo_creation_set) __swig_setmethods__["romSize"] = _pisock.CardInfo_romSize_set __swig_getmethods__["romSize"] = _pisock.CardInfo_romSize_get if _newclass:romSize = property(_pisock.CardInfo_romSize_get, _pisock.CardInfo_romSize_set) __swig_setmethods__["ramSize"] = _pisock.CardInfo_ramSize_set __swig_getmethods__["ramSize"] = _pisock.CardInfo_ramSize_get if _newclass:ramSize = property(_pisock.CardInfo_ramSize_get, _pisock.CardInfo_ramSize_set) __swig_setmethods__["ramFree"] = _pisock.CardInfo_ramFree_set __swig_getmethods__["ramFree"] = _pisock.CardInfo_ramFree_get if _newclass:ramFree = property(_pisock.CardInfo_ramFree_get, _pisock.CardInfo_ramFree_set) __swig_setmethods__["name"] = _pisock.CardInfo_name_set __swig_getmethods__["name"] = _pisock.CardInfo_name_get if _newclass:name = property(_pisock.CardInfo_name_get, _pisock.CardInfo_name_set) __swig_setmethods__["manufacturer"] = _pisock.CardInfo_manufacturer_set __swig_getmethods__["manufacturer"] = _pisock.CardInfo_manufacturer_get if _newclass:manufacturer = property(_pisock.CardInfo_manufacturer_get, _pisock.CardInfo_manufacturer_set) def __init__(self, *args): _swig_setattr(self, CardInfo, 'this', _pisock.new_CardInfo(*args)) _swig_setattr(self, CardInfo, 'thisown', 1) def __del__(self, destroy=_pisock.delete_CardInfo): try: if self.thisown: destroy(self) except: pass class CardInfoPtr(CardInfo): def __init__(self, this): _swig_setattr(self, CardInfo, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, CardInfo, 'thisown', 0) self.__class__ = CardInfo _pisock.CardInfo_swigregister(CardInfoPtr) class NetSyncInfo(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, NetSyncInfo, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, NetSyncInfo, name) def __repr__(self): return "<%s.%s; proxy of C NetSyncInfo instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) __swig_setmethods__["lanSync"] = _pisock.NetSyncInfo_lanSync_set __swig_getmethods__["lanSync"] = _pisock.NetSyncInfo_lanSync_get if _newclass:lanSync = property(_pisock.NetSyncInfo_lanSync_get, _pisock.NetSyncInfo_lanSync_set) __swig_setmethods__["hostName"] = _pisock.NetSyncInfo_hostName_set __swig_getmethods__["hostName"] = _pisock.NetSyncInfo_hostName_get if _newclass:hostName = property(_pisock.NetSyncInfo_hostName_get, _pisock.NetSyncInfo_hostName_set) __swig_setmethods__["hostAddress"] = _pisock.NetSyncInfo_hostAddress_set __swig_getmethods__["hostAddress"] = _pisock.NetSyncInfo_hostAddress_get if _newclass:hostAddress = property(_pisock.NetSyncInfo_hostAddress_get, _pisock.NetSyncInfo_hostAddress_set) __swig_setmethods__["hostSubnetMask"] = _pisock.NetSyncInfo_hostSubnetMask_set __swig_getmethods__["hostSubnetMask"] = _pisock.NetSyncInfo_hostSubnetMask_get if _newclass:hostSubnetMask = property(_pisock.NetSyncInfo_hostSubnetMask_get, _pisock.NetSyncInfo_hostSubnetMask_set) def __init__(self, *args): _swig_setattr(self, NetSyncInfo, 'this', _pisock.new_NetSyncInfo(*args)) _swig_setattr(self, NetSyncInfo, 'thisown', 1) def __del__(self, destroy=_pisock.delete_NetSyncInfo): try: if self.thisown: destroy(self) except: pass class NetSyncInfoPtr(NetSyncInfo): def __init__(self, this): _swig_setattr(self, NetSyncInfo, 'this', this) if not hasattr(self,"thisown"): _swig_setattr(self, NetSyncInfo, 'thisown', 0) self.__class__ = NetSyncInfo _pisock.NetSyncInfo_swigregister(NetSyncInfoPtr) dlpDBFlagResource = _pisock.dlpDBFlagResource dlpDBFlagReadOnly = _pisock.dlpDBFlagReadOnly dlpDBFlagAppInfoDirty = _pisock.dlpDBFlagAppInfoDirty dlpDBFlagBackup = _pisock.dlpDBFlagBackup dlpDBFlagHidden = _pisock.dlpDBFlagHidden dlpDBFlagLaunchable = _pisock.dlpDBFlagLaunchable dlpDBFlagRecyclable = _pisock.dlpDBFlagRecyclable dlpDBFlagBundle = _pisock.dlpDBFlagBundle dlpDBFlagOpen = _pisock.dlpDBFlagOpen dlpDBFlagNewer = _pisock.dlpDBFlagNewer dlpDBFlagReset = _pisock.dlpDBFlagReset dlpDBFlagCopyPrevention = _pisock.dlpDBFlagCopyPrevention dlpDBFlagStream = _pisock.dlpDBFlagStream dlpDBFlagSchema = _pisock.dlpDBFlagSchema dlpDBFlagSecure = _pisock.dlpDBFlagSecure dlpDBFlagExtended = _pisock.dlpDBFlagExtended dlpDBFlagFixedUp = _pisock.dlpDBFlagFixedUp dlpDBMiscFlagExcludeFromSync = _pisock.dlpDBMiscFlagExcludeFromSync dlpDBMiscFlagRamBased = _pisock.dlpDBMiscFlagRamBased dlpRecAttrDeleted = _pisock.dlpRecAttrDeleted dlpRecAttrDirty = _pisock.dlpRecAttrDirty dlpRecAttrBusy = _pisock.dlpRecAttrBusy dlpRecAttrSecret = _pisock.dlpRecAttrSecret dlpRecAttrArchived = _pisock.dlpRecAttrArchived dlpOpenRead = _pisock.dlpOpenRead dlpOpenWrite = _pisock.dlpOpenWrite dlpOpenExclusive = _pisock.dlpOpenExclusive dlpOpenSecret = _pisock.dlpOpenSecret dlpOpenReadWrite = _pisock.dlpOpenReadWrite dlpDBListRAM = _pisock.dlpDBListRAM dlpDBListROM = _pisock.dlpDBListROM dlpDBListMultiple = _pisock.dlpDBListMultiple dlpFindDBOptFlagGetAttributes = _pisock.dlpFindDBOptFlagGetAttributes dlpFindDBOptFlagGetSize = _pisock.dlpFindDBOptFlagGetSize dlpFindDBOptFlagMaxRecSize = _pisock.dlpFindDBOptFlagMaxRecSize dlpFindDBSrchFlagNewSearch = _pisock.dlpFindDBSrchFlagNewSearch dlpFindDBSrchFlagOnlyLatest = _pisock.dlpFindDBSrchFlagOnlyLatest dlpEndCodeNormal = _pisock.dlpEndCodeNormal dlpEndCodeOutOfMemory = _pisock.dlpEndCodeOutOfMemory dlpEndCodeUserCan = _pisock.dlpEndCodeUserCan dlpEndCodeOther = _pisock.dlpEndCodeOther dlpExpCapabilityHasStorage = _pisock.dlpExpCapabilityHasStorage dlpExpCapabilityReadOnly = _pisock.dlpExpCapabilityReadOnly dlpExpCapabilitySerial = _pisock.dlpExpCapabilitySerial vfsVolAttrSlotBased = _pisock.vfsVolAttrSlotBased vfsVolAttrReadOnly = _pisock.vfsVolAttrReadOnly vfsVolAttrHidden = _pisock.vfsVolAttrHidden vfsOriginBeginning = _pisock.vfsOriginBeginning vfsOriginCurrent = _pisock.vfsOriginCurrent vfsOriginEnd = _pisock.vfsOriginEnd dlpVFSOpenExclusive = _pisock.dlpVFSOpenExclusive dlpVFSOpenRead = _pisock.dlpVFSOpenRead dlpVFSOpenWrite = _pisock.dlpVFSOpenWrite dlpVFSOpenReadWrite = _pisock.dlpVFSOpenReadWrite vfsModeExclusive = _pisock.vfsModeExclusive vfsModeRead = _pisock.vfsModeRead vfsModeWrite = _pisock.vfsModeWrite vfsModeReadWrite = _pisock.vfsModeReadWrite vfsModeCreate = _pisock.vfsModeCreate vfsModeTruncate = _pisock.vfsModeTruncate vfsModeLeaveOpen = _pisock.vfsModeLeaveOpen vfsFileAttrReadOnly = _pisock.vfsFileAttrReadOnly vfsFileAttrHidden = _pisock.vfsFileAttrHidden vfsFileAttrSystem = _pisock.vfsFileAttrSystem vfsFileAttrVolumeLabel = _pisock.vfsFileAttrVolumeLabel vfsFileAttrDirectory = _pisock.vfsFileAttrDirectory vfsFileAttrArchive = _pisock.vfsFileAttrArchive vfsFileAttrLink = _pisock.vfsFileAttrLink vfsFileDateCreated = _pisock.vfsFileDateCreated vfsFileDateModified = _pisock.vfsFileDateModified vfsFileDateAccessed = _pisock.vfsFileDateAccessed vfsIteratorStart = _pisock.vfsIteratorStart vfsIteratorStop = _pisock.vfsIteratorStop dlpErrNoError = _pisock.dlpErrNoError dlpErrSystem = _pisock.dlpErrSystem dlpErrIllegalReq = _pisock.dlpErrIllegalReq dlpErrMemory = _pisock.dlpErrMemory dlpErrParam = _pisock.dlpErrParam dlpErrNotFound = _pisock.dlpErrNotFound dlpErrNoneOpen = _pisock.dlpErrNoneOpen dlpErrAlreadyOpen = _pisock.dlpErrAlreadyOpen dlpErrTooManyOpen = _pisock.dlpErrTooManyOpen dlpErrExists = _pisock.dlpErrExists dlpErrOpen = _pisock.dlpErrOpen dlpErrDeleted = _pisock.dlpErrDeleted dlpErrBusy = _pisock.dlpErrBusy dlpErrNotSupp = _pisock.dlpErrNotSupp dlpErrUnused1 = _pisock.dlpErrUnused1 dlpErrReadOnly = _pisock.dlpErrReadOnly dlpErrSpace = _pisock.dlpErrSpace dlpErrLimit = _pisock.dlpErrLimit dlpErrSync = _pisock.dlpErrSync dlpErrWrapper = _pisock.dlpErrWrapper dlpErrArgument = _pisock.dlpErrArgument dlpErrSize = _pisock.dlpErrSize dlpErrUnknown = _pisock.dlpErrUnknown dlp_set_protocol_version = _pisock.dlp_set_protocol_version dlp_ptohdate = _pisock.dlp_ptohdate dlp_htopdate = _pisock.dlp_htopdate dlp_GetSysDateTime_ = _pisock.dlp_GetSysDateTime_ dlp_SetSysDateTime = _pisock.dlp_SetSysDateTime dlp_ReadSysInfo = _pisock.dlp_ReadSysInfo dlp_ReadStorageInfo = _pisock.dlp_ReadStorageInfo dlp_ReadUserInfo = _pisock.dlp_ReadUserInfo dlp_WriteUserInfo = _pisock.dlp_WriteUserInfo dlp_ResetLastSyncPC = _pisock.dlp_ResetLastSyncPC dlp_ReadNetSyncInfo = _pisock.dlp_ReadNetSyncInfo dlp_WriteNetSyncInfo = _pisock.dlp_WriteNetSyncInfo dlp_OpenConduit = _pisock.dlp_OpenConduit dlp_EndOfSync = _pisock.dlp_EndOfSync dlp_AbortSync = _pisock.dlp_AbortSync dlp_ReadFeature = _pisock.dlp_ReadFeature dlp_GetROMToken = _pisock.dlp_GetROMToken dlp_AddSyncLogEntry = _pisock.dlp_AddSyncLogEntry dlp_CallApplication = _pisock.dlp_CallApplication dlp_ReadAppPreference = _pisock.dlp_ReadAppPreference dlp_WriteAppPreference = _pisock.dlp_WriteAppPreference dlp_ResetSystem = _pisock.dlp_ResetSystem dlp_ReadDBList_ = _pisock.dlp_ReadDBList_ dlp_FindDBByName = _pisock.dlp_FindDBByName dlp_FindDBByOpenHandle = _pisock.dlp_FindDBByOpenHandle dlp_FindDBByTypeCreator = _pisock.dlp_FindDBByTypeCreator dlp_FindDBInfo = _pisock.dlp_FindDBInfo dlp_OpenDB = _pisock.dlp_OpenDB dlp_CloseDB = _pisock.dlp_CloseDB dlp_CloseDB_All = _pisock.dlp_CloseDB_All dlp_DeleteDB = _pisock.dlp_DeleteDB dlp_CreateDB = _pisock.dlp_CreateDB dlp_ReadOpenDBInfo = _pisock.dlp_ReadOpenDBInfo dlp_SetDBInfo = _pisock.dlp_SetDBInfo dlp_DeleteCategory = _pisock.dlp_DeleteCategory dlp_MoveCategory = _pisock.dlp_MoveCategory dlp_ReadAppBlock = _pisock.dlp_ReadAppBlock dlp_WriteAppBlock = _pisock.dlp_WriteAppBlock dlp_ReadSortBlock = _pisock.dlp_ReadSortBlock dlp_WriteSortBlock = _pisock.dlp_WriteSortBlock dlp_CleanUpDatabase = _pisock.dlp_CleanUpDatabase dlp_ResetSyncFlags = _pisock.dlp_ResetSyncFlags dlp_ResetDBIndex = _pisock.dlp_ResetDBIndex dlp_ReadRecordById = _pisock.dlp_ReadRecordById dlp_ReadRecordByIndex = _pisock.dlp_ReadRecordByIndex dlp_ReadNextModifiedRec = _pisock.dlp_ReadNextModifiedRec dlp_ReadNextModifiedRecInCategory = _pisock.dlp_ReadNextModifiedRecInCategory dlp_ReadNextRecInCategory = _pisock.dlp_ReadNextRecInCategory dlp_WriteRecord = _pisock.dlp_WriteRecord dlp_DeleteRecord = _pisock.dlp_DeleteRecord dlp_ReadResourceByType = _pisock.dlp_ReadResourceByType dlp_ReadResourceByIndex = _pisock.dlp_ReadResourceByIndex dlp_WriteResource = _pisock.dlp_WriteResource dlp_DeleteResource = _pisock.dlp_DeleteResource dlp_ExpSlotEnumerate = _pisock.dlp_ExpSlotEnumerate dlp_ExpCardPresent = _pisock.dlp_ExpCardPresent dlp_ExpCardInfo = _pisock.dlp_ExpCardInfo dlp_ExpSlotMediaType = _pisock.dlp_ExpSlotMediaType dlp_VFSVolumeEnumerate = _pisock.dlp_VFSVolumeEnumerate dlp_VFSVolumeInfo = _pisock.dlp_VFSVolumeInfo dlp_VFSVolumeGetLabel = _pisock.dlp_VFSVolumeGetLabel dlp_VFSVolumeSetLabel = _pisock.dlp_VFSVolumeSetLabel dlp_VFSVolumeSize = _pisock.dlp_VFSVolumeSize dlp_VFSVolumeFormat = _pisock.dlp_VFSVolumeFormat dlp_VFSGetDefaultDir = _pisock.dlp_VFSGetDefaultDir dlp_VFSDirEntryEnumerate = _pisock.dlp_VFSDirEntryEnumerate dlp_VFSDirCreate = _pisock.dlp_VFSDirCreate dlp_VFSImportDatabaseFromFile = _pisock.dlp_VFSImportDatabaseFromFile dlp_VFSExportDatabaseToFile = _pisock.dlp_VFSExportDatabaseToFile dlp_VFSFileCreate = _pisock.dlp_VFSFileCreate dlp_VFSFileOpen = _pisock.dlp_VFSFileOpen dlp_VFSFileClose = _pisock.dlp_VFSFileClose dlp_VFSFileWrite = _pisock.dlp_VFSFileWrite dlp_VFSFileRead = _pisock.dlp_VFSFileRead dlp_VFSFileDelete = _pisock.dlp_VFSFileDelete dlp_VFSFileRename = _pisock.dlp_VFSFileRename dlp_VFSFileEOF = _pisock.dlp_VFSFileEOF dlp_VFSFileTell = _pisock.dlp_VFSFileTell dlp_VFSFileGetAttributes = _pisock.dlp_VFSFileGetAttributes dlp_VFSFileSetAttributes = _pisock.dlp_VFSFileSetAttributes dlp_VFSFileGetDate = _pisock.dlp_VFSFileGetDate dlp_VFSFileSetDate = _pisock.dlp_VFSFileSetDate dlp_VFSFileSeek = _pisock.dlp_VFSFileSeek dlp_VFSFileResize = _pisock.dlp_VFSFileResize dlp_VFSFileSize = _pisock.dlp_VFSFileSize pilot-link-0.12.5-dfsg/bindings/Python/TODO0000644000175000017500000000075210230770527020655 0ustar rousseaurousseau TODO for python-libpisock: - clean up prc.py from Pyrite/Publisher/palmdb-xml and include it - shadow class for pi_file - shadow class for DLP connection - shadow class for DLP database - wrap the pi-sync functions - wrap the netsync related functions - do something about pack/unpack of fundamental data types (maybe use Python code from Pyrite; consider a simple API which will allow adding other packer/unpackers more easily later) - examples - documentation pilot-link-0.12.5-dfsg/bindings/Python/setup-standalone.py0000644000175000017500000000357611333433255024033 0ustar rousseaurousseau#!/usr/bin/python # # Copyright (c) 2005, Florent Pillet. # # This library 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 of the License, or (at # your option) any later version. # # This 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 Library # General Public License for more details. # # You should have received a copy of the GNU Library General Public License # along with this library; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # $Id: setup-standalone.py.in,v 1.4 2006/05/31 17:59:55 desrod Exp $ from distutils.core import setup, Extension import sys if sys.platform.startswith('darwin'): # additional link options for Mac OS X link_options = ['-framework','Carbon','-framework','System','-framework','IOKit'] else: # TODO: test on other platforms and add options as appropriate link_options = None setup(name = "python-libpisock", version = "0.12.5", description = "Python bindings for the pisock library linked in a standalone module (not requiring the libpisock shared lib).", author = "Florent Pillet", author_email = "pilot-link@florentpillet.com", url = "http://www.pilot-link.org/", ext_modules = [Extension("_pisock", ["src/pisock_wrap.c"], include_dirs = ['../../include'], extra_objects = ['../../libpisock/.libs/libpisock.a'], extra_link_args = link_options ) ], package_dir = {'': 'src'}, py_modules = ["pisock","pisockextras"]) pilot-link-0.12.5-dfsg/bindings/Python/.cvsignore0000644000175000017500000000004311206407417022155 0ustar rousseaurousseaubuild setup.py setup-standalone.py pilot-link-0.12.5-dfsg/bindings/Python/setup.py0000644000175000017500000000276311333433255021702 0ustar rousseaurousseau#!/usr/bin/python # # Copyright (c) 2004-2005, Nick Piper. # # This library 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 of the License, or (at # your option) any later version. # # This 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 Library # General Public License for more details. # # You should have received a copy of the GNU Library General Public License # along with this library; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # $Id: setup.py.in,v 1.7 2006/05/31 17:59:55 desrod Exp $ from distutils.core import setup, Extension setup(name = "python-libpisock", version = "0.12.5", description = "Python bindings for the pisock library.", author = "Nick Piper", author_email = "nick@nickpiper.co.uk", url = "http://www.pilot-link.org/", ext_modules = [Extension("_pisock",["src/pisock_wrap.c"], include_dirs=['../../include'], library_dirs=['../../libpisock/.libs'], libraries=['pisock'], ) ], package_dir = {'': 'src'}, py_modules = ["pisock","pisockextras"]) pilot-link-0.12.5-dfsg/bindings/Python/README0000644000175000017500000000511410465410413021035 0ustar rousseaurousseauPython bindings for libpisock (the pilot-link core) ------------------------------------------------------------------------ The C code for the interface is generated using SWIG, but SWIG is not required for building/installing it. To regenerate the wrapper from the SWIG source, do this: cd ./src swig -python pisock.i There is currently no documentation; that should be fixed "soon". To see real use examples, look at the test/pisocktests.py file * INSTALLATION This package uses the standard Python "distutils" for installation. If you are running a version of Python >= 2.0 you have these already; for Python 1.5.2 you can download a distutils package from python.org. If you want to build it for a Python version older than 1.5.2, you are on your own; it probably won't work anyway. To compile the package, run the command python setup.py build You may safely ignore any warnings from the compiler. To install the package, run the command python setup.py install It will place a module called 'pisock.so' in Python's site-packages directory. To use the module, simply 'import pisock'. * STANDALONE VERSION You can also build a standalone version that doesn't require the libpisock shared library to be installed on the system. This is particularly useful if you need to build a packaged application that doesn't depend on additional installs. To build the standalone verison, run the command python setup-standalone.py build Then copy the files from the build/libxxx/ folder to your Python package * MULTIPLE PYTHON INSTALLS Note: If you have more than one version of Python installed, replace 'python' in the above commands with the name of the interpreter you want to use for building and installation. (For example, 'python2' for Python 2.x on some Linux distributions.) If you want to build/install for multiple versions of Python, just repeat the above steps for each one. * LICENSE This library 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 of the License, or (at your option) any later version. This 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. pilot-link-0.12.5-dfsg/bindings/Python/setup.py.in0000644000175000017500000000304410465410413022274 0ustar rousseaurousseau#!/usr/bin/python # # Copyright (c) 2004-2005, Nick Piper. # # This library 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 of the License, or (at # your option) any later version. # # This 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 Library # General Public License for more details. # # You should have received a copy of the GNU Library General Public License # along with this library; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # $Id: setup.py.in,v 1.7 2006/05/31 17:59:55 desrod Exp $ from distutils.core import setup, Extension setup(name = "python-libpisock", version = "@PILOT_LINK_VERS@.@PILOT_LINK_MAJOR@.@PILOT_LINK_MINOR@", description = "Python bindings for the pisock library.", author = "Nick Piper", author_email = "nick@nickpiper.co.uk", url = "http://www.pilot-link.org/", ext_modules = [Extension("_pisock",["src/pisock_wrap.c"], include_dirs=['../../include'], library_dirs=['../../libpisock/.libs'], libraries=['pisock'], ) ], package_dir = {'': 'src'}, py_modules = ["pisock","pisockextras"]) pilot-link-0.12.5-dfsg/bindings/Python/test/0000755000175000017500000000000011333433324021134 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/bindings/Python/test/run.sh0000755000175000017500000000023510205661545022304 0ustar rousseaurousseau#!/bin/sh #LD_LIBRARY_PATH=../../../libpisock/.libs gdb --args python pisocktests.py $* LD_LIBRARY_PATH=../../../libpisock/.libs python pisocktests.py $* pilot-link-0.12.5-dfsg/bindings/Python/test/pisocktests.py0000644000175000017500000001466210236135315024072 0ustar rousseaurousseauimport unittest import sys,glob,os from optparse import OptionParser builds = glob.glob("../build/lib*") if len(builds) != 1: print "This little hack only works when you've got one build compiled." print "python setup.py clean; python setup.py build" print "and try again." os.exit(10) sys.path.insert(0,os.path.join(os.path.abspath("."),builds[0])) import pisock def dumpDBInfo(dbi): print '\tDatabase info:' print '\t\tname:',dbi['name'] print '\t\ttype:',dbi['type'] print '\t\tcreator:',dbi['creator'] print '\t\tversion:',dbi['version'] print '\t\tflags: 0x%08lx' % (dbi['flags']) print '\t\tmiscFlags: 0x%08lx' % (dbi['miscFlags']) print '\t\tmod. count:',dbi['modnum'] print '\t\tcreated:',dbi['createDate'] print '\t\tmodified',dbi['modifyDate'] print '\t\tbackup:',dbi['backupDate'] def dumpDBSizeInfo(si): print '\tDBSizeInfo:' print '\t\tnumRecords:',si['numRecords'] print '\t\ttotalBytes:',si['totalBytes'] print '\t\tdataBytes:',si['dataBytes'] print '\t\tappBlockSize:',si['appBlockSize'] print '\t\tsortBlockSize:',si['sortBlockSize'] print '\t\tmaxRecSize:',si['maxRecSize'] class OnlineTestCase(unittest.TestCase): def setUp(self): try: pisock.dlp_DeleteDB(sd,0,'PythonTestSuite') except: pass def tearDown(self): pass def testGetSysDateTime(self): res = pisock.dlp_GetSysDateTime(sd) if VERBOSE: print 'GetSysDateTime:',res def testAddSyncLogEntry(self): pisock.dlp_AddSyncLogEntry(sd, "Python test.") def testReadSysInfo(self): res = pisock.dlp_ReadSysInfo(sd) assert res!=None and res.has_key('romVersion') if VERBOSE: print 'ReadSysInfo: romVersion=%s locale=%s name=%s' % ( hex(res['romVersion']), hex(res['locale']), res['name']) def testReadStorageInfo(self): res = pisock.dlp_ReadStorageInfo(sd,0) assert res.has_key('manufacturer') if VERBOSE: print 'ReadStorageInfo: card 0, romSize=%s ramSize=%s ramFree=%s manufacturer=%s' % ( res['romSize'], res['ramSize'], res['ramFree'], res['manufacturer']) def testReadUserInfo(self): res = pisock.dlp_ReadUserInfo(sd) assert res!=None and res.has_key('name') if VERBOSE: print 'ReadUserInfo: username=%s' % res['name'] def testReadNetSyncInfo(self): res = pisock.dlp_ReadNetSyncInfo(sd) assert res!=None and res.has_key('hostName') if VERBOSE: print "ReadNetSyncInfo: lanSync=%d hostname='%s' hostaddress='%s' subnetmask='%s'" % ( res['lanSync'], res['hostName'], res['hostAddress'], res['hostSubnetMask']) def testReadFeature(self): res = pisock.dlp_ReadFeature(sd,'psys',2) assert res!=None if VERBOSE: print "ReadFeature: processor type=%s" % hex(res) def testReadStorageInfo(self): more = 1 i = 0 while more: res = pisock.dlp_ReadStorageInfo(sd,i) assert res!=None and res.has_key('name') if VERBOSE: print "ReadStorageInfo: card=%d version=%d creation=%ld romSize=%ld ramSize=%ld ramFree=%ld name='%s' manufacturer='%s'" % ( res['card'], res['version'], res['creation'], res['romSize'], res['ramSize'], res['ramFree'], res['name'], res['manufacturer']) if res['more'] == 0: break def testReadDBList(self): res = pisock.dlp_ReadDBList(sd,0,pisock.dlpDBListRAM) assert len(res) > 3 assert res[0].has_key('name') if VERBOSE: print "ReadDBList: %s entries" % len(res) def testDatabaseCreationAndSearch(self): db = pisock.dlp_CreateDB(sd,'test','DATA',0,0,1,'PythonTestSuite') assert db != None pisock.dlp_SetDBInfo(sd, db, pisock.dlpDBFlagBackup, pisock.dlpDBFlagCopyPrevention, 0, 0, 0, 0, 'data', 0) pisock.dlp_CloseDB(sd,db) db = pisock.dlp_OpenDB(sd, 0, pisock.dlpOpenReadWrite, 'PythonTestSuite') assert db != None info = pisock.dlp_FindDBByOpenHandle(sd, db) if VERBOSE: print 'FindDBByOpenHandle:' print '\tcardNo',info[0] print '\tlocalID',info[1] dumpDBInfo(info[2]) dumpDBSizeInfo(info[3]) pisock.dlp_CloseDB(sd,db) pisock.dlp_DeleteDB(sd,0,'PythonTestSuite') class OfflineTestCase(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def testBadPort(self): sd = pisock.pi_socket(pisock.PI_AF_PILOT, pisock.PI_SOCK_STREAM, pisock.PI_PF_DLP) self.assertRaises(pisock.error, pisock.pi_bind, sd, "/dev/nosuchport") onlineSuite = unittest.makeSuite(OnlineTestCase,'test') offlineSuite = unittest.makeSuite(OfflineTestCase,'test') combinedSuite = unittest.TestSuite((onlineSuite, offlineSuite)) if __name__ == "__main__": parser = OptionParser() parser.add_option("-p", "--port", dest="pilotport", help="Perform online tests using port", metavar="PORT") parser.add_option("-v", "--verbose", dest="verbose", action="store_true", help="Print more output", default=0) (options, args) = parser.parse_args() runner = unittest.TextTestRunner() VERBOSE = options.verbose if options.pilotport: pilotport = options.pilotport print "Running online and offline tests using port %s" % pilotport print "Connecting" sd = pisock.pi_socket(pisock.PI_AF_PILOT, pisock.PI_SOCK_STREAM, pisock.PI_PF_DLP) pisock.pi_bind(sd, pilotport) pisock.pi_listen(sd, 1) pisock.pi_accept(sd) if VERBOSE: print pisock.dlp_ReadSysInfo(sd) else: pisock.dlp_ReadSysInfo(sd) pisock.dlp_OpenConduit(sd) print "Connected" runner.run(combinedSuite) pisock.pi_close(sd) print "Disconnected" else: print "Running offline tests only" runner.run(offlineSuite) pilot-link-0.12.5-dfsg/bindings/Makefile.am0000644000175000017500000000275110715124371020737 0ustar rousseaurousseauif WITH_JAVA JAVA_DIR=Java else JAVA_DIR= endif if WITH_TCL TCL_DIR=Tcl else TCL_DIR= endif SUBDIRS = $(JAVA_DIR) $(TCL_DIR) # # Python Building # python-build: Python/setup.py cd $(srcdir)/Python && $(PYTHON) setup.py build python-install: python-build cd $(srcdir)/Python && $(PYTHON) setup.py install --root=$(DESTDIR) --prefix=$(prefix) python-clean: Python/setup.py -cd $(srcdir)/Python && $(PYTHON) setup.py clean -cd $(srcdir)/Python && rm -rf build if WITH_PYTHON PYTHON_ALL = python-build PYTHON_INSTALL = python-install PYTHON_CLEAN = python-clean else PYTHON_ALL = PYTHON_INSTALL = PYTHON_MCLEAN = PYTHON_CLEAN = endif # # Perl Building # Perl/Makefile: Perl/Makefile.PL cd Perl && $(PERL) Makefile.PL perl-build: Perl/Makefile cd Perl && $(MAKE) PREFIX=$(DESTDIR)$(prefix) perl-install: cd Perl && $(MAKE) install perl-uninstall: Perl/Makefile cd Perl && $(MAKE) uninstall perl-clean: Perl/Makefile cd Perl && $(MAKE) realclean && rm Makefile.PL if WITH_PERL PERL_ALL = perl-build PERL_INSTALL = perl-install PERL_CLEAN = perl-clean else PERL_ALL = PERL_INSTALL = PERL_MCLEAN = PERL_CLEAN = endif all-local: $(PERL_ALL) $(PYTHON_ALL) install-exec-local: $(PYTHON_INSTALL) $(PERL_INSTALL) uninstall-local: $(PYTHON_INSTALL) $(PERL_UNINSTALL) clean-local: $(PERL_CLEAN) $(PYTHON_CLEAN) distclean-local: $(PERL_CLEAN) $(PYTHON_CLEAN) maintainer-clean-local: $(PERL_CLEAN) $(PYTHON_CLEAN) dist-hook: rm -rf `find $(distdir) -name CVS` EXTRA_DIST = Python Java Perl pilot-link-0.12.5-dfsg/bindings/Perl/0000755000175000017500000000000012346016601017576 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/bindings/Perl/Pilot.xs0000644000175000017500000025535710716111102021251 0ustar rousseaurousseau/* * Pilot.xs - Interface pilot-link library with Perl. * * Copyright (C) 1997, 1998, Kenneth Albanowski * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "patchlevel.h" /* FIXME Hack to get around a perl macro problem with calling the type 'int dirty;' in pi-mail.h and pi-todo.h. This originally showed up with perl 5.6 and gcc-3.x, and was fixed in gcc, but now appears in perl 5.8 with gcc-3.x. It smells like another internal macro being exposed into userland. */ #undef dirty #include "pi-macros.h" #include "pi-buffer.h" #include "pi-file.h" #include "pi-datebook.h" #include "pi-memo.h" #include "pi-expense.h" #include "pi-address.h" #include "pi-todo.h" #include "pi-mail.h" #include "pi-socket.h" #include "pi-dlp.h" #include "pi-syspkt.h" #include "pi-error.h" #include "pi-version.h" #include "const-c.inc" typedef unsigned char * CPTR; static unsigned char mybuf[0xffff]; static pi_buffer_t pibuf = {NULL, 0, 0}; static AV * tmtoav (struct tm * t) { AV * ret = newAV(); av_push(ret, newSViv(t->tm_sec)); av_push(ret, newSViv(t->tm_min)); av_push(ret, newSViv(t->tm_hour)); av_push(ret, newSViv(t->tm_mday)); av_push(ret, newSViv(t->tm_mon)); av_push(ret, newSViv(t->tm_year)); av_push(ret, newSViv(t->tm_wday)); av_push(ret, newSViv(t->tm_yday)); av_push(ret, newSViv(t->tm_isdst)); return ret; } struct tm * avtotm (AV * av, struct tm * t) { SV ** s; t->tm_sec = (s = av_fetch(av, 0, 0)) ? SvIV(*s) : 0; t->tm_min = (s = av_fetch(av, 1, 0)) ? SvIV(*s) : 0; t->tm_hour = (s = av_fetch(av, 2, 0)) ? SvIV(*s) : 0; t->tm_mday = (s = av_fetch(av, 3, 0)) ? SvIV(*s) : 0; t->tm_mon = (s = av_fetch(av, 4, 0)) ? SvIV(*s) : 0; t->tm_year = (s = av_fetch(av, 5, 0)) ? SvIV(*s) : 0; t->tm_wday = (s = av_fetch(av, 6, 0)) ? SvIV(*s) : 0; t->tm_yday = (s = av_fetch(av, 7, 0)) ? SvIV(*s) : 0; t->tm_isdst = (s = av_fetch(av, 8, 0)) ? SvIV(*s) : 0; return t; } #ifndef newRV_noinc static SV * rv; #define newRV_noinc(s) ((rv=newRV(s)), SvREFCNT_dec(s), rv) #endif #if (PATCHLEVEL < 3) || ((PATCHLEVEL == 3) && (SUBVERSION < 16)) #define sv_derived_from(x, y) sv_isobject((x)) #endif extern char * printlong _((unsigned long val)); extern unsigned long makelong _((char * c)); SV * newSVChar4 _((unsigned long arg)); unsigned long SvChar4 _((SV *arg)); typedef struct { int errnop; struct pi_file * pf; SV * Class; } PDA__Pilot__File; typedef struct DLP { int errnop; int socket; } PDA__Pilot__DLP; typedef struct DLPDB { SV * connection; int socket; int handle; int errnop; SV * dbname; int dbmode; int dbcard; SV * Class; } PDA__Pilot__DLP__DB; /* typedef PDA__Pilot__DLP__DB PDA__Pilot__DLP__ResourceDB; typedef PDA__Pilot__DLP__DB PDA__Pilot__DLP__RecordDB; */ typedef struct DBInfo DBInfo; typedef struct PilotUser UserInfo; typedef unsigned long Char4; typedef int Result; SV * newSVChar4(arg) unsigned long arg; { char * c = printlong(arg); if((isalpha(c[0]) || (c[0] == ' ') || (c[0] == '_')) && (isalpha(c[1]) || (c[1] == ' ') || (c[0] == '_')) && (isalpha(c[2]) || (c[2] == ' ') || (c[0] == '_')) && (isalpha(c[3]) || (c[3] == ' ') || (c[0] == '_'))) { return newSVpv(c,4); } else { return newSViv(arg); } } unsigned long SvChar4(arg) SV * arg; { if (SvIOKp(arg)) { return SvIV(arg); } else { STRLEN len; char * c = SvPV(arg, len); if (len != 4) croak("Char4 argument a string that isn't four bytes long"); return makelong(c); } } #define pack_dbinfo(arg, var, failure) { \ if (failure < 0) { \ arg = &sv_undef; \ self->errnop = failure; \ } else { \ HV * i = newHV(); \ hv_store(i, "more", 4, newSViv(var.more), 0); \ hv_store(i, "flagReadOnly", 12, newSViv((var.flags & dlpDBFlagReadOnly) !=0), 0); \ hv_store(i, "flagResource", 12, newSViv((var.flags & dlpDBFlagResource) !=0), 0); \ hv_store(i, "flagBackup", 10, newSViv((var.flags & dlpDBFlagBackup) !=0), 0); \ hv_store(i, "flagOpen", 8, newSViv((var.flags & dlpDBFlagOpen) !=0), 0); \ hv_store(i, "flagAppInfoDirty", 16, newSViv((var.flags & dlpDBFlagAppInfoDirty) !=0), 0); \ hv_store(i, "flagNewer", 9, newSViv((var.flags & dlpDBFlagNewer) !=0), 0); \ hv_store(i, "flagReset", 9, newSViv((var.flags & dlpDBFlagReset) !=0), 0); \ hv_store(i, "flagCopyPrevention", 18, newSViv((var.flags & dlpDBFlagCopyPrevention) !=0), 0); \ hv_store(i, "flagStream", 10, newSViv((var.flags & dlpDBFlagStream) !=0), 0); \ hv_store(i, "flagExcludeFromSync", 19, newSViv((var.miscFlags & dlpDBMiscFlagExcludeFromSync)!=0), 0); \ hv_store(i, "type", 4, newSVChar4(var.type), 0); \ hv_store(i, "creator", 7, newSVChar4(var.creator), 0); \ hv_store(i, "version", 7, newSViv(var.version), 0); \ hv_store(i, "modnum", 6, newSViv(var.modnum), 0); \ hv_store(i, "index", 5, newSViv(var.index), 0); \ hv_store(i, "createDate", 10, newSViv(var.createDate), 0); \ hv_store(i, "modifyDate", 10, newSViv(var.modifyDate), 0); \ hv_store(i, "backupDate", 10, newSViv(var.backupDate), 0); \ hv_store(i, "name", 4, newSVpv(var.name, 0), 0); \ arg = newRV_noinc((SV*)i);\ }\ } #define unpack_dbinfo(arg, var)\ if (SvROK(arg) && (SvTYPE(SvRV(arg))==SVt_PVHV)) {\ HV * i = (HV*)SvRV(arg);\ SV ** s;\ var.more = (s = hv_fetch(i, "more", 4, 0)) ? SvIV(*s) : 0;\ var.flags =\ (((s = hv_fetch(i, "flagReadOnly", 12, 0)) && SvTRUE(*s)) ? dlpDBFlagReadOnly : 0) | \ (((s = hv_fetch(i, "flagResource", 12, 0)) && SvTRUE(*s)) ? dlpDBFlagResource : 0) | \ (((s = hv_fetch(i, "flagBackup", 10, 0)) && SvTRUE(*s)) ? dlpDBFlagBackup : 0) | \ (((s = hv_fetch(i, "flagOpen", 8, 0)) && SvTRUE(*s)) ? dlpDBFlagOpen : 0) | \ (((s = hv_fetch(i, "flagAppInfoDirty", 16, 0)) && SvTRUE(*s)) ? dlpDBFlagAppInfoDirty : 0)| \ (((s = hv_fetch(i, "flagNewer", 9, 0)) && SvTRUE(*s)) ? dlpDBFlagNewer : 0) | \ (((s = hv_fetch(i, "flagReset", 9, 0)) && SvTRUE(*s)) ? dlpDBFlagReset : 0) | \ (((s = hv_fetch(i, "flagCopyPrevention", 18, 0)) && SvTRUE(*s)) ? dlpDBFlagCopyPrevention : 0) |\ (((s = hv_fetch(i, "flagStream", 10, 0)) && SvTRUE(*s)) ? dlpDBFlagStream : 0) | \ 0;\ var.miscFlags =\ (((s = hv_fetch(i, "flagExcludeFromSync", 19, 0)) && SvTRUE(*s)) ? dlpDBMiscFlagExcludeFromSync : 0);\ var.type = (s = hv_fetch(i, "type", 4, 0)) ? SvChar4(*s) : 0;\ var.creator = (s = hv_fetch(i, "creator", 7, 0)) ? SvChar4(*s) : 0;\ var.version = (s = hv_fetch(i, "version", 7, 0)) ? SvIV(*s) : 0;\ var.modnum = (s = hv_fetch(i, "modnum", 6, 0)) ? SvIV(*s) : 0;\ var.index = (s = hv_fetch(i, "index", 5, 0)) ? SvIV(*s) : 0;\ var.createDate = (s = hv_fetch(i, "createDate", 10, 0)) ? SvIV(*s) : 0;\ var.modifyDate = (s = hv_fetch(i, "modifyDate", 10, 0)) ? SvIV(*s) : 0;\ var.backupDate = (s = hv_fetch(i, "backupDate", 10, 0)) ? SvIV(*s) : 0;\ if ((s = hv_fetch(i, "name", 4, 0)) ? SvPV(*s,na) : 0) \ strncpy(var.name, SvPV(*s, na), sizeof(var.name)); \ } else {\ croak("argument is not a hash reference"); \ } #define pack_userinfo(arg, var, failure) { \ if (failure < 0) { \ arg = &sv_undef; \ self->errnop = failure; \ } else { \ HV * i = newHV(); \ hv_store(i, "userID", 6, newSViv(var.userID), 0); \ hv_store(i, "viewerID", 8, newSViv(var.viewerID), 0); \ hv_store(i, "lastSyncPC", 10, newSViv(var.lastSyncPC), 0); \ hv_store(i, "successfulSyncDate", 18, newSViv(var.successfulSyncDate), 0); \ hv_store(i, "lastSyncDate", 12, newSViv(var.lastSyncDate), 0); \ hv_store(i, "name", 4, newSVpv(var.username,0), 0); \ hv_store(i, "password", 8, newSVpvn(var.password,var.passwordLength), 0); \ arg = newRV_noinc((SV*)i); \ }\ } #define unpack_userinfo(arg, var)\ if (SvROK(arg) && (SvTYPE(SvRV(arg))==SVt_PVHV)) {\ HV * i = (HV*)SvRV(arg);\ SV ** s;\ var.userID = (s = hv_fetch(i, "userID", 6, 0)) ? SvIV(*s) : 0;\ var.viewerID = (s = hv_fetch(i, "viewerID", 8, 0)) ? SvIV(*s) : 0;\ var.lastSyncPC = (s = hv_fetch(i, "lastSyncPC", 10, 0)) ? SvIV(*s) : 0;\ var.lastSyncDate = (s = hv_fetch(i, "lastSyncDate", 12, 0)) ? SvIV(*s) : 0;\ var.successfulSyncDate = (s = hv_fetch(i, "successfulSyncDate", 18, 0)) ? SvIV(*s) : 0;\ if ((s = hv_fetch(i, "name", 4, 0)) ? SvPV(*s,na) : 0)\ strncpy(var.username, SvPV(*s, na), sizeof(var.username));\ } else {\ croak("argument is not a hash reference");\ } #define PackAI {\ HV * h;\ if (SvRV(data) && (SvTYPE(h=(HV*)SvRV(data))==SVt_PVHV)) {\ int count; \ PUSHMARK(sp); \ XPUSHs(data); \ PUTBACK; \ count = perl_call_method("Pack", G_SCALAR);\ SPAGAIN; \ if (count != 1) \ croak("Unable to pack app block");\ data = POPs; \ PUTBACK; \ } else { \ croak("Unable to pack app block");\ } \ } #define ReturnReadAI(buf,size)\ if (result >=0) {\ if (self->Class) {\ int count;\ PUSHMARK(sp);\ XPUSHs(self->Class);\ XPUSHs(newSVpvn((char *) buf, size)); \ PUTBACK;\ count = perl_call_method("appblock", G_SCALAR);\ SPAGAIN;\ if (count != 1)\ croak("Unable to create appblock");\ } else {\ croak("Class not defined");\ }\ } else {\ self->errnop = result;\ PUSHs(&sv_undef);\ } #define PackSI\ {\ HV * h;\ if (SvRV(data) &&\ (SvTYPE(h=(HV*)SvRV(data))==SVt_PVHV)) {\ int count;\ PUSHMARK(sp);\ XPUSHs(data);\ PUTBACK;\ count = perl_call_method("Pack", G_SCALAR);\ SPAGAIN;\ if (count != 1)\ croak("Unable to pack sort block");\ data = POPs;\ PUTBACK;\ }\ else {\ croak("Unable to pack sort block");\ }\ } #define ReturnReadSI(buf,size)\ if (result >=0) {\ if (self->Class) {\ int count;\ PUSHMARK(sp);\ XPUSHs(self->Class);\ XPUSHs(newSVpvn((char *) buf, size)); \ PUTBACK;\ count = perl_call_method("sortblock", G_SCALAR);\ SPAGAIN;\ if (count != 1)\ croak("Unable to create sortblock");\ }\ else {\ croak("Class not defined");\ }\ } else {\ self->errnop = result;\ PUSHs(&sv_undef);\ } #define PackRecord {\ HV * h;\ if (SvRV(data) &&\ (SvTYPE(h=(HV*)SvRV(data))==SVt_PVHV)) {\ int count;\ SV ** s;\ if (!(s = hv_fetch(h, "id", 2, 0)) || !SvOK(*s))\ croak("record must contain id");\ id = SvIV(*s);\ attr = 0;\ if (!(s = hv_fetch(h, "secret", 6, 0)) || !SvOK(*s))\ croak("record must contain secret");\ attr |= SvTRUE(*s) ? dlpRecAttrSecret : 0;\ if (!(s = hv_fetch(h, "deleted", 7, 0)) || !SvOK(*s))\ croak("record must contain deleted");\ attr |= SvTRUE(*s) ? dlpRecAttrDeleted : 0;\ if (!(s = hv_fetch(h, "modified", 8, 0)) || !SvOK(*s))\ croak("record must contain modified");\ attr |= SvTRUE(*s) ? dlpRecAttrDirty : 0;\ if (!(s = hv_fetch(h, "busy", 4, 0)) || !SvOK(*s))\ croak("record must contain busy");\ attr |= SvTRUE(*s) ? dlpRecAttrBusy : 0;\ if (!(s = hv_fetch(h, "archived", 8, 0)) || !SvOK(*s))\ croak("record must contain archived");\ attr |= SvTRUE(*s) ? dlpRecAttrArchived : 0;\ if (!(s = hv_fetch(h, "category", 8, 0)) || !SvOK(*s))\ croak("record must contain category");\ category = SvIV(*s);\ PUSHMARK(sp);\ XPUSHs(data);\ PUTBACK;\ count = perl_call_method("Pack", G_SCALAR);\ SPAGAIN;\ if (count != 1)\ croak("Unable to pack record");\ data = POPs;\ PUTBACK;\ } else {\ croak("Unable to pack record");\ }\ } #define PackRaw {\ HV * h;\ if (SvRV(data) &&\ (SvTYPE(h=(HV*)SvRV(data))==SVt_PVHV)) {\ int count;\ PUSHMARK(sp);\ XPUSHs(data);\ PUTBACK;\ count = perl_call_method("Raw", G_SCALAR);\ SPAGAIN;\ if (count != 1) {\ SV ** s = hv_fetch(h, "raw", 3, 0);\ if (s)\ data = *s;\ } else {\ data = POPs;\ PUTBACK;\ }\ }\ } #define ReturnReadRecord(buf,size)\ if (result >=0) {\ if (self->Class) {\ int count;\ SV * ret;\ PUSHMARK(sp);\ XPUSHs(self->Class);\ XPUSHs(newSVpvn((char *) buf, size)); \ XPUSHs(sv_2mortal(newSViv(id)));\ XPUSHs(sv_2mortal(newSViv(attr)));\ XPUSHs(sv_2mortal(newSViv(category)));\ XPUSHs(sv_2mortal(newSViv(index)));\ PUTBACK;\ count = perl_call_method("record", G_SCALAR);\ SPAGAIN;\ if (count != 1)\ croak("Unable to create record");\ ret = POPs;\ PUTBACK;\ PUSHs(ret);\ }\ else {\ croak("Class not defined");\ }\ } else {\ self->errnop = result;\ PUSHs(&sv_undef);\ } #define PackResource\ {\ HV * h;\ if (SvRV(data) &&\ (SvTYPE(h=(HV*)SvRV(data))==SVt_PVHV)) {\ int count;\ SV ** s;\ if (!(s = hv_fetch(h, "id", 2, 0)) || !SvOK(*s))\ croak("record must contain id");\ id = SvIV(*s);\ if (!(s = hv_fetch(h, "type", 4, 0)) || !SvOK(*s))\ croak("record must contain type");\ type = SvChar4(*s);\ PUSHMARK(sp);\ XPUSHs(data);\ PUTBACK;\ count = perl_call_method("Pack", G_SCALAR);\ SPAGAIN;\ if (count != 1)\ croak("Unable to pack resource");\ data = POPs;\ PUTBACK;\ }\ else {\ croak("Unable to pack resource");\ }\ } #define ReturnReadResource(buf,size)\ if (result >=0) {\ if (self->Class) {\ int count;\ PUSHMARK(sp);\ XPUSHs(self->Class);\ XPUSHs(newSVpvn((char *) buf, size)); \ XPUSHs(sv_2mortal(newSVChar4(type)));\ XPUSHs(sv_2mortal(newSViv(id)));\ XPUSHs(sv_2mortal(newSViv(index)));\ PUTBACK;\ count = perl_call_method("resource", G_SCALAR);\ SPAGAIN;\ if (count != 1)\ croak("Unable to create resource");\ }\ else {\ croak("Class not defined");\ }\ } else {\ self->errnop = result;\ PUSHs(&sv_undef);\ } #define PackPref\ {\ HV * h;\ if (SvRV(data) &&\ (SvTYPE(h=(HV*)SvRV(data))==SVt_PVHV)) {\ int count;\ SV ** s;\ if (!(s = hv_fetch(h, "id", 2, 0)) || !SvOK(*s))\ croak("record must contain id");\ id = SvIV(*s);\ if (!(s = hv_fetch(h, "creator", 7, 0)) || !SvOK(*s))\ croak("record must contain type");\ creator = SvChar4(*s);\ if (!(s = hv_fetch(h, "version", 7, 0)) || !SvOK(*s))\ croak("record must contain type");\ version = SvIV(*s);\ if (!(s = hv_fetch(h, "backup", 6, 0)) || !SvOK(*s))\ croak("record must contain type");\ backup = SvIV(*s);\ PUSHMARK(sp);\ XPUSHs(data);\ PUTBACK;\ count = perl_call_method("Pack", G_SCALAR);\ SPAGAIN;\ if (count != 1)\ croak("Unable to pack resource");\ data = POPs;\ PUTBACK;\ }\ else {\ croak("Unable to pack resource");\ }\ } #define ReturnReadPref(buf,size)\ if (result >=0) {\ HV * h = perl_get_hv("PDA::Pilot::PrefClasses", 0);\ SV ** s;\ int count;\ if (!h)\ croak("PrefClasses doesn't exist");\ s = hv_fetch(h, printlong(creator), 4, 0);\ if (!s)\ s = hv_fetch(h, "", 0, 0);\ if (!s)\ croak("Default PrefClass not defined");\ PUSHMARK(sp);\ XPUSHs(newSVsv(*s));\ XPUSHs(newSVpvn((char *) buf, size)); \ XPUSHs(sv_2mortal(newSVChar4(creator)));\ XPUSHs(sv_2mortal(newSViv(id)));\ XPUSHs(sv_2mortal(newSViv(version)));\ XPUSHs(sv_2mortal(newSViv(backup)));\ PUTBACK;\ count = perl_call_method("pref", G_SCALAR);\ SPAGAIN;\ if (count != 1)\ croak("Unable to create resource");\ } else {\ self->errnop = result;\ PUSHs(&sv_undef);\ } void doUnpackCategory(HV * self, struct CategoryAppInfo * c) { AV * e = newAV(); int i; hv_store(self, "categoryRenamed", 15, newRV_noinc((SV*)e), 0); for (i=0;i<16;i++) { av_push(e, newSViv(c->renamed[i])); } e = newAV(); hv_store(self, "categoryName", 12, newRV_noinc((SV*)e), 0); for (i=0;i<16;i++) { av_push(e, newSVpv(c->name[i], 0)); } e = newAV(); hv_store(self, "categoryID", 10, newRV_noinc((SV*)e), 0); for (i=0;i<16;i++) { av_push(e, newSViv(c->ID[i])); } hv_store(self, "categoryLastUniqueID", 20, newSViv(c->lastUniqueID), 0); } void doPackCategory(HV * self, struct CategoryAppInfo * c) { SV ** s; AV * av; int i; if ((s = hv_fetch(self, "categoryName", 12, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(av=(AV*)SvRV(*s))==SVt_PVAV)) for (i=0;i<16;i++) strncpy(c->name[i], (s=av_fetch(av, i, 0)) ? SvPV(*s,na) : "", 16); else for (i=0;i<16;i++) strcpy(c->name[i], ""); for (i=0;i<16;i++) c->name[i][15] = '\0'; if ((s = hv_fetch(self, "categoryID", 10, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(av=(AV*)SvRV(*s))==SVt_PVAV)) for (i=0;i<16;i++) c->ID[i] = (s=av_fetch(av, i, 0)) ? SvIV(*s) : 0; else for (i=0;i<16;i++) c->ID[i] = 0; if ((s = hv_fetch(self, "categoryRenamed", 10, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(av=(AV*)SvRV(*s))==SVt_PVAV)) for (i=0;i<16;i++) c->renamed[i] = (s=av_fetch(av, i, 0)) ? SvIV(*s) : 0; else for (i=0;i<16;i++) c->renamed[i] = 0; } int SvList(SV * arg, char **list) { int i; char * str = SvPV(arg, na); for (i=0;list[i];i++) if (strcasecmp(list[i], str)==0) return i; if (SvPOKp(arg)) { croak("Invalid value"); } return SvIV(arg); } SV * newSVlist(int value, char **list) { int i; for (i=0;list[i];i++) ; if (value < i) return newSVpv(list[value], 0); else return newSViv(value); } MODULE = PDA::Pilot PACKAGE = PDA::Pilot INCLUDE: const-xs.inc MODULE = PDA::Pilot PACKAGE = PDA::Pilot::Appointment SV * Unpack(record) SV * record CODE: { STRLEN len; int i; AV * e; HV * ret, *h; struct Appointment a; char *str; if (SvOK(record) && SvRV(record) && (SvTYPE(SvRV(record)) == SVt_PVHV)) { SV ** raw; ret = (HV*)SvRV(record); raw = hv_fetch(ret, "raw", 3, 0); if (!raw || !SvOK(*raw)) croak("Unable to unpack"); RETVAL = newSVsv(record); record = *raw; } else { ret = newHV(); hv_store(ret, "raw", 3, newSVsv(record),0); RETVAL = newRV_noinc((SV*)ret); } if (!SvPOK(record)) { croak("Not a string!?"); } str = SvPV(record,len); if (len > 0) { /* len == 0 when the record has the deleted flag set */ pi_buffer_clear(&pibuf); if (!pi_buffer_append(&pibuf, str, len)) { croak("Unable to reallocate buffer"); } if (unpack_Appointment(&a, &pibuf, datebook_v1) < 0) { croak("unpack_Appointment failed"); } hv_store(ret, "event", 5, newSViv(a.event), 0); hv_store(ret, "begin", 5, newRV_noinc((SV*)tmtoav(&a.begin)), 0); if (!a.event) { hv_store(ret, "end", 3, newRV_noinc((SV*)tmtoav(&a.end)), 0); } if (a.alarm) { HV * alarm = newHV(); hv_store(ret, "alarm", 5, newRV_noinc((SV*)alarm), 0); hv_store(alarm, "advance", 7, newSViv(a.advance), 0); hv_store(alarm, "units", 5, newSVpv(( (a.advanceUnits == 0) ? "minutes" : /* Minutes */ (a.advanceUnits == 1) ? "hours" : /* Hours */ (a.advanceUnits == 2) ? "days" : /* Days */ 0), 0), 0); if (a.advanceUnits > 2) { warn("Invalid advance unit %d encountered", a.advanceUnits); } } if (a.repeatType) { HV * repeat = newHV(); hv_store(ret, "repeat", 6, newRV_noinc((SV*)repeat), 0); hv_store(repeat, "type", 4, newSVpv(DatebookRepeatTypeNames[a.repeatType],0), 0); hv_store(repeat, "frequency", 9, newSViv(a.repeatFrequency), 0); if (a.repeatType == repeatMonthlyByDay) hv_store(repeat, "day", 3, newSViv(a.repeatDay), 0); else if (a.repeatType == repeatWeekly) { e = newAV(); hv_store(repeat, "days", 4, newRV_noinc((SV*)e), 0); for (i=0;i<7;i++) av_push(e,newSViv(a.repeatDays[i])); } hv_store(repeat, "weekstart", 9, newSViv(a.repeatWeekstart), 0); if (!a.repeatForever) hv_store(repeat, "end", 3, newRV_noinc((SV*)tmtoav(&a.repeatEnd)),0); } if (a.exceptions) { e = newAV(); hv_store(ret, "exceptions", 10, newRV_noinc((SV*)e), 0); for (i=0;i 254) warn("Alarm advance value %d out of range", a.advance); a.alarm = 1; } else { a.alarm = 0; a.advance = 0; a.advanceUnits = 0; } if ((s = hv_fetch(h, "repeat", 6, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(SvRV(*s))==SVt_PVHV)) { HV * h2 = (HV*)SvRV(*s); int i; a.repeatType = (s = hv_fetch(h2, "type", 4, 0)) ? SvList(*s, DatebookRepeatTypeNames) : 0; a.repeatFrequency = (s = hv_fetch(h2, "frequency", 9, 0)) ? SvIV(*s) : 0; a.repeatDay = 0; for(i=0;i<7;i++) a.repeatDays[i] = 0; if (a.repeatType == repeatMonthlyByDay ) { a.repeatDay = (s = hv_fetch(h2, "day", 3, 0)) ? SvIV(*s) : 0; } else if (a.repeatType == repeatWeekly) { if ((s = hv_fetch(h2, "days", 4, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(SvRV(*s))==SVt_PVAV)) { int i; AV * a2 = (AV*)SvRV(*s); for (i=0;i<7;i++) if ((s = av_fetch(a2, i, 0))) a.repeatDays[i] = SvIV(*s); } } a.repeatWeekstart = (s = hv_fetch(h2, "weekstart", 9, 0)) ? SvIV(*s) : 0; if ((s = hv_fetch(h2, "end", 3, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(SvRV(*s))==SVt_PVAV)) { avtotm((AV*)SvRV(*s), &a.repeatEnd); a.repeatForever = 0; } else { a.repeatForever = 1; } } else { a.repeatType = 0; a.repeatForever = 0; a.repeatFrequency = 0; a.repeatDay = 0; a.repeatWeekstart = 0; memset(&a.repeatEnd,'\0', sizeof(struct tm)); } a.exceptions = 0; a.exception = 0; if ((s = hv_fetch(h, "exceptions", 10, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(SvRV(*s))==SVt_PVAV)) { int i; AV * a2 = (AV*)SvRV(*s); if (av_len(a2)>-1) { a.exceptions = av_len(a2)+1; a.exception = malloc(sizeof(struct tm)*a.exceptions); for (i=0;i0) { doUnpackCategory(ret, &a.category); hv_store(ret, "startOfWeek", 11, newSViv(a.startOfWeek), 0); } } OUTPUT: RETVAL SV * PackAppBlock(record) SV * record CODE: { int i; int len; SV ** s; HV * h; AV * av; struct AppointmentAppInfo a; if (!SvRV(record) || (SvTYPE(h=(HV*)SvRV(record))!=SVt_PVHV)) RETVAL = record; else { doPackCategory(h, &a.category); if ((s = hv_fetch(h, "startOfWeek", 11, 0))) a.startOfWeek = SvIV(*s); else a.startOfWeek = 0; len = pack_AppointmentAppInfo(&a, (unsigned char *) mybuf, 0xffff); RETVAL = newSVpvn((char *) mybuf, len); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } } OUTPUT: RETVAL MODULE = PDA::Pilot PACKAGE = PDA::Pilot::ToDo SV * Unpack(record) SV * record CODE: { STRLEN len; int i; AV * e; HV * ret; struct ToDo a; char *str; if (SvOK(record) && SvRV(record) && (SvTYPE(SvRV(record)) == SVt_PVHV)) { SV ** raw; ret = (HV*)SvRV(record); raw = hv_fetch(ret, "raw", 3, 0); if (!raw || !SvOK(*raw)) croak("Unable to unpack"); RETVAL = newSVsv(record); record = *raw; } else { ret = newHV(); hv_store(ret, "raw", 3, newSVsv(record),0); RETVAL = newRV_noinc((SV*)ret); } str = SvPV(record,len); if (len > 0) { /* len == 0 if deleted flag is set */ pi_buffer_clear(&pibuf); if (!pi_buffer_append(&pibuf, str, len)) { croak("Unable to reallocate buffer"); } if (unpack_ToDo(&a, &pibuf, todo_v1) < 0) { croak("unpack_ToDo failed"); } if (!a.indefinite) hv_store(ret, "due", 3, newRV_noinc((SV*)tmtoav(&a.due)), 0); hv_store(ret, "priority", 8, newSViv(a.priority), 0); hv_store(ret, "complete", 8, newSViv(a.complete), 0); if (a.description) hv_store(ret, "description", 11, newSVpv((char*)a.description,0), 0); if (a.note) hv_store(ret, "note", 4, newSVpv((char*)a.note,0), 0); free_ToDo(&a); } } OUTPUT: RETVAL SV * Pack(record) SV * record CODE: { SV ** s; HV * h; struct ToDo a; if (!SvRV(record) || (SvTYPE(h=(HV*)SvRV(record))!=SVt_PVHV)) RETVAL = record; else if ((s=hv_fetch(h, "deleted", 7, 0)) && SvOK(*s) && SvTRUE(*s) && (s=hv_fetch(h, "archived", 8, 0)) && SvOK(*s) && !SvTRUE(*s)) { RETVAL = newSVpv("",0); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } else { a.priority = (s = hv_fetch(h, "priority", 8, 0)) ? SvIV(*s) : 0; a.complete = (s = hv_fetch(h, "complete", 8, 0)) ? SvIV(*s) : 0; if ((s = hv_fetch(h, "due", 3, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(SvRV(*s))==SVt_PVAV)) { avtotm((AV*)SvRV(*s), &a.due); a.indefinite = 0; } else { memset(&a.due,'\0', sizeof(struct tm)); a.indefinite = 1; } a.description = (s = hv_fetch(h, "description", 11, 0)) ? SvPV(*s,na) : 0; a.note = (s = hv_fetch(h, "note", 4, 0)) ? SvPV(*s,na) : 0; if (pack_ToDo(&a, &pibuf, todo_v1) < 0) { croak("pack_ToDo failed"); } RETVAL = newSVpvn((char *) pibuf.data, pibuf.used); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } } OUTPUT: RETVAL SV * UnpackAppBlock(record) SV * record CODE: { STRLEN len; AV * e; HV * ret; int i; struct ToDoAppInfo a; if (SvOK(record) && SvRV(record) && (SvTYPE(SvRV(record)) == SVt_PVHV)) { SV ** raw; ret = (HV*)SvRV(record); raw = hv_fetch(ret, "raw", 3, 0); if (!raw || !SvOK(*raw)) croak("Unable to unpack"); RETVAL = newSVsv(record); record = *raw; } else { ret = newHV(); hv_store(ret, "raw", 3, newSVsv(record),0); RETVAL = newRV_noinc((SV*)ret); } SvPV(record,len); if (unpack_ToDoAppInfo(&a, (CPTR)SvPV(record, na), len)>0) { doUnpackCategory(ret, &a.category); hv_store(ret, "dirty", 5, newSViv(a.dirty), 0); hv_store(ret, "sortByPriority", 14, newSViv(a.sortByPriority), 0); } } OUTPUT: RETVAL SV * PackAppBlock(record) SV * record CODE: { int i; int len; SV ** s; HV * h; AV * av; struct ToDoAppInfo a; if (!SvRV(record) || (SvTYPE(h=(HV*)SvRV(record))!=SVt_PVHV)) RETVAL = record; else { doUnpackCategory(h, &a.category); doPackCategory(h, &a.category); a.dirty = (s = hv_fetch(h, "dirty", 5, 0)) ? SvIV(*s) : 0; a.sortByPriority = (s = hv_fetch(h, "sortByPriority", 14, 0)) ? SvIV(*s) : 0; len = pack_ToDoAppInfo(&a, mybuf, 0xffff); RETVAL = newSVpvn((char *) mybuf, len); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } } OUTPUT: RETVAL MODULE = PDA::Pilot PACKAGE = PDA::Pilot::Address SV * Unpack(record) SV * record CODE: { STRLEN len; int i; AV * e; HV * ret; struct Address a; char *str; if (SvOK(record) && SvRV(record) && (SvTYPE(SvRV(record)) == SVt_PVHV)) { SV ** raw; ret = (HV*)SvRV(record); raw = hv_fetch(ret, "raw", 3, 0); if (!raw || !SvOK(*raw)) croak("Unable to unpack"); RETVAL = newSVsv(record); record = *raw; } else { ret = newHV(); hv_store(ret, "raw", 3, newSVsv(record),0); RETVAL = newRV_noinc((SV*)ret); } str = SvPV(record,len); if (len > 0) { /* len == 0 when deleted flag is set */ pi_buffer_clear(&pibuf); if (!pi_buffer_append(&pibuf, str, len)) { croak("Unable to reallocate buffer"); } if (unpack_Address(&a, &pibuf, address_v1) < 0) { croak("unpack_Address failed"); } e = newAV(); hv_store(ret, "phoneLabel", 10, newRV_noinc((SV*)e), 0); for (i=0;i<5;i++) { av_push(e, newSViv(a.phoneLabel[i])); } e = newAV(); hv_store(ret, "entry", 5, newRV_noinc((SV*)e), 0); for (i=0;i<19;i++) { av_push(e, a.entry[i] ? newSVpv(a.entry[i],0) : &sv_undef); } hv_store(ret, "showPhone", 9, newSViv(a.showPhone), 0); free_Address(&a); } } OUTPUT: RETVAL SV * Pack(record) SV * record CODE: { SV ** s; HV * h; AV * av; int i; struct Address a; if (!SvRV(record) || (SvTYPE(h=(HV*)SvRV(record))!=SVt_PVHV)) RETVAL = record; else if ((s=hv_fetch(h, "deleted", 7, 0)) && SvOK(*s) && SvTRUE(*s) && (s=hv_fetch(h, "archived", 8, 0)) && SvOK(*s) && !SvTRUE(*s)) { RETVAL = newSVpv("",0); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } else { if ((s = hv_fetch(h, "phoneLabel", 10, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(av=(AV*)SvRV(*s))==SVt_PVAV)) for (i=0;i<5;i++) a.phoneLabel[i] = ((s=av_fetch(av, i, 0)) && SvOK(*s)) ? SvIV(*s) : 0; else for (i=0;i<5;i++) a.phoneLabel[i] = 0; if ((s = hv_fetch(h, "entry", 5, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(av=(AV*)SvRV(*s))==SVt_PVAV)) for (i=0;i<19;i++) a.entry[i] = ((s=av_fetch(av, i, 0)) && SvOK(*s)) ? SvPV(*s,na) : 0; else for (i=0;i<19;i++) a.entry[i] = 0; if ((s = hv_fetch(h, "showPhone", 9, 0))) a.showPhone = SvIV(*s); else a.showPhone = 0; if (pack_Address(&a, &pibuf, address_v1) < 0) { croak("pack_Address failed"); } RETVAL = newSVpvn((char *) pibuf.data, pibuf.used); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } } OUTPUT: RETVAL SV * UnpackAppBlock(record) SV * record CODE: { STRLEN len; AV * e; HV * ret; int i; struct AddressAppInfo a; if (SvOK(record) && SvRV(record) && (SvTYPE(SvRV(record)) == SVt_PVHV)) { SV ** raw; ret = (HV*)SvRV(record); raw = hv_fetch(ret, "raw", 3, 0); if (!raw || !SvOK(*raw)) croak("Unable to unpack"); RETVAL = newSVsv(record); record = *raw; } else { ret = newHV(); hv_store(ret, "raw", 3, newSVsv(record),0); RETVAL = newRV_noinc((SV*)ret); } SvPV(record,len); if (unpack_AddressAppInfo(&a, (CPTR)SvPV(record, na), len)>0) { doUnpackCategory(ret, &a.category); e = newAV(); hv_store(ret, "labelRenamed", 12, newRV_noinc((SV*)e), 0); for (i=0;i<22;i++) { av_push(e, newSViv(a.labelRenamed[i])); } hv_store(ret, "country", 7, newSViv(a.country), 0); hv_store(ret, "sortByCompany", 13, newSViv(a.sortByCompany), 0); e = newAV(); hv_store(ret, "label", 5, newRV_noinc((SV*)e), 0); for (i=0;i<22;i++) { av_push(e, newSVpv(a.labels[i],0)); } e = newAV(); hv_store(ret, "phoneLabel", 10, newRV_noinc((SV*)e), 0); for (i=0;i<8;i++) { av_push(e, newSVpv(a.phoneLabels[i],0)); } } } OUTPUT: RETVAL SV * PackAppBlock(record) SV * record CODE: { int i; int len; SV ** s; HV * h; AV * av; struct AddressAppInfo a; if (!SvRV(record) || (SvTYPE(h=(HV*)SvRV(record))!=SVt_PVHV)) RETVAL = record; else { doPackCategory(h, &a.category); if ((s = hv_fetch(h, "labelRenamed", 12, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(av=(AV*)SvRV(*s))==SVt_PVAV)) for (i=0;i<22;i++) a.labelRenamed[i] = (s=av_fetch(av, i, 0)) ? SvIV(*s) : 0; else for (i=0;i<22;i++) a.labelRenamed[i] = 0; a.country = (s = hv_fetch(h, "country", 7, 0)) ? SvIV(*s) : 0; a.sortByCompany = (s = hv_fetch(h, "sortByCompany", 13, 0)) ? SvIV(*s) : 0; if ((s = hv_fetch(h, "label", 5, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(av=(AV*)SvRV(*s))==SVt_PVAV)) for (i=0;i<22;i++) strncpy(a.labels[i], (s=av_fetch(av, i, 0)) ? SvPV(*s,na) : "", 16); else for (i=0;i<22;i++) a.labels[i][0] = 0; for (i=0;i<22;i++) a.labels[i][15] = 0; if ((s = hv_fetch(h, "phoneLabel", 10, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(av=(AV*)SvRV(*s))==SVt_PVAV)) for (i=0;i<8;i++) strncpy(a.phoneLabels[i], (s=av_fetch(av, i, 0)) ? SvPV(*s,na) : "", 16); else for (i=0;i<8;i++) a.phoneLabels[i][0] = 0; for (i=0;i<8;i++) a.phoneLabels[i][15] = 0; len = pack_AddressAppInfo(&a, mybuf, 0xffff); RETVAL = newSVpvn((char *) mybuf, len); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } } OUTPUT: RETVAL MODULE = PDA::Pilot PACKAGE = PDA::Pilot::Memo SV * Unpack(record) SV * record CODE: { STRLEN len; int i; AV * e; HV * ret; struct Memo a; char *str; if (SvOK(record) && SvRV(record) && (SvTYPE(SvRV(record)) == SVt_PVHV)) { SV ** raw; ret = (HV*)SvRV(record); raw = hv_fetch(ret, "raw", 3, 0); if (!raw || !SvOK(*raw)) croak("Unable to unpack"); RETVAL = newSVsv(record); record = *raw; } else { ret = newHV(); hv_store(ret, "raw", 3, newSVsv(record),0); RETVAL = newRV_noinc((SV*)ret); } str = SvPV(record,len); if (len > 0) { /* len == 0 if deleted flag is set */ pi_buffer_clear(&pibuf); if (!pi_buffer_append(&pibuf, str, len)) { croak("Unable to reallocate buffer"); } if (unpack_Memo(&a, &pibuf, memo_v1) < 0) { croak("unpack_Memo failed"); } hv_store(ret, "text", 4, newSVpv(a.text,0), 0); free_Memo(&a); } } OUTPUT: RETVAL SV * Pack(record) SV * record CODE: { SV ** s; HV * h; struct Memo a; if (!SvRV(record) || (SvTYPE(h=(HV*)SvRV(record))!=SVt_PVHV)) RETVAL = record; else if ((s=hv_fetch(h, "deleted", 7, 0)) && SvOK(*s) && SvTRUE(*s) && (s=hv_fetch(h, "archived", 8, 0)) && SvOK(*s) && !SvTRUE(*s)) { RETVAL = newSVpv("",0); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } else { if ((s = hv_fetch(h, "text", 4, 0))) a.text = SvPV(*s,na); else a.text = 0; if (pack_Memo(&a, &pibuf, memo_v1) < 0) { croak("pack_Memo failed"); } RETVAL = newSVpvn((char *) pibuf.data, pibuf.used); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } } OUTPUT: RETVAL SV * UnpackAppBlock(record) SV * record CODE: { STRLEN len; AV * e; HV * ret; int i; struct MemoAppInfo a; if (SvOK(record) && SvRV(record) && (SvTYPE(SvRV(record)) == SVt_PVHV)) { SV ** raw; ret = (HV*)SvRV(record); raw = hv_fetch(ret, "raw", 3, 0); if (!raw || !SvOK(*raw)) croak("Unable to unpack"); RETVAL = newSVsv(record); record = *raw; } else { ret = newHV(); hv_store(ret, "raw", 3, newSVsv(record),0); RETVAL = newRV_noinc((SV*)ret); } SvPV(record,len); if (unpack_MemoAppInfo(&a, (CPTR)SvPV(record, na), len)>0) { doUnpackCategory(ret, &a.category); hv_store(ret, "sortByAlpha", 11, newSViv(a.sortByAlpha), 0); } } OUTPUT: RETVAL SV * PackAppBlock(record) SV * record CODE: { int i; int len; SV ** s; HV * h; AV * av; struct MemoAppInfo a; if (!SvRV(record) || (SvTYPE(h=(HV*)SvRV(record))!=SVt_PVHV)) RETVAL = record; else { doPackCategory(h, &a.category); if ((s = hv_fetch(h, "sortByAlpha", 11, 0))) a.sortByAlpha = SvIV(*s); else a.sortByAlpha = 0; len = pack_MemoAppInfo(&a, mybuf, 0xffff); RETVAL = newSVpvn((char *) mybuf, len); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } } OUTPUT: RETVAL MODULE = PDA::Pilot PACKAGE = PDA::Pilot::Expense SV * Unpack(record) SV * record CODE: { STRLEN len; int i; HV * ret; struct Expense e; if (SvOK(record) && SvRV(record) && (SvTYPE(SvRV(record)) == SVt_PVHV)) { SV ** raw; ret = (HV*)SvRV(record); raw = hv_fetch(ret, "raw", 3, 0); if (!raw || !SvOK(*raw)) croak("Unable to unpack"); RETVAL = newSVsv(record); record = *raw; } else { ret = newHV(); hv_store(ret, "raw", 3, newSVsv(record),0); RETVAL = newRV_noinc((SV*)ret); } SvPV(record,len); if (len > 0) { /* len == 0 if deleted flag is set */ if (unpack_Expense(&e, (CPTR)SvPV(record, na), len)>0) { hv_store(ret, "date", 4, newRV_noinc((SV*)tmtoav(&e.date)), 0); hv_store(ret, "type", 4, newSVlist(e.type,ExpenseTypeNames),0); hv_store(ret, "payment", 7, newSVlist(e.payment,ExpensePaymentNames),0); hv_store(ret, "currency", 8, newSViv(e.currency),0); if (e.amount) hv_store(ret, "amount", 6, newSVpv(e.amount,0), 0); if (e.vendor) hv_store(ret, "vendor", 6, newSVpv(e.vendor,0), 0); if (e.city) hv_store(ret, "city", 4, newSVpv(e.city,0), 0); if (e.note) hv_store(ret, "note", 4, newSVpv(e.note,0), 0); if (e.attendees) hv_store(ret, "attendees", 9, newSVpv(e.attendees,0), 0); free_Expense(&e); } } } OUTPUT: RETVAL SV * Pack(record) SV * record CODE: { STRLEN len; SV ** s; HV * h; struct Expense e; if (!SvRV(record) || (SvTYPE(h=(HV*)SvRV(record))!=SVt_PVHV)) RETVAL = record; else if ((s=hv_fetch(h, "deleted", 7, 0)) && SvOK(*s) && SvTRUE(*s) && (s=hv_fetch(h, "archived", 8, 0)) && SvOK(*s) && !SvTRUE(*s)) { RETVAL = newSVpv("",0); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } else { if ((s = hv_fetch(h, "type", 4, 0))) e.type = SvList(*s,ExpenseTypeNames); else croak("must have type"); if ((s = hv_fetch(h, "payment", 7, 0))) e.payment = SvList(*s,ExpensePaymentNames); else croak("must have payment"); if ((s = hv_fetch(h, "currency", 8, 0))) e.currency = SvIV(*s); else croak("must have currency"); if ((s = hv_fetch(h, "date", 4, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(SvRV(*s))==SVt_PVAV)) avtotm((AV*)SvRV(*s), &e.date); else croak("expense record must contain date"); if ((s = hv_fetch(h, "amount", 6, 0))) e.amount = SvPV(*s,na); else e.amount = 0; if ((s = hv_fetch(h, "vendor", 6, 0))) e.vendor = SvPV(*s,na); else e.vendor = 0; if ((s = hv_fetch(h, "city", 4, 0))) e.city = SvPV(*s,na); else e.city = 0; if ((s = hv_fetch(h, "attendess", 9, 0))) e.attendees = SvPV(*s,na); else e.attendees = 0; if ((s = hv_fetch(h, "note", 4, 0))) e.note = SvPV(*s,na); else e.note = 0; len = pack_Expense(&e, mybuf, 0xffff); RETVAL = newSVpvn((char *) mybuf, len); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } } OUTPUT: RETVAL SV * UnpackAppBlock(record) SV * record CODE: { STRLEN len; HV * ret; AV * a; int i; struct ExpenseAppInfo e; if (SvOK(record) && SvRV(record) && (SvTYPE(SvRV(record)) == SVt_PVHV)) { SV ** raw; ret = (HV*)SvRV(record); raw = hv_fetch(ret, "raw", 3, 0); if (!raw || !SvOK(*raw)) croak("Unable to unpack"); RETVAL = newSVsv(record); record = *raw; } else { ret = newHV(); hv_store(ret, "raw", 3, newSVsv(record),0); RETVAL = newRV_noinc((SV*)ret); } SvPV(record,len); if (unpack_ExpenseAppInfo(&e, (CPTR)SvPV(record, na), len)>0) { hv_store(ret, "sortOrder", 9, newSVlist(e.sortOrder,ExpenseSortNames),0); a = newAV(); hv_store(ret, "currencies", 10, newRV_noinc((SV*)a), 0); for (i=0;i<4;i++) { HV * h = newHV(); hv_store(h, "name", 4, newSVpv(e.currencies[i].name, 0), 0); hv_store(h, "symbol", 6, newSVpv(e.currencies[i].symbol, 0), 0); hv_store(h, "rate", 4, newSVpv(e.currencies[i].rate, 0), 0); av_store(a, i, (SV*)newRV_noinc((SV*)h)); } doUnpackCategory(ret, &e.category); } } OUTPUT: RETVAL SV * PackAppBlock(record) SV * record CODE: { int i; int len; SV ** s; HV * h; AV * av; struct ExpenseAppInfo e; if (!SvRV(record) || (SvTYPE(h=(HV*)SvRV(record))!=SVt_PVHV)) RETVAL = record; else { doPackCategory(h, &e.category); e.sortOrder = (s = hv_fetch(h, "sortOrder", 9, 0)) ? SvList(*s, ExpenseSortNames) : 0; if ((s=hv_fetch(h, "currencies", 10, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(av=(AV*)SvRV(*s))==SVt_PVAV)) { for(i=0;i<4;i++) { HV * hv; if ((s=av_fetch(av, i, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(hv=(HV*)SvRV(*s))==SVt_PVHV)) { if (s = hv_fetch(hv, "name", 4, 0)) { strncpy(e.currencies[i].name, SvPV(*s, na), 16); e.currencies[i].name[15] = 0; } if (s = hv_fetch(hv, "symbol", 6, 0)) { strncpy(e.currencies[i].symbol, SvPV(*s, na), 4); e.currencies[i].symbol[3] = 0; } if (s = hv_fetch(hv, "rate", 4, 0)) { strncpy(e.currencies[i].rate, SvPV(*s, na), 8); e.currencies[i].rate[7] = 0; } } } } else for(i=0;i<4;i++) { e.currencies[i].symbol[0] = 0; e.currencies[i].name[0] = 0; e.currencies[i].rate[0] = 0; } len = pack_ExpenseAppInfo(&e, mybuf, 0xffff); RETVAL = newSVpvn((char *) mybuf, len); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } } OUTPUT: RETVAL SV * UnpackPref(record) SV * record CODE: { STRLEN len; AV * e; HV * ret; int i; struct ExpensePref a; if (SvOK(record) && SvRV(record) && (SvTYPE(SvRV(record)) == SVt_PVHV)) { SV ** raw; ret = (HV*)SvRV(record); raw = hv_fetch(ret, "raw", 3, 0); if (!raw || !SvOK(*raw)) croak("Unable to unpack"); RETVAL = newSVsv(record); record = *raw; } else { ret = newHV(); hv_store(ret, "raw", 3, newSVsv(record),0); RETVAL = newRV_noinc((SV*)ret); } SvPV(record,len); if (unpack_ExpensePref(&a, (CPTR)SvPV(record, na), len)>0) { hv_store(ret, "unitOfDistance", 14, newSVlist(a.unitOfDistance, ExpenseDistanceNames), 0); hv_store(ret, "currentCategory", 15, newSViv(a.currentCategory), 0); hv_store(ret, "defaultCurrency", 15, newSViv(a.defaultCurrency), 0); hv_store(ret, "attendeeFont", 8, newSViv(a.attendeeFont), 0); hv_store(ret, "showAllCategories", 17, newSViv(a.showAllCategories), 0); hv_store(ret, "showCurrency", 12, newSViv(a.showCurrency), 0); hv_store(ret, "saveBackup", 10, newSViv(a.saveBackup), 0); hv_store(ret, "allowQuickFill", 14, newSViv(a.allowQuickFill), 0); e = newAV(); for (i=0;i<5;i++) av_store(e, i, newSViv(a.currencies[i])); hv_store(ret, "currencies", 10, (SV*)newRV_noinc((SV*)e), 0); hv_store(ret, "noteFont", 8, newSViv(a.noteFont), 0); } } OUTPUT: RETVAL SV * PackPref(record, id) SV * record int id CODE: { int i; int len; SV ** s; HV * h; AV * av; struct ExpensePref a; if (!SvRV(record) || (SvTYPE(h=(HV*)SvRV(record))!=SVt_PVHV)) RETVAL = record; else { a.unitOfDistance = (s = hv_fetch(h, "unitOfDistance", 14, 0)) ? SvList(*s, ExpenseDistanceNames) : 0; a.currentCategory = (s=hv_fetch(h,"currentCategory",15,0)) ? SvIV(*s) : 0; a.defaultCurrency = (s=hv_fetch(h,"defaultCurrency",15,0)) ? SvIV(*s) : 0; a.attendeeFont = (s=hv_fetch(h,"attendeeFont",8,0)) ? SvIV(*s) : 0; a.showAllCategories = (s=hv_fetch(h,"showAllCategories",17,0)) ? SvIV(*s) : 0; a.showCurrency = (s=hv_fetch(h,"showCurrency",12,0)) ? SvIV(*s) : 0; a.saveBackup = (s=hv_fetch(h,"saveBackup",10,0)) ? SvIV(*s) : 0; a.allowQuickFill = (s=hv_fetch(h,"allowQuickFill",14,0)) ? SvIV(*s) : 0; if ((s=hv_fetch(h, "currencies", 10, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(av=(AV*)SvRV(*s))==SVt_PVAV)) { for(i=0;i<5;i++) a.currencies[i] = (s=av_fetch(av, i, 0)) ? SvIV(*s) : 0; } else for(i=0;i<5;i++) a.currencies[i] = 0; a.noteFont = (s=hv_fetch(h,"noteFont",8,0)) ? SvIV(*s) : 0; len = pack_ExpensePref(&a, mybuf, 0xffff); RETVAL = newSVpvn((char *) mybuf, len); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } } OUTPUT: RETVAL MODULE = PDA::Pilot PACKAGE = PDA::Pilot::Mail SV * Unpack(record) SV * record CODE: { STRLEN len; int i; AV * e; HV * ret; struct Mail a; if (SvOK(record) && SvRV(record) && (SvTYPE(SvRV(record)) == SVt_PVHV)) { SV ** raw; ret = (HV*)SvRV(record); raw = hv_fetch(ret, "raw", 3, 0); if (!raw || !SvOK(*raw)) croak("Unable to unpack"); RETVAL = newSVsv(record); record = *raw; } else { ret = newHV(); hv_store(ret, "raw", 3, newSVsv(record),0); RETVAL = newRV_noinc((SV*)ret); } SvPV(record,len); if (len > 0) { /* len == 0 if deleted flag is set */ if (unpack_Mail(&a, (CPTR)SvPV(record, na), len)>0) { if (a.subject) hv_store(ret, "subject", 7, newSVpv(a.subject,0), 0); if (a.from) hv_store(ret, "from", 4, newSVpv(a.from,0), 0); if (a.to) hv_store(ret, "to", 2, newSVpv(a.to,0), 0); if (a.cc) hv_store(ret, "cc", 2, newSVpv(a.cc,0), 0); if (a.bcc) hv_store(ret, "bcc", 3, newSVpv(a.bcc,0), 0); if (a.replyTo) hv_store(ret, "replyTo", 7, newSVpv(a.replyTo,0), 0); if (a.sentTo) hv_store(ret, "sentTo", 6, newSVpv(a.sentTo,0), 0); if (a.body) hv_store(ret, "body", 4, newSVpv(a.body,0), 0); hv_store(ret, "read", 4, newSViv(a.read), 0); hv_store(ret, "signature", 9, newSViv(a.signature), 0); hv_store(ret, "confirmRead", 11, newSViv(a.confirmRead), 0); hv_store(ret, "confirmDelivery", 15, newSViv(a.confirmDelivery), 0); hv_store(ret, "priority", 8, newSViv(a.priority), 0); hv_store(ret, "addressing", 10, newSViv(a.addressing), 0); if (a.dated) hv_store(ret, "date", 4, newRV_noinc((SV*)tmtoav(&a.date)), 0); free_Mail(&a); } } } OUTPUT: RETVAL SV * Pack(record) SV * record CODE: { STRLEN len; SV ** s; HV * h; struct Mail a; if (!SvRV(record) || (SvTYPE(h=(HV*)SvRV(record))!=SVt_PVHV)) RETVAL = record; else if ((s=hv_fetch(h, "deleted", 7, 0)) && SvOK(*s) && SvTRUE(*s) && (s=hv_fetch(h, "archived", 8, 0)) && SvOK(*s) && !SvTRUE(*s)) { RETVAL = newSVpv("",0); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } else { a.subject = (s = hv_fetch(h, "subject", 7, 0)) ? SvPV(*s,na) : 0; a.from = (s = hv_fetch(h, "from", 4, 0)) ? SvPV(*s,na) : 0; a.to = (s = hv_fetch(h, "to", 2, 0)) ? SvPV(*s,na) : 0; a.cc = (s = hv_fetch(h, "cc", 2, 0)) ? SvPV(*s,na) : 0; a.bcc = (s = hv_fetch(h, "bcc", 3, 0)) ? SvPV(*s,na) : 0; a.replyTo = (s = hv_fetch(h, "replyTo", 7, 0)) ? SvPV(*s,na) : 0; a.sentTo = (s = hv_fetch(h, "sentTo", 6, 0)) ? SvPV(*s,na) : 0; a.body = (s = hv_fetch(h, "body", 4, 0)) ? SvPV(*s,na) : 0; a.read = (s = hv_fetch(h, "read", 4, 0)) ? SvIV(*s) : 0; a.signature = (s = hv_fetch(h, "signature", 9, 0)) ? SvIV(*s) : 0; a.confirmRead = (s = hv_fetch(h, "confirmRead", 11, 0)) ? SvIV(*s) : 0; a.confirmDelivery = (s = hv_fetch(h, "confirmDelivery", 15, 0)) ? SvIV(*s) : 0; a.priority = (s = hv_fetch(h, "priority", 8, 0)) ? SvIV(*s) : 0; a.addressing = (s = hv_fetch(h, "addressing", 10, 0)) ? SvIV(*s) : 0; a.dated = (s = hv_fetch(h, "date", 4, 0)) ? 1 : 0; if (s && SvOK(*s) && SvRV(*s) && (SvTYPE(SvRV(*s))==SVt_PVAV)) avtotm((AV*)SvRV(*s), &a.date); len = pack_Mail(&a, mybuf, 0xffff); RETVAL = newSVpvn((char *) mybuf, len); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } } OUTPUT: RETVAL SV * UnpackAppBlock(record) SV * record CODE: { STRLEN len; AV * e; HV * ret; int i; struct MailAppInfo a; if (SvOK(record) && SvRV(record) && (SvTYPE(SvRV(record)) == SVt_PVHV)) { SV ** raw; ret = (HV*)SvRV(record); raw = hv_fetch(ret, "raw", 3, 0); if (!raw || !SvOK(*raw)) croak("Unable to unpack"); RETVAL = newSVsv(record); record = *raw; } else { ret = newHV(); hv_store(ret, "raw", 3, newSVsv(record),0); RETVAL = newRV_noinc((SV*)ret); } SvPV(record,len); if (unpack_MailAppInfo(&a, (CPTR)SvPV(record, na), len)>0) { doUnpackCategory(ret, &a.category); hv_store(ret, "sortOrder", 9, newSVlist(a.sortOrder, MailSortTypeNames), 0); hv_store(ret, "dirty", 5, newSViv(a.dirty), 0); hv_store(ret, "unsentMessage", 13, newSViv(a.unsentMessage), 0); } } OUTPUT: RETVAL SV * PackAppBlock(record) SV * record CODE: { int i; int len; SV ** s; HV * h; AV * av; struct MailAppInfo a; if (!SvRV(record) || (SvTYPE(h=(HV*)SvRV(record))!=SVt_PVHV)) RETVAL = record; else { doPackCategory(h, &a.category); if ((s = hv_fetch(h, "sortOrder", 9, 0))) a.sortOrder = SvList(*s, MailSortTypeNames); else a.sortOrder = 0; a.dirty = (s=hv_fetch(h,"dirty",5,0)) ? SvIV(*s) : 0; a.unsentMessage = (s=hv_fetch(h,"unsentMessage",13,0)) ? SvIV(*s) : 0; len = pack_MailAppInfo(&a, mybuf, 0xffff); RETVAL = newSVpvn((char *) mybuf, len); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } } OUTPUT: RETVAL SV * UnpackSyncPref(record) SV * record CODE: { STRLEN len; AV * e; HV * ret; int i; struct MailSyncPref a; if (SvOK(record) && SvRV(record) && (SvTYPE(SvRV(record)) == SVt_PVHV)) { SV ** raw; ret = (HV*)SvRV(record); raw = hv_fetch(ret, "raw", 3, 0); if (!raw || !SvOK(*raw)) croak("Unable to unpack"); RETVAL = newSVsv(record); record = *raw; } else { ret = newHV(); hv_store(ret, "raw", 3, newSVsv(record),0); RETVAL = newRV_noinc((SV*)ret); } SvPV(record,len); if (unpack_MailSyncPref(&a, (CPTR)SvPV(record, na), len)>0) { hv_store(ret, "syncType", 8, newSVlist(a.syncType, MailSyncTypeNames), 0); hv_store(ret, "getHigh", 7, newSViv(a.getHigh), 0); hv_store(ret, "getContaining", 13, newSViv(a.getContaining), 0); hv_store(ret, "truncate", 8, newSViv(a.truncate), 0); if (a.filterTo) hv_store(ret, "filterTo", 8, newSVpv(a.filterTo, 0), 0); if (a.filterFrom) hv_store(ret, "filterFrom", 10, newSVpv(a.filterFrom, 0), 0); if (a.filterSubject) hv_store(ret, "filterSubject", 13, newSVpv(a.filterSubject, 0), 0); } } OUTPUT: RETVAL SV * PackSyncPref(record, id) SV * record int id CODE: { int i; int len; SV ** s; HV * h; AV * av; struct MailSyncPref a; if (!SvRV(record) || (SvTYPE(h=(HV*)SvRV(record))!=SVt_PVHV)) RETVAL = record; else { if ((s = hv_fetch(h, "syncType", 8, 0))) a.syncType = SvList(*s, MailSyncTypeNames); else a.syncType = 0; a.getHigh = (s=hv_fetch(h,"getHigh",7,0)) ? SvIV(*s) : 0; a.getContaining = (s=hv_fetch(h,"getContaining",13,0)) ? SvIV(*s) : 0; a.truncate = (s=hv_fetch(h,"truncate",8,0)) ? SvIV(*s) : 0; a.filterTo = (s=hv_fetch(h,"filterTo",8,0)) ? SvPV(*s,na) : 0; a.filterFrom = (s=hv_fetch(h,"filterFrom",10,0)) ? SvPV(*s,na) : 0; a.filterSubject = (s=hv_fetch(h,"filterSubject",13,0)) ? SvPV(*s,na) : 0; len = pack_MailSyncPref(&a, mybuf, 0xffff); RETVAL = newSVpvn((char *) mybuf, len); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } } OUTPUT: RETVAL SV * UnpackSignaturePref(record) SV * record CODE: { STRLEN len; AV * e; HV * ret; int i; struct MailSignaturePref a; if (SvOK(record) && SvRV(record) && (SvTYPE(SvRV(record)) == SVt_PVHV)) { SV ** raw; ret = (HV*)SvRV(record); raw = hv_fetch(ret, "raw", 3, 0); if (!raw || !SvOK(*raw)) croak("Unable to unpack"); RETVAL = newSVsv(record); record = *raw; } else { ret = newHV(); hv_store(ret, "raw", 3, newSVsv(record),0); RETVAL = newRV_noinc((SV*)ret); } SvPV(record,len); if (unpack_MailSignaturePref(&a, (CPTR)SvPV(record, na), len)>0) { if (a.signature) hv_store(ret, "signature", 9, newSVpv(a.signature, 0), 0); } } OUTPUT: RETVAL SV * PackSignaturePref(record, id) SV * record int id CODE: { int i; int len; SV ** s; HV * h; AV * av; struct MailSignaturePref a; if (!SvRV(record) || (SvTYPE(h=(HV*)SvRV(record))!=SVt_PVHV)) RETVAL = record; else { a.signature = (s=hv_fetch(h,"signature",9,0)) ? SvPV(*s,na) : 0; len = pack_MailSignaturePref(&a, mybuf, 0xffff); RETVAL = newSVpvn((char *) mybuf, len); hv_store(h, "raw", 3, SvREFCNT_inc(RETVAL), 0); } } OUTPUT: RETVAL MODULE = PDA::Pilot PACKAGE = PDA::Pilot int close(socket) int socket CODE: RETVAL = pi_close(socket); OUTPUT: RETVAL int write(socket, msg) int socket SV * msg CODE: { STRLEN len; SvPV(msg, len); RETVAL = pi_write(socket,SvPV(msg,na),len); } SV * read(socket, len) int socket int len CODE: { int result; result = pi_read(socket, &pibuf, len); if (result >=0) RETVAL = newSVpvn((char *) pibuf.data, result); else RETVAL = &sv_undef; } OUTPUT: RETVAL int socket(domain, type, protocol) int domain int type int protocol CODE: RETVAL = pi_socket(domain, type, protocol); OUTPUT: RETVAL int listen(socket, backlog) int socket int backlog CODE: RETVAL = pi_listen(socket, backlog); OUTPUT: RETVAL char * errorText(error) int error CODE: RETVAL = dlp_strerror(error); OUTPUT: RETVAL int bind(socket, port) int socket char * port CODE: RETVAL = pi_bind(socket, port); OUTPUT: RETVAL int openPort(port) char * port CODE: { int socket = pi_socket(PI_AF_PILOT, PI_SOCK_STREAM, PI_PF_DLP); pi_bind(socket, port); pi_listen(socket, 1); RETVAL = socket; } OUTPUT: RETVAL void accept(socket) int socket PPCODE: { struct pi_sockaddr a; size_t len = sizeof(struct pi_sockaddr); int result; result = pi_accept(socket, (struct sockaddr*)&a, &len); EXTEND(SP, 1); if (result < 0) { PUSHs(sv_newmortal()); } else { PDA__Pilot__DLP * x = malloc(sizeof(PDA__Pilot__DLP)); SV * sv = newSViv((IV)(void*)x); x->errnop = 0; x->socket = result; SV * rv = newRV_noinc(sv); sv_bless(rv, gv_stashpv("PDA::Pilot::DLPPtr",0)); PUSHs(sv_2mortal(rv)); } /* In list context, return error code as a second value */ if (GIMME_V == G_ARRAY) { EXTEND(SP, 1); if (result < 0) { PUSHs(sv_2mortal(newSViv(result))); } else { PUSHs(sv_newmortal()); } } } MODULE = PDA::Pilot PACKAGE = PDA::Pilot::DLP::DBPtr void DESTROY(db) PDA::Pilot::DLP::DB * db CODE: if (db->Class) SvREFCNT_dec(db->Class); if (db->handle) dlp_CloseDB(db->socket, db->handle); if (db->dbname) SvREFCNT_dec(db->dbname); SvREFCNT_dec(db->connection); free(db); int errno(self) PDA::Pilot::DLP::DB *self CODE: RETVAL = self->errnop; self->errnop = 0; OUTPUT: RETVAL int palmos_errno(self) PDA::Pilot::DLP::DB *self CODE: RETVAL = pi_palmos_error(self->socket); OUTPUT: RETVAL MODULE = PDA::Pilot PACKAGE = PDA::Pilot::DLP::DBPtr SV * class(self, name=0) PDA::Pilot::DLP::DB *self SV * name CODE: { SV ** s = 0; HV * h; if (name) { STRLEN len; h = perl_get_hv("PDA::Pilot::DBClasses", 0); if (!h) croak("DBClasses doesn't exist"); if (SvOK(name)) { (void)SvPV(name,len); s = hv_fetch(h, SvPV(name,na), len, 0); } if (!s) s = hv_fetch(h, "", 0, 0); if (!s) croak("Default DBClass not defined"); SvREFCNT_inc(*s); if (self->Class) SvREFCNT_dec(self->Class); self->Class = *s; } RETVAL = newSVsv(self->Class); } OUTPUT: RETVAL Result close(self) PDA::Pilot::DLP::DB *self CODE: RETVAL = dlp_CloseDB(self->socket, self->handle); self->handle=0; OUTPUT: RETVAL Result setSortBlock(self, data) PDA::Pilot::DLP::DB *self SV *data CODE: { STRLEN len; void * c; PackSI; c = SvPV(data, len); RETVAL = dlp_WriteSortBlock(self->socket, self->handle, c, len); } OUTPUT: RETVAL SV * getAppBlock(self) PDA::Pilot::DLP::DB *self PPCODE: { int result = dlp_ReadAppBlock(self->socket, self->handle, 0, -1, &pibuf); ReturnReadAI(pibuf.data, result); } SV * getSortBlock(self) PDA::Pilot::DLP::DB *self PPCODE: { int result = dlp_ReadSortBlock(self->socket,self->handle, 0, -1, &pibuf); ReturnReadSI(pibuf.data, result); } Result setAppBlock(self, data) PDA::Pilot::DLP::DB *self SV *data CODE: { STRLEN len; void * c; PackAI; c = SvPV(data, len); RETVAL = dlp_WriteAppBlock(self->socket, self->handle, c, len); } OUTPUT: RETVAL Result purge(self) PDA::Pilot::DLP::DB *self CODE: RETVAL = dlp_CleanUpDatabase(self->socket, self->handle); OUTPUT: RETVAL Result resetFlags(self) PDA::Pilot::DLP::DB *self CODE: RETVAL = dlp_ResetSyncFlags(self->socket, self->handle); OUTPUT: RETVAL Result deleteCategory(self, category) PDA::Pilot::DLP::DB *self int category CODE: RETVAL = dlp_DeleteCategory(self->socket, self->handle, category); OUTPUT: RETVAL void newRecord(self, id=0, attr=0, cat=0) PDA::Pilot::DLP::DB *self SV * id SV * attr SV * cat PPCODE: { if (self->Class) { int count; PUSHMARK(sp); XPUSHs(self->Class); if (id) XPUSHs(id); if (attr) XPUSHs(attr); if (cat) XPUSHs(cat); PUTBACK; count = perl_call_method("record", G_SCALAR); SPAGAIN; if (count != 1) croak("Unable to create record"); } else { croak("Class not defined"); } } void newResource(self, type=0, id=0) PDA::Pilot::DLP::DB *self SV * type SV * id PPCODE: { if (self->Class) { int count; PUSHMARK(sp); XPUSHs(self->Class); if (type) XPUSHs(type); if (id) XPUSHs(id); PUTBACK; count = perl_call_method("resource", G_SCALAR); SPAGAIN; if (count != 1) croak("Unable to create record"); } else { croak("Class not defined"); } } void newAppBlock(self) PDA::Pilot::DLP::DB *self PPCODE: { if (self->Class) { int count; PUSHMARK(sp); XPUSHs(self->Class); PUTBACK; count = perl_call_method("appblock", G_SCALAR); SPAGAIN; if (count != 1) croak("Unable to create record"); } else { croak("Class not defined"); } } void newSortBlock(self) PDA::Pilot::DLP::DB *self PPCODE: { if (self->Class) { int count; PUSHMARK(sp); XPUSHs(self->Class); PUTBACK; count = perl_call_method("sortblock", G_SCALAR); SPAGAIN; if (count != 1) croak("Unable to create record"); } else { croak("Class not defined"); } } void newPref(self, id=0, version=0, backup=0, creator=0) PDA::Pilot::DLP::DB *self SV * id SV * version SV * backup SV * creator PPCODE: { if (!creator) { int count; PUSHMARK(sp); XPUSHs(self->Class); PUTBACK; count = perl_call_method("creator", G_SCALAR); SPAGAIN; if (count != 1) croak("Unable to get creator"); creator = POPs; PUTBACK; } if (self->Class) { int count; PUSHMARK(sp); XPUSHs(self->Class); if (creator) XPUSHs(creator); if (id) XPUSHs(id); if (version) XPUSHs(version); if (backup) XPUSHs(backup); PUTBACK; count = perl_call_method("pref", G_SCALAR); SPAGAIN; if (count != 1) croak("Unable to create record"); } else { croak("Class not defined"); } } void getRecord(self, index) PDA::Pilot::DLP::DB *self int index PPCODE: { int attr, category; unsigned long id; int result; result = dlp_ReadRecordByIndex(self->socket, self->handle, index, &pibuf, &id, &attr, &category); ReturnReadRecord(pibuf.data, pibuf.used); } Result moveCategory(self, fromcat, tocat) PDA::Pilot::DLP::DB *self int fromcat int tocat CODE: RETVAL = dlp_MoveCategory(self->socket, self->handle, fromcat, tocat); OUTPUT: RETVAL Result deleteRecord(self, id) PDA::Pilot::DLP::DB *self unsigned long id CODE: RETVAL = dlp_DeleteRecord(self->socket, self->handle, 0, id); OUTPUT: RETVAL Result deleteRecords(self) PDA::Pilot::DLP::DB *self CODE: RETVAL = dlp_DeleteRecord(self->socket, self->handle, 1, 0); OUTPUT: RETVAL Result resetNext(self) PDA::Pilot::DLP::DB *self CODE: RETVAL = dlp_ResetDBIndex(self->socket, self->handle); OUTPUT: RETVAL int getRecords(self) PDA::Pilot::DLP::DB *self CODE: { int result = dlp_ReadOpenDBInfo(self->socket, self->handle, &RETVAL); if (result < 0) { RETVAL = newSVsv(&sv_undef); self->errnop = result; } } OUTPUT: RETVAL void getRecordIDs(self, sort=0) PDA::Pilot::DLP::DB *self int sort PPCODE: { recordid_t * id = (recordid_t*)mybuf; int result; int start; int count; int i; AV * list = newAV(); start = 0; for(;;) { result = dlp_ReadRecordIDList(self->socket, self->handle, sort, start, 0xFFFF/sizeof(recordid_t), id, &count); if (result < 0) { self->errnop = result; break; } else { for(i=0;isocket, self->handle, id, &pibuf, &index, &attr, &category); ReturnReadRecord(pibuf.data, pibuf.used); } void getNextModRecord(self, category=-1) PDA::Pilot::DLP::DB *self int category PPCODE: { int result, attr, index; unsigned long id; if (category == -1) result = dlp_ReadNextModifiedRec(self->socket, self->handle, &pibuf, &id, &index, &attr, &category); else result = dlp_ReadNextModifiedRecInCategory(self->socket, self->handle, category, &pibuf, &id, &index, &attr); ReturnReadRecord(pibuf.data, pibuf.used); } void getNextRecord(self, category) PDA::Pilot::DLP::DB *self int category PPCODE: { int result, attr, index; unsigned long id; result = dlp_ReadNextRecInCategory(self->socket, self->handle, category, &pibuf, &id, &index, &attr); ReturnReadRecord(pibuf.data, pibuf.used); } unsigned long setRecord(self, data) PDA::Pilot::DLP::DB *self SV *data CODE: { STRLEN len; unsigned long id; int attr, category; int result; void * c; PackRecord; c = SvPV(data, len); result = dlp_WriteRecord(self->socket, self->handle, attr, id, category, c, len, &RETVAL); if (result<0) { RETVAL = 0; self->errnop = result; } } OUTPUT: RETVAL unsigned long setRecordRaw(self, data, id, attr, category) PDA::Pilot::DLP::DB *self unsigned long id int attr int category SV *data CODE: { STRLEN len; int result; void * c; PackRaw; c = SvPV(data, len); result = dlp_WriteRecord(self->socket, self->handle, attr, id, category, c, len, &RETVAL); if (result<0) { RETVAL = 0; self->errnop = result; } } OUTPUT: RETVAL void setResourceByID(self, type, id) PDA::Pilot::DLP::DB *self Char4 type int id PPCODE: { int result, index; result = dlp_ReadResourceByType(self->socket, self->handle, type, id, &pibuf, &index); ReturnReadResource(pibuf.data, pibuf.used); } void getResource(self, index) PDA::Pilot::DLP::DB *self int index PPCODE: { int result, id; Char4 type; result = dlp_ReadResourceByIndex(self->socket, self->handle, index, &pibuf, &type, &id); ReturnReadResource(pibuf.data, pibuf.used); } SV * setResource(self, data) PDA::Pilot::DLP::DB *self SV *data CODE: { STRLEN len; int result; Char4 type; int id; void * c; PackResource; c = SvPV(data, len); result = dlp_WriteResource(self->socket, self->handle, type, id, c, len); if (result < 0) { self->errnop = result; RETVAL = newSVsv(&sv_undef); } else RETVAL = newSViv(result); } OUTPUT: RETVAL Result deleteResource(self, type, id) PDA::Pilot::DLP::DB *self Char4 type int id CODE: RETVAL = dlp_DeleteResource(self->socket, self->handle, 0, type, id); OUTPUT: RETVAL Result deleteResources(self) PDA::Pilot::DLP::DB *self CODE: RETVAL = dlp_DeleteResource(self->socket, self->handle, 1, 0, 0); OUTPUT: RETVAL void getPref(self, id=0, backup=1) PDA::Pilot::DLP::DB *self int id int backup PPCODE: { Char4 creator; int version, result; size_t len; SV * c, n, v; int r; if (self->Class) { int count; PUSHMARK(sp); XPUSHs(self->Class); PUTBACK; count = perl_call_method("creator", G_SCALAR); SPAGAIN; if (count != 1) croak("Unable to get creator"); creator = SvChar4(POPs); PUTBACK; } if (pi_version(self->socket)< 0x101) r = dlp_CloseDB(self->socket, self->handle); result = dlp_ReadAppPreference(self->socket, creator, id, backup, 0xFFFF, mybuf, &len, &version); if (pi_version(self->socket)< 0x101) r = dlp_OpenDB(self->socket, self->dbcard, self->dbmode, SvPV(self->dbname,na), &self->handle); ReturnReadPref(mybuf, len); } SV * setPref(self, data) PDA::Pilot::DLP::DB *self SV *data PPCODE: { Char4 creator; int id; int version; int backup; STRLEN len; int result; void * buf; int r; PackPref; buf = SvPV(data, len); if (pi_version(self->socket)< 0x101) r = dlp_CloseDB(self->socket, self->handle); result = dlp_WriteAppPreference(self->socket, creator, id, backup, version, buf, len); if (pi_version(self->socket)< 0x101) r = dlp_OpenDB(self->socket, self->dbcard, self->dbmode, SvPV(self->dbname,na), &self->handle); if (result < 0) { self->errnop = result; RETVAL = newSVsv(&sv_undef); } else { RETVAL = newSViv(result); } } SV * setPrefRaw(self, data, number, version, backup=1) PDA::Pilot::DLP::DB *self SV *data int number int version int backup PPCODE: { STRLEN len; Char4 creator; int version, result; void * buf; PackRaw; buf = SvPV(data, len); if (self->Class) { int count; PUSHMARK(sp); XPUSHs(self->Class); PUTBACK; count = perl_call_method("creator", G_SCALAR); SPAGAIN; if (count != 1) croak("Unable to get creator"); creator = SvChar4(POPs); PUTBACK; } result = dlp_WriteAppPreference(self->socket, creator, number, backup, version, buf, len); if (result < 0) { self->errnop = result; RETVAL = newSVsv(&sv_undef); } else { RETVAL = newSViv(result); } } MODULE = PDA::Pilot PACKAGE = PDA::Pilot::DLPPtr void DESTROY(self) PDA::Pilot::DLP *self CODE: if (self->socket) pi_close(self->socket); free(self); int errno(self) PDA::Pilot::DLP *self CODE: RETVAL = self->errnop; self->errnop = 0; OUTPUT: RETVAL int palmos_errno(self) PDA::Pilot::DLP *self CODE: RETVAL = pi_palmos_error(self->socket); OUTPUT: RETVAL SV * getTime(self) PDA::Pilot::DLP *self CODE: { time_t t; int result = dlp_GetSysDateTime(self->socket, &t); if (result < 0) { self->errnop = result; RETVAL = newSVsv(&sv_undef); } else RETVAL = newSViv(t); } OUTPUT: RETVAL Result setTime(self, time) PDA::Pilot::DLP *self long time CODE: RETVAL = dlp_SetSysDateTime(self->socket, time); OUTPUT: RETVAL SV * getSysInfo(self) PDA::Pilot::DLP *self CODE: { struct SysInfo si; int result = dlp_ReadSysInfo(self->socket, &si); if (result < 0) { self->errnop = result; RETVAL = newSVsv(&sv_undef); } else { HV * i = newHV(); hv_store(i, "romVersion", 10, newSViv(si.romVersion), 0);\ hv_store(i, "locale", 6, newSViv(si.locale), 0);\ hv_store(i, "product", 4, newSVpvn(si.prodID, si.prodIDLength), 0);\ RETVAL = newRV((SV*)i); } } OUTPUT: RETVAL SV * getCardInfo(self, cardno=0) PDA::Pilot::DLP *self int cardno CODE: { struct CardInfo c; int result = dlp_ReadStorageInfo(self->socket, cardno, &c); if (result < 0) { self->errnop = result; RETVAL = newSVsv(&sv_undef); } else { HV * i = newHV(); hv_store(i, "card", 6, newSViv(c.card), 0);\ hv_store(i, "version", 7, newSViv(c.version), 0);\ hv_store(i, "created", 8, newSViv(c.creation), 0);\ hv_store(i, "romSize", 7, newSViv(c.romSize), 0);\ hv_store(i, "ramSize", 7, newSViv(c.ramSize), 0);\ hv_store(i, "ramFree", 7, newSViv(c.ramFree), 0);\ hv_store(i, "name", 4, newSVpv(c.name,0), 0);\ hv_store(i, "manufacturer", 12, newSVpv(c.manufacturer,0), 0);\ RETVAL = newRV((SV*)i); } } OUTPUT: RETVAL int setUserInfo(self, info) PDA::Pilot::DLP *self UserInfo &info CODE: RETVAL = dlp_WriteUserInfo(self->socket, &info); OUTPUT: RETVAL void getBattery(self) PDA::Pilot::DLP *self PPCODE: { int warn, critical, ticks, kind, AC; unsigned long voltage; int result; struct RPC_params p; PackRPC(&p,0xA0B6, RPC_IntReply, RPC_Byte(0), RPC_ShortPtr(&warn), RPC_ShortPtr(&critical), RPC_ShortPtr(&ticks), RPC_BytePtr(&kind), RPC_BytePtr(&AC), RPC_End); result = dlp_RPC(self->socket, &p, &voltage); if (result==0) { EXTEND(sp,5); PUSHs(sv_2mortal(newSVnv((float)voltage/100))); PUSHs(sv_2mortal(newSVnv((float)warn/100))); PUSHs(sv_2mortal(newSVnv((float)critical/100))); PUSHs(sv_2mortal(newSViv(kind))); PUSHs(sv_2mortal(newSViv(AC))); } } SV * getUserInfo(self) PDA::Pilot::DLP *self CODE: { UserInfo info; int result; result = dlp_ReadUserInfo(self->socket, &info); pack_userinfo(RETVAL, info, result); } OUTPUT: RETVAL void newPref(self, creator, id=0, version=0, backup=0) PDA::Pilot::DLP *self Char4 creator SV * id SV * version SV * backup PPCODE: { HV * h = perl_get_hv("PDA::Pilot::PrefClasses", 0); SV ** s; int count; if (!h) croak("PrefClasses doesn't exist"); s = hv_fetch(h, printlong(creator), 4, 0); if (!s) s = hv_fetch(h, "", 0, 0); if (!s) croak("Default PrefClass not defined"); PUSHMARK(sp); XPUSHs(newSVsv(*s)); XPUSHs(&sv_undef); XPUSHs(sv_2mortal(newSVChar4(creator))); if (id) XPUSHs(id); if (version) XPUSHs(version); if (backup) XPUSHs(backup); PUTBACK; count = perl_call_method("pref", G_SCALAR); SPAGAIN; if (count != 1) croak("Unable to create resource"); } Result delete(self, name, cardno=0) PDA::Pilot::DLP *self char * name int cardno CODE: { UserInfo info; int result; RETVAL = dlp_DeleteDB(self->socket, cardno, name); } OUTPUT: RETVAL SV * open(self, name, mode=0, cardno=0) PDA::Pilot::DLP *self char * name SV * mode int cardno CODE: { int handle; int nummode; int result; if (!mode) nummode = dlpOpenRead|dlpOpenWrite|dlpOpenSecret; else { char *c; STRLEN len; nummode = SvIV(mode); if (SvPOKp(mode)) { c = SvPV(mode, len); while (*c) { switch (*c) { case 'r': nummode |= dlpOpenRead; break; case 'w': nummode |= dlpOpenWrite; break; case 'x': nummode |= dlpOpenExclusive; break; case 's': nummode |= dlpOpenSecret; break; } c++; } } } result = dlp_OpenDB(self->socket, cardno, nummode, name, &handle); if (result<0) { self->errnop = result; RETVAL = &sv_undef; } else { int type; PDA__Pilot__DLP__DB * x = malloc(sizeof(PDA__Pilot__DLP__DB)); SV * sv = newSViv((IV)(void*)x); SvREFCNT_inc(ST(0)); x->connection = ST(0); x->socket = self->socket; x->handle = handle; x->errnop = 0; x->dbname = newSVpv(name,0); x->dbmode = nummode; x->dbcard = cardno; RETVAL = newRV(sv); SvREFCNT_dec(sv); sv_bless(RETVAL, gv_stashpv("PDA::Pilot::DLP::DBPtr",0)); { HV * h = perl_get_hv("PDA::Pilot::DBClasses", 0); SV ** s; if (!h) croak("DBClasses doesn't exist"); s = hv_fetch(h, name, strlen(name), 0); if (!s) s = hv_fetch(h, "", 0, 0); if (!s) croak("Default DBClass not defined"); x->Class = *s; SvREFCNT_inc(*s); } } } OUTPUT: RETVAL SV * create(self, name, creator, type, flags, version, cardno=0) PDA::Pilot::DLP *self char * name Char4 creator Char4 type int flags int version int cardno CODE: { int handle; int result = dlp_CreateDB(self->socket, creator, type, cardno, flags, version, name, &handle); if (result<0) { self->errnop = result; RETVAL = &sv_undef; } else { PDA__Pilot__DLP__DB * x = malloc(sizeof(PDA__Pilot__DLP__DB)); SV * sv = newSViv((IV)(void*)x); SvREFCNT_inc(ST(0)); x->connection = ST(0); x->socket = self->socket; x->handle = handle; x->errnop = 0; x->dbname = newSVpv(name,0); x->dbmode = dlpOpenRead|dlpOpenWrite|dlpOpenSecret; x->dbcard = cardno; RETVAL = newRV(sv); SvREFCNT_dec(sv); sv_bless(RETVAL, gv_stashpv("PDA::Pilot::DLP::DBPtr",0)); { HV * h = perl_get_hv("PDA::Pilot::DBClasses", 0); SV ** s; if (!h) croak("DBClasses doesn't exist"); s = hv_fetch(h, name, strlen(name), 0); if (!s) s = hv_fetch(h, "", 0, 0); if (!s) croak("Default DBClass not defined"); x->Class = *s; SvREFCNT_inc(*s); } } } OUTPUT: RETVAL void getPref(self, creator, id=0, backup=1) PDA::Pilot::DLP *self Char4 creator int id int backup PPCODE: { int version, result; size_t len; SV * c, n, v; result = dlp_ReadAppPreference(self->socket, creator, id, backup, 0xFFFF, mybuf, &len, &version); ReturnReadPref(mybuf, len); } SV * setPref(self, data) PDA::Pilot::DLP *self SV *data PPCODE: { Char4 creator; int id; int version; int backup; STRLEN len; int result; void * buf; PackPref; buf = SvPV(data, len); result = dlp_WriteAppPreference(self->socket, creator, id, backup, version, buf, len); if (result < 0) { self->errnop = result; RETVAL = newSVsv(&sv_undef); } else { RETVAL = newSViv(result); } } SV * setPrefRaw(self, data, creator, number, version, backup=1) PDA::Pilot::DLP *self SV *data Char4 creator int number int version int backup PPCODE: { STRLEN len; int version, result; void * buf; PackRaw; buf = SvPV(data, len); result = dlp_WriteAppPreference(self->socket, creator, number, backup, version, buf, len); if (result < 0) { self->errnop = result; RETVAL = newSVsv(&sv_undef); } else { RETVAL = newSViv(result); } } Result close(self, status=0) PDA::Pilot::DLP *self int status CODE: RETVAL = dlp_EndOfSync(self->socket, status) || pi_close(self->socket); if (!RETVAL) self->socket = 0; OUTPUT: RETVAL Result abort(self) PDA::Pilot::DLP *self CODE: RETVAL = dlp_AbortSync(self->socket) || pi_close(self->socket); if (!RETVAL) self->socket = 0; OUTPUT: RETVAL Result reset(self) PDA::Pilot::DLP *self CODE: RETVAL = dlp_ResetSystem(self->socket); OUTPUT: RETVAL Result getStatus(self) PDA::Pilot::DLP *self CODE: RETVAL = dlp_OpenConduit(self->socket); OUTPUT: RETVAL Result log(self, message) PDA::Pilot::DLP *self char * message CODE: RETVAL = dlp_AddSyncLogEntry(self->socket,message); OUTPUT: RETVAL Result dirty(self) PDA::Pilot::DLP *self CODE: RETVAL = dlp_ResetLastSyncPC(self->socket); OUTPUT: RETVAL SV * getDBInfo(self, start, RAM=1, ROM=0, cardno=0) PDA::Pilot::DLP *self int start int RAM int ROM int cardno CODE: { struct DBInfo info; int where = (RAM ? dlpDBListRAM : 0) | (ROM ? dlpDBListROM : 0); int result = dlp_ReadDBList(self->socket, cardno, where, start, &pibuf); pack_dbinfo(RETVAL,(*(struct DBInfo *)(pibuf.data)), result); } OUTPUT: RETVAL SV * findDBInfo(self, start, name, creator, type, cardno=0) PDA::Pilot::DLP *self int start SV * name SV * creator SV * type int cardno CODE: { struct DBInfo info; Char4 c,t; int result; if (SvOK(creator)) c = SvChar4(creator); else c = 0; if (SvOK(type)) t = SvChar4(type); else t = 0; result = dlp_FindDBInfo(self->socket, cardno, start, SvOK(name) ? SvPV(name,na) : 0, t, c, &info); pack_dbinfo(RETVAL, info, result); } OUTPUT: RETVAL SV * getFeature(self, creator, number) PDA::Pilot::DLP *self Char4 creator int number CODE: { unsigned long f; int result; if ((result = dlp_ReadFeature(self->socket, creator, number, &f))<0) { RETVAL = newSVsv(&sv_undef); self->errnop = result; } else { RETVAL = newSViv(f); } } OUTPUT: RETVAL void getROMToken(self,token) PDA::Pilot::DLP *self Char4 token PPCODE: { char buffer[50]; long long_token; size_t size; int result; result = dlp_GetROMToken(self->socket, token, buffer, &size); if (result==0) { EXTEND(sp,1); PUSHs(sv_2mortal(newSVpvn(buffer, size))); } } void callApplication(self, creator, type, action, data=&sv_undef) PDA::Pilot::DLP *self Char4 creator Char4 type int action SV *data PPCODE: { unsigned long retcode; STRLEN len; int result; (void)SvPV(data,len); result = dlp_CallApplication(self->socket, creator, type, action, len, SvPV(data,na), &retcode, &pibuf); EXTEND(sp, 2); if (result >= 0) { PUSHs(sv_2mortal(newSVpvn((char *) pibuf.data, pibuf.used))); if (GIMME != G_SCALAR) { PUSHs(sv_2mortal(newSViv(retcode))); } } else PUSHs(&sv_undef); } int tickle(self) PDA::Pilot::DLP *self CODE: { RETVAL = pi_tickle(self->socket); } OUTPUT: RETVAL int watchdog(self, interval) PDA::Pilot::DLP *self int interval CODE: { RETVAL = pi_watchdog(self->socket, interval); } OUTPUT: RETVAL MODULE = PDA::Pilot PACKAGE = PDA::Pilot::File PDA::Pilot::File * open(name) char * name CODE: { RETVAL = calloc(sizeof(PDA__Pilot__File),1); RETVAL->errnop = 0; RETVAL->pf = pi_file_open(name); { HV * h = perl_get_hv("PDA::Pilot::DBClasses", 0); SV ** s; if (!h) croak("DBClasses doesn't exist"); s = hv_fetch(h, name, strlen(name), 0); if (!s) s = hv_fetch(h, "", 0, 0); if (!s) croak("Default DBClass not defined"); RETVAL->Class = *s; SvREFCNT_inc(*s); } } OUTPUT: RETVAL PDA::Pilot::File * create(name, info) char * name DBInfo info CODE: RETVAL = calloc(sizeof(PDA__Pilot__File),1); RETVAL->errnop = 0; RETVAL->pf = pi_file_create(name, &info); { HV * h = perl_get_hv("PDA::Pilot::DBClasses", 0); SV ** s; if (!h) croak("DBClasses doesn't exist"); s = hv_fetch(h, name, strlen(name), 0); if (!s) s = hv_fetch(h, "", 0, 0); if (!s) croak("Default DBClass not defined"); RETVAL->Class = *s; SvREFCNT_inc(*s); } OUTPUT: RETVAL MODULE = PDA::Pilot PACKAGE = PDA::Pilot::FilePtr int errno(self) PDA::Pilot::File *self CODE: RETVAL = self->errnop; self->errnop = 0; OUTPUT: RETVAL void DESTROY(self) PDA::Pilot::File *self CODE: if (self->pf) pi_file_close(self->pf); if (self->Class) SvREFCNT_dec(self->Class); free(self); SV * class(self, name=0) PDA::Pilot::File *self SV * name CODE: { SV ** s = 0; HV * h; if (name) { STRLEN len; h = perl_get_hv("PDA::Pilot::DBClasses", 0); if (!h) croak("DBClasses doesn't exist"); if (SvOK(name)) { (void)SvPV(name, len); s = hv_fetch(h, SvPV(name, na), len, 0); } if (!s) s = hv_fetch(h, "", 0, 0); if (!s) croak("Default DBClass not defined"); SvREFCNT_inc(*s); if (self->Class) SvREFCNT_dec(self->Class); self->Class = *s; } RETVAL = newSVsv(self->Class); } OUTPUT: RETVAL int close(self) PDA::Pilot::File *self CODE: if (self->pf) { RETVAL = pi_file_close(self->pf); self->pf = 0; } else RETVAL = 0; OUTPUT: RETVAL SV * getAppBlock(self) PDA::Pilot::File *self PPCODE: { int result = 0; size_t len; void * buf; pi_file_get_app_info(self->pf, &buf, &len); ReturnReadAI(buf, (int)len); } SV * getSortBlock(self) PDA::Pilot::File *self PPCODE: { int result = 0; size_t len; void * buf; pi_file_get_sort_info(self->pf, &buf, &len); ReturnReadSI(buf, (int)len); } SV * getRecords(self) PDA::Pilot::File *self CODE: { int len, result = 0; pi_file_get_entries(self->pf, &len); RETVAL = newSViv((int)len); } OUTPUT: RETVAL SV * getResource(self, index) PDA::Pilot::File *self int index CODE: { int result, id; size_t len; Char4 type; void * buf; result = pi_file_read_resource(self->pf, index, &buf, &len, &type, &id); ReturnReadResource(buf,(int)len); } OUTPUT: RETVAL SV * getRecord(self, index) PDA::Pilot::File *self int index PPCODE: { int result, attr, category; size_t len; unsigned long id; void * buf; result = pi_file_read_record(self->pf, index, &buf, &len, &attr, &category, &id); ReturnReadRecord(buf,(int)len); } SV * getRecordByID(self, id) PDA::Pilot::File *self unsigned long id CODE: { int result; size_t len; int attr, category, index; void * buf; result = pi_file_read_record_by_id(self->pf, id, &buf, &len, &index, &attr, &category); ReturnReadRecord(buf, (int)len); } OUTPUT: RETVAL int checkID(self, uid) PDA::Pilot::File *self unsigned long uid CODE: RETVAL = pi_file_id_used(self->pf, uid); OUTPUT: RETVAL SV * getDBInfo(self) PDA::Pilot::File *self CODE: { DBInfo result; pi_file_get_info(self->pf, &result); pack_dbinfo(RETVAL, result, 0); } OUTPUT: RETVAL int setDBInfo(self, info) PDA::Pilot::File *self DBInfo info CODE: RETVAL = pi_file_set_info(self->pf, &info); OUTPUT: RETVAL int setAppBlock(self, data) PDA::Pilot::File *self SV *data CODE: { STRLEN len; char * c; PackAI; c = SvPV(data, len); RETVAL = pi_file_set_app_info(self->pf, c, len); } OUTPUT: RETVAL int setSortBlock(self, data) PDA::Pilot::File *self SV *data CODE: { STRLEN len; char * c; PackSI; c = SvPV(data, len); RETVAL = pi_file_set_sort_info(self->pf, c, len); } OUTPUT: RETVAL int addResource(self, data, type, id) PDA::Pilot::File *self SV *data Char4 type int id CODE: { STRLEN len; int result; void * buf; PackResource; buf = SvPV(data, len); RETVAL = pi_file_append_resource(self->pf, buf, len, type, id); } OUTPUT: RETVAL int addRecord(self, data) PDA::Pilot::File *self SV *data CODE: { STRLEN len; unsigned long id; int attr, category; int result; void * buf; PackRecord; buf = SvPV(data, len); RETVAL = pi_file_append_record(self->pf, buf, len, attr, category, id); } OUTPUT: RETVAL int addRecordRaw(self, data, uid, attr, category) PDA::Pilot::File *self SV *data unsigned long uid int attr int category CODE: { STRLEN len; int result; void * buf; PackRaw; buf = SvPV(data, len); RETVAL = pi_file_append_record(self->pf, buf, len, attr, category, uid); } OUTPUT: RETVAL int install(self, socket, cardno) PDA::Pilot::File *self PDA::Pilot::DLP *socket int cardno CODE: RETVAL = pi_file_install(self->pf, socket->socket, cardno, NULL); OUTPUT: RETVAL int retrieve(self, socket, cardno) PDA::Pilot::File *self PDA::Pilot::DLP *socket int cardno CODE: RETVAL = pi_file_retrieve(self->pf, socket->socket, cardno, NULL); OUTPUT: RETVAL pilot-link-0.12.5-dfsg/bindings/Perl/typemap0000644000175000017500000000173407176416224021217 0ustar rousseaurousseauTYPEMAP PDA::Pilot::File * T_PTROBJ PDA::Pilot::DLP * T_PTROBJ PDA::Pilot::DLP::DB * T_PTROBJ PDA::Pilot::DLP::ResourceDB * T_PTROBJ PDA::Pilot::DLP::RecordDB * T_PTROBJ DlpDB T_PTROBJ DBInfo T_DBInfo UserInfo T_UserInfo Char4 T_CHAR4 Result T_RESULT INPUT T_DBInfo unpack_dbinfo($arg, $var); T_UserInfo unpack_userinfo($arg, $var); T_CHAR4 { if (SvIOKp($arg) || SvNOKp($arg)) $var = SvIV($arg); else { STRLEN len; char * c = SvPV($arg, len); $var = makelong(c); } } T_PTROBJ if (sv_derived_from($arg, \"${ntype}\")) { IV tmp = SvIV((SV*)SvRV($arg)); $var = ($type) tmp; } else croak(\"$var is not of type ${ntype}\") OUTPUT T_DBInfo pack_dbinfo($arg, $var, 0); T_UserInfo pack_userinfo($arg, $var, 0); T_CHAR4 { char * c = printlong($var); sv_setpvn($arg, c, 4); } T_RESULT if ($var < 0) { sv_setsv($arg, &sv_no); self->errnop = $var; } else sv_setsv($arg, &sv_yes); T_PTROBJ sv_setref_pv($arg, \"${ntype}\", (void*)$var); pilot-link-0.12.5-dfsg/bindings/Perl/test.pl0000644000175000017500000001056610046473437021133 0ustar rousseaurousseau#!/usr/bin/env perl use strict; use warnings; # use diagnostics; use PDA::Pilot; use Data::Dumper; # Test::Harness will hijack STDERR and STDOUT, waiting for an 'ok' on a test # result. If you run this non-interatively, it will seem to hang, just run # it interactively to test it until this test is corrected. my ($port, # device port $db, # database to dump $socket, # socket descriptor $app, # AppInfo block $dlp, # sd = pilot_connect(port); $ui, # dlp_ReadUserInfo $info, # dlp_ReadOpenDBInfo $rec); # record count if ($ARGV[0]) { $port = $ARGV[0]; } else { print "What port should I use [/dev/pilot]: "; $port = ; chomp $port; $port ||= "/dev/pilot"; } $socket = PDA::Pilot::openPort($port) or die "$!"; # # openPort is the equivalent of: # # $socket = PDA::Pilot::socket(PI_AF_PILOT, PI_SOCK_STREAM, PI_PF_DLP); # PDA::Pilot::bind($socket, {family => PI_AF_PILOT, device => $port}); # PDA::Pilot::listen($socket, 1); # print "Please press the HotSync button\n"; $dlp = PDA::Pilot::accept($socket) or die "$!"; print Dumper($dlp); # dump_sysinfo(); dump_memopad(); dump_datebook(); dump_mail(); dump_expense(); undef $db; # Close database undef $dlp; # Close connection ############################################################ # # Read UserInfo, SysInfo, DBInfo # ############################################################ sub dump_sysinfo { $ui = $dlp->getUserInfo; my @b = $dlp->getBattery; $info = $dlp->getDBInfo(0); print "-"x40, "\n"; print "Dumping SysInfo\n"; print "-"x40, "\n"; print Dumper($info); print "Battery voltage is $b[0], (warning marker $b[1], critical marker $b[2])\n"; print "Your name is $ui->{name}\n"; } ############################################################ # # Dump MemoDB.pdb # ############################################################ sub dump_memopad { $db = $dlp->open("MemoDB") or die "$!"; if ($db) { print "-"x40, "\n"; print "Dumping MemoDB\n"; print "-"x40, "\n"; print "db class is ", ref $db, "\n"; # $rec = $db->getRecord(0); # print "Contents: '$rec->{text}'\n"; my $app = $db->getAppBlock; # Dump all records to STDOUT # print Dumper($app); print "Categories: @{$app->{categoryName}}\n"; print Dumper($db->getPref(0)); print Dumper($db->getPref(1)); $db->close(); } } ############################################################ # # Dump DatebookDB.pdb # ############################################################ sub dump_datebook { $db = $dlp->open("DatebookDB") or die "$!"; if ($db) { print "-"x40, "\n"; print "Dumping DatebookDB\n"; print "-"x40, "\n"; print "db class is ", ref $db, "\n"; # $rec = $db->getRecord(0); # print "Contents: ", Dumper($rec); my $app = $db->getAppBlock; # Dump all records to STDOUT # print Dumper($app); print "Categories: @{$app->{categoryName}}\n"; $db->close(); } } ############################################################ # # Dump MailDB.pdb # ############################################################ sub dump_mail { $PDA::Pilot::UnpackPref{mail}->{3} = sub { $_[0] . "x"}; # # $pref[0] == "Confirm deleted message" # $pref[1] == "Default Mail" # $pref[2] == "Signature text" # my @pref = $dlp->getPref('mail', 0); @pref = "not available" if (!defined $pref[0]); print "Mail preferences: @pref\n"; $db = $dlp->open("MailDB") or die "$!"; if ($db) { print "-"x40, "\n"; print "Dumping MailDB\n"; print "-"x40, "\n"; print "db class is ", ref $db, "\n"; # $rec = $db->getRecord(0); # print "Contents: ", Dumper($rec); $app = $db->getAppBlock; # Dump all records to STDOUT # print Dumper($app); $db->close(); } } ############################################################ # # Dump ExpenseDB.pdb # ############################################################ sub dump_expense { $db = $dlp->open("ExpenseDB") or die "$!"; if ($db) { print "-"x40, "\n"; print "Dumping ExpenseDB\n"; print "-"x40, "\n"; print "db class is ", ref $db, "\n"; # $rec = $db->getRecord(0); # print "Contents: ", Dumper($rec); $app = $db->getAppBlock; # Dump all records to STDOUT # print Dumper($app); print "Categories: @{$app->{categoryName}}\n"; } } pilot-link-0.12.5-dfsg/bindings/Perl/Makefile.PL0000644000175000017500000000231711333433255021556 0ustar rousseaurousseauuse ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. $prefix = "/usr/local"; $exec_prefix = "${prefix}"; $libdir = "../../libpisock/.libs"; $lib = "-L$libdir -lpisock"; $plincdir = "../../include"; $h2xsheaders = join(' ', map { "$plincdir/$_" } qw( pi-macros.h pi-buffer.h pi-file.h pi-datebook.h pi-memo.h pi-expense.h pi-address.h pi-todo.h pi-mail.h pi-socket.h pi-dlp.h pi-syspkt.h pi-error.h pi-version.h )); sub MY::postamble { "%.inc: perl ./h2xs-pilot-link -n PDA::Pilot $h2xsheaders cp PDA-Pilot/fallback/*.inc . rm -rf PDA-Pilot "; } WriteMakefile( 'NAME' => 'PDA::Pilot', 'VERSION' => '0.12.5', 'XSPROTOARG' => '-noprototypes', 'INC' => "-I$plincdir", 'DEFINE' => '-DPERL_POLLUTE', 'PREFIX' => "$prefix", 'INSTALLDIRS'=> 'vendor', 'dynamic_lib'=> {'OTHERLDFLAGS' => $lib}, 'depend' => {'Pilot.c' => 'const-c.inc const-xs.inc'}, 'clean' => {'FILES' => 'const-c.inc const-xs.inc'}, ); pilot-link-0.12.5-dfsg/bindings/Perl/Makefile.PL.in0000644000175000017500000000242610577035621022170 0ustar rousseaurousseauuse ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. $prefix = "@prefix@"; $exec_prefix = "@exec_prefix@"; $libdir = "../../libpisock/.libs"; $lib = "-L$libdir -lpisock"; $plincdir = "../../include"; $h2xsheaders = join(' ', map { "$plincdir/$_" } qw( pi-macros.h pi-buffer.h pi-file.h pi-datebook.h pi-memo.h pi-expense.h pi-address.h pi-todo.h pi-mail.h pi-socket.h pi-dlp.h pi-syspkt.h pi-error.h pi-version.h )); sub MY::postamble { "%.inc: @PERL@ ./h2xs-pilot-link -n PDA::Pilot $h2xsheaders cp PDA-Pilot/fallback/*.inc . rm -rf PDA-Pilot "; } WriteMakefile( 'NAME' => 'PDA::Pilot', 'VERSION' => '@PILOT_LINK_VERS@.@PILOT_LINK_MAJOR@.@PILOT_LINK_MINOR@@PILOT_LINK_PATCH@', 'XSPROTOARG' => '-noprototypes', 'INC' => "-I$plincdir", 'DEFINE' => '-DPERL_POLLUTE', 'PREFIX' => "$prefix", 'INSTALLDIRS'=> 'vendor', 'dynamic_lib'=> {'OTHERLDFLAGS' => $lib}, 'depend' => {'Pilot.c' => 'const-c.inc const-xs.inc'}, 'clean' => {'FILES' => 'const-c.inc const-xs.inc'}, ); pilot-link-0.12.5-dfsg/bindings/Perl/Pilot.pm0000644000175000017500000007275310437354633021252 0ustar rousseaurousseau# # Pilot.pm - Interface glue for the pilot-link libraries and Perl. # # Copyright (C) 1997, 1998, Kenneth Albanowski # # This library 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 of the License, or (at your # option) any later version. # # This 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 Library General Public # License for more details. # # You should have received a copy of the GNU Library General Public License # along with this library; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * # package PDA::Pilot; require Exporter; require DynaLoader; require AutoLoader; use Carp; @ISA = qw(Exporter DynaLoader); # Items to export into callers namespace by default. Note: do not export # names by default without a very good reason. Use EXPORT_OK instead. # Do not simply export all your public functions/methods/constants. @ EXPORT = qw(PI_AF_SLP PI_PF_LOOP PI_PF_PADP PI_PF_SLP PI_PilotSocketConsole PI_PilotSocketDLP PI_PilotSocketDebugger PI_PilotSocketRemoteUI PI_SOCK_DGRAM PI_SOCK_RAW PI_SOCK_SEQPACKET PI_SOCK_STREAM dlpOpenRead dlpOpenWrite dlpOpenExclusive dlpOpenSecret dlpOpenReadWrite dlpEndCodeNormal dlpEndCodeOutOfMemory dlpEndCodeUserCan dlpEndCodeOther dlpRecAttrDeleted dlpRecAttrDirty dlpRecAttrBusy dlpRecAttrSecret dlpRecAttrArchived dlpDBFlagResource dlpDBFlagReadOnly dlpDBFlagAppInfoDirty dlpDBFlagBackup dlpDBFlagOpen dlpDBFlagNewer dlpDBFlagReset dlpDBFlagCopyPrevention dlpDBFlagStream dlpDBListRAM dlpDBListROM ); # Other items we are prepared to export if requested @EXPORT_OK = qw( CompareTm ); # This AUTOLOAD is used to 'autoload' constants from the constant() XS # function. If a constant is not found then control is passed to the # AUTOLOAD in AutoLoader. sub AUTOLOAD { # This AUTOLOAD is used to 'autoload' constants from the constant() # XS function. my $constname; our $AUTOLOAD; ($constname = $AUTOLOAD) =~ s/.*:://; croak "&PDA::Pilot::constant not defined" if $constname eq 'constant'; my ($error, $val) = constant($constname); if ($error) { croak $error; } { no strict 'refs'; # Fixed between 5.005_53 and 5.005_61 #XXX if ($] >= 5.00561) { #XXX *$AUTOLOAD = sub () { $val }; #XXX } #XXX else { *$AUTOLOAD = sub { $val }; #XXX } } goto &$AUTOLOAD; } bootstrap PDA::Pilot; package PDA::Pilot::Block; ##################################################################### # # Generic functions for "blocks", i.e., chunks of data from a Pilot. # ##################################################################### sub new { my($self,$data) = @_; $self = bless {}, (ref($self) || $self); if (defined($data)) { $self->Unpack($data); } else { $self->Fill(); } return $self; } ##################################################################### # # Translate a "packed" block of binary data into a decent Perl # representation # ##################################################################### sub Unpack { my($self,$data) = @_; $self->{raw} = $data; } ##################################################################### # # Translate a Perl representation of a data block into a string of # binary data # ##################################################################### sub Pack { my($self) = @_; return $self->{raw}; } ##################################################################### # # Just copy the "raw" item straight through # ##################################################################### sub Raw { my($self) = @_; return $self->{raw}; } ##################################################################### # # Fill in a block with default Perl data # ##################################################################### sub Fill { } ##################################################################### # # Copy a block # ##################################################################### sub Clone { my($self) = @_; my($k,$v); my($new) = bless {}, ref($_); for (($k,$v) = each %$self) { $new->{$k} = $v } $new; } package PDA::Pilot::Record; ##################################################################### # # A class to represent generic database records # ##################################################################### @ISA = qw(PDA::Pilot::Block); sub new { my($self,$data,$id,$attr,$cat,$index) = @_; $index = 0 unless defined($index); $id = 0 unless defined($id); $attr = 0 unless defined($attr); $cat = "" unless defined($cat); $self = bless { "index" => $index, id => $id, deleted => !!($attr & 0x80), modified => !!($attr & 0x40), busy => !!($attr & 0x20), secret => !!($attr & 0x10), archived => !!($attr & 0x08), category => $cat}, (ref($self) || $self); if (defined($data)) { $self->Unpack($data); } else { $self->Fill(); } return $self; } package PDA::Pilot::Resource; ##################################################################### # # A class to represent generic database resources # ##################################################################### @ISA = qw(PDA::Pilot::Block); sub new { my($self,$data,$index,$type,$id) = @_; $self = bless { "index" => $index, type => $type, id => $id}, (ref($self) || $self); if (defined($data)) { $self->Unpack($data); } else { $self->Fill(); } return $self; } package PDA::Pilot::AppBlock; ##################################################################### # A class to represent generic application-information blocks ##################################################################### @ISA = qw(PDA::Pilot::Block); package PDA::Pilot::SortBlock; ##################################################################### # A class to represent generic sort-information blocks ##################################################################### @ISA = qw(PDA::Pilot::Block); package PDA::Pilot::Pref; ##################################################################### # A class to represent generic preference blocks ##################################################################### @ISA = qw(PDA::Pilot::Block); sub new { my($self,$data,$creator,$id,$version,$backup) = @_; $self = bless { creator => $creator, id => $id, version => $version, backup => $backup}, (ref($self) || $self); if (defined($data)) { $self->Unpack($data); } else { $self->Fill(); } return $self; } package PDA::Pilot::MemoRecord; ##################################################################### # A class to represent records of the Memo application ##################################################################### @ISA = qw(PDA::Pilot::Record); sub Pack { my($self) = @_; return $self->{raw} = PDA::Pilot::Memo::Pack($self); } sub Unpack { my($self, $data) = @_; $self->{raw} = $data; PDA::Pilot::Memo::Unpack($self); } package PDA::Pilot::MemoAppBlock; ##################################################################### # A class to represent records of the Memo application ##################################################################### @ISA = qw(PDA::Pilot::AppBlock); sub Pack { my($self) = @_; return PDA::Pilot::Memo::PackAppBlock($self); } sub Unpack { my($self, $data) = @_; $self->{raw} = $data; PDA::Pilot::Memo::UnpackAppBlock($self); } package PDA::Pilot::ToDoRecord; ##################################################################### # A class to represent records of the ToDo application ##################################################################### @ISA = qw(PDA::Pilot::Record); sub Pack { my($self) = @_; return $self->{raw} = PDA::Pilot::ToDo::Pack($self); } sub Unpack { my($self, $data) = @_; $self->{raw} = $data; PDA::Pilot::ToDo::Unpack($self); } package PDA::Pilot::ToDoAppBlock; ##################################################################### # A class to represent the app block of the ToDo application ##################################################################### @ISA = qw(PDA::Pilot::AppBlock); sub Pack { my($self) = @_; return PDA::Pilot::ToDo::PackAppBlock($self); } sub Unpack { my($self, $data) = @_; $self->{raw} = $data; PDA::Pilot::ToDo::UnpackAppBlock($self); } package PDA::Pilot::AddressRecord; ##################################################################### # A class to represent records of the Address application ##################################################################### @ISA = qw(PDA::Pilot::Record); sub Pack { my($self) = @_; return $self->{raw} = PDA::Pilot::Address::Pack($self); } sub Unpack { my($self, $data) = @_; $self->{raw} = $data; PDA::Pilot::Address::Unpack($self); } package PDA::Pilot::AddressAppBlock; ##################################################################### # A class to represent the app block of the Address application ##################################################################### @ISA = qw(PDA::Pilot::AppBlock); sub Pack { my($self) = @_; return PDA::Pilot::Address::PackAppBlock($self); } sub Unpack { my($self, $data) = @_; $self->{raw} = $data; PDA::Pilot::Address::UnpackAppBlock($self); } package PDA::Pilot::AppointmentRecord; ##################################################################### # A class to represent records of the Appointment application ##################################################################### @ISA = qw(PDA::Pilot::Record); sub Pack { my($self) = @_; return PDA::Pilot::Appointment::Pack($self); } sub Unpack { my($self, $data) = @_; $self->{raw} = $data; PDA::Pilot::Appointment::Unpack($self); } package PDA::Pilot::AppointmentAppBlock; ##################################################################### # A class to represent the app block of the Appointment application ##################################################################### @ISA = qw(PDA::Pilot::AppBlock); sub Pack { my($self) = @_; return PDA::Pilot::Appointment::PackAppBlock($self); } sub Unpack { my($self, $data) = @_; $self->{raw} = $data; PDA::Pilot::Appointment::UnpackAppBlock($self); } package PDA::Pilot::MailRecord; ##################################################################### # A class to represent records of the Mail application ##################################################################### @ISA = qw(PDA::Pilot::Record); sub Pack { my($self) = @_; return PDA::Pilot::Mail::Pack($self); } sub Unpack { my($self, $data) = @_; $self->{raw} = $data; PDA::Pilot::Mail::Unpack($self); } package PDA::Pilot::MailAppBlock; ##################################################################### # A class to represent the app block of the Mail application ##################################################################### @ISA = qw(PDA::Pilot::AppBlock); sub Pack { my($self) = @_; return PDA::Pilot::Mail::PackAppBlock($self); } sub Unpack { my($self, $data) = @_; $self->{raw} = $data; PDA::Pilot::Mail::UnpackAppBlock($self); } package PDA::Pilot::MailSyncPref; ##################################################################### # A class to represent the sync pref of the Mail application ##################################################################### @ISA = qw(PDA::Pilot::Pref); sub Pack { my($self) = @_; return PDA::Pilot::Mail::PackSyncPref($self); } sub Unpack { my($self, $data) = @_; $self->{raw} = $data; PDA::Pilot::Mail::UnpackSyncPref($self); } package PDA::Pilot::MailSignaturePref; ##################################################################### # A class to represent the signature pref of the Mail application ##################################################################### @ISA = qw(PDA::Pilot::Pref); sub Pack { my($self) = @_; return PDA::Pilot::Mail::PackSignaturePref($self); } sub Unpack { my($self, $data) = @_; $self->{raw} = $data; PDA::Pilot::Mail::UnpackSignaturePref($self); } package PDA::Pilot::ExpenseRecord; ##################################################################### # A class to represent records of the Expense application ##################################################################### @ISA = qw(PDA::Pilot::Record); sub Pack { my($self) = @_; return PDA::Pilot::Expense::Pack($self); } sub Unpack { my($self, $data) = @_; $self->{raw} = $data; PDA::Pilot::Expense::Unpack($self); } package PDA::Pilot::ExpenseAppBlock; ##################################################################### # A class to represent the app block of the Expense application ##################################################################### @ISA = qw(PDA::Pilot::AppBlock); sub Pack { my($self) = @_; return PDA::Pilot::Expense::PackAppBlock($self); } sub Unpack { my($self, $data) = @_; $self->{raw} = $data; PDA::Pilot::Expense::UnpackAppBlock($self); } package PDA::Pilot::ExpensePref; ##################################################################### # A class to represent the pref of the Expense application ##################################################################### @ISA = qw(PDA::Pilot::Pref); sub Pack { my($self) = @_; return PDA::Pilot::Expense::PackPref($self); } sub Unpack { my($self, $data) = @_; $self->{raw} = $data; PDA::Pilot::Expense::UnpackPref($self); } package PDA::Pilot::Database; ##################################################################### # A class to specify which classes are used for generic database entries ##################################################################### sub record { shift @_; PDA::Pilot::Record->new(@_) } sub resource { shift @_; PDA::Pilot::Resource->new(@_) } sub pref { shift @_; PDA::Pilot::Pref->new(@_) } sub appblock { shift @_; PDA::Pilot::AppBlock->new(@_) } sub sortblock { shift @_; PDA::Pilot::SortBlock->new(@_) } package PDA::Pilot::MemoDatabase; ##################################################################### # A class to specify which classes are used for Memo database entries ##################################################################### @ISA=qw(PDA::Pilot::Database); sub record { shift @_; PDA::Pilot::MemoRecord->new(@_) } sub appblock { shift @_; PDA::Pilot::MemoAppBlock->new(@_) } sub creator { 'memo' } sub dbname { 'MemoDB' } package PDA::Pilot::ToDoDatabase; @ISA=qw(PDA::Pilot::Database); sub record { shift @_; PDA::Pilot::ToDoRecord->new(@_) } sub appblock { shift @_; PDA::Pilot::ToDoAppBlock->new(@_) } sub creator { 'todo' } sub dbname { 'ToDoDB' } package PDA::Pilot::AppointmentDatabase; @ISA=qw(PDA::Pilot::Database); sub record { shift @_; PDA::Pilot::AppointmentRecord->new(@_) } sub appblock { shift @_; PDA::Pilot::AppointmentAppBlock->new(@_) } sub creator { 'date' } sub dbname { 'DatebookDB' } package PDA::Pilot::AddressDatabase; @ISA=qw(PDA::Pilot::Database); sub record { shift @_; PDA::Pilot::AddressRecord->new(@_) } sub appblock { shift @_; PDA::Pilot::AddressAppBlock->new(@_) } sub creator { 'addr' } sub dbname { 'AddressDB' } package PDA::Pilot::MailDatabase; @ISA=qw(PDA::Pilot::Database); sub record { shift @_; PDA::Pilot::MailRecord->new(@_) } sub appblock { shift @_; PDA::Pilot::MailAppBlock->new(@_) } sub pref { shift @_; my($data,$creator,$id) = @_; if (($id == 1) || ($id == 2)) { PDA::Pilot::MailSyncPref->new(@_); } elsif ($id == 3) { PDA::Pilot::MailSignaturePref->new(@_); } else { PDA::Pilot::Database->pref(@_); } } sub creator { 'mail' } sub dbname { 'MailDB' } package PDA::Pilot::ExpenseDatabase; @ISA=qw(PDA::Pilot::Database); sub record { shift @_; PDA::Pilot::ExpenseRecord->new(@_) } sub appblock { shift @_; PDA::Pilot::ExpenseAppBlock->new(@_) } sub pref { shift @_; my($data,$creator,$id) = @_; if ($id == 1) { PDA::Pilot::ExpensePref->new(@_); } else { PDA::Pilot::Database->pref(@_); } } sub creator { 'exps' } sub dbname { 'ExpenseDB' } package PDA::Pilot; %DBClasses = ( MemoDB => 'PDA::Pilot::MemoDatabase', ToDoDB => 'PDA::Pilot::ToDoDatabase', AddressDB => 'PDA::Pilot::AddressDatabase', DatebookDB => 'PDA::Pilot::AppointmentDatabase', MailDB => 'PDA::Pilot::MailDatabase', ExpenseDB => 'PDA::Pilot::ExpenseDatabase' ); %PrefClasses = ( memo => 'PDA::Pilot::MemoDatabase', todo => 'PDA::Pilot::ToDoDatabase', mail => 'PDA::Pilot::MailDatabase', date => 'PDA::Pilot::AppointmentDatabase', addr => 'PDA::Pilot::AddressDatabase', exps => 'PDA::Pilot::ExpenseDatabase' ); ##################################################################### # Default classes ##################################################################### $DBClasses{''} = 'PDA::Pilot::Database'; $PrefClasses{''} = 'PDA::Pilot::Database'; sub CompareTm { my(@a) = @{$_[0]}; my(@b) = @{$_[1]}; return ($a[5] <=> $b[5]) || ($a[4] <=> $b[4]) || ($a[3] <=> $b[3]) || ($a[2] <=> $b[2]) || ($a[1] <=> $b[1]) || ($a[0] <=> $b[0]); } ##################################################################### # Autoload methods go after __END__, and are processed by the # autosplit program. ##################################################################### 1; __END__ =head1 Commands include: B This information is out of date, and potentially quite misleading. =over 4 =item PDA::Pilot::Appointment::Unpack(buffer) Returns hash reference containing appointment (datebook entry) in a usable format, given a record from a .pdb file or a Pilot database. =item PDA::Pilot::Appointment::Pack(buffer) Given a hash reference in the form that the previous call generates, returns a single string suitable for storing in a Pilot's database. =item PDA::Pilot::Appointment::UnpackAppInfo(buffer) Returns hash reference containing appointment (datebook entry) in a usable format, given the AppInfo record from a .pdb file or a Pilot database. =item PDA::Pilot::Appointment::PackAppInfo(buffer) Given a hash reference in the form that the previous call generates, returns a single string suitable for storing in a Pilot's database AppInfo block. =item PDA::Pilot::Memo::Unpack(buffer) Returns hash reference containing appointment (datebook entry) in a usable format, given a record from a .pdb file or a Pilot database. =item PDA::Pilot::Memo::Pack(buffer) Given a hash reference in the form that the previous call generates, returns a single string suitable for storing in a Pilot's database. =item PDA::Pilot::Memo::UnpackAppInfo(buffer) Returns hash reference containing appointment (datebook entry) in a usable format, given the AppInfo record from a .pdb file or a Pilot database. =item PDA::Pilot::Memo::PackAppInfo(buffer) Given a hash reference in the form that the previous call generates, returns a single string suitable for storing in a Pilot's database AppInfo block. =item PDA::Pilot::ToDo::Unpack(buffer) Returns hash reference containing appointment (datebook entry) in a usable format, given a record from a .pdb file or a Pilot database. =item PDA::Pilot::ToDo::Pack(buffer) Given a hash reference in the form that the previous call generates, returns a single string suitable for storing in a Pilot's database. =item PDA::Pilot::ToDo::UnpackAppInfo(buffer) Returns hash reference containing appointment (datebook entry) in a usable format, given the AppInfo record from a .pdb file or a Pilot database. =item PDA::Pilot::ToDo::PackAppInfo(buffer) Given a hash reference in the form that the previous call generates, returns a single string suitable for storing in a Pilot's database AppInfo block. =item PDA::Pilot::Address::Unpack(buffer) Returns hash reference containing appointment (datebook entry) in a usable format, given a record from a .pdb file or a Pilot database. =item PDA::Pilot::Address::Pack(buffer) Given a hash reference in the form that the previous call generates, returns a single string suitable for storing in a Pilot's database. =item PDA::Pilot::Address::UnpackAppInfo(buffer) Returns hash reference containing appointment (datebook entry) in a usable format, given the AppInfo record from a .pdb file or a Pilot database. =item PDA::Pilot::Address::PackAppInfo(buffer) Given a hash reference in the form that the previous call generates, returns a single string suitable for storing in a Pilot's database AppInfo block. =item PDA::Pilot::Mail::Unpack(buffer) Returns hash reference containing appointment (datebook entry) in a usable format, given a record from a .pdb file or a Pilot database. =item PDA::Pilot::Mail::Pack(buffer) Given a hash reference in the form that the previous call generates, returns a single string suitable for storing in a Pilot's database. =item PDA::Pilot::Mail::UnpackAppInfo(buffer) Returns hash reference containing appointment (datebook entry) in a usable format, given the AppInfo record from a .pdb file or a Pilot database. =item PDA::Pilot::Mail::PackAppInfo(buffer) Given a hash reference in the form that the previous call generates, returns a single string suitable for storing in a Pilot's database AppInfo block. =item PDA::Pilot::Socket::socket(domain, type, protocol) Same as pi-link routine called pi_socket. =item PDA::Pilot::Socket::close(socket) Same as pi-link routine called pi_close. =item PDA::Pilot::Socket::write(socket, string) Same as pi-link routine called pi_write. =item PDA::Pilot::Socket::read(socket, len) Same as pi-link routine called pi_write (returns read data as result.) =item PDA::Pilot::Socket::listen(socket, backlog) Same as pi-link routine called pi_listen. =item PDA::Pilot::Socket::bind(socket, sockaddr) Same as pi-link routine called pi_bind. Sockaddr may either be a packed string containing a pi_sockaddr structure, or a hash reference containing "device", "family", and "port" keys. =item PDA::Pilot::Socket::accept(socket) Same as pi-link routine called pi_accept. If connection is successfull, returns reference to hash containing remote address, as described above. If failed, returns undef. =item PDA::Pilot::DLP::errno() Returns last DLP error, resetting error to zero. =item PDA::Pilot::DLP::GetSysDateTime(socket) Same as DLP call dlp_GetSysDateTime. If successfull, returns time, otherwise returns undef. =item PDA::Pilot::DLP::SetSysDateTime(socket, time) Same as DLP call dlp_SetSysDateTime. time must be a time_t value. =item PDA::Pilot::DLP::ReadSysInfo(socket) Same as DLP call dlp_ReadSysInfo. If successfull, returns reference to hash containing system information. =item PDA::Pilot::DLP::ReadStorageInfo(socket, cardno) Same as DLP call dlp_ReadStorageInfo. If successfull, returns reference to hash containing information on given memory card. =item PDA::Pilot::DLP::ReadUserInfo(socket) Same as DLP call dlp_ReadUserInfo. If successfull, returns reference to hash containing information about user settings. =item PDA::Pilot::DLP::WriteUserInfo(socket, info) Same as DLP call dlp_WriteUserInfo. info must be a reference to a hash containing data similar to that returned by ReadUserInfo (Note: the password can not be set through this call.) =item PDA::Pilot::DLP::OpenDB(socket, cardno, mode, name) Same as DLP call dlp_OpenDB. If successfull returns database handle, otherwise returns undef. =item PDA::Pilot::DLP::CloseDB(socket, handle) Same as DLP call dlp_CloseDB. =item PDA::Pilot::DLP::EndOfSync(socket, status) Same as DLP call dlp_EndOfSync. =item PDA::Pilot::DLP::AbortSync(socket) Same as DLP call dlp_AbortSync. =item PDA::Pilot::DLP::MoveCategory(socket, handle, fromcat, tocat) Same as DLP call dlp_MoveCategory. =item PDA::Pilot::DLP::ResetSystem(socket) Same as DLP call dlp_ResetSystem. =item PDA::Pilot::DLP::OpenConduit(socket) Same as DLP call dlp_OpenConduit. =item PDA::Pilot::DLP::AddSyncLogEntry(socket, message) Same as DLP call dlp_AddSyncLogEntry =item PDA::Pilot::DLP::CleanUpDatabase(socket, handle) Same as DLP call dlp_CleanUpDatabase. =item PDA::Pilot::DLP::ResetSyncFlags(socket, handle) Same as DLP call dlp_ResetSyncFlags. =item PDA::Pilot::DLP::ResetDBIndex(socket, handle) Same as DLP call dlp_ResetDBIndex. =item PDA::Pilot::DLP::ResetLastSyncPC(socket) Same as DLP call dlp_ResetLastSyncPC. =item PDA::Pilot::DLP::DeleteCategory(socket, handle, category) Same as DLP call dlp_DeleteCategory. =item PDA::Pilot::DLP::DeleteRecord(socket, handle, all, id) Same as DLP call dlp_DeleteRecord. =item PDA::Pilot::DLP::ReadDBList(socket, cardno, flags, start) Same as DLP call dlp_ReadDBList. If successfull, returns reference to hash containing DB information. If failed, returns undef. =item PDA::Pilot::DLP::FindDBInfo(socket, cardno, flags, name, type, creator) Same as DLP call dlp_FindDBInfo. If successfull, returns reference to hash containing DB information. If failed, returns undef. =item PDA::Pilot::DLP::ReadFeature(socket, creator, number) Same as DLP call dlp_ReadFeature. If successfull, returns feature value. If failed, returns undef. =item PDA::Pilot::DLP::ReadAppBlock(socket, handle) Same as DLP call dlp_ReadAppBlock. If successfull, returns app block. If failed, returns undef. =item PDA::Pilot::DLP::ReadSortBlock(socket, handle) Same as DLP call dlp_ReadSortBlock. If successfull, returns app block. If failed, returns undef. =item PDA::Pilot::DLP::WriteAppBlock(socket, handle, block) Same as DLP call dlp_WriteAppBlock. =item PDA::Pilot::DLP::WriteSortBlock(socket, handle, block) Same as DLP call dlp_WriteSortBlock. =item PDA::Pilot::DLP::ReadOpenDBInfo(socket, handle) Same as DLP call dlp_ReadOpenDBInfo. =item PDA::Pilot::DLP::ReadRecordByIndex(socket, handle, index) Same as DLP call dlp_ReadRecordByIndex. If call fails, it returns undef. Otherwise, in scalar context it returns the read record, in array it returns the record, id, index, attr, and category, in that order. =item PDA::Pilot::DLP::ReadRecordById(socket, handle, id) Same as DLP call dlp_ReadRecordById. If call fails, it returns undef. Otherwise, in scalar context it returns the read record, in array it returns the record, id, index, attr, and category, in that order. =item PDA::Pilot::DLP::ReadNextModifiedRec(socket, handle) Same as DLP call dlp_ReadNextModifiedRec. If call fails, it returns undef. Otherwise, in scalar context it returns the read record, in array it returns the record, id, index, attr, and category, in that order. =item PDA::Pilot::DLP::ReadNextRecInCategory(socket, handle, category) Same as DLP call dlp_ReadNextRecInCategory. If call fails, it returns undef. Otherwise, in scalar context it returns the read record, in array it returns the record, id, index, attr, and category, in that order. =item PDA::Pilot::DLP::ReadNextModifiedRecInCategory(socket, handle, category) Same as DLP call dlp_ReadNextModifiedRecInCategory. If call fails, it returns undef. Otherwise, in scalar context it returns the read record, in array it returns the record, id, index, attr, and category, in that order. =item PDA::Pilot::DLP::WriteRecord(socket, handle, record, id, attr, category) Same as DLP call dlp_WriteRecord. =item PDA::Pilot::DLP::ReadResourceByType(socket, handle, type, id) Same as DLP call dlp_ReadResourceByType. If call fails, it returns undef. Otherwise, in scalar context it returns the read record, in array it returns the record, type, id, and index, in that order. =item PDA::Pilot::DLP::ReadResourceByIndex(socket, handle, index) Same as DLP call dlp_ReadResourceByIndex. If call fails, it returns undef. Otherwise, in scalar context it returns the read record, in array it returns the record, type, id, and index, in that order. =item PDA::Pilot::DLP::WriteResource(socket, handle, record, type, id) Same as DLP call dlp_WriteResource. =item PDA::Pilot::DLP::DeleteResource(socket, handle, all, type, id) Same as DLP call dlp_DeleteResource. =item PDA::Pilot::DLP::CallApplication(socket, creator, type, action, data) Same as DLP call dlp_CallApplication. =item PDA::Pilot::File::open(name) Same as pi_file_open. Returns a PDA::Pilot::File object on success. =item PDA::Pilot::File::close(file) Same as pi_file_close. =item PDA::Pilot::File::get_app_info(file) Same as pi_file_get_app_info. =item PDA::Pilot::File::get_sort_info(file) Same as pi_file_get_sort_info. =item PDA::Pilot::File::get_entries(file) Same as pi_file_get_entries. =item PDA::Pilot::File::read_resource(file, index) Same as pi_file_read_resource. Returns (record, type, id, index). =item PDA::Pilot::File::read_record(file, index) Same as pi_file_read_record. Returns (record, id, index, attr, category). =item PDA::Pilot::File::read_record_by_id(file, type, id) Same as pi_file_read_record_by_id. Returns (record, id, index, attr, category). =item PDA::Pilot::File::create(name, info) Same as pi_file_create. Info is reference to hash containg dbinfo data. =item PDA::Pilot::File::get_info(file) Same as pi_file_get_info. =item PDA::Pilot::File::set_info(file, info) Same as pi_file_set_info. =item PDA::Pilot::File::set_app_info(file, data) Same as pi_file_set_app_info. =item PDA::Pilot::File::set_sort_info(file, data) Same as pi_file_set_sort_info. =item PDA::Pilot::File::append_resource(file, data, type, id) Same as pi_file_append_resource. =item PDA::Pilot::File::append_record(file, data, attr, category, id) Same as pi_file_append_record. =item PDA::Pilot::File::install(file, socket, cardno) Same as pi_file_install. =item PDA::Pilot::File::retrieve(file, socket, cardno) Same as pi_file_retrieve. =back =cut pilot-link-0.12.5-dfsg/bindings/Perl/MANIFEST0000644000175000017500000000010607176416224020736 0ustar rousseaurousseauMANIFEST Makefile.PL Pilot.pm Pilot.xs README dump.pl test.pl typemap pilot-link-0.12.5-dfsg/bindings/Perl/.cvsignore0000644000175000017500000000006607417632350021610 0ustar rousseaurousseauMakefile Makefile.PL blib pm_to_blib Pilot.c Pilot.bs pilot-link-0.12.5-dfsg/bindings/Perl/README0000644000175000017500000000075507660425107020475 0ustar rousseaurousseauThis is a functional (yet always experimental) set of modules to interface Perl to the pilot-link library. To use it, you will need to perform these steps: perl ./Makefile.PL make If everything is working, you can execute a "make test". If that proves successful, execute a "make install UNINST=1" as the superuser (root in most cases) to install this interface into a system-wide location. make test su - root make install UNINST=1 For additional documentation, please read test.pl. pilot-link-0.12.5-dfsg/bindings/Perl/h2xs-pilot-link0000755000175000017500000017054110405564102022476 0ustar rousseaurousseau#!/usr/bin/perl eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if $running_under_some_shell; # NOTE: This version modified by Aaron Kaplan for use in the # pilot-link project. Fixes the following bugs that were present in # the version of h2xs included with perl 5.8.6. Bug numbers refer to # bugs listed on rt.perl.org. # # 1. No code was generated for enum constants with an explicitly # declared, negative value. I opened a bug this issue (haven't # received a bug number yet), and included a patch. # 2. Code was being generated for a constant whose name is the empty # string, which caused the C compiler to choke, and was also responsible # for differences between const-c.inc and fallback/const-c.inc such as # those reported in bugs 25366, 32502, and 33784. I have attached a # patch for this to bug 25366. # 3. The code generated for enums involved #ifdef tests which always # failed, since an enum is not a #define. This has been reported as bug # 32498, and someone attached a patch for it in January 2005, but as of # today the patch has not been applied. # 4. No code was generated for enum constants with implicit values. # This was bug 32491, and has already been fixed by changes 23652 and # 23822. # 5. Convert previously-defined constants and octal or hex constants # into integers before trying to increment them. I haven't submitted # this one to perl.org because the fix isn't fully general--doesn't # handle character constants, for example. use warnings; =head1 NAME h2xs - convert .h C header files to Perl extensions (Aaron Kaplan's modified version for pilot-link) =head1 SYNOPSIS B [B ...] [headerfile ... [extra_libraries]] B B<-h>|B<-?>|B<--help> =head1 DESCRIPTION I builds a Perl extension from C header files. The extension will include functions which can be used to retrieve the value of any #define statement which was in the C header files. The I will be used for the name of the extension. If module_name is not supplied then the name of the first header file will be used, with the first character capitalized. If the extension might need extra libraries, they should be included here. The extension Makefile.PL will take care of checking whether the libraries actually exist and how they should be loaded. The extra libraries should be specified in the form -lm -lposix, etc, just as on the cc command line. By default, the Makefile.PL will search through the library path determined by Configure. That path can be augmented by including arguments of the form B<-L/another/library/path> in the extra-libraries argument. =head1 OPTIONS =over 5 =item B<-A>, B<--omit-autoload> Omit all autoload facilities. This is the same as B<-c> but also removes the S> statement from the .pm file. =item B<-B>, B<--beta-version> Use an alpha/beta style version number. Causes version number to be "0.00_01" unless B<-v> is specified. =item B<-C>, B<--omit-changes> Omits creation of the F file, and adds a HISTORY section to the POD template. =item B<-F>, B<--cpp-flags>=I Additional flags to specify to C preprocessor when scanning header for function declarations. Writes these options in the generated F too. =item B<-M>, B<--func-mask>=I selects functions/macros to process. =item B<-O>, B<--overwrite-ok> Allows a pre-existing extension directory to be overwritten. =item B<-P>, B<--omit-pod> Omit the autogenerated stub POD section. =item B<-X>, B<--omit-XS> Omit the XS portion. Used to generate templates for a module which is not XS-based. C<-c> and C<-f> are implicitly enabled. =item B<-a>, B<--gen-accessors> Generate an accessor method for each element of structs and unions. The generated methods are named after the element name; will return the current value of the element if called without additional arguments; and will set the element to the supplied value (and return the new value) if called with an additional argument. Embedded structures and unions are returned as a pointer rather than the complete structure, to facilitate chained calls. These methods all apply to the Ptr type for the structure; additionally two methods are constructed for the structure type itself, C<_to_ptr> which returns a Ptr type pointing to the same structure, and a C method to construct and return a new structure, initialised to zeroes. =item B<-b>, B<--compat-version>=I Generates a .pm file which is backwards compatible with the specified perl version. For versions < 5.6.0, the changes are. - no use of 'our' (uses 'use vars' instead) - no 'use warnings' Specifying a compatibility version higher than the version of perl you are using to run h2xs will have no effect. If unspecified h2xs will default to compatibility with the version of perl you are using to run h2xs. =item B<-c>, B<--omit-constant> Omit C from the .xs file and corresponding specialised C from the .pm file. =item B<-d>, B<--debugging> Turn on debugging messages. =item B<-e>, B<--omit-enums>=[I] If I is not given, skip all constants that are defined in a C enumeration. Otherwise skip only those constants that are defined in an enum whose name matches I. Since I is optional, make sure that this switch is followed by at least one other switch if you omit I and have some pending arguments such as header-file names. This is ok: h2xs -e -n Module::Foo foo.h This is not ok: h2xs -n Module::Foo -e foo.h In the latter, foo.h is taken as I. =item B<-f>, B<--force> Allows an extension to be created for a header even if that header is not found in standard include directories. =item B<-g>, B<--global> Include code for safely storing static data in the .xs file. Extensions that do no make use of static data can ignore this option. =item B<-h>, B<-?>, B<--help> Print the usage, help and version for this h2xs and exit. =item B<-k>, B<--omit-const-func> For function arguments declared as C, omit the const attribute in the generated XS code. =item B<-m>, B<--gen-tied-var> B: for each variable declared in the header file(s), declare a perl variable of the same name magically tied to the C variable. =item B<-n>, B<--name>=I Specifies a name to be used for the extension, e.g., S<-n RPC::DCE> =item B<-o>, B<--opaque-re>=I Use "opaque" data type for the C types matched by the regular expression, even if these types are C-equivalent to types from typemaps. Should not be used without B<-x>. This may be useful since, say, types which are C-equivalent to integers may represent OS-related handles, and one may want to work with these handles in OO-way, as in C<$handle-Edo_something()>. Use C<-o .> if you want to handle all the Ced types as opaque types. The type-to-match is whitewashed (except for commas, which have no whitespace before them, and multiple C<*> which have no whitespace between them). =item B<-p>, B<--remove-prefix>=I Specify a prefix which should be removed from the Perl function names, e.g., S<-p sec_rgy_> This sets up the XS B keyword and removes the prefix from functions that are autoloaded via the C mechanism. =item B<-s>, B<--const-subs>=I Create a perl subroutine for the specified macros rather than autoload with the constant() subroutine. These macros are assumed to have a return type of B, e.g., S<-s sec_rgy_wildcard_name,sec_rgy_wildcard_sid>. =item B<-t>, B<--default-type>=I Specify the internal type that the constant() mechanism uses for macros. The default is IV (signed integer). Currently all macros found during the header scanning process will be assumed to have this type. Future versions of C may gain the ability to make educated guesses. =item B<--use-new-tests> When B<--compat-version> (B<-b>) is present the generated tests will use C rather than C which is the default for versions before 5.7.2 . C will be added to PREREQ_PM in the generated C. =item B<--use-old-tests> Will force the generation of test code that uses the older C module. =item B<--skip-exporter> Do not use C and/or export any symbol. =item B<--skip-ppport> Do not use C: no portability to older version. =item B<--skip-autoloader> Do not use the module C; but keep the constant() function and C for constants. =item B<--skip-strict> Do not use the pragma C. =item B<--skip-warnings> Do not use the pragma C. =item B<-v>, B<--version>=I Specify a version number for this extension. This version number is added to the templates. The default is 0.01, or 0.00_01 if C<-B> is specified. The version specified should be numeric. =item B<-x>, B<--autogen-xsubs> Automatically generate XSUBs basing on function declarations in the header file. The package C should be installed. If this option is specified, the name of the header file may look like C. In this case NAME1 is used instead of the specified string, but XSUBs are emitted only for the declarations included from file NAME2. Note that some types of arguments/return-values for functions may result in XSUB-declarations/typemap-entries which need hand-editing. Such may be objects which cannot be converted from/to a pointer (like C), pointers to functions, or arrays. See also the section on L>. =back =head1 EXAMPLES # Default behavior, extension is Rusers h2xs rpcsvc/rusers # Same, but extension is RUSERS h2xs -n RUSERS rpcsvc/rusers # Extension is rpcsvc::rusers. Still finds h2xs rpcsvc::rusers # Extension is ONC::RPC. Still finds h2xs -n ONC::RPC rpcsvc/rusers # Without constant() or AUTOLOAD h2xs -c rpcsvc/rusers # Creates templates for an extension named RPC h2xs -cfn RPC # Extension is ONC::RPC. h2xs -cfn ONC::RPC # Extension is Lib::Foo which works at least with Perl5.005_03. # Constants are created for all #defines and enums h2xs can find # in foo.h. h2xs -b 5.5.3 -n Lib::Foo foo.h # Extension is Lib::Foo which works at least with Perl5.005_03. # Constants are created for all #defines but only for enums # whose names do not start with 'bar_'. h2xs -b 5.5.3 -e '^bar_' -n Lib::Foo foo.h # Makefile.PL will look for library -lrpc in # additional directory /opt/net/lib h2xs rpcsvc/rusers -L/opt/net/lib -lrpc # Extension is DCE::rgynbase # prefix "sec_rgy_" is dropped from perl function names h2xs -n DCE::rgynbase -p sec_rgy_ dce/rgynbase # Extension is DCE::rgynbase # prefix "sec_rgy_" is dropped from perl function names # subroutines are created for sec_rgy_wildcard_name and # sec_rgy_wildcard_sid h2xs -n DCE::rgynbase -p sec_rgy_ \ -s sec_rgy_wildcard_name,sec_rgy_wildcard_sid dce/rgynbase # Make XS without defines in perl.h, but with function declarations # visible from perl.h. Name of the extension is perl1. # When scanning perl.h, define -DEXT=extern -DdEXT= -DINIT(x)= # Extra backslashes below because the string is passed to shell. # Note that a directory with perl header files would # be added automatically to include path. h2xs -xAn perl1 -F "-DEXT=extern -DdEXT= -DINIT\(x\)=" perl.h # Same with function declaration in proto.h as visible from perl.h. h2xs -xAn perl2 perl.h,proto.h # Same but select only functions which match /^av_/ h2xs -M '^av_' -xAn perl2 perl.h,proto.h # Same but treat SV* etc as "opaque" types h2xs -o '^[S]V \*$' -M '^av_' -xAn perl2 perl.h,proto.h =head2 Extension based on F<.h> and F<.c> files Suppose that you have some C files implementing some functionality, and the corresponding header files. How to create an extension which makes this functionality accessable in Perl? The example below assumes that the header files are F and I, and you want the perl module be named as C. If you need some preprocessor directives and/or linking with external libraries, see the flags C<-F>, C<-L> and C<-l> in L<"OPTIONS">. =over =item Find the directory name Start with a dummy run of h2xs: h2xs -Afn Ext::Ension The only purpose of this step is to create the needed directories, and let you know the names of these directories. From the output you can see that the directory for the extension is F. =item Copy C files Copy your header files and C files to this directory F. =item Create the extension Run h2xs, overwriting older autogenerated files: h2xs -Oxan Ext::Ension interface_simple.h interface_hairy.h h2xs looks for header files I changing to the extension directory, so it will find your header files OK. =item Archive and test As usual, run cd Ext/Ension perl Makefile.PL make dist make make test =item Hints It is important to do C as early as possible. This way you can easily merge(1) your changes to autogenerated files if you decide to edit your C<.h> files and rerun h2xs. Do not forget to edit the documentation in the generated F<.pm> file. Consider the autogenerated files as skeletons only, you may invent better interfaces than what h2xs could guess. Consider this section as a guideline only, some other options of h2xs may better suit your needs. =back =head1 ENVIRONMENT No environment variables are used. =head1 AUTHOR Larry Wall and others =head1 SEE ALSO L, L, L, and L. =head1 DIAGNOSTICS The usual warnings if it cannot read or write the files involved. =head1 LIMITATIONS of B<-x> F would not distinguish whether an argument to a C function which is of the form, say, C, is an input, output, or input/output parameter. In particular, argument declarations of the form int foo(n) int *n should be better rewritten as int foo(n) int &n if C is an input parameter. Additionally, F has no facilities to intuit that a function int foo(addr,l) char *addr int l takes a pair of address and length of data at this address, so it is better to rewrite this function as int foo(sv) SV *addr PREINIT: STRLEN len; char *s; CODE: s = SvPV(sv,len); RETVAL = foo(s, len); OUTPUT: RETVAL or alternately static int my_foo(SV *sv) { STRLEN len; char *s = SvPV(sv,len); return foo(s, len); } MODULE = foo PACKAGE = foo PREFIX = my_ int foo(sv) SV *sv See L and L for additional details. =cut # ' # Grr use strict; my( $H2XS_VERSION ) = ' ANK modified version $Revision: 1.1 $ ' =~ /\$Revision:\s+([^\s]+)/; my $TEMPLATE_VERSION = '0.01'; my @ARGS = @ARGV; my $compat_version = $]; use Getopt::Long; use Config; use Text::Wrap; $Text::Wrap::huge = 'overflow'; $Text::Wrap::columns = 80; use ExtUtils::Constant qw (WriteConstants WriteMakefileSnippet autoload); use File::Compare; use File::Path; sub usage { warn "@_\n" if @_; die <. --skip-strict Do not use the pragma C. --skip-warnings Do not use the pragma C. -v, --version Specify a version number for this extension. -x, --autogen-xsubs Autogenerate XSUBs using C::Scan. extra_libraries are any libraries that might be needed for loading the extension, e.g. -lm would try to link in the math library. EOFUSAGE } my ($opt_A, $opt_B, $opt_C, $opt_F, $opt_M, $opt_O, $opt_P, $opt_X, $opt_a, $opt_c, $opt_d, $opt_e, $opt_f, $opt_g, $opt_h, $opt_k, $opt_m, $opt_n, $opt_o, $opt_p, $opt_s, $opt_v, $opt_x, $opt_b, $opt_t, $new_test, $old_test, $skip_exporter, $skip_ppport, $skip_autoloader, $skip_strict, $skip_warnings, ); Getopt::Long::Configure('bundling'); Getopt::Long::Configure('pass_through'); my %options = ( 'omit-autoload|A' => \$opt_A, 'beta-version|B' => \$opt_B, 'omit-changes|C' => \$opt_C, 'cpp-flags|F=s' => \$opt_F, 'func-mask|M=s' => \$opt_M, 'overwrite_ok|O' => \$opt_O, 'omit-pod|P' => \$opt_P, 'omit-XS|X' => \$opt_X, 'gen-accessors|a' => \$opt_a, 'compat-version|b=s' => \$opt_b, 'omit-constant|c' => \$opt_c, 'debugging|d' => \$opt_d, 'omit-enums|e:s' => \$opt_e, 'force|f' => \$opt_f, 'global|g' => \$opt_g, 'help|h|?' => \$opt_h, 'omit-const-func|k' => \$opt_k, 'gen-tied-var|m' => \$opt_m, 'name|n=s' => \$opt_n, 'opaque-re|o=s' => \$opt_o, 'remove-prefix|p=s' => \$opt_p, 'const-subs|s=s' => \$opt_s, 'default-type|t=s' => \$opt_t, 'version|v=s' => \$opt_v, 'autogen-xsubs|x' => \$opt_x, 'use-new-tests' => \$new_test, 'use-old-tests' => \$old_test, 'skip-exporter' => \$skip_exporter, 'skip-ppport' => \$skip_ppport, 'skip-autoloader' => \$skip_autoloader, 'skip-warnings' => \$skip_warnings, 'skip-strict' => \$skip_strict, ); GetOptions(%options) || usage; usage if $opt_h; if( $opt_b ){ usage "You cannot use -b and -m at the same time.\n" if ($opt_b && $opt_m); $opt_b =~ /^\d+\.\d+\.\d+/ || usage "You must provide the backwards compatibility version in X.Y.Z form. " . "(i.e. 5.5.0)\n"; my ($maj,$min,$sub) = split(/\./,$opt_b,3); if ($maj < 5 || ($maj == 5 && $min < 6)) { $compat_version = $sub ? sprintf("%d.%03d%02d",$maj,$min,$sub) : sprintf("%d.%03d", $maj,$min); } else { $compat_version = $sub ? sprintf("%d.%03d%03d",$maj,$min,$sub) : sprintf("%d.%03d", $maj,$min); } } else { my ($maj,$min,$sub) = $compat_version =~ /(\d+)\.(\d\d\d)(\d*)/; $sub ||= 0; warn sprintf <<'EOF', $maj,$min,$sub; Defaulting to backwards compatibility with perl %d.%d.%d If you intend this module to be compatible with earlier perl versions, please specify a minimum perl version with the -b option. EOF } if( $opt_B ){ $TEMPLATE_VERSION = '0.00_01'; } if( $opt_v ){ $TEMPLATE_VERSION = $opt_v; # check if it is numeric my $temp_version = $TEMPLATE_VERSION; my $beta_version = $temp_version =~ s/(\d)_(\d\d)/$1$2/; my $notnum; { local $SIG{__WARN__} = sub { $notnum = 1 }; use warnings 'numeric'; $temp_version = 0+$temp_version; } if ($notnum) { my $module = $opt_n || 'Your::Module'; warn <<"EOF"; You have specified a non-numeric version. Unless you supply an appropriate VERSION class method, users may not be able to specify a minimum required version with C. EOF } else { $opt_B = $beta_version; } } # -A implies -c. $skip_autoloader = $opt_c = 1 if $opt_A; # -X implies -c and -f $opt_c = $opt_f = 1 if $opt_X; $opt_t ||= 'IV'; my %const_xsub; %const_xsub = map { $_,1 } split(/,+/, $opt_s) if $opt_s; my $extralibs = ''; my @path_h; while (my $arg = shift) { if ($arg =~ /^-l/i) { $extralibs .= "$arg "; next; } last if $extralibs; push(@path_h, $arg); } usage "Must supply header file or module name\n" unless (@path_h or $opt_n); my $fmask; my $tmask; $fmask = qr{$opt_M} if defined $opt_M; $tmask = qr{$opt_o} if defined $opt_o; my $tmask_all = $tmask && $opt_o eq '.'; if ($opt_x) { eval {require C::Scan; 1} or die <= 0.70 or die <curdir(), $Config{usrinc}, (split ' ', $Config{locincpth}), '/usr/include'); } foreach my $path_h (@path_h) { $name ||= $path_h; $module ||= do { $name =~ s/\.h$//; if ( $name !~ /::/ ) { $name =~ s#^.*/##; $name = "\u$name"; } $name; }; if( $path_h =~ s#::#/#g && $opt_n ){ warn "Nesting of headerfile ignored with -n\n"; } $path_h .= ".h" unless $path_h =~ /\.h$/; my $fullpath = $path_h; $path_h =~ s/,.*$// if $opt_x; $fullpath{$path_h} = $fullpath; # Minor trickery: we can't chdir() before we processed the headers # (so know the name of the extension), but the header may be in the # extension directory... my $tmp_path_h = $path_h; my $rel_path_h = $path_h; my @dirs = @paths; if (not -f $path_h) { my $found; for my $dir (@paths) { $found++, last if -f ($path_h = File::Spec->catfile($dir, $tmp_path_h)); } if ($found) { $rel_path_h = $path_h; $fullpath{$path_h} = $fullpath; } else { (my $epath = $module) =~ s,::,/,g; $epath = File::Spec->catdir('ext', $epath) if -d 'ext'; $rel_path_h = File::Spec->catfile($epath, $tmp_path_h); $path_h = $tmp_path_h; # Used during -x push @dirs, $epath; } } if (!$opt_c) { die "Can't find $tmp_path_h in @dirs\n" if ( ! $opt_f && ! -f "$rel_path_h" ); # Scan the header file (we should deal with nested header files) # Record the names of simple #define constants into const_names # Function prototypes are processed below. open(CH, "<$rel_path_h") || die "Can't open $rel_path_h: $!\n"; defines: while () { if ($pre_sub_tri_graphs) { # Preprocess all tri-graphs # including things stuck in quoted string constants. s/\?\?=/#/g; # | ??=| #| s/\?\?\!/|/g; # | ??!| || s/\?\?'/^/g; # | ??'| ^| s/\?\?\(/[/g; # | ??(| [| s/\?\?\)/]/g; # | ??)| ]| s/\?\?\-/~/g; # | ??-| ~| s/\?\?\//\\/g; # | ??/| \| s/\?\?/}/g; # | ??>| }| } if (/^[ \t]*#[ \t]*define\s+([\$\w]+)\b(?!\()\s*(?=[^"\s])(.*)/) { my $def = $1; my $rest = $2; $rest =~ s!/\*.*?(\*/|\n)|//.*!!g; # Remove comments $rest =~ s/^\s+//; $rest =~ s/\s+$//; # Cannot do: (-1) and ((LHANDLE)3) are OK: #print("Skip non-wordy $def => $rest\n"), # next defines if $rest =~ /[^\w\$]/; if ($rest =~ /"/) { print("Skip stringy $def => $rest\n") if $opt_d; next defines; } print "Matched $_ ($def)\n" if $opt_d; $seen_define{$def} = $rest; $_ = $def; next if /^_.*_h_*$/i; # special case, but for what? if (defined $opt_p) { if (!/^$opt_p(\d)/) { ++$prefix{$_} if s/^$opt_p//; } else { warn "can't remove $opt_p prefix from '$_'!\n"; } } $prefixless{$def} = $_; if (!$fmask or /$fmask/) { print "... Passes mask of -M.\n" if $opt_d and $fmask; $const_names{$_}++; } } } if (defined $opt_e and !$opt_e) { close(CH); } else { # Work from miniperl too - on "normal" systems my $SEEK_SET = eval 'use Fcntl qw/SEEK_SET/; SEEK_SET' or 0; seek CH, 0, $SEEK_SET; my $src = do { local $/; }; close CH; no warnings 'uninitialized'; # Remove C and C++ comments $src =~ s#/\*[^*]*\*+([^/*][^*]*\*+)*/|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)#$2#gs; while ($src =~ /\benum\s*([\w_]*)\s*\{\s([^}]+)\}/gsc) { my ($enum_name, $enum_body) = ($1, $2); # skip enums matching $opt_e next if $opt_e && $enum_name =~ /$opt_e/; my $val = 0; for my $item (split /,/, $enum_body) { next if $item =~ /\A\s*\Z/; my ($key, $declared_val) = $item =~ /(\w+)\s*(?:=\s*(.*))?/; if (defined($declared_val) && length($declared_val)) { $val = $declared_val; } else { $val =~ s/^\s*(.*?)\s*$/$1/; # strip whitespace if ($val =~ /^\d+$/) { $val++; } elsif ($val =~ /^0x[0-9a-fA-F]+$/) { $val = hex($val)+1; } elsif ($val =~ /^0[0-7]+$/) { $val = oct($val)+1; } elsif ($seen_define{$val}) { $val = $seen_define{$val} + 1; } else { die "hx2s bug: don't know how to increment $val"; } } $seen_define{$key} = $val; $const_names{$key} = {name => $key, macro => 1}; } } # while (...) } # if (!defined $opt_e or $opt_e) } } } # Save current directory so that C::Scan can use it my $cwd = File::Spec->rel2abs( File::Spec->curdir ); # As Ilya suggested, use a name that contains - and then it can't clash with # the names of any packages. A directory 'fallback' will clash with any # new pragmata down the fallback:: tree, but that seems unlikely. my $constscfname = 'const-c.inc'; my $constsxsfname = 'const-xs.inc'; my $fallbackdirname = 'fallback'; my $ext = chdir 'ext' ? 'ext/' : ''; my @modparts = split(/::/,$module); my $modpname = join('-', @modparts); my $modfname = pop @modparts; my $modpmdir = join '/', 'lib', @modparts; my $modpmname = join '/', $modpmdir, $modfname.'.pm'; if ($opt_O) { warn "Overwriting existing $ext$modpname!!!\n" if -e $modpname; } else { die "Won't overwrite existing $ext$modpname\n" if -e $modpname; } -d "$modpname" || mkpath([$modpname], 0, 0775); chdir($modpname) || die "Can't chdir $ext$modpname: $!\n"; my %types_seen; my %std_types; my $fdecls = []; my $fdecls_parsed = []; my $typedef_rex; my %typedefs_pre; my %known_fnames; my %structs; my @fnames; my @fnames_no_prefix; my %vdecl_hash; my @vdecls; if( ! $opt_X ){ # use XS, unless it was disabled unless ($skip_ppport) { require Devel::PPPort; warn "Writing $ext$modpname/ppport.h\n"; Devel::PPPort::WriteFile('ppport.h') || die "Can't create $ext$modpname/ppport.h: $!\n"; } open(XS, ">$modfname.xs") || die "Can't create $ext$modpname/$modfname.xs: $!\n"; if ($opt_x) { warn "Scanning typemaps...\n"; get_typemap(); my @td; my @good_td; my $addflags = $opt_F || ''; foreach my $filename (@path_h) { my $c; my $filter; if ($fullpath{$filename} =~ /,/) { $filename = $`; $filter = $'; } warn "Scanning $filename for functions...\n"; my @styles = $Config{gccversion} ? qw(C++ C9X GNU) : qw(C++ C9X); $c = new C::Scan 'filename' => $filename, 'filename_filter' => $filter, 'add_cppflags' => $addflags, 'c_styles' => \@styles; $c->set('includeDirs' => ["$Config::Config{archlib}/CORE", $cwd]); $c->get('keywords')->{'__restrict'} = 1; push @$fdecls_parsed, @{ $c->get('parsed_fdecls') }; push(@$fdecls, @{$c->get('fdecls')}); push @td, @{$c->get('typedefs_maybe')}; if ($opt_a) { my $structs = $c->get('typedef_structs'); @structs{keys %$structs} = values %$structs; } if ($opt_m) { %vdecl_hash = %{ $c->get('vdecl_hash') }; @vdecls = sort keys %vdecl_hash; for (local $_ = 0; $_ < @vdecls; ++$_) { my $var = $vdecls[$_]; my($type, $post) = @{ $vdecl_hash{$var} }; if (defined $post) { warn "Can't handle variable '$type $var $post', skipping.\n"; splice @vdecls, $_, 1; redo; } $type = normalize_type($type); $vdecl_hash{$var} = $type; } } unless ($tmask_all) { warn "Scanning $filename for typedefs...\n"; my $td = $c->get('typedef_hash'); # eval {require 'dumpvar.pl'; ::dumpValue($td)} or warn $@ if $opt_d; my @f_good_td = grep $td->{$_}[1] eq '', keys %$td; push @good_td, @f_good_td; @typedefs_pre{@f_good_td} = map $_->[0], @$td{@f_good_td}; } } { local $" = '|'; $typedef_rex = qr(\b(?[$i][1] =~ /$fmask/; # [1] is NAME push @good, $i; print "... Function $fdecls_parsed->[$i][1] passes -M mask.\n" if $opt_d; } $fdecls = [@$fdecls[@good]]; $fdecls_parsed = [@$fdecls_parsed[@good]]; } @fnames = sort map $_->[1], @$fdecls_parsed; # 1 is NAME # Sort declarations: { my %h = map( ($_->[1], $_), @$fdecls_parsed); $fdecls_parsed = [ @h{@fnames} ]; } @fnames_no_prefix = @fnames; @fnames_no_prefix = sort map { ++$prefix{$_} if s/^$opt_p(?!\d)//; $_ } @fnames_no_prefix if defined $opt_p; # Remove macros which expand to typedefs print "Typedefs are @td.\n" if $opt_d; my %td = map {($_, $_)} @td; # Add some other possible but meaningless values for macros for my $k (qw(char double float int long short unsigned signed void)) { $td{"$_$k"} = "$_$k" for ('', 'signed ', 'unsigned '); } # eval {require 'dumpvar.pl'; ::dumpValue( [\@td, \%td] ); 1} or warn $@; my $n = 0; my %bad_macs; while (keys %td > $n) { $n = keys %td; my ($k, $v); while (($k, $v) = each %seen_define) { # print("found '$k'=>'$v'\n"), $bad_macs{$k} = $td{$k} = $td{$v} if exists $td{$v}; } } # Now %bad_macs contains names of bad macros for my $k (keys %bad_macs) { delete $const_names{$prefixless{$k}}; print "Ignoring macro $k which expands to a typedef name '$bad_macs{$k}'\n" if $opt_d; } } } my @const_names = sort keys %const_names; my @const_info = map { ref($const_names{$_}) eq 'HASH' ? $const_names{$_} : $_ } sort keys(%const_names); -d $modpmdir || mkpath([$modpmdir], 0, 0775); open(PM, ">$modpmname") || die "Can't create $ext$modpname/$modpmname: $!\n"; $" = "\n\t"; warn "Writing $ext$modpname/$modpmname\n"; print PM <<"END"; package $module; use $compat_version; END print PM <<"END" unless $skip_strict; use strict; END print PM "use warnings;\n" unless $skip_warnings or $compat_version < 5.006; unless( $opt_X || $opt_c || $opt_A ){ # we'll have an AUTOLOAD(), and it will have $AUTOLOAD and # will want Carp. print PM <<'END'; use Carp; END } print PM <<'END' unless $skip_exporter; require Exporter; END my $use_Dyna = (not $opt_X and $compat_version < 5.006); print PM <<"END" if $use_Dyna; # use DynaLoader, unless XS was disabled require DynaLoader; END # Are we using AutoLoader or not? unless ($skip_autoloader) { # no autoloader whatsoever. unless ($opt_c) { # we're doing the AUTOLOAD print PM "use AutoLoader;\n"; } else { print PM "use AutoLoader qw(AUTOLOAD);\n" } } if ( $compat_version < 5.006 ) { my $vars = '$VERSION @ISA'; $vars .= ' @EXPORT @EXPORT_OK %EXPORT_TAGS' unless $skip_exporter; $vars .= ' $AUTOLOAD' unless $opt_X || $opt_c || $opt_A; $vars .= ' $XS_VERSION' if $opt_B && !$opt_X; print PM "use vars qw($vars);"; } # Determine @ISA. my @modISA; push @modISA, 'Exporter' unless $skip_exporter; push @modISA, 'DynaLoader' if $use_Dyna; # no XS my $myISA = "our \@ISA = qw(@modISA);"; $myISA =~ s/^our // if $compat_version < 5.006; print PM "\n$myISA\n\n"; my @exported_names = (@const_names, @fnames_no_prefix, map '$'.$_, @vdecls); my $tmp=''; $tmp .= <<"END" unless $skip_exporter; # Items to export into callers namespace by default. Note: do not export # names by default without a very good reason. Use EXPORT_OK instead. # Do not simply export all your public functions/methods/constants. # This allows declaration use $module ':all'; # If you do not need this, moving things directly into \@EXPORT or \@EXPORT_OK # will save memory. our %EXPORT_TAGS = ( 'all' => [ qw( @exported_names ) ] ); our \@EXPORT_OK = ( \@{ \$EXPORT_TAGS{'all'} } ); our \@EXPORT = qw( @const_names ); END $tmp .= "our \$VERSION = '$TEMPLATE_VERSION';\n"; if ($opt_B) { $tmp .= "our \$XS_VERSION = \$VERSION;\n" unless $opt_X; $tmp .= "\$VERSION = eval \$VERSION; # see L\n"; } $tmp .= "\n"; $tmp =~ s/^our //mg if $compat_version < 5.006; print PM $tmp; if (@vdecls) { printf PM "our(@{[ join ', ', map '$'.$_, @vdecls ]});\n\n"; } print PM autoload ($module, $compat_version) unless $opt_c or $opt_X; if( ! $opt_X ){ # print bootstrap, unless XS is disabled if ($use_Dyna) { $tmp = <<"END"; bootstrap $module \$VERSION; END } else { $tmp = <<"END"; require XSLoader; XSLoader::load('$module', \$VERSION); END } $tmp =~ s:\$VERSION:\$XS_VERSION:g if $opt_B; print PM $tmp; } # tying the variables can happen only after bootstrap if (@vdecls) { printf PM <))[0,6]; if (defined $username && defined $author) { $author =~ s/,.*$//; # in case of sub fields my $domain = $Config{'mydomain'}; $domain =~ s/^\.//; $email = "$username\@$domain"; } }; $author ||= "A. U. Thor"; $email ||= 'a.u.thor@a.galaxy.far.far.away'; $licence = sprintf << "DEFAULT", $^V; Copyright (C) ${\(1900 + (localtime) [5])} by $author This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version %vd or, at your option, any later version of Perl 5 you may have available. DEFAULT my $revhist = ''; $revhist = < should be removed. # #EOD $exp_doc .= <${email}E # #=head1 COPYRIGHT AND LICENSE # $licence_hash # #=cut END $pod =~ s/^\#//gm unless $opt_P; print PM $pod unless $opt_P; close PM; if( ! $opt_X ){ # print XS, unless it is disabled warn "Writing $ext$modpname/$modfname.xs\n"; print XS <<"END"; #include "EXTERN.h" #include "perl.h" #include "XSUB.h" END print XS <<"END" unless $skip_ppport; #include "ppport.h" END if( @path_h ){ foreach my $path_h (@path_h_ini) { my($h) = $path_h; $h =~ s#^/usr/include/##; if ($^O eq 'VMS') { $h =~ s#.*vms\]#sys/# or $h =~ s#.*[:>\]]##; } print XS qq{#include <$h>\n}; } print XS "\n"; } print XS <<"END" if $opt_g; /* Global Data */ #define MY_CXT_KEY "${module}::_guts" XS_VERSION typedef struct { /* Put Global Data in here */ int dummy; /* you can access this elsewhere as MY_CXT.dummy */ } my_cxt_t; START_MY_CXT END my %pointer_typedefs; my %struct_typedefs; sub td_is_pointer { my $type = shift; my $out = $pointer_typedefs{$type}; return $out if defined $out; my $otype = $type; $out = ($type =~ /\*$/); # This converts only the guys which do not have trailing part in the typedef if (not $out and $typedef_rex and $type =~ s/($typedef_rex)/$typedefs_pre{$1}/go) { $type = normalize_type($type); print "Is-Pointer: Type mutation via typedefs: $otype ==> $type\n" if $opt_d; $out = td_is_pointer($type); } return ($pointer_typedefs{$otype} = $out); } sub td_is_struct { my $type = shift; my $out = $struct_typedefs{$type}; return $out if defined $out; my $otype = $type; $out = ($type =~ /^(struct|union)\b/) && !td_is_pointer($type); # This converts only the guys which do not have trailing part in the typedef if (not $out and $typedef_rex and $type =~ s/($typedef_rex)/$typedefs_pre{$1}/go) { $type = normalize_type($type); print "Is-Struct: Type mutation via typedefs: $otype ==> $type\n" if $opt_d; $out = td_is_struct($type); } return ($struct_typedefs{$otype} = $out); } print_tievar_subs(\*XS, $_, $vdecl_hash{$_}) for @vdecls; if( ! $opt_c ) { # We write the "sample" files used when this module is built by perl without # ExtUtils::Constant. # h2xs will later check that these are the same as those generated by the # code embedded into Makefile.PL unless (-d $fallbackdirname) { mkdir "$fallbackdirname" or die "Cannot mkdir $fallbackdirname: $!\n"; } warn "Writing $ext$modpname/$fallbackdirname/$constscfname\n"; warn "Writing $ext$modpname/$fallbackdirname/$constsxsfname\n"; my $cfallback = File::Spec->catfile($fallbackdirname, $constscfname); my $xsfallback = File::Spec->catfile($fallbackdirname, $constsxsfname); WriteConstants ( C_FILE => $cfallback, XS_FILE => $xsfallback, DEFAULT_TYPE => $opt_t, NAME => $module, NAMES => \@const_info, ); print XS "#include \"$constscfname\"\n"; } my $prefix = defined $opt_p ? "PREFIX = $opt_p" : ''; # Now switch from C to XS by issuing the first MODULE declaration: print XS <<"END"; MODULE = $module PACKAGE = $module $prefix END # If a constant() function was #included then output a corresponding # XS declaration: print XS "INCLUDE: $constsxsfname\n" unless $opt_c; print XS <<"END" if $opt_g; BOOT: { MY_CXT_INIT; /* If any of the fields in the my_cxt_t struct need to be initialised, do it here. */ } END foreach (sort keys %const_xsub) { print XS <<"END"; char * $_() CODE: #ifdef $_ RETVAL = $_; #else croak("Your vendor has not defined the $module macro $_"); #endif OUTPUT: RETVAL END } my %seen_decl; my %typemap; sub print_decl { my $fh = shift; my $decl = shift; my ($type, $name, $args) = @$decl; return if $seen_decl{$name}++; # Need to do the same for docs as well? my @argnames = map {$_->[1]} @$args; my @argtypes = map { normalize_type( $_->[0], 1 ) } @$args; if ($opt_k) { s/^\s*const\b\s*// for @argtypes; } my @argarrays = map { $_->[4] || '' } @$args; my $numargs = @$args; if ($numargs and $argtypes[-1] eq '...') { $numargs--; $argnames[-1] = '...'; } local $" = ', '; $type = normalize_type($type, 1); print $fh <<"EOP"; $type $name(@argnames) EOP for my $arg (0 .. $numargs - 1) { print $fh <<"EOP"; $argtypes[$arg] $argnames[$arg]$argarrays[$arg] EOP } } sub print_tievar_subs { my($fh, $name, $type) = @_; print $fh <[0] =~ /_ANON/) { if (defined $item->[2]) { push @items, map [ @$_[0, 1], "$item->[2]_$_->[2]", "$item->[2].$_->[2]", ], @{ $structs{$item->[0]} }; } else { push @items, @{ $structs{$item->[0]} }; } } else { my $type = normalize_type($item->[0]); my $ttype = $structs{$type} ? normalize_type("$type *") : $type; print $fh <<"EOF"; $ttype $item->[2](THIS, __value = NO_INIT) $ptrname THIS $type __value PROTOTYPE: \$;\$ CODE: if (items > 1) THIS->$item->[-1] = __value; RETVAL = @{[ $type eq $ttype ? "THIS->$item->[-1]" : "&(THIS->$item->[-1])" ]}; OUTPUT: RETVAL EOF } } } sub accessor_docs { my($name, $struct) = @_; return unless defined $struct && $name !~ /\s|_ANON/; $name = normalize_type($name); my $ptrname = $name . 'Ptr'; my @items = @$struct; my @list; while (@items) { my $item = shift @items; if ($item->[0] =~ /_ANON/) { if (defined $item->[2]) { push @items, map [ @$_[0, 1], "$item->[2]_$_->[2]", "$item->[2].$_->[2]", ], @{ $structs{$item->[0]} }; } else { push @items, @{ $structs{$item->[0]} }; } } else { push @list, $item->[2]; } } my $methods = (join '(...)>, C<', @list) . '(...)'; my $pod = <<"EOF"; # #=head2 Object and class methods for C<$name>/C<$ptrname> # #The principal Perl representation of a C object of type C<$name> is an #object of class C<$ptrname> which is a reference to an integer #representation of a C pointer. To create such an object, one may use #a combination # # my \$buffer = $name->new(); # my \$obj = \$buffer->_to_ptr(); # #This exersizes the following two methods, and an additional class #C<$name>, the internal representation of which is a reference to a #packed string with the C structure. Keep in mind that \$buffer should #better survive longer than \$obj. # #=over # #=item C<\$object_of_type_$name-E_to_ptr()> # #Converts an object of type C<$name> to an object of type C<$ptrname>. # #=item C<$name-Enew()> # #Creates an empty object of type C<$name>. The corresponding packed #string is zeroed out. # #=item C<$methods> # #return the current value of the corresponding element if called #without additional arguments. Set the element to the supplied value #(and return the new value) if called with an additional argument. # #Applicable to objects of type C<$ptrname>. # #=back # EOF $pod =~ s/^\#//gm; return $pod; } # Should be called before any actual call to normalize_type(). sub get_typemap { # We do not want to read ./typemap by obvios reasons. my @tm = qw(../../../typemap ../../typemap ../typemap); my $stdtypemap = "$Config::Config{privlib}/ExtUtils/typemap"; unshift @tm, $stdtypemap; my $proto_re = "[" . quotemeta('\$%&*@;') . "]" ; # Start with useful default values $typemap{float} = 'T_NV'; foreach my $typemap (@tm) { next unless -e $typemap ; # skip directories, binary files etc. warn " Scanning $typemap\n"; warn("Warning: ignoring non-text typemap file '$typemap'\n"), next unless -T $typemap ; open(TYPEMAP, $typemap) or warn ("Warning: could not open typemap file '$typemap': $!\n"), next; my $mode = 'Typemap'; while () { next if /^\s*\#/; if (/^INPUT\s*$/) { $mode = 'Input'; next; } elsif (/^OUTPUT\s*$/) { $mode = 'Output'; next; } elsif (/^TYPEMAP\s*$/) { $mode = 'Typemap'; next; } elsif ($mode eq 'Typemap') { next if /^\s*($|\#)/ ; my ($type, $image); if ( ($type, $image) = /^\s*(.*?\S)\s+(\S+)\s*($proto_re*)\s*$/o # This may reference undefined functions: and not ($image eq 'T_PACKED' and $typemap eq $stdtypemap)) { $typemap{normalize_type($type)} = $image; } } } close(TYPEMAP) or die "Cannot close $typemap: $!"; } %std_types = %types_seen; %types_seen = (); } sub normalize_type { # Second arg: do not strip const's before \* my $type = shift; my $do_keep_deep_const = shift; # If $do_keep_deep_const this is heuristical only my $keep_deep_const = ($do_keep_deep_const ? '\b(?![^(,)]*\*)' : ''); my $ignore_mods = "(?:\\b(?:(?:__const__|const)$keep_deep_const|static|inline|__inline__)\\b\\s*)*"; if ($do_keep_deep_const) { # Keep different compiled /RExen/o separately! $type =~ s/$ignore_mods//go; } else { $type =~ s/$ignore_mods//go; } $type =~ s/([^\s\w])/ $1 /g; $type =~ s/\s+$//; $type =~ s/^\s+//; $type =~ s/\s+/ /g; $type =~ s/\* (?=\*)/*/g; $type =~ s/\. \. \./.../g; $type =~ s/ ,/,/g; $types_seen{$type}++ unless $type eq '...' or $type eq 'void' or $std_types{$type}; $type; } my $need_opaque; sub assign_typemap_entry { my $type = shift; my $otype = $type; my $entry; if ($tmask and $type =~ /$tmask/) { print "Type $type matches -o mask\n" if $opt_d; $entry = (td_is_struct($type) ? "T_OPAQUE_STRUCT" : "T_PTROBJ"); } elsif ($typedef_rex and $type =~ s/($typedef_rex)/$typedefs_pre{$1}/go) { $type = normalize_type $type; print "Type mutation via typedefs: $otype ==> $type\n" if $opt_d; $entry = assign_typemap_entry($type); } # XXX good do better if our UV happens to be long long return "T_NV" if $type =~ /^(unsigned\s+)?long\s+(long|double)\z/; $entry ||= $typemap{$otype} || (td_is_struct($type) ? "T_OPAQUE_STRUCT" : "T_PTROBJ"); $typemap{$otype} = $entry; $need_opaque = 1 if $entry eq "T_OPAQUE_STRUCT"; return $entry; } for (@vdecls) { print_tievar_xsubs(\*XS, $_, $vdecl_hash{$_}); } if ($opt_x) { for my $decl (@$fdecls_parsed) { print_decl(\*XS, $decl) } if ($opt_a) { while (my($name, $struct) = each %structs) { print_accessors(\*XS, $name, $struct); } } } close XS; if (%types_seen) { my $type; warn "Writing $ext$modpname/typemap\n"; open TM, ">typemap" or die "Cannot open typemap file for write: $!"; for $type (sort keys %types_seen) { my $entry = assign_typemap_entry $type; print TM $type, "\t" x (5 - int((length $type)/8)), "\t$entry\n" } print TM <<'EOP' if $need_opaque; # Older Perls do not have correct entry ############################################################################# INPUT T_OPAQUE_STRUCT if (sv_derived_from($arg, \"${ntype}\")) { STRLEN len; char *s = SvPV((SV*)SvRV($arg), len); if (len != sizeof($var)) croak(\"Size %d of packed data != expected %d\", len, sizeof($var)); $var = *($type *)s; } else croak(\"$var is not of type ${ntype}\") ############################################################################# OUTPUT T_OPAQUE_STRUCT sv_setref_pvn($arg, \"${ntype}\", (char *)&$var, sizeof($var)); EOP close TM or die "Cannot close typemap file for write: $!"; } } # if( ! $opt_X ) warn "Writing $ext$modpname/Makefile.PL\n"; open(PL, ">Makefile.PL") || die "Can't create $ext$modpname/Makefile.PL: $!\n"; my $prereq_pm; if ( $compat_version < 5.00702 and $new_test ) { $prereq_pm = q%'Test::More' => 0%; } else { $prereq_pm = ''; } print PL <<"END"; use $compat_version; use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( NAME => '$module', VERSION_FROM => '$modpmname', # finds \$VERSION PREREQ_PM => {$prereq_pm}, # e.g., Module::Name => 1.1 (\$] >= 5.005 ? ## Add these new keywords supported since 5.005 (ABSTRACT_FROM => '$modpmname', # retrieve abstract from module AUTHOR => '$author <$email>') : ()), END if (!$opt_X) { # print C stuff, unless XS is disabled $opt_F = '' unless defined $opt_F; my $I = (((glob '*.h') || (glob '*.hh')) ? '-I.' : ''); my $Ihelp = ($I ? '-I. ' : ''); my $Icomment = ($I ? '' : < ['$extralibs'], # e.g., '-lm' DEFINE => '$opt_F', # e.g., '-DHAVE_SOMETHING' $Icomment INC => '$I', # e.g., '${Ihelp}-I/usr/include/other' END my $C = grep {$_ ne "$modfname.c"} (glob '*.c'), (glob '*.cc'), (glob '*.C'); my $Cpre = ($C ? '' : '# '); my $Ccomment = ($C ? '' : < '\$(O_FILES)', # link all the C files too END } # ' # Grr print PL ");\n"; if (!$opt_c) { my $generate_code = WriteMakefileSnippet ( C_FILE => $constscfname, XS_FILE => $constsxsfname, DEFAULT_TYPE => $opt_t, NAME => $module, NAMES => \@const_info, ); print PL <<"END"; if (eval {require ExtUtils::Constant; 1}) { # If you edit these definitions to change the constants used by this module, # you will need to use the generated $constscfname and $constsxsfname # files to replace their "fallback" counterparts before distributing your # changes. $generate_code } else { use File::Copy; use File::Spec; foreach my \$file ('$constscfname', '$constsxsfname') { my \$fallback = File::Spec->catfile('$fallbackdirname', \$file); copy (\$fallback, \$file) or die "Can't copy \$fallback to \$file: \$!"; } } END eval $generate_code; if ($@) { warn <<"EOM"; Attempting to test constant code in $ext$modpname/Makefile.PL: $generate_code __END__ gave unexpected error $@ Please report the circumstances of this bug in h2xs version $H2XS_VERSION using the perlbug script. EOM } else { my $fail; foreach my $file ($constscfname, $constsxsfname) { my $fallback = File::Spec->catfile($fallbackdirname, $file); if (compare($file, $fallback)) { warn << "EOM"; Files "$ext$modpname/$fallbackdirname/$file" and "$ext$modpname/$file" differ. EOM $fail++; } } if ($fail) { warn fill ('','', <<"EOM") . "\n"; It appears that the code in $ext$modpname/Makefile.PL does not autogenerate the files $ext$modpname/$constscfname and $ext$modpname/$constsxsfname correctly. Please report the circumstances of this bug in h2xs version $H2XS_VERSION using the perlbug script. EOM } else { unlink $constscfname, $constsxsfname; } } } close(PL) || die "Can't close $ext$modpname/Makefile.PL: $!\n"; # Create a simple README since this is a CPAN requirement # and it doesnt hurt to have one warn "Writing $ext$modpname/README\n"; open(RM, ">README") || die "Can't create $ext$modpname/README:$!\n"; my $thisyear = (gmtime)[5] + 1900; my $rmhead = "$modpname version $TEMPLATE_VERSION"; my $rmheadeq = "=" x length($rmhead); my $rm_prereq; if ( $compat_version < 5.00702 and $new_test ) { $rm_prereq = 'Test::More'; } else { $rm_prereq = 'blah blah blah'; } print RM <<_RMEND_; $rmhead $rmheadeq The README is used to introduce the module and provide instructions on how to install the module, any machine dependencies it may have (for example C compilers and installed libraries) and any other information that should be provided before the module is installed. A README file is required for CPAN modules since CPAN extracts the README file from a module distribution so that people browsing the archive can use it get an idea of the modules uses. It is usually a good idea to provide version information here so that people can decide whether fixes for the module are worth downloading. INSTALLATION To install this module type the following: perl Makefile.PL make make test make install DEPENDENCIES This module requires these other modules and libraries: $rm_prereq COPYRIGHT AND LICENCE Put the correct copyright and licence information here. $licence _RMEND_ close(RM) || die "Can't close $ext$modpname/README: $!\n"; my $testdir = "t"; my $testfile = "$testdir/$modpname.t"; unless (-d "$testdir") { mkdir "$testdir" or die "Cannot mkdir $testdir: $!\n"; } warn "Writing $ext$modpname/$testfile\n"; my $tests = @const_names ? 2 : 1; open EX, ">$testfile" or die "Can't create $ext$modpname/$testfile: $!\n"; print EX <<_END_; # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl $modpname.t' ######################### # change 'tests => $tests' to 'tests => last_test_to_print'; _END_ my $test_mod = 'Test::More'; if ( $old_test or ($compat_version < 5.007 and not $new_test )) { my $test_mod = 'Test'; print EX <<_END_; use Test; BEGIN { plan tests => $tests }; use $module; ok(1); # If we made it this far, we're ok. _END_ if (@const_names) { my $const_names = join " ", @const_names; print EX <<'_END_'; my $fail; foreach my $constname (qw( _END_ print EX wrap ("\t", "\t", $const_names); print EX (")) {\n"); print EX <<_END_; next if (eval "my \\\$a = \$constname; 1"); if (\$\@ =~ /^Your vendor has not defined $module macro \$constname/) { print "# pass: \$\@"; } else { print "# fail: \$\@"; \$fail = 1; } } if (\$fail) { print "not ok 2\\n"; } else { print "ok 2\\n"; } _END_ } } else { print EX <<_END_; use Test::More tests => $tests; BEGIN { use_ok('$module') }; _END_ if (@const_names) { my $const_names = join " ", @const_names; print EX <<'_END_'; my $fail = 0; foreach my $constname (qw( _END_ print EX wrap ("\t", "\t", $const_names); print EX (")) {\n"); print EX <<_END_; next if (eval "my \\\$a = \$constname; 1"); if (\$\@ =~ /^Your vendor has not defined $module macro \$constname/) { print "# pass: \$\@"; } else { print "# fail: \$\@"; \$fail = 1; } } ok( \$fail == 0 , 'Constants' ); _END_ } } print EX <<_END_; ######################### # Insert your test code below, the $test_mod module is use()ed here so read # its man page ( perldoc $test_mod ) for help writing this test script. _END_ close(EX) || die "Can't close $ext$modpname/$testfile: $!\n"; unless ($opt_C) { warn "Writing $ext$modpname/Changes\n"; $" = ' '; open(EX, ">Changes") || die "Can't create $ext$modpname/Changes: $!\n"; @ARGS = map {/[\s\"\'\`\$*?^|&<>\[\]\{\}\(\)]/ ? "'$_'" : $_} @ARGS; print EX <MANIFEST') or die "Can't create MANIFEST: $!"; my @files = grep { -f } (<*>, , <$fallbackdirname/*>, <$modpmdir/*>); if (!@files) { eval {opendir(D,'.');}; unless ($@) { @files = readdir(D); closedir(D); } } if (!@files) { @files = map {chomp && $_} `ls`; } if ($^O eq 'VMS') { foreach (@files) { # Clip trailing '.' for portability -- non-VMS OSs don't expect it s%\.$%%; # Fix up for case-sensitive file systems s/$modfname/$modfname/i && next; $_ = "\U$_" if $_ eq 'manifest' or $_ eq 'changes'; $_ = 'Makefile.PL' if $_ eq 'makefile.pl'; } } print MANI join("\n",@files), "\n"; close MANI; pilot-link-0.12.5-dfsg/bindings/Perl/dump.pl0000644000175000017500000000061010046473437021106 0ustar rousseaurousseau#!/usr/bin/env perl use strict; # use warnings; # use diagnostics; use PDA::Pilot; use Data::Dumper; print "Now press the HotSync button (defaults to /dev/pilot)\n"; my $socket = PDA::Pilot::openPort("/dev/ttyqe") or die "$!"; my $dlp = PDA::Pilot::accept($socket); my $db = $dlp->open("DatebookDB"); my $r; my $i = 0; while(defined($r = $db->getRecord($i++))) { print Dumper($r); } pilot-link-0.12.5-dfsg/bindings/README0000644000175000017500000000127710563133120017556 0ustar rousseaurousseauWhat you will find here is a series of "language bindings" which talk to the core pilot-link libraries and headers for implementation and public functions. If you would like to write a perl script for example, that queries the data on your Palm device, the bindings in the ./Perl subdirectory will help you with that. Likewise for the ./Java ./Tcl, and ./Python locations. Each of them contains a small bit of code that will allow you to "bind" to the pilot-link subsystem for your needs. If you have any code which uses these bindings, and you feel that others may be able to use it or benefit from it, we encourage you to consider contributing it to the pilot-link project for future releases. pilot-link-0.12.5-dfsg/bindings/Java/0000755000175000017500000000000012346016472017563 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/bindings/Java/Makefile.in0000644000175000017500000003524111333433243021627 0ustar rousseaurousseau# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ target_triplet = @target@ subdir = bindings/Java DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in TODO ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/bluez.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/tcl.m4 \ $(top_srcdir)/m4/threads.m4 \ $(top_srcdir)/m4/vl_lib_readline.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/include/pi-md5.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLUEZ_CFLAGS = @BLUEZ_CFLAGS@ BLUEZ_LIBS = @BLUEZ_LIBS@ CAT_ENTRY_END = @CAT_ENTRY_END@ CAT_ENTRY_START = @CAT_ENTRY_START@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOCBOOK_ROOT = @DOCBOOK_ROOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVA = @JAVA@ JAVABASE = @JAVABASE@ JAVAC = @JAVAC@ JAVA_VERSION = @JAVA_VERSION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PIC_LIBS = @PIC_LIBS@ PILOT_LINK_MAJOR = @PILOT_LINK_MAJOR@ PILOT_LINK_MINOR = @PILOT_LINK_MINOR@ PILOT_LINK_PATCH = @PILOT_LINK_PATCH@ PILOT_LINK_VERS = @PILOT_LINK_VERS@ PISOCK_AGE = @PISOCK_AGE@ PISOCK_CURRENT = @PISOCK_CURRENT@ PISOCK_REVISION = @PISOCK_REVISION@ PISYNC_AGE = @PISYNC_AGE@ PISYNC_CURRENT = @PISYNC_CURRENT@ PISYNC_REVISION = @PISYNC_REVISION@ PKG_CONFIG = @PKG_CONFIG@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ POPT_INCLUDES = @POPT_INCLUDES@ POPT_LIBS = @POPT_LIBS@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_H = @PYTHON_H@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RL_LIBS = @RL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ XML_CATALOG = @XML_CATALOG@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ builddir = @builddir@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ usb_libs = @usb_libs@ PORT = /dev/pilot INCLUDES = \ -I../../include \ -I $(top_srcdir)/include \ -I $(top_builddir)/include \ -I $(JAVABASE)/include \ -I $(JAVABASE)/include/linux java_files = \ $(srcdir)/MidiMgr.java \ $(srcdir)/TestTodos.java \ $(srcdir)/org/gnu/pilotlink/AddressAppInfo.java \ $(srcdir)/org/gnu/pilotlink/AppInfo.java \ $(srcdir)/org/gnu/pilotlink/DBInfo.java \ $(srcdir)/org/gnu/pilotlink/DatabaseExistsException.java \ $(srcdir)/org/gnu/pilotlink/DatabaseNotFoundException.java \ $(srcdir)/org/gnu/pilotlink/DatebookAppInfo.java \ $(srcdir)/org/gnu/pilotlink/FTB3CostCatRecord.java \ $(srcdir)/org/gnu/pilotlink/MemoRecord.java \ $(srcdir)/org/gnu/pilotlink/PilotLink.java \ $(srcdir)/org/gnu/pilotlink/PilotLinkException.java \ $(srcdir)/org/gnu/pilotlink/RawAppInfo.java \ $(srcdir)/org/gnu/pilotlink/RawRecord.java \ $(srcdir)/org/gnu/pilotlink/SysInfo.java \ $(srcdir)/org/gnu/pilotlink/User.java \ $(srcdir)/org/gnu/pilotlink/Version.java \ $(srcdir)/org/gnu/pilotlink/AddressRecord.java \ $(srcdir)/org/gnu/pilotlink/FTB3TripRecord.java \ $(srcdir)/org/gnu/pilotlink/FTB3VehicleRecord.java \ $(srcdir)/org/gnu/pilotlink/DatebookRecord.java \ $(srcdir)/org/gnu/pilotlink/MidiRecord.java \ $(srcdir)/org/gnu/pilotlink/ToDoRecord.java \ $(srcdir)/org/gnu/pilotlink/Record.java \ $(srcdir)/test.java \ $(srcdir)/datebooktst.java \ $(srcdir)/adrtest.java java_classes = \ MidiMgr.class \ TestTodos.class \ org/gnu/pilotlink/AddressAppInfo.class \ org/gnu/pilotlink/AppInfo.class \ org/gnu/pilotlink/DBInfo.class \ org/gnu/pilotlink/DatabaseExistsException.class \ org/gnu/pilotlink/DatabaseNotFoundException.class \ org/gnu/pilotlink/DatebookAppInfo.class \ org/gnu/pilotlink/FTB3CostCatRecord.class \ org/gnu/pilotlink/MemoRecord.class \ org/gnu/pilotlink/PilotLink.class \ org/gnu/pilotlink/PilotLinkException.class \ org/gnu/pilotlink/RawAppInfo.class \ org/gnu/pilotlink/RawRecord.class \ org/gnu/pilotlink/SysInfo.class \ org/gnu/pilotlink/User.class \ org/gnu/pilotlink/Version.class \ org/gnu/pilotlink/AddressRecord.class \ org/gnu/pilotlink/FTB3TripRecord.class \ org/gnu/pilotlink/FTB3VehicleRecord.class \ org/gnu/pilotlink/DatebookRecord.class \ org/gnu/pilotlink/MidiRecord.class \ org/gnu/pilotlink/ToDoRecord.class \ org/gnu/pilotlink/Record.class \ test.class \ datebooktst.class \ adrtest.class all: all-am .SUFFIXES: $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/Java/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu bindings/Java/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ clean-local distclean distclean-generic distclean-libtool \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am all: java_pisock $(java_classes): java_compile java_compile: $(java_files) $(JAVAC) -d . $(java_files) java_lib: libjpisock.c $(CXX) $(INCLUDES) -fPIC $(DEFS) -L $(top_builddir)/libpisock/.libs -lpisock -shared -o libjpisock.so $(srcdir)/libjpisock.c java_jar: $(java_classes) $(JAR) cvf pilot-link.jar $(java_classes) java_pisock: java_compile java_lib java_jar install: all ARCH=""; \ for a in i386 amd64 ppc; do \ if [ -e ${JAVABASE}/jre/lib/$${a} ]; then \ ARCH="$${a}"; \ break; \ fi; \ done; \ if [ -n "$${ARCH}" ]; then \ echo "Unknown architecture. Copy lipijsock.so to ${JAVABASE}/jre/lib/ARCH/"; \ else \ mkdir -p "$(DESTDIR)${JAVABASE}/jre/lib/$${ARCH}" && \ cp libjpisock.so "$(DESTDIR)${JAVABASE}/jre/lib/$${ARCH}"; \ echo "done."; \ fi test: install ${JAVABASE}/bin/java test ${PORT} clean-local: rm -f libjpisock.so rm -f test.class rm -f $(java_classes) rm -f pilot-link.jar # 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: pilot-link-0.12.5-dfsg/bindings/Java/build.xml0000644000175000017500000000273410161574445021414 0ustar rousseaurousseau simple example build file Actual build ${build.number} of Version ${build.version} package org.gnu.pilotlink; public class Version { public static String VERSION="${build.version}"; public static long BUILD=${build.number}; } pilot-link-0.12.5-dfsg/bindings/Java/adrtest.java0000644000175000017500000001042210161574445022075 0ustar rousseaurousseauimport org.gnu.pilotlink.*; import java.io.*; import java.util.*; import javax.swing.*; import java.awt.*; /** * Description of the Class * * @author stephan * @created 4. Dezember 2004 */ public class adrtest { /** * Description of the Method * * @param args Description of the Parameter */ public static void main(String args[]) { test tst=new test(); JFrame frame = new JFrame("Progress"); frame.getContentPane().setLayout(new BorderLayout()); JLabel txt = new JLabel("Reading in"); frame.getContentPane().add(txt, BorderLayout.NORTH); JProgressBar progress = new JProgressBar(0, 100); frame.getContentPane().add(progress, BorderLayout.CENTER); frame.setSize(300, 50); frame.setVisible(true); String port; if (args.length==0) { port="/dev/usb/tts/1"; } else { port=args[0]; } File p=new File(port); System.out.println("looking for file "+port); if (!p.exists()) { System.out.println("File does not exist... USB? Waiting for port to appear"); while (!p.exists()) { System.out.print("."); try { Thread.sleep(1000); } catch (Exception e) {} } } PilotLink pl = null; try { pl = new PilotLink(port); if (!pl.isConnected()) { System.out.println("Something went wrong. Check output!"); System.exit(1); } } catch (Exception e) { e.printStackTrace(); System.exit(1); } try { User u = pl.getUserInfo(); System.out.println("User: " + u.getName()); System.out.println("Last Synchronization Date: " + u.getLastSyncDate()); } catch (PilotLinkException e) { e.printStackTrace(); } System.out.println("GEtting App..."); pl.getAppInfoBlock("AddressDB"); try { SysInfo si = pl.getSysInfo(); System.out.println("Product ID: '" + si.getProdID() + "'"); System.out.println("Rom Version: " + si.getRomVersion()); } catch (PilotLinkException e) { e.printStackTrace(); } try { System.out.println("Opening DatebookDB"); int dbhAdr=pl.openDB("AddressDB"); System.out.println("addresses opened!"); Record r=pl.getRecordByIndex(dbhAdr,0); //tst.hexdump(r.getBuffer()); //System.out.println("Now adrrecord"); AddressRecord adrRecord; /*tst.hexdump(adrRecord.getBuffer()); System.out.println("Adding new Record..."); AddressRecord adrRecord2=new AddressRecord(); for (int i=0;i<19;i++) { if (adrRecord.getField(i)!=null) { adrRecord2.setField("TST:"+adrRecord.getField(i),i); } } for (int i=0;i<5;i++) { adrRecord2.setLabelId(adrRecord.getLabelId(i),i); } System.out.println("new Record:"); tst.hexdump(adrRecord2.getBuffer()); pl.writeRecord(dbhAdr,adrRecord2); if (true) { pl.endSync(); pl.close(); System.exit(0); } */ progress.setMaximum(pl.getRecordCount(dbhAdr)); for (int i=0; i /* Header for class org_gnu_pilotlink_PilotLink */ #ifndef _Included_org_gnu_pilotlink_PilotLink #define _Included_org_gnu_pilotlink_PilotLink #ifdef __cplusplus extern "C" { #endif /* * Class: org_gnu_pilotlink_PilotLink * Method: connect * Signature: (Ljava/lang/String;)I */ JNIEXPORT jint JNICALL Java_org_gnu_pilotlink_PilotLink_connect (JNIEnv *, jobject, jstring); /* * Class: org_gnu_pilotlink_PilotLink * Method: readSysInfo * Signature: (I)Lorg/gnu/pilotlink/SysInfo; */ JNIEXPORT jobject JNICALL Java_org_gnu_pilotlink_PilotLink_readSysInfo (JNIEnv *, jobject, jint); /* * Class: org_gnu_pilotlink_PilotLink * Method: readUserInfo * Signature: (I)Lorg/gnu/pilotlink/User; */ JNIEXPORT jobject JNICALL Java_org_gnu_pilotlink_PilotLink_readUserInfo (JNIEnv *, jobject, jint); /* * Class: org_gnu_pilotlink_PilotLink * Method: readAppInfo * Signature: (II)Lorg/gnu/pilotlink/RawAppInfo; */ JNIEXPORT jobject JNICALL Java_org_gnu_pilotlink_PilotLink_readAppInfo (JNIEnv *, jobject, jint, jint); /* * Class: org_gnu_pilotlink_PilotLink * Method: getAppInfoBlock * Signature: (ILjava/lang/String;)I */ JNIEXPORT jobject JNICALL Java_org_gnu_pilotlink_PilotLink_getAppInfoBlock (JNIEnv *, jobject, jint, jstring); /* * Class: org_gnu_pilotlink_PilotLink * Method: writeUserInfo * Signature: (ILorg/gnu/pilotlink/User;)V */ JNIEXPORT void JNICALL Java_org_gnu_pilotlink_PilotLink_writeUserInfo (JNIEnv *, jobject, jint, jobject); /* * Class: org_gnu_pilotlink_PilotLink * Method: createDB * Signature: (IJLjava/lang/String;J)I */ JNIEXPORT jint JNICALL Java_org_gnu_pilotlink_PilotLink_createDB__IJLjava_lang_String_2J (JNIEnv *, jobject, jint, jlong, jstring, jlong); /* * Class: org_gnu_pilotlink_PilotLink * Method: createDB * Signature: (IJLjava/lang/String;JII)I */ JNIEXPORT jint JNICALL Java_org_gnu_pilotlink_PilotLink_createDB__IJLjava_lang_String_2JII (JNIEnv *, jobject, jint, jlong, jstring, jlong, jint, jint); /* * Class: org_gnu_pilotlink_PilotLink * Method: deleteDB * Signature: (ILjava/lang/String;)I */ JNIEXPORT jint JNICALL Java_org_gnu_pilotlink_PilotLink_deleteDB (JNIEnv *, jobject, jint, jstring); /* * Class: org_gnu_pilotlink_PilotLink * Method: openDB * Signature: (ILjava/lang/String;)I */ JNIEXPORT jint JNICALL Java_org_gnu_pilotlink_PilotLink_openDB (JNIEnv *, jobject, jint, jstring); /* * Class: org_gnu_pilotlink_PilotLink * Method: writeAppBlock * Signature: (II[BI)I */ JNIEXPORT jint JNICALL Java_org_gnu_pilotlink_PilotLink_writeAppBlock (JNIEnv *, jobject, jint, jint, jbyteArray, jint); /* * Class: org_gnu_pilotlink_PilotLink * Method: getRecordCount * Signature: (II)I */ JNIEXPORT jint JNICALL Java_org_gnu_pilotlink_PilotLink_getRecordCount (JNIEnv *, jobject, jint, jint); /* * Class: org_gnu_pilotlink_PilotLink * Method: getRecordByIndex * Signature: (III)Lorg/gnu/pilotlink/RawRecord; */ JNIEXPORT jobject JNICALL Java_org_gnu_pilotlink_PilotLink_getRecordByIndex (JNIEnv *, jobject, jint, jint, jint); /* * Class: org_gnu_pilotlink_PilotLink * Method: deleteRecordByIndex * Signature: (III)I */ JNIEXPORT jint JNICALL Java_org_gnu_pilotlink_PilotLink_deleteRecordById (JNIEnv *, jobject, jint, jint, jlong); /* * Class: org_gnu_pilotlink_PilotLink * Method: writeRecord * Signature: (IILorg/gnu/pilotlink/Record;)I */ JNIEXPORT jint JNICALL Java_org_gnu_pilotlink_PilotLink_writeRecord (JNIEnv *, jobject, jint, jint, jobject); /* * Class: org_gnu_pilotlink_PilotLink * Method: closeDB * Signature: (II)V */ JNIEXPORT void JNICALL Java_org_gnu_pilotlink_PilotLink_closeDB (JNIEnv *, jobject, jint, jint); /* * Class: org_gnu_pilotlink_PilotLink * Method: endSync * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_gnu_pilotlink_PilotLink_endSync (JNIEnv *, jobject, jint); /* * Class: org_gnu_pilotlink_PilotLink * Method: close * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_gnu_pilotlink_PilotLink_close (JNIEnv *, jobject, jint); /* * Class: org_gnu_pilotlink_PilotLink * Method: openConduit * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_gnu_pilotlink_PilotLink_openConduit (JNIEnv *, jobject, jint); /* * Class: org_gnu_pilotlink_PilotLink * Method: getResourceByIndex * Signature: (III)Lorg/gnu/pilotlink/RawRecord; */ JNIEXPORT jobject JNICALL Java_org_gnu_pilotlink_PilotLink_getResourceByIndex (JNIEnv *, jobject, jint, jint, jint); /* * Class: org_gnu_pilotlink_PilotLink * Method: writeResource * Signature: (IILorg/gnu/pilotlink/RawRecord;)V */ JNIEXPORT void JNICALL Java_org_gnu_pilotlink_PilotLink_writeResource (JNIEnv *, jobject, jint, jint, jobject); /* * Class: org_gnu_pilotlink_PilotLink * Method: resetSystem * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_gnu_pilotlink_PilotLink_resetSystem (JNIEnv *, jobject, jint); /* * Class: org_gnu_pilotlink_PilotLink * Method: readDBList * Signature: (IIII)Lorg/gnu/pilotlink/DBInfo; */ JNIEXPORT jobject JNICALL Java_org_gnu_pilotlink_PilotLink_readDBList (JNIEnv *, jobject, jint, jint, jint, jint); #ifdef __cplusplus } #endif #endif pilot-link-0.12.5-dfsg/bindings/Java/datebooktst.java0000644000175000017500000001136510161574445022761 0ustar rousseaurousseauimport org.gnu.pilotlink.*; import java.io.*; import java.util.*; import javax.swing.*; import java.awt.*; /** * Description of the Class * * @author stephan * @created 4. Dezember 2004 */ public class datebooktst { /** * Description of the Method * * @param args Description of the Parameter */ public static void main(String args[]) { DatebookRecord dbr; test tst=new test(); JFrame frame = new JFrame("Progress"); frame.getContentPane().setLayout(new BorderLayout()); JLabel txt = new JLabel("Reading in"); frame.getContentPane().add(txt, BorderLayout.NORTH); JProgressBar progress = new JProgressBar(0, 100); frame.getContentPane().add(progress, BorderLayout.CENTER); frame.setSize(300, 50); frame.setVisible(true); String port; if (args.length==0) { port="/dev/usb/tts/1"; } else { port=args[0]; } File p=new File(port); System.out.println("looking for file "+port); if (!p.exists()) { System.out.println("File does not exist... USB? Waiting for port to appear"); while (!p.exists()) { System.out.print("."); try { Thread.sleep(1000); } catch (Exception e) {} } } PilotLink pl = null; try { pl = new PilotLink(port); if (!pl.isConnected()) { System.out.println("Something went wrong. Check output!"); System.exit(1); } } catch (Exception e) { e.printStackTrace(); System.exit(1); } try { User u = pl.getUserInfo(); System.out.println("User: " + u.getName()); System.out.println("Last Synchronization Date: " + u.getLastSyncDate()); } catch (PilotLinkException e) { e.printStackTrace(); } try { System.out.println("Opening catdb!"); int dbh = pl.openDB("DatebookDB"); System.out.println("db opened!"); System.out.println("Count: " + pl.getRecordCount(dbh)); progress.setMaximum(pl.getRecordCount(dbh)); Vector ids = new Vector(); for (int i = 0; i < pl.getRecordCount(dbh); i++) { Record r = pl.getRecordByIndex(dbh, i); progress.setValue(i); txt.setText("Reading in " + i); if (r == null) { break; } if (r.getBuffer() == null || r.getBuffer().length == 0) { System.out.println("0-sized record? Deleting..."); pl.deleteRecordById(dbh, r.getId()); continue; } if (!r.isDirty()) { //only new entries continue; } dbr = new DatebookRecord(r); //System.out.println("comparing "+dbr.getStartDate()+ "to yesterday "+yesterday); //if (dbr.getStartDate().before(yesterday) || dbr.getStartDate().after(new Date())) { // continue; //} ids.add(new Integer(i)); System.out.println("Read index " + i); System.out.println(" id: " + dbr.getId()); System.out.println("attr: " + Integer.toHexString(dbr.getAttribs())); System.out.println(" dirty:" + dbr.isDirty()); System.out.println(" arch :" + dbr.isArchived()); System.out.println(" del :" + dbr.isDeleted()); System.out.println("size: " + dbr.getSize()); System.out.println("cat : " + dbr.getCategory()); tst.hexdump(dbr.getBuffer()); tst.hexdump(r.getBuffer()); System.out.println("Has alarm : " + dbr.hasAlarm()); System.out.println("Description: " + dbr.hasDescription()); System.out.println("Note : " + dbr.hasNote()); System.out.println("Reapeated : " + dbr.isRepeated()); System.out.println("hasTime : " + dbr.hasTime()); if (dbr.hasDescription()) { System.out.println("Descr: " + dbr.getDescription()); } if (dbr.hasNote()) { System.out.println("Note: " + dbr.getNote()); } System.out.println("Start: " + dbr.getStartDate()); System.out.println("End: " + dbr.getEndDate()); } //Doing this not to interfere with the reading of records for (int i = 0; i < ids.size(); i++) { System.out.println("updating..." + ids.get(i)); Record r = pl.getRecordByIndex(dbh, ((Integer) ids.get(i)).intValue()); r.setDirty(false); tst.hexdump(r.getBuffer()); if (r.isDirty()) { System.out.println("Hïż½ïż½ïż½ïż½?!"); } //pl.writeRecord(dbh,r); } System.out.println("\n\n\nNew Datebookentry:\n"); GregorianCalendar start = new GregorianCalendar(); start.setTime(new Date()); start.set(GregorianCalendar.SECOND, 0); GregorianCalendar end = new GregorianCalendar(); end.setTime(new Date(System.currentTimeMillis() + 15 * 60000)); end.set(GregorianCalendar.SECOND, 0); System.out.println("Instaciating..."); dbr = new DatebookRecord(start.getTime(), end.getTime(), "Test of pilot-links new java bindings", ""); //tst.hexdump(dbr.getBuffer()); //System.out.println("Size: "+dbr.getSize()); pl.writeRecord(dbh,dbr); pl.closeDB(dbh); pl.endSync(); pl.close(); } catch (PilotLinkException e) { e.printStackTrace(); } frame.dispose(); } } pilot-link-0.12.5-dfsg/bindings/Java/Makefile0000644000175000017500000003536111333433255021230 0ustar rousseaurousseau# Makefile.in generated by automake 1.11.1 from Makefile.am. # bindings/Java/Makefile. Generated from Makefile.in by configure. # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. pkgdatadir = $(datadir)/pilot-link pkgincludedir = $(includedir)/pilot-link pkglibdir = $(libdir)/pilot-link pkglibexecdir = $(libexecdir)/pilot-link am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = x86_64-unknown-linux-gnu host_triplet = x86_64-unknown-linux-gnu target_triplet = x86_64-unknown-linux-gnu subdir = bindings/Java DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in TODO ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/bluez.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/tcl.m4 \ $(top_srcdir)/m4/threads.m4 \ $(top_srcdir)/m4/vl_lib_readline.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/include/pi-md5.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = ${SHELL} /Source/cvs/palm/pilot-link/HEAD/missing --run aclocal-1.11 AMTAR = ${SHELL} /Source/cvs/palm/pilot-link/HEAD/missing --run tar AR = ar AUTOCONF = ${SHELL} /Source/cvs/palm/pilot-link/HEAD/missing --run autoconf AUTOHEADER = ${SHELL} /Source/cvs/palm/pilot-link/HEAD/missing --run autoheader AUTOMAKE = ${SHELL} /Source/cvs/palm/pilot-link/HEAD/missing --run automake-1.11 AWK = gawk BLUEZ_CFLAGS = BLUEZ_LIBS = -lbluetooth CAT_ENTRY_END = CAT_ENTRY_START = CC = gcc CCDEPMODE = depmode=gcc3 CFLAGS = -g -ansi -Wshadow -Wall -W -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wpointer-arith -Wundef -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wconversion -Winline -pedantic -O0 -std=gnu99 -g -Wshadow -Wall -W -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wpointer-arith -Wundef -Winline -Wbad-function-cast -pedantic -O0 CPP = gcc -E CPPFLAGS = CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H DEPDIR = .deps DOCBOOK_ROOT = DSYMUTIL = DUMPBIN = ECHO_C = ECHO_N = -n ECHO_T = EGREP = /bin/grep -E EXEEXT = F77 = FFLAGS = FGREP = /bin/grep -F GREP = /bin/grep ICONV_CFLAGS = ICONV_LIBS = INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s JAR = /usr/local/jdk1.6.0_13/bin/jar JAVA = /usr/local/jdk1.6.0_13/bin/java JAVABASE = /usr/local/jdk1.6.0_13 JAVAC = /usr/local/jdk1.6.0_13/bin/javac JAVA_VERSION = 1.6.0_13 LD = /usr/bin/ld -m elf_x86_64 LDFLAGS = LIBOBJS = LIBS = LIBTOOL = $(SHELL) $(top_builddir)/libtool LIPO = LN_S = ln -s LTLIBOBJS = MAINT = MAKEINFO = ${SHELL} /Source/cvs/palm/pilot-link/HEAD/missing --run makeinfo MKDIR_P = /bin/mkdir -p NM = /usr/bin/nm -B NMEDIT = OBJDUMP = objdump OBJEXT = o OTOOL = OTOOL64 = PACKAGE = pilot-link PACKAGE_BUGREPORT = PACKAGE_NAME = PACKAGE_STRING = PACKAGE_TARNAME = PACKAGE_URL = PACKAGE_VERSION = PATH_SEPARATOR = : PERL = perl PIC_LIBS = PILOT_LINK_MAJOR = 12 PILOT_LINK_MINOR = 5 PILOT_LINK_PATCH = PILOT_LINK_VERS = 0 PISOCK_AGE = 0 PISOCK_CURRENT = 9 PISOCK_REVISION = 2 PISYNC_AGE = 0 PISYNC_CURRENT = 1 PISYNC_REVISION = 3 PKG_CONFIG = /usr/bin/pkg-config PNG_CFLAGS = PNG_LIBS = -lpng POPT_INCLUDES = -I$(top_srcdir)/popt POPT_LIBS = $(top_builddir)/popt/libpopt.la PTHREAD_CC = gcc PTHREAD_CFLAGS = -pthread PTHREAD_LIBS = PYTHON = PYTHON_CFLAGS = PYTHON_H = PYTHON_LIBS = PYTHON_VERSION = RANLIB = ranlib RL_LIBS = -lreadline SED = /bin/sed SET_MAKE = SHELL = /bin/bash STRIP = strip TCLSH_PROG = TCL_BIN_DIR = TCL_DEFS = TCL_EXTRA_CFLAGS = TCL_INCLUDES = TCL_LD_FLAGS = TCL_LIBS = TCL_LIB_FILE = TCL_LIB_FLAG = TCL_LIB_SPEC = TCL_SHLIB_LD_LIBS = TCL_SRC_DIR = TCL_STUB_LIB_FILE = TCL_STUB_LIB_FLAG = TCL_STUB_LIB_SPEC = TCL_VERSION = VERSION = 0.12.5 WISH_PROG = XML_CATALOG = XSLTPROC = /usr/bin/xsltproc XSLTPROC_FLAGS = --nonet YACC = yacc YFLAGS = abs_builddir = /Source/cvs/palm/pilot-link/HEAD/bindings/Java abs_srcdir = /Source/cvs/palm/pilot-link/HEAD/bindings/Java abs_top_builddir = /Source/cvs/palm/pilot-link/HEAD abs_top_srcdir = /Source/cvs/palm/pilot-link/HEAD ac_ct_CC = gcc ac_ct_DUMPBIN = ac_ct_F77 = acx_pthread_config = am__include = include am__leading_dot = . am__quote = am__tar = ${AMTAR} chof - "$$tardir" am__untar = ${AMTAR} xf - bindir = ${exec_prefix}/bin build = x86_64-unknown-linux-gnu build_alias = build_cpu = x86_64 build_os = linux-gnu build_vendor = unknown builddir = . datadir = ${datarootdir} datarootdir = ${prefix}/share docdir = ${datarootdir}/doc/${PACKAGE} dvidir = ${docdir} exec_prefix = ${prefix} host = x86_64-unknown-linux-gnu host_alias = host_cpu = x86_64 host_os = linux-gnu host_vendor = unknown htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info install_sh = ${SHELL} /Source/cvs/palm/pilot-link/HEAD/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var lt_ECHO = echo mandir = ${datarootdir}/man mkdir_p = /bin/mkdir -p oldincludedir = /usr/include pdfdir = ${docdir} prefix = /usr/local program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${exec_prefix}/sbin sharedstatedir = ${prefix}/com srcdir = . sysconfdir = ${prefix}/etc target = x86_64-unknown-linux-gnu target_alias = target_cpu = x86_64 target_os = linux-gnu target_vendor = unknown top_build_prefix = ../../ top_builddir = ../.. top_srcdir = ../.. usb_libs = -lusb PORT = /dev/pilot INCLUDES = \ -I../../include \ -I $(top_srcdir)/include \ -I $(top_builddir)/include \ -I $(JAVABASE)/include \ -I $(JAVABASE)/include/linux java_files = \ $(srcdir)/MidiMgr.java \ $(srcdir)/TestTodos.java \ $(srcdir)/org/gnu/pilotlink/AddressAppInfo.java \ $(srcdir)/org/gnu/pilotlink/AppInfo.java \ $(srcdir)/org/gnu/pilotlink/DBInfo.java \ $(srcdir)/org/gnu/pilotlink/DatabaseExistsException.java \ $(srcdir)/org/gnu/pilotlink/DatabaseNotFoundException.java \ $(srcdir)/org/gnu/pilotlink/DatebookAppInfo.java \ $(srcdir)/org/gnu/pilotlink/FTB3CostCatRecord.java \ $(srcdir)/org/gnu/pilotlink/MemoRecord.java \ $(srcdir)/org/gnu/pilotlink/PilotLink.java \ $(srcdir)/org/gnu/pilotlink/PilotLinkException.java \ $(srcdir)/org/gnu/pilotlink/RawAppInfo.java \ $(srcdir)/org/gnu/pilotlink/RawRecord.java \ $(srcdir)/org/gnu/pilotlink/SysInfo.java \ $(srcdir)/org/gnu/pilotlink/User.java \ $(srcdir)/org/gnu/pilotlink/Version.java \ $(srcdir)/org/gnu/pilotlink/AddressRecord.java \ $(srcdir)/org/gnu/pilotlink/FTB3TripRecord.java \ $(srcdir)/org/gnu/pilotlink/FTB3VehicleRecord.java \ $(srcdir)/org/gnu/pilotlink/DatebookRecord.java \ $(srcdir)/org/gnu/pilotlink/MidiRecord.java \ $(srcdir)/org/gnu/pilotlink/ToDoRecord.java \ $(srcdir)/org/gnu/pilotlink/Record.java \ $(srcdir)/test.java \ $(srcdir)/datebooktst.java \ $(srcdir)/adrtest.java java_classes = \ MidiMgr.class \ TestTodos.class \ org/gnu/pilotlink/AddressAppInfo.class \ org/gnu/pilotlink/AppInfo.class \ org/gnu/pilotlink/DBInfo.class \ org/gnu/pilotlink/DatabaseExistsException.class \ org/gnu/pilotlink/DatabaseNotFoundException.class \ org/gnu/pilotlink/DatebookAppInfo.class \ org/gnu/pilotlink/FTB3CostCatRecord.class \ org/gnu/pilotlink/MemoRecord.class \ org/gnu/pilotlink/PilotLink.class \ org/gnu/pilotlink/PilotLinkException.class \ org/gnu/pilotlink/RawAppInfo.class \ org/gnu/pilotlink/RawRecord.class \ org/gnu/pilotlink/SysInfo.class \ org/gnu/pilotlink/User.class \ org/gnu/pilotlink/Version.class \ org/gnu/pilotlink/AddressRecord.class \ org/gnu/pilotlink/FTB3TripRecord.class \ org/gnu/pilotlink/FTB3VehicleRecord.class \ org/gnu/pilotlink/DatebookRecord.class \ org/gnu/pilotlink/MidiRecord.class \ org/gnu/pilotlink/ToDoRecord.class \ org/gnu/pilotlink/Record.class \ test.class \ datebooktst.class \ adrtest.class all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/Java/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu bindings/Java/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ clean-local distclean distclean-generic distclean-libtool \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am all: java_pisock $(java_classes): java_compile java_compile: $(java_files) $(JAVAC) -d . $(java_files) java_lib: libjpisock.c $(CXX) $(INCLUDES) -fPIC $(DEFS) -L $(top_builddir)/libpisock/.libs -lpisock -shared -o libjpisock.so $(srcdir)/libjpisock.c java_jar: $(java_classes) $(JAR) cvf pilot-link.jar $(java_classes) java_pisock: java_compile java_lib java_jar install: all ARCH=""; \ for a in i386 amd64 ppc; do \ if [ -e ${JAVABASE}/jre/lib/$${a} ]; then \ ARCH="$${a}"; \ break; \ fi; \ done; \ if [ -n "$${ARCH}" ]; then \ echo "Unknown architecture. Copy lipijsock.so to ${JAVABASE}/jre/lib/ARCH/"; \ else \ mkdir -p "$(DESTDIR)${JAVABASE}/jre/lib/$${ARCH}" && \ cp libjpisock.so "$(DESTDIR)${JAVABASE}/jre/lib/$${ARCH}"; \ echo "done."; \ fi test: install ${JAVABASE}/bin/java test ${PORT} clean-local: rm -f libjpisock.so rm -f test.class rm -f $(java_classes) rm -f pilot-link.jar # 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: pilot-link-0.12.5-dfsg/bindings/Java/TODO0000644000175000017500000000036007673705050020256 0ustar rousseaurousseau- SD Card info details - Mail, Todo and Expense conduits not implemented - File manipulation (install, retrieve files) - Category and Sort app blocks can't be read (although app blocks in general can be) - Preferences cannot be read. pilot-link-0.12.5-dfsg/bindings/Java/org/0000755000175000017500000000000011333433324020344 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/bindings/Java/org/gnu/0000755000175000017500000000000011333433324021135 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/bindings/Java/org/gnu/pilotlink/0000755000175000017500000000000012346016511023142 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/bindings/Java/org/gnu/pilotlink/AddressRecord.java0000644000175000017500000000457710161574446026557 0ustar rousseaurousseaupackage org.gnu.pilotlink; public class AddressRecord extends Record { String fields[]; int[] labelIds; int showPhone; public AddressRecord(Record r) { super(r); } public AddressRecord() { labelIds=new int[5]; fields=new String[20]; } public void setBuffer(byte buf[]) { labelIds=new int[5]; fields=new String[20]; if (buf.length<5) { System.out.println("Wrong sized buffer for address..."); return; } showPhone=hi(buf[1]); labelIds[4]=lo(buf[1]); labelIds[3]=hi(buf[2]); labelIds[2]=lo(buf[2]); labelIds[1]=hi(buf[3]); labelIds[0]=lo(buf[3]); long contents=buf[4]*256*256*256+buf[5]*256*256+buf[6]*256+buf[7]; int len=buf.length-9; int offset=9; for (int i=0; i<19; i++) { if ((contents & (1<>4; } private int lo(byte b) { return (b&0x0f); } public String getField(int idx) { return fields[idx]; } public int getLabelId(int idx) { if (idx>5) { return 0; } return labelIds[idx]; } public void setField(String cont,int idx) { if (idx>19) { return; } fields[idx]=cont; setSize(getBuffer().length); } public void setLabelId(int id, int idx) { if (idx>5) { return; } labelIds[idx]=id; setSize(getBuffer().length); } } pilot-link-0.12.5-dfsg/bindings/Java/org/gnu/pilotlink/FTB3VehicleRecord.java0000644000175000017500000000407310161574446027157 0ustar rousseaurousseau/* * Created on 15.02.2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package org.gnu.pilotlink; /** * @author stephan * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class FTB3VehicleRecord extends Record { private String name; private String note; private String plate; private double monthlyCost; /** * */ public FTB3VehicleRecord() { super(); } /** * @param i * @param att * @param cat * @param sz */ public FTB3VehicleRecord(int i, int att, int cat, int sz) { super(i, att, cat, sz); } /** * @param r */ public FTB3VehicleRecord(Record r) { super(r); } /* (non-Javadoc) * @see org.gnu.pilotlink.Record#getBuffer() */ public byte[] getBuffer() { byte buf[]=new byte[0x70]; setStringAt(buf,name,0x08); setStringAt(buf,plate,0x18); setStringAt(buf,note,0x30); return buf; } /* (non-Javadoc) * @see org.gnu.pilotlink.Record#setBuffer(byte[]) */ public void setBuffer(byte[] buf) { name=getStringAt(buf,0x08); plate=getStringAt(buf,0x18); //TODO: parse monthly cost as float at 0x28 monthlyCost=getDoubleAt(buf,0x28); note=getStringAt(buf,0x30); setSize(buf.length); } /** * @return Returns the name. */ public String getName() { return name; } /** * @param name The name to set. */ public void setName(String name) { this.name= name; setSize(getBuffer().length); } /** * @return Returns the note. */ public String getNote() { return note; } /** * @param note The note to set. */ public void setNote(String note) { this.note= note; setSize(getBuffer().length); } /** * @return Returns the plate. */ public String getPlate() { return plate; } /** * @param plate The plate to set. */ public void setPlate(String plate) { this.plate= plate; setSize(getBuffer().length); } public String toString() { return "Vehicle: "+name+" ("+plate+") - "+note+ " Cost: "+monthlyCost; } } pilot-link-0.12.5-dfsg/bindings/Java/org/gnu/pilotlink/RawAppInfo.java0000644000175000017500000000216107673700001026014 0ustar rousseaurousseaupackage org.gnu.pilotlink; public class RawAppInfo extends AppInfo { byte buffer[]; String categories[]=new String[16]; boolean isRenamed[]=new boolean[16]; int catCount=0; public RawAppInfo(byte b[]) { setBuffer(b); } public byte[] getBuffer() { return buffer; } public void setBuffer(byte b[]) { buffer=b; int bits=b[0]*256+b[1]; catCount=0; for (int i=0; i<16; i++) { if (b[2+i*16]!=0) { categories[i]=new String(b,2+i*16,16); System.out.println("Got Category: \""+categories[i]+"\""); catCount++; } else { categories[i]=null; } if ( (bits&(1<255) throw new IllegalArgumentException("Invalid priority"); priority=(byte)i; } public void setNote(String n) { note=n; setSize(getBuffer().length); } public String getNote() { return note; } public void setDueDate(Date dd) { dueDate=dd; setSize(getBuffer().length); } public Date getDueDate() { return dueDate; } public ToDoRecord(Record r) { super(r); } public ToDoRecord() { } /* (non-Javadoc) * @see org.gnu.pilotlink.Record#getBuffer() */ public byte[] getBuffer() { int size=3; if (note!=null) { size+=note.length()+1; } else { size++; } if (description!=null) { size+=description.length()+1; } else { size++; } byte buf[]=new byte[size]; System.out.println("Size: "+size); if (dueDate!=null) { Record.setDateAt(buf,dueDate,0); } else { buf[0]=(byte)0xff; buf[1]=(byte)0xff; } buf[2]=priority; if(done) { buf[2]|=0x80; } int offset=3; if (description!=null) { offset=Record.setStringAt(buf,description,offset); } else { buf[offset++]=0; } if (note!=null) { Record.setStringAt(buf,note,offset); } else { buf[offset++]=0; } return buf; } /* (non-Javadoc) * @see org.gnu.pilotlink.Record#setBuffer(byte[]) */ public void setBuffer(byte[] buf) { if (Record.getIntAt(buf,0) != 0xffff) { //due-date set System.out.println("\n\nReading in due-date..."+(buf[0]&0xff)+" "+(buf[1]&0xff)+" getInt "+Record.getIntAt(buf,0)+" "+Record.getDateAt(buf,0)); dueDate=Record.getDateAt(buf,0); } priority=buf[2]; if ((priority & 0x80) > 0) { //Completed priority&=0x7f; done=true; } else { done=false; } if (buf.length <= 3) { return; } int pos=3; description=Record.getStringAt(buf,3); if (buf.length<=3+description.length()) { return; } note=Record.getStringAt(buf,3+description.length()); setSize(buf.length); } public String toString() { return "P"+priority+": "+description+" Done: "+done+" due to: "+dueDate+" note: "+note; } } pilot-link-0.12.5-dfsg/bindings/Java/org/gnu/pilotlink/DatebookRecord.java0000644000175000017500000002551610161574446026716 0ustar rousseaurousseaupackage org.gnu.pilotlink; import java.util.Date; import java.util.GregorianCalendar; public class DatebookRecord extends Record { byte buffer[]=new byte[65535]; //max buffer //Statics public final static int REP_WEEKLY=2; public final static int REP_DAYLY=1; public final static int REP_MONTHLY_BY_DAY=3; public final static int REP_MONTHLY_BY_DATE=4; public final static int REP_YEARLY=5; public final static int REP_NONE=6; public final static int NO_REP=0; public final static int ALARM_MINUTES=0; public final static int ALARM_HOURS=1; public final static int ALARM_DAYS=2; public final static int ALARM_NONE=3; //Privates //private Record rawData; private Date startDate; private Date endDate; private Date repeatEnd; private String description; private String note; private int alarmAdvance; private int alarmUnits; private int repAdvance; private int repType; private int repDay; private int repWeekstart; private int dist; private Date repExceptions[]; private boolean[] repDays; //die flags... private boolean hasNote; private boolean hasAlarm; private boolean hasTime; private boolean isRepeated; private boolean hasDescription; private boolean hasExceptions; private boolean repeatForever; public boolean hasNote() { return hasNote; } public boolean hasTime() { return hasTime; } public boolean hasAlarm() { return hasAlarm; } public boolean isRepeated() { return isRepeated; } public boolean hasDescription() { return hasDescription; } public boolean hasExceptions() { return hasExceptions; } public boolean repeatForever() { return repeatForever; } public DatebookRecord(Date sd, Date ed,String descr, String n) { resetVars(); startDate = sd; endDate=ed; description=descr; note=n; if (n!=null && n.length()!=0) { hasNote=true; } if (descr!=null && descr.length()!=0) { hasDescription=true; } GregorianCalendar cal=new GregorianCalendar(); cal.setTime(sd); if (cal.get(GregorianCalendar.HOUR_OF_DAY)!=0 && cal.get(GregorianCalendar.MINUTE)!=0) { hasTime=true; } //CLUMSY: getting buffer once to calc size //getBuffer(); setSize(getBuffer().length); } //Constructor public DatebookRecord(Record raw) { super(raw); } public DatebookRecord() { startDate=new Date(); resetVars(); endDate=new Date(); } private void resetVars() { description=""; note=""; alarmAdvance=0; alarmUnits=ALARM_NONE; repAdvance=0; repType=REP_NONE; repDay=0; repWeekstart=0; repAdvance=0; dist=0; repDays= new boolean[] { false, false ,false, false, false, false, false }; hasNote=false; hasAlarm=false; hasTime=false; isRepeated=false; hasDescription=false; hasExceptions=false; repeatForever=false; } public void setBuffer(byte arr[]) { //buffer=raw.getBuffer(); resetVars(); if (arr[0]==(byte)0xff && arr[1]==(byte)0xff) { //keine Zeit festgelegt hasTime=false; startDate=Record.getDateAt(arr,4); endDate=startDate; } else { hasTime=true; startDate=Record.getDateTimeAt(arr,4,0); endDate=Record.getDateTimeAt(arr,4,2); } //Parsing flags int flags=arr[6]; if ((flags & 64) != 0) { hasAlarm=true; } if ((flags & 32) != 0) { isRepeated=true; } if ((flags & 8) !=0) { hasExceptions=true; } if ((flags & 16) !=0) { hasNote=true; } if ((flags & 4) != 0) { hasDescription=true; } int idx=8; //getting data if (hasAlarm) { alarmAdvance=arr[idx]; idx++; alarmUnits=arr[idx]; idx++; } if (isRepeated) { repType=arr[idx]; idx+=2; dist=256*arr[idx]+arr[idx]+1; if (dist==0xffff) { repeatForever=true; } else { repeatEnd=Record.getDateAt(arr,idx); } idx+=2; repAdvance=arr[idx]; idx++; int on=arr[idx]; if (repType==REP_MONTHLY_BY_DAY) { repDay=on; } else { for (int i=0; i<7;i++) { //repDays[i]=((on&(1<Preferences>Java>Code Generation>Code and Comments */ package org.gnu.pilotlink; /** * @author stephan * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class AddressAppInfo extends AppInfo { private String labels[]; //19+3 private boolean labelRenamed[]; private String phoneLabels[]; //whatever private int country=0; private int sortByCompany=0; /** * */ public AddressAppInfo() { super(); } /** * @param ai */ public AddressAppInfo(AppInfo ai) { super(ai); } /* (non-Javadoc) * @see org.gnu.pilotlink.AppInfo#setBuffer(byte[]) */ public void setBuffer(byte[] b) { labels=new String[22]; labelRenamed=new boolean[22]; phoneLabels=new String[8]; buffer=b; super.parseCategories(); long r=Record.getLongAt(buffer,dataOffset); for (int i=0; i<22;i++) { labelRenamed[i]=((r&(1<Preferences>Java>Code Generation>Code and Comments */ package org.gnu.pilotlink; /** * @author stephan * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class FTB3CostCatRecord extends Record { private String name; /** * */ public FTB3CostCatRecord() { super(); // TODO Auto-generated constructor stub } /** * @param i * @param att * @param cat * @param sz */ public FTB3CostCatRecord(int i, int att, int cat, int sz) { super(i, att, cat, sz); // TODO Auto-generated constructor stub } /** * @param r */ public FTB3CostCatRecord(Record r) { super(r); // TODO Auto-generated constructor stub } /* (non-Javadoc) * @see org.gnu.pilotlink.Record#getBuffer() */ public byte[] getBuffer() { byte buf[]=new byte[0x48]; if (name==null) { return buf; } if (name.length()>0x40) { name=name.substring(0,0x40); } setStringAt(buf,name,0x08); return buf; } /* (non-Javadoc) * @see org.gnu.pilotlink.Record#setBuffer(byte[]) */ public void setBuffer(byte[] buf) { name=getStringAt(buf,0x08); } /** * @return Returns the name. */ public String getName() { return name; } /** * @param name The name to set. */ public void setName(String name) { this.name= name; } public String toString(){ return ""+name; } } pilot-link-0.12.5-dfsg/bindings/Java/org/gnu/pilotlink/MidiRecord.java0000644000175000017500000000312610161574446026041 0ustar rousseaurousseau/* * Created on 16.03.2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package org.gnu.pilotlink; /** * @author stephan * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class MidiRecord extends Record { private byte midi[]; private String name; private static String id="PMrc"; public MidiRecord() { midi=new byte[1]; //avoid nullpointer exception name=""; } /* (non-Javadoc) * @see org.gnu.pilotlink.Record#getBuffer() */ public byte[] getBuffer() { // TODO Auto-generated method stub int offset=name.length()+1+6; byte buf[]=new byte[offset+midi.length]; setStringAt(buf,id,0); buf[4]=(byte)offset; buf[5]=0; setStringAt(buf,name,6); for (int i=0; i= 0; } public PilotLink(String port) throws IOException, PilotLinkException { System.out.println("Initialising Pilot-Link-Java-Bindings V"+Version.VERSION+" build #"+Version.BUILD); handle = connect(port); } private int handle; private native/* synchronized */int connect(String port) throws IOException, PilotLinkException; public SysInfo getSysInfo() throws PilotLinkException { // System.out.println("Getting Sysinfo..."); SysInfo si = readSysInfo(handle); return si; } private native/* synchronized */SysInfo readSysInfo(int handle) throws PilotLinkException; public User getUserInfo() throws PilotLinkException { User u = readUserInfo(handle); return u; } private native/* synchronized */User readUserInfo(int handle) throws PilotLinkException; /** * @deprecated */ public RawAppInfo getAppInfo(int db) throws PilotLinkException { return readAppInfo(handle, db); } private native/* synchronized */RawAppInfo readAppInfo(int h, int db) throws PilotLinkException; public RawAppInfo getAppInfoBlock(String dbname) { return getAppInfoBlock(handle,dbname); } private native RawAppInfo getAppInfoBlock(int h, String dbnmae); public void writeUserInfo(User u) throws PilotLinkException { writeUserInfo(handle, u); } private native/* synchronized */void writeUserInfo(int h, User u) throws PilotLinkException; private long toLong(char[] charArray) { int length = charArray.length; long result = 0; for (int i = 0; i < length - 1; i++) { result |= charArray[i]; result <<= 8; } result |= charArray[length - 1]; return result; } public int createDB(String dbn, String creator, String type) throws PilotLinkException { // System.out.println("Creating new database..."); long longCreator = toLong(creator.toCharArray()); long longType = toLong(type.toCharArray()); return createDB(handle, longCreator, dbn, longType, 0, 1); } public int createDB(String dbn, String creator, String type, int flags, int version) throws PilotLinkException { long longCreator = toLong(creator.toCharArray()); long longType = toLong(type.toCharArray()); return createDB(handle, longCreator, dbn, longType, flags, version); } private native/* synchronized */int createDB(int handle, long creator, String dbname, long type) throws PilotLinkException; private native int createDB(int handle, long creator, String dbname, long type, int flags, int version) throws PilotLinkException; public int deleteDB(String dbn) throws PilotLinkException { // System.out.println("Deleting database " + dbn); return deleteDB(handle, dbn); } private native/* synchronized */int deleteDB(int handle, String dbname) throws PilotLinkException; public int openDB(String dbn) throws PilotLinkException { return openDB(handle, dbn); } private native/* synchronized */int openDB(int handle, String dbname) throws PilotLinkException; public int writeAppBlock(byte[] data, int dbhandle) throws PilotLinkException { return writeAppBlock(handle, dbhandle, data, data.length); } private native/* synchronized */int writeAppBlock(int handle, int dbhandle, byte[] data, int length) throws PilotLinkException; public int getRecordCount(int dbhandle) throws PilotLinkException { return getRecordCount(handle, dbhandle); } private native/* synchronized */int getRecordCount(int handle, int dbhandle) throws PilotLinkException; public Record getRecordByIndex(int dbh, int idx) throws PilotLinkException { return getRecordByIndex(handle, dbh, idx); } private native/* synchronized */RawRecord getRecordByIndex(int handle, int dbhandle, int idx) throws PilotLinkException; public void deleteRecordById(int dbhandle, long id) { deleteRecordById(handle, dbhandle, id); } private native/* synchronized */int deleteRecordById(int handle, int dbhandle, long id); public boolean writeRecord(int dbh, Record r) throws PilotLinkException { return writeRecord(handle, dbh, r) > 0; } private native/* synchronized */int writeRecord(int handle, int dbhandle, Record r) throws PilotLinkException; public int writeNewRecord(int dbhandle, Record r) throws PilotLinkException { return writeRecord(handle, dbhandle, r); } public void closeDB(int dbh) throws PilotLinkException { closeDB(handle, dbh); dbh = 0; } private native/* synchronized */void closeDB(int handle, int dbhandle) throws PilotLinkException; public void endSync() throws PilotLinkException { endSync(handle); } private native/* synchronized */void endSync(int handle) throws PilotLinkException; public void close() { close(handle); handle = 0; } private native/* synchronized */void close(int handle); public void openConduit() throws PilotLinkException { openConduit(handle); } private native/* synchronized */void openConduit(int handle) throws PilotLinkException; private native/* synchronized */RawRecord getResourceByIndex(int handle, int dbhandle, int idx) throws PilotLinkException; private native/* synchronized */void writeResource(int handle, int dbhandle, RawRecord r) throws PilotLinkException; private native/* synchronized */void resetSystem(int handle) throws PilotLinkException; private native/* synchronized */DBInfo readDBList(int handle, int cardno, int flags, int start) throws PilotLinkException; public RawRecord getResourceByIndex(int dbhandle, int idx) throws PilotLinkException { return getResourceByIndex(handle, dbhandle, idx); } public void writeResource(int dbhandle, RawRecord r) throws PilotLinkException { writeResource(handle, dbhandle, r); } public void resetSystem() throws PilotLinkException { resetSystem(handle); } public DBInfo readDBList(int cardno, int flags, int start) throws PilotLinkException { return readDBList(handle, cardno, flags, start); } } pilot-link-0.12.5-dfsg/bindings/Java/org/gnu/pilotlink/AppInfo.java0000644000175000017500000000524610161574446025361 0ustar rousseaurousseaupackage org.gnu.pilotlink; public abstract class AppInfo { protected byte buffer[]; protected String categories[]=new String[16]; protected boolean isCatRenamed[]=new boolean[16]; protected int catCount=0; protected int dataOffset=0; protected int bits; protected long id[]; protected int lastUniqueID; public AppInfo() { buffer=new byte[65535]; } public AppInfo(AppInfo ai) { setBuffer(ai.getBuffer()); } public abstract void setBuffer(byte[] b); public void parseCategories(){ bits=buffer[0]*256+buffer[1]; id=new long[4]; catCount=0; for (int i=0; i<16; i++) { if (buffer[2+i*16]!=0) { categories[i]=getStringAt(buffer,2+i*16); //=new String(buffer,2+i*16,16); //System.out.println("Got Category: \""+categories[i]+"\""); catCount++; } else { categories[i]=null; } if ( (bits&(1<>256); buffer[1]=(byte) (bits&256); } public abstract byte[] getBuffer() ; public boolean isCatRenamed(int idx) { return isCatRenamed[idx]; } public void setCatRenamed(int idx,boolean b) { isCatRenamed[idx]=b; } public String getCatName(int idx) { return categories[idx]; } public void setCatName(int idx,String n){ if (n.length()>16) { n=n.substring(0,16); } categories[idx]=n; } public static String getStringAt(byte buffer[], int idx) { String str=""; while (idx> 9; year += 1904; int month = binary & 0x01e0; month = month >> 5; month--; int day = binary & 0x001f; //System.out.println("Y: "+year+" M:"+month+" D: "+day); GregorianCalendar cal = new GregorianCalendar(year, month, day); return cal.getTime(); } /** * Sets the dateAt attribute of the Record class * *@param buffer The new dateAt value *@param d The new dateAt value *@param idx The new dateAt value */ public static void setDateAt(byte buffer[], Date d, int idx) { GregorianCalendar cal = new GregorianCalendar(); //System.out.println("Setting date "+d+" at: "+idx); cal.setTime(d); int binary = 0; int year = cal.get(GregorianCalendar.YEAR); int month = cal.get(GregorianCalendar.MONTH); int day = cal.get(GregorianCalendar.DAY_OF_MONTH); year -= 1904; year = year << 9; month++; month = month << 5; binary = year | month | day; buffer[idx + 1] = (byte) (binary & 0x00ff); buffer[idx] = (byte) ((binary & 0xff00) >> 8); } /** * Sets the dateTimeAt attribute of the Record class * *@param buffer The new dateTimeAt value *@param d The new dateTimeAt value *@param idx The new dateTimeAt value *@param tidx The new dateTimeAt value */ public static void setDateTimeAt(byte buffer[], Date d, int idx, int tidx) { setDateAt(buffer, d, idx); GregorianCalendar cal = new GregorianCalendar(); cal.setTime(d); int h = cal.get(GregorianCalendar.HOUR_OF_DAY); int m = cal.get(GregorianCalendar.MINUTE); buffer[tidx] = (byte) h; buffer[tidx + 1] = (byte) m; } /** * Gets the dateTimeAt attribute of the Record object * *@param idx Description of the Parameter *@param tidx Description of the Parameter *@return The dateTimeAt value */ public Date getDateTimeAt(int idx, int tidx) { return getDateTimeAt(getBuffer(), idx, tidx); } /** * Gets the dateTimeAt attribute of the Record class * *@param buffer Description of the Parameter *@param idx Description of the Parameter *@param tidx Description of the Parameter *@return The dateTimeAt value */ public static Date getDateTimeAt(byte buffer[], int idx, int tidx) { int binary = (buffer[idx] & 0xff) * 256 + (buffer[idx + 1] & 0xff); int year = binary & 0xfe00; year = year >> 9; year += 1904; int month = binary & 0x01e0; month = month >> 5; month--; int day = binary & 0x001f; //System.out.println("Y: "+year+" M:"+month+" D: "+day); int hour = buffer[tidx] & 0xff; int min = buffer[tidx + 1] & 0xff; GregorianCalendar cal = new GregorianCalendar(year, month, day, hour, min, 0); return cal.getTime(); } /** * Sets the stringAt attribute of the Record class * *@param buffer The new stringAt value *@param s The new stringAt value *@param idx The new stringAt value *@return Description of the Return Value */ public static int setStringAt(byte buffer[], String s, int idx) { if (s == null) { return idx; } byte str[]; str = s.getBytes(); for (int i = 0; i < str.length; i++) { if (s.charAt(i) == '\ufffd') { buffer[idx + i] = (byte) 252; } else if (s.charAt(i) == '\ufffd') { buffer[idx + i] = (byte) 246; } else if (s.charAt(i) == '\ufffd') { buffer[idx + i] = (byte) 228; } else if (s.charAt(i) == '\ufffd') { buffer[idx + i] = (byte) 223; } else if (s.charAt(i) == '\ufffd') { buffer[idx + i] = (byte) 196; } else if (s.charAt(i) == '\ufffd') { buffer[idx + i] = (byte) 220; } else if (s.charAt(i) == '\ufffd') { buffer[idx + i] = (byte) 214; } else { buffer[idx + i] = str[i]; } } //System.out.println(); buffer[idx + str.length] = 0; return (idx + str.length + 1); } /** * Gets the stringAt attribute of the Record object * *@param idx Description of the Parameter *@return The stringAt value */ public String getStringAt(int idx) { return getStringAt(getBuffer(), idx); } /** * Gets the stringAt attribute of the Record class * *@param buffer Description of the Parameter *@param idx Description of the Parameter *@return The stringAt value */ public static String getStringAt(byte buffer[], int idx) { String str = ""; while (idx < buffer.length && buffer[idx] != 0) { if (buffer[idx] + 256 == 252) { str += "\ufffd"; } else if (buffer[idx] + 256 == 246) { str += "\ufffd"; } else if (buffer[idx] + 256 == 228) { str += "\ufffd"; } else if (buffer[idx] + 256 == 223) { str += "\ufffd"; } else if (buffer[idx] + 256 == 196) { str += "\ufffd"; } else if (buffer[idx] + 256 == 220) { str += "\ufffd"; } else if (buffer[idx] + 256 == 214) { str += "\ufffd"; } else { str += (char) buffer[idx]; } idx++; } return str; } /** * Sets the intAt attribute of the Record class * *@param buffer The new intAt value *@param i The new intAt value *@param idx The new intAt value */ public static void setIntAt(byte buffer[], int i, int idx) { buffer[idx + 1] = (byte) (i & 0x00ff); buffer[idx] = (byte) ((i & 0xff00) >> 8); } /** * Gets the intAt attribute of the Record object * *@param idx Description of the Parameter *@return The intAt value */ public int getIntAt(int idx) { return getIntAt(getBuffer(), idx); } /** * Gets the intAt attribute of the Record class * *@param buffer Description of the Parameter *@param idx Description of the Parameter *@return The intAt value */ public static int getIntAt(byte buffer[], int idx) { return ((buffer[idx] & 0xff) << 8) + (buffer[idx + 1] & 0xff); } /** * Gets the doubleAt attribute of the Record class * *@param buffer Description of the Parameter *@param idx Description of the Parameter *@return The doubleAt value */ public static double getDoubleAt(byte buffer[], int idx) { long l = getDoubleLongAt(buffer, idx); return Double.longBitsToDouble(l); } /** * Sets the doubleAt attribute of the Record class * *@param buffer The new doubleAt value *@param v The new doubleAt value *@param idx The new doubleAt value */ public static void setDoubleAt(byte buffer[], double v, int idx) { long l = Double.doubleToLongBits(v); setDoubleLongAt(buffer, l, idx); } /** * Gets the doubleLongAt attribute of the Record class * *@param buffer Description of the Parameter *@param idx Description of the Parameter *@return The doubleLongAt value */ public static long getDoubleLongAt(byte buffer[], int idx) { long value = 0; //A clumsy hack, but quick //could not think of a better version //java makes is impossible to convert large bytes to chars wihtout //losing information for (int octet = 0; octet < 8; octet++) { for (int bit = 0; bit < 8; bit++) { if ((buffer[octet + idx] & (1 << bit)) != 0) { value |= (1L << (56 - octet * 8 + bit)); } } } return value; } /** * Sets the doubleLongAt attribute of the Record class * *@param buffer The new doubleLongAt value *@param v The new doubleLongAt value *@param idx The new doubleLongAt value */ public static void setDoubleLongAt(byte buffer[], long v, int idx) { buffer[idx + 0] = (byte) ((v & 0xff00000000000000L) >> 56); buffer[idx + 1] = (byte) ((v & 0x00ff000000000000L) >> 48); buffer[idx + 2] = (byte) ((v & 0x0000ff0000000000L) >> 40); buffer[idx + 3] = (byte) ((v & 0x000000ff00000000L) >> 32); buffer[idx + 4] = (byte) ((v & 0x00000000ff000000L) >> 24); buffer[idx + 5] = (byte) ((v & 0x0000000000ff0000L) >> 16); buffer[idx + 6] = (byte) ((v & 0x000000000000ff00L) >> 8); buffer[idx + 7] = (byte) ((v & 0x00000000000000ffL)); } /** * Sets the longAt attribute of the Record class * *@param buffer The new longAt value *@param v The new longAt value *@param idx The new longAt value */ public static void setLongAt(byte buffer[], long v, int idx) { buffer[idx + 0] = (byte) ((v & 0x00000000ff000000L) >> 24); buffer[idx + 1] = (byte) ((v & 0x0000000000ff0000L) >> 16); buffer[idx + 2] = (byte) ((v & 0x000000000000ff00L) >> 8); buffer[idx + 3] = (byte) ((v & 0x00000000000000ffL)); } /** * Gets the longAt attribute of the Record class * *@param buffer Description of the Parameter *@param idx Description of the Parameter *@return The longAt value */ public static long getLongAt(byte buffer[], int idx) { long value = 0; //A clumsy hack, but quick //could not think of a better version //java makes is impossible to convert large bytes to chars wihtout //losing information for (int octet = 0; octet < 4; octet++) { for (int bit = 0; bit < 8; bit++) { if ((buffer[octet + idx] & (1 << bit)) != 0) { value |= (1L << (24 - octet * 8 + bit)); } } } return value; } } pilot-link-0.12.5-dfsg/bindings/Java/org/gnu/pilotlink/MemoRecord.java0000644000175000017500000000170710161574446026057 0ustar rousseaurousseaupackage org.gnu.pilotlink; public class MemoRecord extends Record { String memo; /** * Calls the constructor of Record which calles setBuffer, * do not call setBuffer directly */ public MemoRecord(Record r) { super(r); } public MemoRecord(String txt) { memo=txt+'\0'; setSize(memo.length()); } public String getText() { return memo; } public void setText(String m) { memo=m; setSize(m.length()+1); } /** * usually called by the Constructor of Record */ public void setBuffer(byte dat[]) { memo=new String(dat)+'\0'; setSize(memo.length()+1); } public byte[] getBuffer() { //Trying to write a Memo! //String str="Eine TestNachricht!"; //byte a[]=str.getBytes(); //Record r=new Record(a,a.length,64,2); //pl.writeRecord(dbh,r); return memo.getBytes(); } } pilot-link-0.12.5-dfsg/bindings/Java/org/gnu/pilotlink/DatebookAppInfo.java0000644000175000017500000000226210161574446027025 0ustar rousseaurousseau/* * Created on 15.02.2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package org.gnu.pilotlink; /** * @author stephan * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class DatebookAppInfo extends AppInfo { private int startOfWeek=0; public DatebookAppInfo(int startofweek) { startOfWeek=startofweek; } /** * @param ai */ public DatebookAppInfo(AppInfo ai) { super(ai); // TODO Auto-generated constructor stub } /* (non-Javadoc) * @see org.gnu.pilotlink.AppInfo#setBuffer(byte[]) */ public void setBuffer(byte[] b) { parseCategories(); startOfWeek=b[dataOffset]; } /** * @return Returns the startOfWeek. */ public int getStartOfWeek() { return startOfWeek; } /** * @param startOfWeek The startOfWeek to set. */ public void setStartOfWeek(int startOfWeek) { this.startOfWeek= startOfWeek; } /* (non-Javadoc) * @see org.gnu.pilotlink.AppInfo#getBuffer() */ public byte[] getBuffer() { createDefaultBuffer(); buffer[dataOffset]=(byte)startOfWeek; return buffer; } } pilot-link-0.12.5-dfsg/bindings/Java/org/gnu/pilotlink/FTB3TripRecord.java0000644000175000017500000001563010161574446026517 0ustar rousseaurousseau/* * Created on 15.02.2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package org.gnu.pilotlink; import java.util.Date; /** * @author stephan * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class FTB3TripRecord extends Record { private String startLocation; private String destLocation; private Date startTime; private Date arrivalTime; private boolean priv; private boolean storno; private String note; private long startMileage; private long endMileage; private long carID; private boolean isCost; private double sum; private double fuel; private double fuelCost; private long[] cat; private double[] cost; /** * */ public FTB3TripRecord() { super(); } /** * @param i * @param att * @param cat * @param sz */ public FTB3TripRecord(int i, int att, int cat, int sz) { super(i, att, cat, sz); } /** * @param r */ public FTB3TripRecord(Record r) { super(r); } /* (non-Javadoc) * @see org.gnu.pilotlink.Record#getBuffer() */ public byte[] getBuffer() { byte buffer[]=new byte[65535]; Record.setStringAt(buffer,startLocation,0x28); Record.setStringAt(buffer,destLocation,0x68); Record.setDateTimeAt(buffer,startTime,0x12,0x16); Record.setDateTimeAt(buffer,arrivalTime,0x14,0x18); Record.setStringAt(buffer,note,0xa8); Record.setLongAt(buffer,startMileage*10,0x1a); Record.setLongAt(buffer,carID,0x0a); if (!priv) buffer[0x101]=1; if (storno) buffer[0x102]=1; if (isCost) { Record.setLongAt(buffer,0,0x1e); //Cost isCost=true; Record.setDoubleAt(buffer,sum,0x28); Record.setDoubleAt(buffer,fuel,0x30); Record.setDoubleAt(buffer,fuelCost,0x38); for (int i=0; i<4; i++) { Record.setLongAt(buffer,cat[i],0x40+i*4); setDoubleAt(buffer,cost[i],0x50+i*8); } } else { Record.setLongAt(buffer,endMileage*10,0x1e); } return buffer; } /* (non-Javadoc) * @see org.gnu.pilotlink.Record#setBuffer(byte[]) */ public void setBuffer(byte[] buf) { this.cat=new long[4]; cost=new double[4]; startLocation=Record.getStringAt(buf,0x28); destLocation=Record.getStringAt(buf,0x68); startTime=Record.getDateTimeAt(buf,0x12,0x16); arrivalTime=Record.getDateTimeAt(buf,0x14,0x18); note=Record.getStringAt(buf,0xa8); startMileage=Record.getLongAt(buf,0x1a)/10; endMileage=Record.getLongAt(buf,0x1e)/10; carID=Record.getLongAt(buf,0x0a); priv=(buf[0x101]==0); storno=(buf[0x102]==1); if (endMileage==0) { //Cost isCost=true; sum=Record.getDoubleAt(buf,0x28); fuel=Record.getDoubleAt(buf,0x30); fuelCost=Record.getDoubleAt(buf,0x38); for (int i=0; i<4; i++) { cat[i]=Record.getLongAt(buf,0x40+i*4); cost[i]=getDoubleAt(buf,0x50+i*8); } } setSize(buf.length); } /** * @return Returns the arrivalTime. */ public Date getArrivalTime() { return arrivalTime; } /** * @param arrivalTime The arrivalTime to set. */ public void setArrivalTime(Date arrivalTime) { this.arrivalTime= arrivalTime; } /** * @return Returns the carID. */ public long getCarID() { return carID; } /** * @param carID The carID to set. */ public void setCarID(long carID) { this.carID= carID; setSize(getBuffer().length); } /** * @return Returns the cat. */ public long[] getCat() { return cat; } /** * @param cat The cat to set. */ public void setCat(long[] cat) { this.cat= cat; setSize(getBuffer().length); } /** * @return Returns the cost. */ public double[] getCost() { return cost; } /** * @param cost The cost to set. */ public void setCost(double[] cost) { this.cost= cost; setSize(getBuffer().length); } /** * @return Returns the destLocation. */ public String getDestLocation() { return destLocation; } /** * @param destLocation The destLocation to set. */ public void setDestLocation(String destLocation) { this.destLocation= destLocation; setSize(getBuffer().length); } /** * @return Returns the endMileage. */ public long getEndMileage() { return endMileage; } /** * @param endMileage The endMileage to set. */ public void setEndMileage(long endMileage) { this.endMileage= endMileage; setSize(getBuffer().length); } /** * @return Returns the fuel. */ public double getFuel() { return fuel; } /** * @param fuel The fuel to set. */ public void setFuel(double fuel) { this.fuel= fuel; setSize(getBuffer().length); } /** * @return Returns the fuelCost. */ public double getFuelCost() { return fuelCost; } /** * @param fuelCost The fuelCost to set. */ public void setFuelCost(float fuelCost) { this.fuelCost= fuelCost; setSize(getBuffer().length); } /** * @return Returns the isCost. */ public boolean isCost() { return isCost; } /** * @param isCost The isCost to set. */ public void setCost(boolean isCost) { this.isCost= isCost; setSize(getBuffer().length); } /** * @return Returns the note. */ public String getNote() { return note; } /** * @param note The note to set. */ public void setNote(String note) { this.note= note; setSize(getBuffer().length); } /** * @return Returns the priv. */ public boolean isPriv() { return priv; } /** * @param priv The priv to set. */ public void setPriv(boolean priv) { this.priv= priv; setSize(getBuffer().length); } /** * @return Returns the startLocation. */ public String getStartLocation() { return startLocation; } /** * @param startLocation The startLocation to set. */ public void setStartLocation(String startLocation) { this.startLocation= startLocation; setSize(getBuffer().length); } /** * @return Returns the startMileage. */ public long getStartMileage() { return startMileage; } /** * @param startMileage The startMileage to set. */ public void setStartMileage(long startMileage) { this.startMileage= startMileage; setSize(getBuffer().length); } /** * @return Returns the startTime. */ public Date getStartTime() { return startTime; } /** * @param startTime The startTime to set. */ public void setStartTime(Date startTime) { this.startTime= startTime; setSize(getBuffer().length); } /** * @return Returns the storno. */ public boolean isStorno() { return storno; } /** * @param storno The storno to set. */ public void setStorno(boolean storno) { this.storno= storno; setSize(getBuffer().length); } /** * @return Returns the sum. */ public double getSum() { return sum; } /** * @param sum The sum to set. */ public void setSum(double sum) { this.sum= sum; setSize(getBuffer().length); } public String toString() { String out=""; if (isCost) { out="cost "+getSum(); } else { out="trip "+getStartLocation()+" ("+getStartMileage()+"km) ->"+getDestLocation()+"("+getEndMileage()+")"; } return out; } } pilot-link-0.12.5-dfsg/bindings/Java/org/gnu/pilotlink/SysInfo.java0000644000175000017500000000210407673700001025375 0ustar rousseaurousseaupackage org.gnu.pilotlink; public class SysInfo { private long romVersion; private long locale; private String prodID; private short dlpMajorVersion; private short dlpMinorVersion; private short compatMajorVersion; private short compatMinorVersion; private long maxRecSize; public SysInfo(String pID, long rv, long lc, short mav, short miv, short cmav, short cmiv, long maxr) { romVersion=rv; locale=lc; prodID=pID; dlpMajorVersion=mav; dlpMinorVersion=miv; compatMajorVersion=cmav; compatMinorVersion=cmiv; maxRecSize=maxr; } public String getProdID() { return prodID; } public long getMaxRecSize() { return maxRecSize; } public long getCompatMajorVersion() { return compatMajorVersion; } public long getCompatMinorVersion() { return compatMinorVersion; } public long getMinorVersion() { return dlpMinorVersion; } public long getMajorVersion() { return dlpMajorVersion; } public long getLocale() { return locale; } public long getRomVersion() { return romVersion; } } pilot-link-0.12.5-dfsg/bindings/Java/org/gnu/pilotlink/User.java0000644000175000017500000000247110161574446024740 0ustar rousseaurousseaupackage org.gnu.pilotlink; import java.util.Date; public class User { String name; String password; long userid; long lastSyncPC; long viewerid; Date successfulSyncDate; Date lastSyncDate; public User(String username, String pw,long uid, long vid, long lsp,Date lsd, Date ssd) { name=username; userid=uid; lastSyncPC=lsp; password=pw; viewerid=vid; lastSyncDate=lsd; successfulSyncDate=ssd; } public User(String username, String pw, long uid, long vid, long lsp, long sec_epoch_lsd, long sec_epoch_ssd) { name=username; userid=uid; lastSyncPC=lsp; password=pw; viewerid=vid; lastSyncDate=new Date(sec_epoch_lsd * 1000L); successfulSyncDate=new Date(sec_epoch_ssd * 1000L); } public Date getLastSyncDate() { return lastSyncDate; } public Date getLastSuccessfulSyncDate() { return successfulSyncDate; } public long getLastSyncDate_time_t() { return lastSyncDate.getTime() / 1000; } public long getLastSuccessfulSyncDate_time_t() { return successfulSyncDate.getTime() / 1000; } public String getPassword() { return password; } public long getViewerId() { return viewerid; } public String getName() { return name; } public long getUserId() { return userid; } public long getLastSyncPC() { return lastSyncPC; } } pilot-link-0.12.5-dfsg/bindings/Java/org/gnu/pilotlink/RawRecord.java0000644000175000017500000000076110161574446025712 0ustar rousseaurousseaupackage org.gnu.pilotlink; public class RawRecord extends Record { private byte[] buffer; public RawRecord(byte[] b,long i, int sz, int attr, int cat) { buffer=b; setCategory(cat); setAttribs(attr); setSize(sz); setId(i); //System.out.println("Attribs: "+attr); } public RawRecord(byte[] b, int sz, int attr, int cat) { this(b,0,sz,attr,cat); } public byte[] getBuffer() { return buffer; } public void setBuffer(byte buf[]) { buffer=buf; } } pilot-link-0.12.5-dfsg/bindings/Java/org/gnu/pilotlink/DatabaseNotFoundException.java0000644000175000017500000000034610161574446031061 0ustar rousseaurousseaupackage org.gnu.pilotlink; public class DatabaseNotFoundException extends PilotLinkException { DatabaseNotFoundException() { super(); } DatabaseNotFoundException(String s) { super(s); } } pilot-link-0.12.5-dfsg/bindings/Java/Makefile.am0000644000175000017500000000636010715070741021621 0ustar rousseaurousseauPORT=/dev/pilot all: java_pisock INCLUDES= \ -I../../include \ -I $(top_srcdir)/include \ -I $(top_builddir)/include \ -I $(JAVABASE)/include \ -I $(JAVABASE)/include/linux java_files= \ $(srcdir)/MidiMgr.java \ $(srcdir)/TestTodos.java \ $(srcdir)/org/gnu/pilotlink/AddressAppInfo.java \ $(srcdir)/org/gnu/pilotlink/AppInfo.java \ $(srcdir)/org/gnu/pilotlink/DBInfo.java \ $(srcdir)/org/gnu/pilotlink/DatabaseExistsException.java \ $(srcdir)/org/gnu/pilotlink/DatabaseNotFoundException.java \ $(srcdir)/org/gnu/pilotlink/DatebookAppInfo.java \ $(srcdir)/org/gnu/pilotlink/FTB3CostCatRecord.java \ $(srcdir)/org/gnu/pilotlink/MemoRecord.java \ $(srcdir)/org/gnu/pilotlink/PilotLink.java \ $(srcdir)/org/gnu/pilotlink/PilotLinkException.java \ $(srcdir)/org/gnu/pilotlink/RawAppInfo.java \ $(srcdir)/org/gnu/pilotlink/RawRecord.java \ $(srcdir)/org/gnu/pilotlink/SysInfo.java \ $(srcdir)/org/gnu/pilotlink/User.java \ $(srcdir)/org/gnu/pilotlink/Version.java \ $(srcdir)/org/gnu/pilotlink/AddressRecord.java \ $(srcdir)/org/gnu/pilotlink/FTB3TripRecord.java \ $(srcdir)/org/gnu/pilotlink/FTB3VehicleRecord.java \ $(srcdir)/org/gnu/pilotlink/DatebookRecord.java \ $(srcdir)/org/gnu/pilotlink/MidiRecord.java \ $(srcdir)/org/gnu/pilotlink/ToDoRecord.java \ $(srcdir)/org/gnu/pilotlink/Record.java \ $(srcdir)/test.java \ $(srcdir)/datebooktst.java \ $(srcdir)/adrtest.java java_classes= \ MidiMgr.class \ TestTodos.class \ org/gnu/pilotlink/AddressAppInfo.class \ org/gnu/pilotlink/AppInfo.class \ org/gnu/pilotlink/DBInfo.class \ org/gnu/pilotlink/DatabaseExistsException.class \ org/gnu/pilotlink/DatabaseNotFoundException.class \ org/gnu/pilotlink/DatebookAppInfo.class \ org/gnu/pilotlink/FTB3CostCatRecord.class \ org/gnu/pilotlink/MemoRecord.class \ org/gnu/pilotlink/PilotLink.class \ org/gnu/pilotlink/PilotLinkException.class \ org/gnu/pilotlink/RawAppInfo.class \ org/gnu/pilotlink/RawRecord.class \ org/gnu/pilotlink/SysInfo.class \ org/gnu/pilotlink/User.class \ org/gnu/pilotlink/Version.class \ org/gnu/pilotlink/AddressRecord.class \ org/gnu/pilotlink/FTB3TripRecord.class \ org/gnu/pilotlink/FTB3VehicleRecord.class \ org/gnu/pilotlink/DatebookRecord.class \ org/gnu/pilotlink/MidiRecord.class \ org/gnu/pilotlink/ToDoRecord.class \ org/gnu/pilotlink/Record.class \ test.class \ datebooktst.class \ adrtest.class $(java_classes): java_compile java_compile: $(java_files) $(JAVAC) -d . $(java_files) java_lib: libjpisock.c $(CXX) $(INCLUDES) -fPIC $(DEFS) -L $(top_builddir)/libpisock/.libs -lpisock -shared -o libjpisock.so $(srcdir)/libjpisock.c java_jar: $(java_classes) $(JAR) cvf pilot-link.jar $(java_classes) java_pisock: java_compile java_lib java_jar install: all ARCH=""; \ for a in i386 amd64 ppc; do \ if [ -e ${JAVABASE}/jre/lib/$${a} ]; then \ ARCH="$${a}"; \ break; \ fi; \ done; \ if [ -n "$${ARCH}" ]; then \ echo "Unknown architecture. Copy lipijsock.so to ${JAVABASE}/jre/lib/ARCH/"; \ else \ mkdir -p "$(DESTDIR)${JAVABASE}/jre/lib/$${ARCH}" && \ cp libjpisock.so "$(DESTDIR)${JAVABASE}/jre/lib/$${ARCH}"; \ echo "done."; \ fi test: install ${JAVABASE}/bin/java test ${PORT} clean-local: rm -f libjpisock.so rm -f test.class rm -f $(java_classes) rm -f pilot-link.jar pilot-link-0.12.5-dfsg/bindings/Java/README.de0000644000175000017500000000344610161574445021043 0ustar rousseaurousseauFeb 2003, Stephan Bösebeck & John Mitchell Ich hab diese Pilotlink unterstützung für Java geschrieben, weil ich die ursprüngliche Version von David Goodenough nicht mit Java 1.4 ans laufen bekommen hab und alle anderen Java Unterstüztungen für Palm auf Windows aufsetzen bzw. JComm benötigen. Ich bin die Sache auch etwas anders angegangen: - Ich will den C-Part so klein wie möglich halten, damit ist es einfacher, platformunabhängig zu bleiben und die Erweiterung auf neue Datentypen (Fahrtenbücher, Bilder, Telefon etc.) ist in Java möglich. (ausserdem hab ich schon ne ganze Weile kein c mehr programmiert ;-) - Jede Kommunikation mit der Bibliothek wird über die Klasse org.gnu.PilotLink erledigt. Dort werden RawRecords verwendet (Eigentlich nur eine Classe um ein byte Array). Diese können wiederum umgebaut werden in andere Datenstrukturen (DatebookRecord, Memo, etc). Das ganze läuft ähnlich ab wie bei Streams: DatebookRecord dbr=new DatebookRecord(PilotLink.getRecord...) Im Moment wird folgende Funktionalität unterstützt: - Lesen und schreiben von RawRecords (by index) - Lesen von User und Systeminfo - Lesen DatebookRecords - schreiben von DatebookRecords die Funktionalität wird bald erweitert werden... Im Moment gibt es ein Problem, mehr als eine DB pro Session zu öffnen. Es wird eine Fehlernummer -1 ausgegeben, auch wenn die DB vorher geschlossen wird. INSTALL normalerweise sind folgende Schritte nötig: - Installation über configure --with-java normalerweise - bei make install werden die Lib und pilot-link.jar entsprchend installeirt - test.java zum ausprobieren der Schnittstelle. (Bitte code vorher lesen!) Bei Fragen, Wünschen oder Anregungen, Mail an mich. Stephan Bösebeck (stephan_boesebeck@web.de) John Mitchell (jfm@minioak.com) Danke an Alex Villacís Lasso (a_villacis@palosanto.com) pilot-link-0.12.5-dfsg/bindings/Java/test.java0000644000175000017500000001642510405575473021422 0ustar rousseaurousseauimport org.gnu.pilotlink.*; import java.io.*; import java.util.*; import javax.swing.*; import java.awt.*; /** * Description of the Class * *@author stephan *@created 5. Dezember 2004 */ public class test { /** * Description of the Method * *@param args Description of the Parameter */ public static void main(String args[]) { JFrame frame = new JFrame("Progress"); frame.getContentPane().setLayout(new BorderLayout()); JLabel txt = new JLabel("Reading in"); frame.getContentPane().add(txt, BorderLayout.NORTH); JProgressBar progress = new JProgressBar(0, 100); frame.getContentPane().add(progress, BorderLayout.CENTER); frame.setSize(300, 50); frame.setVisible(true); Date yesterday = new Date(System.currentTimeMillis() - 3600000 * 24); System.out.println("Date 2 check: " + yesterday); String port; if (args.length == 0) { port = "/dev/usb/tts/1"; } else { port = args[0]; } File p = new File(port); System.out.println("looking for file " + port); if (!p.exists()) { System.out.println("File does not exist... USB? Waiting for port to appear"); while (!p.exists()) { System.out.print("."); try { Thread.sleep(1000); } catch (Exception e) {} } } //System.out.println("Systemzeit: "+Long.toHexString(System.currentTimeMillis()/1000)); PilotLink pl = null; try { pl = new PilotLink(port); if (!pl.isConnected()) { System.out.println("Something went wrong. Check output!"); System.exit(1); } } catch (Exception e) { e.printStackTrace(); System.exit(1); } try { User u = pl.getUserInfo(); System.out.println("User: " + u.getName()); System.out.println("Last Synchronization Date: " + u.getLastSyncDate()); } catch (PilotLinkException e) { e.printStackTrace(); } System.out.println("GEtting App..."); pl.getAppInfoBlock("AddressDB"); if (true) { try { pl.endSync(); pl.close(); System.exit(1); } catch (Exception e) {} } try { SysInfo si = pl.getSysInfo(); System.out.println("Product ID: '" + si.getProdID() + "'"); System.out.println("Rom Version: " + si.getRomVersion()); } catch (PilotLinkException e) { e.printStackTrace(); } try { System.out.println("Opening catdb!"); int dbh = pl.openDB("DatebookDB"); System.out.println("db opened!"); System.out.println("Count: " + pl.getRecordCount(dbh)); progress.setMaximum(pl.getRecordCount(dbh)); Vector ids = new Vector(); for (int i = 0; i < pl.getRecordCount(dbh); i++) { Record r = pl.getRecordByIndex(dbh, i); progress.setValue(i); txt.setText("Reading in " + i); if (r == null) { break; } if (r.getBuffer() == null || r.getBuffer().length == 0) { System.out.println("0-sized record? Deleting..."); pl.deleteRecordById(dbh, r.getId()); continue; } if (!r.isDirty()) { //only new entries continue; } DatebookRecord dbr = new DatebookRecord(r); //System.out.println("comparing "+dbr.getStartDate()+ "to yesterday "+yesterday); //if (dbr.getStartDate().before(yesterday) || dbr.getStartDate().after(new Date())) { // continue; //} ids.add(new Integer(i)); System.out.println("Read index " + i); System.out.println(" id: " + dbr.getId()); System.out.println("attr: " + Integer.toHexString(dbr.getAttribs())); System.out.println(" dirty:" + dbr.isDirty()); System.out.println(" arch :" + dbr.isArchived()); System.out.println(" del :" + dbr.isDeleted()); System.out.println("size: " + dbr.getSize()); System.out.println("cat : " + dbr.getCategory()); hexdump(dbr.getBuffer()); hexdump(r.getBuffer()); System.out.println("Has alarm : " + dbr.hasAlarm()); System.out.println("Description: " + dbr.hasDescription()); System.out.println("Note : " + dbr.hasNote()); System.out.println("Reapeated : " + dbr.isRepeated()); System.out.println("hasTime : " + dbr.hasTime()); if (dbr.hasDescription()) { System.out.println("Descr: " + dbr.getDescription()); } if (dbr.hasNote()) { System.out.println("Note: " + dbr.getNote()); } System.out.println("Start: " + dbr.getStartDate()); System.out.println("End: " + dbr.getEndDate()); } //Doing this not to interfere with the reading of records for (int i = 0; i < ids.size(); i++) { System.out.println("updating..." + ids.get(i)); Record r = pl.getRecordByIndex(dbh, ((Integer) ids.get(i)).intValue()); r.setDirty(false); hexdump(r.getBuffer()); if (r.isDirty()) { System.out.println("H\ufffd\ufffd\ufffd\ufffd?!"); } //pl.writeRecord(dbh,r); } System.out.println("\n\n\nNew Datebookentry:\n"); GregorianCalendar start = new GregorianCalendar(); start.setTime(new Date()); start.set(GregorianCalendar.SECOND, 0); GregorianCalendar end = new GregorianCalendar(); end.setTime(new Date(System.currentTimeMillis() + 15 * 60000)); end.set(GregorianCalendar.SECOND, 0); DatebookRecord dbr = new DatebookRecord(start.getTime(), end.getTime(), "Test of pilot-links new java bindings", ""); //hexdump(dbr.getBuffer()); //System.out.println("Size: "+dbr.getSize()); //pl.writeRecord(dbh,dbr); pl.closeDB(dbh); } catch (PilotLinkException e) { e.printStackTrace(); } try { System.out.println("\n\n------------------------------------\nNOW reading in Memos..."); //Now reading MEMOS int db2 = pl.openDB("MemoDB"); if (db2 < 0) { System.out.println("ERROR! " + db2); System.exit(1); } for (int i = 0; i < pl.getRecordCount(db2); i++) { Record r = pl.getRecordByIndex(db2, i); MemoRecord mr = new MemoRecord(r); System.out.println("Memo " + i + ": " + mr.getText()); } MemoRecord newMemo = new MemoRecord("The new Java-Bindings work fine"); pl.writeRecord(db2, newMemo); pl.closeDB(db2); } catch (PilotLinkException e) { e.printStackTrace(); } try { System.out.println("Creating new database 'testDB2'..."); int db3 = pl.createDB("testDB2", "RMSd", "Me"); MemoRecord memo = new MemoRecord("new database"); pl.writeRecord(db3, memo); pl.closeDB(db3); } catch (DatabaseExistsException e) { try { System.out.println("Database exists, deleting database 'testDB2'..."); pl.deleteDB("testDB2"); } catch (Exception f) { f.printStackTrace(); } } catch (PilotLinkException e) { e.printStackTrace(); } try { pl.endSync(); } catch (PilotLinkException e) { e.printStackTrace(); } pl.close(); //done frame.dispose(); System.exit(0); } /** * Description of the Method * *@param arr Description of the Parameter */ public static void hexdump(byte[] arr) { for (int i = 0; i < arr.length; ) { String chars = ""; String l = "" + Integer.toHexString(i); while (l.length() < 4) { l = "0" + l; } System.out.print(l + ": "); for (int j = 0; j < 16 && i < arr.length; j++, i++) { l = Integer.toHexString(arr[i]); if (arr[i] < 0) { l = l.substring(l.length() - 2); } while (l.length() < 2) { l = "0" + l; } System.out.print(l + " "); if ((arr[i] >= '0' && arr[i] <= 'z') || (arr[i] == ' ')) { chars += (char) arr[i]; } else if (arr[i] == (byte) '\ufffd') { chars += "\ufffd"; } else { chars += "."; } } System.out.println(" " + chars); } } } pilot-link-0.12.5-dfsg/bindings/Java/libjpisock.c0000644000175000017500000014013010300651732022047 0ustar rousseaurousseau#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "libjpisock.h" #define MAX_RESOURCE_SIZE 65536 int pilot_connect(JNIEnv * env, const char *port); static void postPilotLinkException(JNIEnv *, const char *, int, int); static void postJavaException(JNIEnv *, const char *, const char *); static int getBasicTypeField(JNIEnv * env, jclass pClass, jobject pObject, const char * sFieldType, const char * sFieldName, void * pLocation); static int assignBasicTypeField(JNIEnv * env, jclass pClass, jobject pObject, const char * sFieldType, const char * sFieldName, ...); /* PilotLink.connect */ JNIEXPORT jint JNICALL Java_org_gnu_pilotlink_PilotLink_connect (JNIEnv *env, jobject obj, jstring jprt) { jint iResult = 0; const char * port = NULL; char * prt = NULL; /* Get working copy of port name */ port = env->GetStringUTFChars(jprt, NULL); prt = (char *)malloc(strlen(port) + 1); if (prt != NULL) strcpy(prt, port); env->ReleaseStringUTFChars(jprt, port); iResult = pilot_connect(env, prt); if (prt != NULL) free(prt); return iResult; } /* ReadAppInfo */ JNIEXPORT jobject JNICALL Java_org_gnu_pilotlink_PilotLink_readAppInfo (JNIEnv *env, jobject obj, jint handle, jint db) { /* unsigned char buffer[MAX_RESOURCE_SIZE]; int size=dlp_ReadAppBlock(handle,db, 0,buffer,MAX_RESOURCE_SIZE); //printf("STill alive...\n"); //fflush(stdout); jclass appinfo_cls=env->FindClass("org/gnu/pilotlink/RawAppInfo"); if (appinfo_cls==NULL) { printf("Class not found! Sysinfo!\n"); return NULL; } //printf("STill alive...\n"); fflush(stdout); jmethodID appinfo_mid=env->GetMethodID(appinfo_cls, "","([B)V"); if (appinfo_mid==NULL) { printf("Problem mid!\n"); fflush(stdout); return NULL; } //printf("STill alive...\n"); //fflush(stdout); jbyteArray array=env->NewByteArray(size); env->SetByteArrayRegion(array,0,(jint)size,(jbyte*)buffer); jobject appinfo=env->NewObject(appinfo_cls, appinfo_mid, array); return appinfo; */ jclass jClass_appInfo = NULL; jobject jObject_appInfo = NULL; jmethodID jMethod_appInfo = NULL; jbyte * pBuffer = NULL; int bProceed = 1; int iNumBytesRead = 0; if (bProceed) { /* Allocate memory for maximum data size */ pBuffer = (jbyte *)malloc(MAX_RESOURCE_SIZE); if (pBuffer == NULL) { postJavaException(env, "org/gnu/pilotlink/PilotLinkException", "Unable to allocate buffer for app-info block"); bProceed = 0; } } if (bProceed) { /* Read app-info block && verify successful read */ iNumBytesRead = dlp_ReadAppBlock(handle, db, 0, MAX_RESOURCE_SIZE, (pi_buffer_t*)pBuffer); if (iNumBytesRead < 0) { /* Throw Java exception, iNumBytesRead is actually an error code */ postPilotLinkException(env, "Unable to read app-block", iNumBytesRead, errno); bProceed = 0; } } if (bProceed) { /* Look up RawAppInfo class */ jClass_appInfo = env->FindClass("org/gnu/pilotlink/RawAppInfo"); if (jClass_appInfo == NULL) { /* pending ClassNotFoundException in env */ bProceed = 0; } } if (bProceed) { /* Look up constructor method with byte array argument */ jMethod_appInfo = env->GetMethodID(jClass_appInfo, "","([B)V"); if (jMethod_appInfo == NULL) { /* pending NoSuchMethodException in env */ bProceed = 0; } } if (bProceed) { jbyteArray jArray_buffer = env->NewByteArray(iNumBytesRead); env->SetByteArrayRegion(jArray_buffer, 0, (jint)iNumBytesRead, pBuffer); jObject_appInfo = env->NewObject(jClass_appInfo, jMethod_appInfo, jArray_buffer); } if (pBuffer != NULL) free(pBuffer); return jObject_appInfo; } /* readSysInfo */ JNIEXPORT jobject JNICALL Java_org_gnu_pilotlink_PilotLink_readSysInfo (JNIEnv *env, jobject obj, jint handle) { /* struct SysInfo s; s.prodID[s.prodIDLength]=0; int r=dlp_ReadSysInfo(handle,&s); jstring prod=env->NewStringUTF(s.prodID); //printf("STill alive...\n"); fflush(stdout); jclass sysinfo_cls=env->FindClass("org/gnu/pilotlink/SysInfo"); if (sysinfo_cls==NULL) { printf("Class not found! Sysinfo!\n"); return NULL; } //printf("STill alive...\n"); fflush(stdout); jmethodID sysinfo_mid=env->GetMethodID(sysinfo_cls, "","(Ljava/lang/String;JJSSSSJ)V"); if (sysinfo_mid==NULL) { printf("Problem mid!\n"); fflush(stdout); return NULL; } //printf("STill alive...\n"); fflush(stdout); jobject sysinfo=env->NewObject(sysinfo_cls, sysinfo_mid, prod, s.romVersion, s.locale, s.dlpMajorVersion, s.dlpMinorVersion,s.compatMajorVersion,s.compatMinorVersion,s.maxRecSize); printf("Returning from getsysinfo...\n"); fflush(stdout); return sysinfo; */ jclass jClass_sysInfo = NULL; jobject jObject_sysInfo = NULL; jmethodID jMethod_sysInfo = NULL; struct SysInfo rSysInfo; int bProceed = 1; if (bProceed) { int iResult; /* Check that dlp_ReadSysInfo call actually succeeded */ memset(&rSysInfo, 0, sizeof(struct SysInfo)); iResult = dlp_ReadSysInfo(handle, &rSysInfo); if (iResult < 0) { /* Throw Java exception in case of failure */ postPilotLinkException(env, "Unable to read SysInfo", iResult, errno); bProceed = 0; } } if (bProceed) { /* Look up SysInfo class */ jClass_sysInfo = env->FindClass("org/gnu/pilotlink/SysInfo"); if (jClass_sysInfo == NULL) { /* pending ClassNotFoundException in env */ bProceed = 0; } } if (bProceed) { /* Look up constructor method with complete-specification argument */ jMethod_sysInfo = env->GetMethodID(jClass_sysInfo, "", "(Ljava/lang/String;JJSSSSJ)V"); if (jMethod_sysInfo == NULL) { /* pending NoSuchMethodException in env */ bProceed = 0; } } if (bProceed) { /* Explicit casts to jlong are required because env->NewObject() works very similar to (and probably identical) to printf() and related procedures which use stdarg.h routines for variable arguments. The constructor requires a jlong (64 bits) for some fields, but the corresponding fields in the C struct are of a system-dependent size (32 bits for an unsigned long in i386). Failure to cast to an appropriate size results in a stack misalignment which, at the very least, causes incorrect values to be received at the Java side. For the sake of completeness, jshort values are explicitly casted too. */ jstring jString_prodID = env->NewStringUTF(rSysInfo.prodID); jObject_sysInfo = env->NewObject(jClass_sysInfo, jMethod_sysInfo, jString_prodID, (jlong)rSysInfo.romVersion, (jlong)rSysInfo.locale, (jshort)rSysInfo.dlpMajorVersion, (jshort)rSysInfo.dlpMinorVersion, (jshort)rSysInfo.compatMajorVersion, (jshort)rSysInfo.compatMinorVersion, (jlong)rSysInfo.maxRecSize); } return jObject_sysInfo; } /* readUserInfo */ JNIEXPORT jobject JNICALL Java_org_gnu_pilotlink_PilotLink_readUserInfo (JNIEnv *env, jobject obj, jint handler) { /* struct PilotUser U; dlp_ReadUserInfo(handler, &U); U.username[127]=0; U.password[U.passwordLength]=0; printf("Last sync-->%ld\n",U.lastSyncDate); printf("Last ssync->%ld\n",U.successfulSyncDate); jstring str_name=env->NewStringUTF(U.username); if (str_name==NULL) { return NULL; } jstring str_pw=env->NewStringUTF(U.password); if (str_pw==NULL) { return NULL; } jlong vid=U.viewerID; jlong uid=U.userID; jlong lspc=U.lastSyncPC; jclass calclass=env->FindClass("java/util/Date"); if (calclass==NULL) { return NULL; } jmethodID cal_mid=env->GetMethodID(calclass,"","(J)V"); if (cal_mid==NULL){ return NULL; } jobject lsd_date=env->NewObject(calclass,cal_mid,U.lastSyncDate*1000); jobject sucd_date=env->NewObject(calclass,cal_mid,U.successfulSyncDate*1000); jclass usercls=env->FindClass("org/gnu/pilotlink/User"); if (usercls==NULL) { printf("USERCLASS not found!\n"); return NULL; } else { printf("ok...\n"); } jmethodID umid=env->GetMethodID(usercls,"","(Ljava/lang/String;Ljava/lang/String;JJJLjava/util/Date;Ljava/util/Date;)V"); if (umid==NULL) { printf("MethodID not found!\n"); return NULL; } else { printf("ok...\n"); } //printf("Returning from getuserinfo...\n"); jobject u=env->NewObject(usercls,umid,str_name,str_pw,uid,vid,lspc,lsd_date, sucd_date); return u; */ jclass jClass_user = NULL; jobject jObject_user = NULL; jmethodID jMethod_user = NULL; struct PilotUser rUserInfo; int bProceed = 1; if (bProceed) { int iResult; /* Check that dlp_ReadUserInfo call actually succeeded */ memset(&rUserInfo, 0, sizeof(struct PilotUser)); iResult = dlp_ReadUserInfo(handler, &rUserInfo); if (iResult < 0) { /* Throw Java exception in case of failure */ postPilotLinkException(env, "Unable to read UserInfo", iResult, errno); bProceed = 0; } else { /* This was taken from previous code... */ rUserInfo.username[sizeof(rUserInfo.username) - 1] = '\0'; rUserInfo.password[rUserInfo.passwordLength] = '\0'; } } if (bProceed) { /* Look up User class */ jClass_user = env->FindClass("org/gnu/pilotlink/User"); if (jClass_user == NULL) { /* pending ClassNotFoundException in env */ bProceed = 0; } } if (bProceed) { /* Look up constructor method with complete-specification argument. NOTE: a new constructor was provided in User.java in order to avoid having to create Date objects in C code, AND to fix a subtle bug in which the multiplication of time_t * int (miliseconds since Epoch) silently overflows because both time_t and int are 32-bit, and the result is NOT promoted to at least 64 bits, required for the constructor Date(long). */ jMethod_user = env->GetMethodID(jClass_user, "", "(Ljava/lang/String;Ljava/lang/String;JJJJJ)V"); if (jMethod_user == NULL) { /* pending NoSuchMethodException in env */ bProceed = 0; } } if (bProceed) { /* Explicit casts added - see object creation at Java_org_gnu_pilotlink_PilotLink_readSysInfo() for explanation. */ jstring jString_username = env->NewStringUTF(rUserInfo.username); jstring jString_password = env->NewStringUTF(rUserInfo.password); jObject_user = env->NewObject(jClass_user, jMethod_user, jString_username, jString_password, (jlong)rUserInfo.userID, (jlong)rUserInfo.viewerID, (jlong)rUserInfo.lastSyncPC, (jlong)rUserInfo.lastSyncDate, (jlong)rUserInfo.successfulSyncDate); } return jObject_user; } /* writeUserInfo */ JNIEXPORT void JNICALL Java_org_gnu_pilotlink_PilotLink_writeUserInfo (JNIEnv *env, jobject obj, jint so, jobject user) { /* printf("Not implemented yet...sorry\n"); */ /* Now it IS implemented... ;-) */ jclass jClass_user = NULL; jmethodID jMethod_user = NULL; struct PilotUser rUserInfo; jlong jTempValue; jstring jTempString; int bProceed = 1; /* Set everything not explicitly assigned to blanks */ memset(&rUserInfo, 0, sizeof(struct PilotUser)); /* Get object class for user... this should not fail */ jClass_user = env->GetObjectClass(user); /* Assign all of the basic fields */ if (bProceed) { bProceed = getBasicTypeField(env, jClass_user, user, "J", "userid", &jTempValue); rUserInfo.userID = jTempValue; } if (bProceed) { bProceed = getBasicTypeField(env, jClass_user, user, "J", "viewerid", &jTempValue); rUserInfo.viewerID = jTempValue; } if (bProceed) { bProceed = getBasicTypeField(env, jClass_user, user, "J", "lastSyncPC", &jTempValue); rUserInfo.lastSyncPC = jTempValue; } if (bProceed) { jTempString = NULL; bProceed = getBasicTypeField(env, jClass_user, user, "Ljava/lang/String;", "name", &jTempString); if (bProceed && jTempString != NULL) { const char * sTempString = env->GetStringUTFChars(jTempString, 0); strncpy(rUserInfo.username, sTempString, sizeof(rUserInfo.username) - 1); rUserInfo.username[sizeof(rUserInfo.username) - 1] = '\0'; env->ReleaseStringUTFChars(jTempString, sTempString); } } if (bProceed) { jTempString = NULL; bProceed = getBasicTypeField(env, jClass_user, user, "Ljava/lang/String;", "password", &jTempString); if (bProceed && jTempString != NULL) { const char * sTempString = env->GetStringUTFChars(jTempString, 0); strncpy(rUserInfo.password, sTempString, sizeof(rUserInfo.password) - 1); rUserInfo.password[sizeof(rUserInfo.password) - 1] = '\0'; rUserInfo.passwordLength = strlen(rUserInfo.password); env->ReleaseStringUTFChars(jTempString, sTempString); } } /* In order to get the correct time_t, a function call is needed. The methods User.getLastSyncDate_time_t() and User.getLastSuccessfulSyncDate_time_t() were created for this purpose. */ if (bProceed) { jMethod_user = env->GetMethodID(jClass_user, "getLastSyncDate_time_t", "()J"); if (jMethod_user == NULL) { /* pending NoSuchMethodException in env */ bProceed = 0; } else { /* Use Date.getTime() in Java side and divide by 1000 */ rUserInfo.lastSyncDate = env->CallLongMethod(user, jMethod_user); } } if (bProceed) { jMethod_user = env->GetMethodID(jClass_user, "getLastSuccessfulSyncDate_time_t", "()J"); if (jMethod_user == NULL) { /* pending NoSuchMethodException in env */ bProceed = 0; } else { /* Use Date.getTime() in Java side and divide by 1000 */ rUserInfo.successfulSyncDate = env->CallLongMethod(user, jMethod_user); } } /* Write user info if all assignments were successful */ if (bProceed) { int iResult = dlp_WriteUserInfo(so, &rUserInfo); if (iResult < 0) { postPilotLinkException(env, "Unable to write UserInfo", iResult, errno); } } } /* * writeAppBlock */ JNIEXPORT int JNICALL Java_org_gnu_pilotlink_PilotLink_writeAppBlock (JNIEnv *env, jobject obj, jint handle, jint dbhandle, jbyteArray data, jint length) { /* char buffer[MAX_RESOURCE_SIZE]; env->GetByteArrayRegion(data,0,length,(jbyte*)buffer); return dlp_WriteAppBlock(handle,dbhandle,buffer,length); */ jbyte * buffer; int iResult = 0; /* Allocate memory for copy of app block */ if ((buffer = (jbyte *)malloc(length * sizeof(jbyte))) != NULL) { env->GetByteArrayRegion(data, 0, length, buffer); iResult = dlp_WriteAppBlock(handle, dbhandle, buffer, length); if (iResult < 0) { /* Throw Java exception to signal error */ postPilotLinkException(env, "Unable to write app-block", iResult, errno); } free(buffer); } else { postJavaException(env, "org/gnu/pilotlink/PilotLinkException", "Unable to allocate memory for app block"); } return iResult; } /* openConduit */ JNIEXPORT void JNICALL Java_org_gnu_pilotlink_PilotLink_openConduit (JNIEnv *env, jobject obj, jint handle) { int iResult = dlp_OpenConduit(handle); if (iResult < 0) postPilotLinkException(env, "Unable to open conduit", iResult, errno); } /* * createDB */ JNIEXPORT jint JNICALL Java_org_gnu_pilotlink_PilotLink_createDB (JNIEnv *env, jobject obj, jint handle, jlong creator, jstring jdbname, jlong type, jint flags, jint version) { jint db = -1; /* Get working copy of database name */ const char * dbname = env->GetStringUTFChars(jdbname, NULL); char * dbn = (char *)malloc(strlen(dbname) + 1); if (dbn != NULL) strcpy(dbn, dbname); env->ReleaseStringUTFChars(jdbname, dbname); if (dbn != NULL) { int ret = dlp_CreateDB(handle,creator,type,0,flags,version,dbn, &db); if (ret < 0) { /* debug message replaced by Java exception */ /* printf("Error creating db %s: %d\n",dbn, ret); */ postPilotLinkException(env, "Could not create database", ret, errno); } free(dbn); } else { /* Unable to create copy - memory heap may be corrupted */ postJavaException(env, "org/gnu/pilotlink/PilotLinkException", "Unable to create working copy of database name"); } return db; } /* * deleteDB */ JNIEXPORT jint JNICALL Java_org_gnu_pilotlink_PilotLink_deleteDB (JNIEnv *env, jobject obj, jint handle, jstring jdbname) { int ret = 0; /* Get working copy of database name */ const char * dbname = env->GetStringUTFChars(jdbname,NULL); char * dbn = (char*)malloc(strlen(dbname)+1); if (dbn != NULL) strcpy(dbn,dbname); env->ReleaseStringUTFChars(jdbname, dbname); if (dbn != NULL) { ret = dlp_DeleteDB(handle,0,dbn); if (ret < 0) { /* debug message replaced by Java exception */ /* printf("Error deleting db %s %d:\n",dbn,ret); */ postPilotLinkException(env, "Could not delete database", ret, errno); } free(dbn); } else { /* Unable to create copy - memory heap may be corrupted */ postJavaException(env, "org/gnu/pilotlink/PilotLinkException", "Unable to create working copy of database name"); } return ret; } JNIEXPORT jobject JNICALL Java_org_gnu_pilotlink_PilotLink_getAppInfoBlock(JNIEnv *env,jobject obj, jint handle,jstring jdbname) { int db; const char * dbname = env->GetStringUTFChars(jdbname, NULL); char * dbn = (char *)malloc(strlen(dbname) + 1); if (dbn != NULL) strcpy(dbn, dbname); env->ReleaseStringUTFChars(jdbname, dbname); if (dlp_OpenDB(handle,0,0x80|0x40,dbn,&db)<0) { printf("Fehler!"); return NULL; } jbyte buff[0xffff]; int l=dlp_ReadAppBlock(handle,db,0,0xffff,(pi_buffer_t*)&buff); printf("read app-Block of size %d\n",l); fflush(stdout); jclass jClass_appInfo = NULL; jobject jObject_appInfo = NULL; jmethodID jMethod_appInfo = NULL; int bProceed = 1; int iNumBytesRead = 0; if (bProceed) { /* Look up RawAppInfo class */ jClass_appInfo = env->FindClass("org/gnu/pilotlink/RawAppInfo"); if (jClass_appInfo == NULL) { /* pending ClassNotFoundException in env */ bProceed = 0; } } if (bProceed) { /* Look up constructor method with byte array argument */ jMethod_appInfo = env->GetMethodID(jClass_appInfo, "","([B)V"); if (jMethod_appInfo == NULL) { /* pending NoSuchMethodException in env */ bProceed = 0; } } if (bProceed) { jbyteArray jArray_buffer = env->NewByteArray(l); env->SetByteArrayRegion(jArray_buffer, 0, (jint)l, buff); jObject_appInfo = env->NewObject(jClass_appInfo, jMethod_appInfo, jArray_buffer); } dlp_CloseDB(handle,db); return jObject_appInfo; } /* openDB */ JNIEXPORT jint JNICALL Java_org_gnu_pilotlink_PilotLink_openDB (JNIEnv *env, jobject obj, jint handle, jstring jdbname) { jint db = 0; /* Get working copy of database name */ const char* dbname = env->GetStringUTFChars(jdbname,NULL); char* dbn = (char*)malloc(strlen(dbname)+1); if (dbn != NULL) strcpy(dbn,dbname); env->ReleaseStringUTFChars(jdbname, dbname); if (dbn != NULL) { int ret=dlp_OpenDB(handle,0,dlpOpenReadWrite,dbn,&db); if (ret < 0) { /* printf("Error opening db %s: %d\n",dbn, ret); */ postPilotLinkException(env, "Could not open database", ret, errno); return (jint)ret; } } else { /* Unable to create copy - memory heap may be corrupted */ postJavaException(env, "org/gnu/pilotlink/PilotLinkException", "Unable to create working copy of database name"); } return db; } /* getRecordCount */ JNIEXPORT jint JNICALL Java_org_gnu_pilotlink_PilotLink_getRecordCount (JNIEnv *env, jobject obj, jint handle, jint dbh) { jint num; int iResult; iResult = dlp_ReadOpenDBInfo(handle,dbh,&num); if (iResult < 0) { postPilotLinkException(env, "Could not get record count for database", iResult, errno); } return num; } /* getRecordByIndex */ JNIEXPORT jobject JNICALL Java_org_gnu_pilotlink_PilotLink_getRecordByIndex (JNIEnv *env, jobject obj, jint handle , jint db , jint idx) { jbyte buffer[MAX_RESOURCE_SIZE]; recordid_t id; jint size, attr, category; //printf("Getting record..\n"); int ret = dlp_ReadRecordByIndex(handle, db, idx, (pi_buffer_t*)buffer, &id, &attr, &category); if (ret<0) { postPilotLinkException(env,"Error reading database by index",ret,errno); return NULL; } //printf("getting class!\n"); jclass rcls=env->FindClass("org/gnu/pilotlink/RawRecord"); if (rcls==NULL) { return NULL; } jmethodID rid=env->GetMethodID(rcls,"","([BJIII)V"); if (rid==NULL) { printf("jmethodID is null!\n"); return NULL; } jbyteArray array=env->NewByteArray(size); env->SetByteArrayRegion(array,0,size,buffer); jobject record=env->NewObject(rcls, rid, array, (jlong)id,size,attr,category ); return record; /*jbyte * buffer; jobject jObject_RawRecord = NULL; if ((buffer = (jbyte *)malloc(MAX_RESOURCE_SIZE)) != NULL) { recordid_t id; jint iRecSize, iRecAttr, iRecCategory; jclass jClass_RawRecord; jmethodID jMethod_RawRecord; int iResult = dlp_ReadRecordByIndex(handle, db, idx, buffer, &id, &iRecSize, &iRecAttr, &iRecCategory); if (iResult < 0) { postPilotLinkException(env, "Could not read database record by index", iResult, errno); } else if ((jClass_RawRecord = env->FindClass( "org/gnu/pilotlink/RawRecord")) == NULL) { } else if ((jMethod_RawRecord = env->GetMethodID(jClass_RawRecord, "", "([BJIII)V")) == NULL) { } else { jbyteArray jArray_buffer = env->NewByteArray(iRecSize); env->SetByteArrayRegion(jArray_buffer, 0, iRecSize, buffer); jObject_RawRecord = env->NewObject(jClass_RawRecord, jMethod_RawRecord, jArray_buffer, (jlong)id, (jint)iRecSize, (jint)iRecAttr, (jint)iRecCategory); } free(buffer); } else { postJavaException(env, "org/gnu/pilotlink/PilotLinkException", "Unable to allocate buffer for record data"); } return jObject_RawRecord;*/ } /* deleteRecordById */ JNIEXPORT jint JNICALL Java_org_gnu_pilotlink_PilotLink_deleteRecordById (JNIEnv *env, jobject obj, jint handle, jint db, jlong id) { int ret=dlp_DeleteRecord(handle,db,0,id); if (ret<0) { postPilotLinkException(env,"Deletition not possible!",ret,errno); } return ret; } /* Write Record */ JNIEXPORT jint JNICALL Java_org_gnu_pilotlink_PilotLink_writeRecord (JNIEnv *env, jobject obj, jint handle, jint db, jobject record) { jlong id=0; jclass cls=env->GetObjectClass(record); jmethodID mid=env->GetMethodID(cls,"getCategory","()I"); if (mid==NULL) { printf("Error getting mid!"); return -1; } jint cat=env->CallIntMethod(record,mid); jmethodID mid2=env->GetMethodID(cls,"getId","()J"); id=env->CallLongMethod(record,mid2, NULL); if (id==0) { printf("Creating new entry!\n"); } mid=env->GetMethodID(cls,"getAttribs","()I"); jint attr=env->CallIntMethod(record,mid); mid=env->GetMethodID(cls,"getSize","()I"); jint size=env->CallIntMethod(record,mid); printf("Got size: %d\n",size); char buffer[MAX_RESOURCE_SIZE]; mid=env->GetMethodID(cls,"getBuffer","()[B"); jbyteArray arr=(jbyteArray)env->CallObjectMethod(record,mid); env->GetByteArrayRegion(arr,0,size,(jbyte*)buffer); recordid_t i=0; int ret=dlp_WriteRecord(handle,db,attr, id, cat, buffer,size,&i); if (id==0 && ret>0) { mid=env->GetMethodID(cls,"setId","(J)V"); env->CallVoidMethod(record,mid,(jlong)i); } return ret; } /*CloseDB*/ JNIEXPORT void JNICALL Java_org_gnu_pilotlink_PilotLink_closeDB (JNIEnv *env, jobject obj, jint han, jint db) { int bException = 0; int ret=dlp_CleanUpDatabase(han, db); if (ret<0) { // printf("Error cleaning up! %d\n",ret); postPilotLinkException(env, "Unable to clean up before database close", ret, errno); bException = 1; } ret=dlp_CloseDB(han, db); if (ret < 0 && !bException) { // printf("Error closing DB: %d\n",ret); postPilotLinkException(env, "Unable to close database", ret, errno); } } /*ENDSync*/ JNIEXPORT void JNICALL Java_org_gnu_pilotlink_PilotLink_endSync (JNIEnv *env, jobject obj, jint sd) { int iResult = dlp_EndOfSync(sd, dlpEndCodeNormal); if (iResult < 0) postPilotLinkException(env, "Unable to signal endSync", iResult, errno); } /*Close*/ JNIEXPORT void JNICALL Java_org_gnu_pilotlink_PilotLink_close (JNIEnv *env, jobject obj, jint sd) { pi_close(sd); } /*pilot-connect*/ int pilot_connect(JNIEnv * env, const char *port) { int parent_sd = -1, /* Client socket, formerly sd */ client_sd = -1, /* Parent socket, formerly sd2 */ result; struct pi_sockaddr addr; struct stat attr; struct SysInfo sys_info; const char *defport = "/dev/pilot"; int bProceed = 1; if (port == NULL && (port = getenv("PILOTPORT")) == NULL) { /* err seems to be used for stat() only */ int err = 0; /* Commented out debug code */ /* fprintf(stderr, " No $PILOTPORT specified and no -p " " given.\n" " Defaulting to '%s'\n", defport); */ port = defport; err = stat(port, &attr); /* Moved err check inside if() block - err only meaningful here */ if (err) { /* *BAD* practice - cannot recover from within Java if exit() here. Should create && throw exception instead. */ /* fprintf(stderr, " ERROR: %s (%d)\n\n", strerror(errno), errno); fprintf(stderr, " Error accessing: '%s'. Does '%s' exist?\n", port, port); //fprintf(stderr, " Please use --help for more information\n\n"); exit(1); */ /* Throw an exception - FileNotFoundException seems appropriate here */ postJavaException(env, "java/io/FileNotFoundException", strerror(errno)); bProceed = 0; } } /* At this point, either bProceed is 0, or port != NULL, further checks are unnecesary */ /* Check bProceed to account for previous exceptions */ if (bProceed && !(parent_sd = pi_socket(PI_AF_PILOT, PI_SOCK_STREAM, PI_PF_DLP))) { /* fprintf(stderr, "\n Unable to create socket '%s'\n", port ? port : getenv("PILOTPORT")); return -1; */ /* Throw exception here to inform nature of connection failure. */ const char * sTemplate = "Unable to create socket '%s'"; char * sMessage = (char *)malloc(strlen(sTemplate) + strlen(port) + 1); if (sMessage != NULL) sprintf(sMessage, sTemplate, port); postJavaException(env, "org/gnu/pilotlink/PilotLinkException", (sMessage != NULL) ? sMessage : port); if (sMessage != NULL) free(sMessage); bProceed = 0; } /* Check bProceed to account for previous exceptions */ if (bProceed) { /* Removed check for port != NULL, since port was validated before */ /* if (port != NULL) { */ result = pi_bind(parent_sd, port); /* } else { result = pi_bind(parent_sd, NULL, 0); } */ } if (bProceed && result < 0) { int save_errno = errno; /* const char *portname; portname = (port != NULL) ? port : getenv("PILOTPORT"); if (portname) { fprintf(stderr, "\n"); errno = save_errno; fprintf(stderr, " ERROR: %s (%d)\n\n", strerror(errno), errno); if (errno == 2) { fprintf(stderr, " The device %s does not exist..\n", portname); fprintf(stderr, " Possible solution:\n\n\tmknod %s c " " \n\n", portname ); } else if (errno == 13) { fprintf(stderr, " Please check the " "permissions on %s..\n", portname ); fprintf(stderr, " Possible solution:\n\n\tchmod 0666 " "%s\n\n", portname ); } else if (errno == 19) { fprintf(stderr, " Press the HotSync button first and " "relaunch this conduit..\n\n"); } else if (errno == 21) { fprintf(stderr, " The port specified must contain a " "device name, and %s was a directory.\n" " Please change that to reference a real " "device, and try again\n\n", portname ); } fprintf(stderr, " Unable to bind to port: %s\n", portname) ; fprintf(stderr, " Please use --help for more " "information\n\n"); } else fprintf(stderr, "\n No port specified\n"); */ const char * sTemplate = "Unable to bind to port %s - (%d) %s%s"; const char * sFailureReason; char * sMessage; switch (save_errno) { case 2: sFailureReason = "; Device does not exist (use mknod to fix)"; break; case 13: sFailureReason = "; Access denied on device (use chmod to fix)"; break; case 19: sFailureReason = "; HotSync button must be pressed first"; break; case 21: sFailureReason = "; Device name appears to be a directory"; break; default: sFailureReason = ""; break; } sMessage = (char *)malloc(strlen(sTemplate) + strlen(port) + 16 + strlen(strerror(save_errno)) + strlen(sFailureReason)); if (sMessage != NULL) { sprintf(sMessage, sTemplate, port, save_errno, strerror(save_errno), sFailureReason); postJavaException(env, "org/gnu/pilotlink/PilotLinkException", sMessage); free(sMessage); } else { /* Unable to malloc(), inform of errno string */ postJavaException(env, "org/gnu/pilotlink/PilotLinkException", strerror(save_errno)); } pi_close(parent_sd); pi_close(client_sd); // return -1; bProceed = 0; } /* Removed debug message, maybe add notification framework to invoke here fprintf(stderr, "\n Listening to port: %s\n\n Please press the HotSync " "button now... ", port ? port : getenv("PILOTPORT")); */ /* Check bProceed to account for previous exceptions */ if (bProceed && pi_listen(parent_sd, 1) == -1) { /* debug message replaced with Java exception */ /* fprintf(stderr, "\n Error listening on %s\n", port); */ postJavaException(env, "org/gnu/pilotlink/PilotLinkException", "Unable to listen on port"); pi_close(parent_sd); pi_close(client_sd); /* return -1; */ bProceed = 0; } /* Check bProceed to account for previous exceptions */ if (bProceed) { client_sd = pi_accept_to(parent_sd, 0, 0, 5); if (client_sd == -1) { /* debug message replaced with Java exception */ /* fprintf(stderr, "\n Error accepting data on %s\n", port); */ postJavaException(env, "org/gnu/pilotlink/PilotLinkException", "Unable to accept data on port"); pi_close(parent_sd); pi_close(client_sd); /* return -1;*/ bProceed = 0; } else { int so_timeout = 16; size_t sizeof_so_timeout = sizeof(so_timeout); pi_setsockopt(client_sd, PI_LEVEL_DEV, PI_DEV_TIMEOUT, &so_timeout, &sizeof_so_timeout); } } /* Removed debug message, maybe add notification framework to invoke here */ /* fprintf(stderr, "Connected\n\n"); */ /* Check bProceed to account for previous exceptions */ if (bProceed) { int iResult; int iNumRetries = 5; while (iNumRetries > 0 && (iResult = dlp_ReadSysInfo(client_sd, &sys_info)) < 0) iNumRetries--; if (iResult < 0) { /* debug message replaced with Java exception */ /* fprintf(stderr, "\n Error read system info on %s\n", port); */ postJavaException(env, "org/gnu/pilotlink/PilotLinkException", "Unable to read system info on port"); pi_close(parent_sd); pi_close(client_sd); /* return -1; */ bProceed = 0; } } /* Removed debug message, maybe add notification framework to invoke here */ /* printf("Opening counduit...\n"); */ dlp_OpenConduit(client_sd); /* Why should parent_sd remain open after connect? Nobody receives it. */ pi_close(parent_sd); return client_sd; } /* * getResourceByIndex() */ JNIEXPORT jobject JNICALL Java_org_gnu_pilotlink_PilotLink_getResourceByIndex (JNIEnv * env, jobject obj, jint iSockHandle, jint iDBHandle, jint iRsrcIndex) { unsigned long iRsrcType; /* Resource type */ int iRsrcID; /* Resource ID */ int iRsrcSize; /* Actual resource size */ jbyte * pRsrcData; /* Buffer for resource data */ int iResult; /* Result of library call */ jobject pRecordObject = NULL; /* Get "enough" memory for incoming resource data */ if ((pRsrcData = (jbyte *)malloc(MAX_RESOURCE_SIZE * sizeof(jbyte))) != NULL) { /* Invoke C library function */ iResult = dlp_ReadResourceByIndex(iSockHandle, iDBHandle, iRsrcIndex, (pi_buffer_t*)pRsrcData, &iRsrcType, &iRsrcID); if (iResult >= 0) { jclass pRecordClass; jmethodID pRecordConstructor; /* Look up class and constructor method */ if ((pRecordClass = env->FindClass("org/gnu/pilotlink/RawRecord")) != NULL && (pRecordConstructor = env->GetMethodID(pRecordClass, "", "([BJIII)V")) != NULL ) { /* Fill a Java array with resource data && invoke constructor */ jbyteArray pJavaArray = env->NewByteArray(iRsrcSize); env->SetByteArrayRegion(pJavaArray, 0, iRsrcSize, pRsrcData); pRecordObject = env->NewObject(pRecordClass, pRecordConstructor, pJavaArray, (jlong)iRsrcID, (jint)iRsrcSize, (jint)0, (jint)iRsrcType); } } else { postPilotLinkException(env, "Unable to read resource by index", iResult, errno); } free(pRsrcData); } else { postJavaException(env, "org/gnu/pilotlink/PilotLinkException", "Unable to allocate buffer for copy of resource"); } return pRecordObject; } /* * writeResource() */ JNIEXPORT void JNICALL Java_org_gnu_pilotlink_PilotLink_writeResource (JNIEnv * env, jobject obj, jint iSockHandle, jint iDBHandle, jobject pRecord) { jlong iRsrcID; /* Resource ID for record */ jint iRsrcType; /* Resource type for record */ jint iRsrcSize; /* Actual resource size */ jbyte * pRsrcData = NULL; /* Buffer for resource data */ jclass pRecordClass; /* Java class for record */ jmethodID pRecordMethod; /* Java instance method for record */ jbyteArray pDataArray; /* Java array for resource data */ jint iResult = -1; /* Result of library call */ int bProceed = 1; /* Get reference to record class */ pRecordClass = env->GetObjectClass(pRecord); /* Find out required attributes for resource write */ if (bProceed) { /* Find out category (resource type) */ if ((pRecordMethod = env->GetMethodID(pRecordClass, "getCategory", "()I")) != NULL) { iRsrcType = env->CallIntMethod(pRecord, pRecordMethod); } else { /* Method lookup failed */ bProceed = 0; } } if (bProceed) { /* Find out resource ID */ if ((pRecordMethod = env->GetMethodID(pRecordClass, "getId", "()J")) != NULL) { iRsrcID = env->CallLongMethod(pRecord, pRecordMethod); } else { /* Method lookup failed */ bProceed = 0; } } if (bProceed) { /* Find out resource size && allocate memory */ if ((pRecordMethod = env->GetMethodID(pRecordClass, "getSize", "()I")) != NULL) { iRsrcSize = env->CallIntMethod(pRecord, pRecordMethod); if (iRsrcSize > 0) pRsrcData = (jbyte *)malloc(iRsrcSize * sizeof(char)); if (pRsrcData == NULL) { postJavaException(env, "org/gnu/pilotlink/PilotLinkException", "Unable to allocate buffer for copy of resource"); bProceed = 0; } } else { /* Method lookup failed */ bProceed = 0; } } if (bProceed) { /* Get copy of resource data in allocated memory */ if ((pRecordMethod = env->GetMethodID(pRecordClass, "getBuffer", "()[B")) != NULL) { pDataArray = (jbyteArray)env->CallObjectMethod(pRecord, pRecordMethod); env->GetByteArrayRegion(pDataArray, 0, iRsrcSize, pRsrcData); iResult = dlp_WriteResource(iSockHandle, iDBHandle, iRsrcType, iRsrcID, pRsrcData, iRsrcSize); if (iResult < 0) { postPilotLinkException(env, "Unable to write resource", iResult, errno); } } else { /* Method lookup failed */ bProceed = 0; } } if (pRsrcData != NULL) free(pRsrcData); } JNIEXPORT void JNICALL Java_org_gnu_pilotlink_PilotLink_resetSystem (JNIEnv * env, jobject, jint iSockHandle) { int iResult = dlp_ResetSystem(iSockHandle); if (iResult < 0) { postPilotLinkException(env, "Unable to reset system", iResult, errno); } } /* * readDBList */ JNIEXPORT jobject JNICALL Java_org_gnu_pilotlink_PilotLink_readDBList (JNIEnv * env, jobject, jint iSockHandle, jint cardno, jint flags, jint start) { int iResult = 0; struct DBInfo rInfoDB; jobject pDBInfoObject = NULL; /* Execute low-level library call... */ iResult = dlp_ReadDBList(iSockHandle, cardno, flags, start, (pi_buffer_t*)&rInfoDB); if (iResult >= 0) { jclass pDBInfoClass = NULL; jmethodID pDBInfoMethod = NULL; int bProceed = 1; /* Find class for DBInfo - throws ClassNotFoundException if not found */ if (bProceed) { pDBInfoClass = env->FindClass("org/gnu/pilotlink/DBInfo"); if (pDBInfoClass == NULL) bProceed = 0; } /* Find constructor method for class DBInfo */ if (bProceed) { pDBInfoMethod = env->GetMethodID(pDBInfoClass, "", "(Ljava/lang/String;IIIIIISSSBB)V"); if (pDBInfoMethod != NULL && env->ExceptionOccurred() == NULL) { /* Build new object, propagate any exception into Java caller */ jstring jString_nombre = env->NewStringUTF(rInfoDB.name); pDBInfoObject = env->NewObject(pDBInfoClass, pDBInfoMethod, jString_nombre, (jint)rInfoDB.createDate, (jint)rInfoDB.modifyDate, (jint)rInfoDB.backupDate, (jint)rInfoDB.type, (jint)rInfoDB.creator, (jint)rInfoDB.modnum, (jshort)rInfoDB.flags, (jshort)rInfoDB.version, (jshort)rInfoDB.index, (jbyte)rInfoDB.miscFlags, (jbyte)rInfoDB.more); if (env->ExceptionOccurred() != NULL) bProceed = 0; } else { /* pending NoSuchMethodException in env */ bProceed = 0; } } /* "Not Found" error returns null, else throw Java exception to inform problem with listing */ } else if (iResult != -5) { postPilotLinkException(env, "Unable to read DB list entry", iResult, errno); } return pDBInfoObject; } static void postPilotLinkException(JNIEnv * env, const char * sTexto, int iResult, int save_errno) { const char * sTemplate = "%s: %s - %s"; const char * sGenericException = "org/gnu/pilotlink/PilotLinkException"; const char * sDBExistsException = "org/gnu/pilotlink/DatabaseExistsException"; const char * sDBNotFoundException = "org/gnu/pilotlink/DatabaseNotFoundException"; const char * sExceptionClass; char * sMessage = NULL; // Make save_errno positive in all cases if (save_errno < 0) save_errno = -save_errno; // Choose which exception to report switch (abs(iResult)) { case 5: sExceptionClass = sDBNotFoundException; break; case 9: sExceptionClass = sDBExistsException; break; default: sExceptionClass = sGenericException; break; } // Attempt to describe underlying errno for exception sMessage = (char *)malloc(strlen(sTemplate) + strlen(sTexto) + strlen(dlp_strerror(iResult)) + strlen(strerror(save_errno)) + 1); if (sMessage != NULL) { sprintf(sMessage, sTemplate, sTexto, dlp_strerror(iResult), strerror(save_errno)); postJavaException(env, sExceptionClass, sMessage); free(sMessage); } else { postJavaException(env, sExceptionClass, dlp_strerror(iResult)); } } /* Post a named exception in the Java environment */ static void postJavaException(JNIEnv * env, const char * sExceptionClass, const char * sMessage) { jclass pExceptionClass = env->FindClass(sExceptionClass); if (pExceptionClass != NULL) env->ThrowNew(pExceptionClass, sMessage); } /* Get a value from a named Java field of basic type or String */ static int getBasicTypeField(JNIEnv * env, jclass pClass, jobject pObject, const char * sFieldType, const char * sFieldName, void * pLocation) { int bProceed = 1; jfieldID pFieldID = NULL; jthrowable pException = NULL; pFieldID = env->GetFieldID(pClass, sFieldName, sFieldType); if (pFieldID != NULL && (pException = env->ExceptionOccurred()) == NULL) { if (strcmp(sFieldType, "I") == 0) { *((jint *)pLocation) = env->GetIntField(pObject, pFieldID); } else if (strcmp(sFieldType, "S") == 0) { *((jshort *)pLocation) = env->GetShortField(pObject, pFieldID); } else if (strcmp(sFieldType, "B") == 0) { *((jbyte *)pLocation) = env->GetByteField(pObject, pFieldID); } else if (strcmp(sFieldType, "Z") == 0) { *((jboolean *)pLocation) = env->GetBooleanField(pObject, pFieldID); } else if (strcmp(sFieldType, "C") == 0) { *((jchar *)pLocation) = env->GetCharField(pObject, pFieldID); } else if (strcmp(sFieldType, "J") == 0) { *((jlong *)pLocation) = env->GetLongField(pObject, pFieldID); } else if (strcmp(sFieldType, "F") == 0) { *((jfloat *)pLocation) = env->GetFloatField(pObject, pFieldID); } else if (strcmp(sFieldType, "D") == 0) { *((jdouble *)pLocation) = env->GetDoubleField(pObject, pFieldID); } else if (sFieldType[0] == 'L') { *((jobject *)pLocation) = env->GetObjectField(pObject, pFieldID); } } else { bProceed = 0; } return bProceed; } /* Assign a value to a named Java field of basic type or String */ static int assignBasicTypeField(JNIEnv * env, jclass pClass, jobject pObject, const char * sFieldType, const char * sFieldName, ...) { int bProceed = 1; jfieldID pFieldID = NULL; jthrowable pException = NULL; pFieldID = env->GetFieldID(pClass, sFieldName, sFieldType); if (pFieldID != NULL && (pException = env->ExceptionOccurred()) == NULL) { va_list ap; va_start(ap, sFieldName); if (strcmp(sFieldType, "I") == 0) { jint iValue = va_arg(ap, jint); env->SetIntField(pObject, pFieldID, iValue); } else if (strcmp(sFieldType, "S") == 0) { jshort iValue = va_arg(ap, int); env->SetShortField(pObject, pFieldID, iValue); } else if (strcmp(sFieldType, "B") == 0) { jbyte iValue = va_arg(ap, int); env->SetByteField(pObject, pFieldID, iValue); } else if (strcmp(sFieldType, "Z") == 0) { jboolean iValue = va_arg(ap, int); env->SetBooleanField(pObject, pFieldID, iValue); } else if (strcmp(sFieldType, "C") == 0) { jchar iValue = va_arg(ap, int); env->SetCharField(pObject, pFieldID, iValue); } else if (strcmp(sFieldType, "J") == 0) { jlong iValue = va_arg(ap, jlong); env->SetLongField(pObject, pFieldID, iValue); } else if (strcmp(sFieldType, "F") == 0) { jfloat iValue = va_arg(ap, double); env->SetFloatField(pObject, pFieldID, iValue); } else if (strcmp(sFieldType, "D") == 0) { jdouble iValue = va_arg(ap, jdouble); env->SetDoubleField(pObject, pFieldID, iValue); } else if (strcmp(sFieldType, "Ljava/lang/String;") == 0) { const char * s = va_arg(ap, const char *); jstring jNameString = env->NewStringUTF(s); env->SetObjectField(pObject, pFieldID, jNameString); } else if (sFieldType[0] == 'L') { jobject pAssignedObject = va_arg(ap, jobject); env->SetObjectField(pObject, pFieldID, pAssignedObject); } va_end(ap); } else { bProceed = 0; } return bProceed; } pilot-link-0.12.5-dfsg/bindings/Java/MidiMgr.java0000644000175000017500000001510310405575473021763 0ustar rousseaurousseauimport java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import org.gnu.pilotlink.MidiRecord; import org.gnu.pilotlink.PilotLink; import org.gnu.pilotlink.PilotLinkException; import org.gnu.pilotlink.SysInfo; import org.gnu.pilotlink.User; public class MidiMgr { public final static int LIST=1; public final static int INSTALL=2; public final static int NOTHING=0; public final static int DELETE=3; public final static int FETCH=4; public static void main(String args[]) { String port="/dev/usb/tts/1"; //DEVFS String db="MIDI Ring Tones"; int command=0; String arg=""; String arg2=""; try { for (int i=0; i= '0' && arr[i] <= 'z') || (arr[i] == ' ')) { chars += (char) arr[i]; } else if (arr[i] == 252) { chars += "\ufffd"; } else if (arr[i] ==246) { chars += "\ufffd"; } else if (arr[i] == (byte) '\ufffd') { chars += "\ufffd"; } else { chars += "."; } } System.out.println(" " + chars); } } } pilot-link-0.12.5-dfsg/bindings/Java/TestTodos.java0000644000175000017500000000517110161574445022364 0ustar rousseaurousseauimport java.io.File; import org.gnu.pilotlink.PilotLink; import org.gnu.pilotlink.PilotLinkException; import org.gnu.pilotlink.Record; import org.gnu.pilotlink.SysInfo; import org.gnu.pilotlink.ToDoRecord; import org.gnu.pilotlink.User; /* * Created on 15.10.2004 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ /** *@author stephan TODO To change the template for this generated type * comment go to Window - Preferences - Java - Code Style - Code Templates *@created 5. Dezember 2004 */ public class TestTodos { /** * The main program for the TestTodos class * *@param args The command line arguments */ public static void main(String[] args) { String port; test tst = new test(); if (args.length == 0) { port = "/dev/usb/tts/1"; } else { port = args[0]; } File p = new File(port); System.out.println("looking for file " + port); if (!p.exists()) { System.out.println("File does not exist... USB? Waiting for port to appear"); while (!p.exists()) { System.out.print("."); try { Thread.sleep(1000); } catch (Exception e) {} } } //System.out.println("Systemzeit: "+Long.toHexString(System.currentTimeMillis()/1000)); PilotLink pl = null; try { pl = new PilotLink(port); if (!pl.isConnected()) { System.out.println("Something went wrong. Check output!"); System.exit(1); } } catch (Exception e) { e.printStackTrace(); System.exit(1); } try { User u = pl.getUserInfo(); System.out.println("User: " + u.getName()); System.out.println("Last Synchronization Date: " + u.getLastSyncDate()); } catch (PilotLinkException e) { e.printStackTrace(); } try { SysInfo si = pl.getSysInfo(); System.out.println("Product ID: '" + si.getProdID() + "'"); System.out.println("Rom Version: " + si.getRomVersion()); } catch (PilotLinkException e) { e.printStackTrace(); } try { int dbh = pl.openDB("ToDoDB"); System.out.println("db opened!"); System.out.println("Count: " + pl.getRecordCount(dbh)); for (int i = 0; i < pl.getRecordCount(dbh); i++) { Record r = pl.getRecordByIndex(dbh, i); ToDoRecord tdr = new ToDoRecord(r); System.out.println("READ IN:"); System.out.println(tdr); tst.hexdump(r.getBuffer()); System.out.println("\nRE-PACKED:"); tst.hexdump(tdr.getBuffer()); System.out.println(); } } catch (PilotLinkException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { pl.endSync(); } catch (PilotLinkException e) { e.printStackTrace(); } pl.close(); } } pilot-link-0.12.5-dfsg/bindings/Java/.cvsignore0000644000175000017500000000002407700364441021557 0ustar rousseaurousseauMakefile Makefile.inpilot-link-0.12.5-dfsg/bindings/Java/README0000644000175000017500000000275710161574445020460 0ustar rousseaurousseauStephan Bösebeck & John Mitchell We have coded this bindings for the PilotLink library, as the original version by David Goodenough did not run with jdk 1.4. Some remarks about the source: - We wanted to keep the C-part as small es possible. So porting to other platforms should be easier - All communication with the lib is done via org.gnu.PilotLink, which uses RawRecords. These RawRecords can be used to build other data records (lik DatebookRecord, Memo, etc). Disgn like in jdk's streams: DatebookRecord dbr= new DatebookRecord(PilotLink.getRecord...) At the moment, this functions are supported: - Reading and writing of RawRecords by index - Reading of user and sysinfo - reading and writing of DatebookRecords I hope i can add more features soon. BUG: There is a problem opening more than one db at a time. The lib gives back Errorcode -1, even if the DB was being closed before. INSTALLATION: Normally just do a "configure --with-java" in the Pilot-Link dir. Then you will get a pilotlink.jar and a lib, which will be installed in JAVA_HOME. For testing an as an example, there is a test.java which can be used to demonstrate the funktionality of the bindings. Take a look at the test.java, before you try it... By default, the port the test.java connects ist /dev/usb/tts/1 (Devfs), you can either change it in source or start the testclass with the port as param. Stephan Bösebeck (stephan_boesebeck@web.de) John Mitchell (jfm@minioak.com) Thanks to Alex Villacís Lasso (a_villacis@palosanto.com) pilot-link-0.12.5-dfsg/bindings/Tcl/0000755000175000017500000000000011333433324017416 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/bindings/Tcl/Makefile.in0000644000175000017500000006117011333433243021470 0ustar rousseaurousseau# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ # $Id: Makefile.am,v 1.4 2007/02/17 02:40:26 desrod Exp $ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ target_triplet = @target@ bin_PROGRAMS = pitclsh$(EXEEXT) subdir = bindings/Tcl DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/bluez.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/tcl.m4 \ $(top_srcdir)/m4/threads.m4 \ $(top_srcdir)/m4/vl_lib_readline.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/include/pi-md5.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libpitcl_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/src/libpiuserland.la \ $(top_builddir)/libpisock/libpisock.la am_libpitcl_la_OBJECTS = pitcl.lo libpitcl_la_OBJECTS = $(am_libpitcl_la_OBJECTS) libpitcl_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libpitcl_la_LDFLAGS) $(LDFLAGS) -o $@ libpiuserland_la_LIBADD = am_libpiuserland_la_OBJECTS = plu_args.lo userland.lo libpiuserland_la_OBJECTS = $(am_libpiuserland_la_OBJECTS) libpiuserland_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libpiuserland_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(bin_PROGRAMS) am_pitclsh_OBJECTS = tclAppInit.$(OBJEXT) pitclsh_OBJECTS = $(am_pitclsh_OBJECTS) pitclsh_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/src/libpiuserland.la \ $(top_builddir)/libpisock/libpisock.la libpitcl.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libpitcl_la_SOURCES) $(libpiuserland_la_SOURCES) \ $(pitclsh_SOURCES) DIST_SOURCES = $(libpitcl_la_SOURCES) $(libpiuserland_la_SOURCES) \ $(pitclsh_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLUEZ_CFLAGS = @BLUEZ_CFLAGS@ BLUEZ_LIBS = @BLUEZ_LIBS@ CAT_ENTRY_END = @CAT_ENTRY_END@ CAT_ENTRY_START = @CAT_ENTRY_START@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOCBOOK_ROOT = @DOCBOOK_ROOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVA = @JAVA@ JAVABASE = @JAVABASE@ JAVAC = @JAVAC@ JAVA_VERSION = @JAVA_VERSION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PIC_LIBS = @PIC_LIBS@ PILOT_LINK_MAJOR = @PILOT_LINK_MAJOR@ PILOT_LINK_MINOR = @PILOT_LINK_MINOR@ PILOT_LINK_PATCH = @PILOT_LINK_PATCH@ PILOT_LINK_VERS = @PILOT_LINK_VERS@ PISOCK_AGE = @PISOCK_AGE@ PISOCK_CURRENT = @PISOCK_CURRENT@ PISOCK_REVISION = @PISOCK_REVISION@ PISYNC_AGE = @PISYNC_AGE@ PISYNC_CURRENT = @PISYNC_CURRENT@ PISYNC_REVISION = @PISYNC_REVISION@ PKG_CONFIG = @PKG_CONFIG@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ POPT_INCLUDES = @POPT_INCLUDES@ POPT_LIBS = @POPT_LIBS@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_H = @PYTHON_H@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RL_LIBS = @RL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ XML_CATALOG = @XML_CATALOG@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ builddir = @builddir@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ usb_libs = @usb_libs@ INCLUDES = \ -I../../include \ -I$(top_srcdir)/include \ -DPACKAGE_VERSION=\"1.0\" \ $(POPT_INCLUDES) \ $(TCL_INCLUDES) noinst_LTLIBRARIES = libpiuserland.la libpiuserland_la_SOURCES = \ $(top_builddir)/src/plu_args.c \ $(top_builddir)/src/userland.c libpiuserland_la_LDFLAGS = -static lib_LTLIBRARIES = libpitcl.la libpitcl_la_SOURCES = pitcl.c libpitcl_la_LIBADD = \ $(TCL_LIB_SPEC) \ $(POPT_LIBS) \ $(top_builddir)/src/libpiuserland.la \ $(top_builddir)/libpisock/libpisock.la libpitcl_la_LDFLAGS = \ -export-dynamic -version-info 0:0:0 pitclsh_SOURCES = tclAppInit.c pitclsh_LDADD = \ $(TCL_LIB_SPEC) \ $(POPT_LIBS) \ $(top_builddir)/src/libpiuserland.la \ $(top_builddir)/libpisock/libpisock.la \ libpitcl.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/Tcl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu bindings/Tcl/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 $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libpitcl.la: $(libpitcl_la_OBJECTS) $(libpitcl_la_DEPENDENCIES) $(libpitcl_la_LINK) -rpath $(libdir) $(libpitcl_la_OBJECTS) $(libpitcl_la_LIBADD) $(LIBS) libpiuserland.la: $(libpiuserland_la_OBJECTS) $(libpiuserland_la_DEPENDENCIES) $(libpiuserland_la_LINK) $(libpiuserland_la_OBJECTS) $(libpiuserland_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list pitclsh$(EXEEXT): $(pitclsh_OBJECTS) $(pitclsh_DEPENDENCIES) @rm -f pitclsh$(EXEEXT) $(LINK) $(pitclsh_OBJECTS) $(pitclsh_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pitcl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plu_args.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tclAppInit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userland.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< plu_args.lo: $(top_builddir)/src/plu_args.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT plu_args.lo -MD -MP -MF $(DEPDIR)/plu_args.Tpo -c -o plu_args.lo `test -f '$(top_builddir)/src/plu_args.c' || echo '$(srcdir)/'`$(top_builddir)/src/plu_args.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/plu_args.Tpo $(DEPDIR)/plu_args.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/src/plu_args.c' object='plu_args.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o plu_args.lo `test -f '$(top_builddir)/src/plu_args.c' || echo '$(srcdir)/'`$(top_builddir)/src/plu_args.c userland.lo: $(top_builddir)/src/userland.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT userland.lo -MD -MP -MF $(DEPDIR)/userland.Tpo -c -o userland.lo `test -f '$(top_builddir)/src/userland.c' || echo '$(srcdir)/'`$(top_builddir)/src/userland.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/userland.Tpo $(DEPDIR)/userland.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/src/userland.c' object='userland.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o userland.lo `test -f '$(top_builddir)/src/userland.c' || echo '$(srcdir)/'`$(top_builddir)/src/userland.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(LTLIBRARIES) $(PROGRAMS) install-binPROGRAMS: install-libLTLIBRARIES installdirs: for dir in "$(DESTDIR)$(libdir)" "$(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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-libLTLIBRARIES \ clean-libtool clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-libLTLIBRARIES # 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: pilot-link-0.12.5-dfsg/bindings/Tcl/Makefile.am0000644000175000017500000000153310565465432021467 0ustar rousseaurousseau# $Id: Makefile.am,v 1.4 2007/02/17 02:40:26 desrod Exp $ INCLUDES = \ -I../../include \ -I$(top_srcdir)/include \ -DPACKAGE_VERSION=\"1.0\" \ $(POPT_INCLUDES) \ $(TCL_INCLUDES) noinst_LTLIBRARIES = libpiuserland.la libpiuserland_la_SOURCES = \ $(top_builddir)/src/plu_args.c \ $(top_builddir)/src/userland.c libpiuserland_la_LDFLAGS = -static bin_PROGRAMS = pitclsh lib_LTLIBRARIES = libpitcl.la libpitcl_la_SOURCES = pitcl.c libpitcl_la_LIBADD = \ $(TCL_LIB_SPEC) \ $(POPT_LIBS) \ $(top_builddir)/src/libpiuserland.la \ $(top_builddir)/libpisock/libpisock.la libpitcl_la_LDFLAGS = \ -export-dynamic -version-info 0:0:0 pitclsh_SOURCES = tclAppInit.c pitclsh_LDADD = \ $(TCL_LIB_SPEC) \ $(POPT_LIBS) \ $(top_builddir)/src/libpiuserland.la \ $(top_builddir)/libpisock/libpisock.la \ libpitcl.la pilot-link-0.12.5-dfsg/bindings/Tcl/tclAppInit.c0000644000175000017500000000624007176416226021647 0ustar rousseaurousseau/* * tclAppInit.c -- * * Provides a default version of the main program and Tcl_AppInit * procedure for Tcl applications (without Tk). * * Copyright (c) 1993 The Regents of the University of California. * Copyright (c) 1994-1995 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * SCCS: @(#) tclAppInit.c 1.17 96/03/26 12:45:29 */ #include "tcl.h" /* * The following variable is a special hack that is needed in order for * Sun shared libraries to be used for Tcl. */ extern int matherr(); int *tclDummyMathPtr = (int *) matherr; EXTERN int Pitcl_Init _ANSI_ARGS_((Tcl_Interp *interp)); #ifdef TCL_TEST EXTERN int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp)); #endif /* TCL_TEST */ /* *---------------------------------------------------------------------- * * main -- * * This is the main program for the application. * * Results: * None: Tcl_Main never returns here, so this procedure never * returns either. * * Side effects: * Whatever the application does. * *---------------------------------------------------------------------- */ int main(argc, argv) int argc; /* Number of command-line arguments. */ char **argv; /* Values of command-line arguments. */ { Tcl_Main(argc, argv, Tcl_AppInit); return 0; /* Needed only to prevent compiler warning. */ } /* *---------------------------------------------------------------------- * * Tcl_AppInit -- * * This procedure performs application-specific initialization. * Most applications, especially those that incorporate additional * packages, will have their own version of this procedure. * * Results: * Returns a standard Tcl completion code, and leaves an error * message in interp->result if an error occurs. * * Side effects: * Depends on the startup script. * *---------------------------------------------------------------------- */ int Tcl_AppInit(interp) Tcl_Interp *interp; /* Interpreter for application. */ { if (Tcl_Init(interp) == TCL_ERROR) { return TCL_ERROR; } if (Pitcl_Init(interp) == TCL_ERROR) { return TCL_ERROR; } #ifdef TCL_TEST if (Tcltest_Init(interp) == TCL_ERROR) { return TCL_ERROR; } Tcl_StaticPackage(interp, "Tcltest", Tcltest_Init, (Tcl_PackageInitProc *) NULL); #endif /* TCL_TEST */ /* * Call the init procedures for included packages. Each call should * look like this: * * if (Mod_Init(interp) == TCL_ERROR) { * return TCL_ERROR; * } * * where "Mod" is the name of the module. */ /* * Call Tcl_CreateCommand for application-specific commands, if * they weren't already created by the init procedures called above. */ /* * Specify a user-specific startup file to invoke if the application * is run interactively. Typically the startup file is "~/.apprc" * where "app" is the name of the application. If this line is deleted * then no user-specific startup file will be run under any conditions. */ Tcl_SetVar(interp, "tcl_rcFileName", "~/.pitclrc", TCL_GLOBAL_ONLY); return TCL_OK; } pilot-link-0.12.5-dfsg/bindings/Tcl/README0000644000175000017500000000053507673617241020317 0ustar rousseaurousseau This is an experimental piece of code to bind the pilot-link library to Tcl. You must have Tcl 8.0b1 or later installed, and you'll need to figure out how to properly build a dynamically loadable library . The included Makefile is only likely to work on ELF-based systems. Currently only a very few commands are bound. test.tcl demonstrates them. pilot-link-0.12.5-dfsg/bindings/Tcl/pitcl.c0000644000175000017500000010555010565461670020716 0ustar rousseaurousseau/* * Portions of this file are copied or derivered from various files in the * tcl8.0b1 distribution. * Those portions are Copyright (c) 1995 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ /* The remainder of this file is Copyright (c) 1997, Kenneth Albanowski, and * is free software, licensed under the GNU Public License V2. See the file * COPYING for details. */ #include #include #include #include #include "pi-source.h" #include "pi-socket.h" #include "pi-dlp.h" #include "pi-memo.h" #include "pi-buffer.h" #include "pi-userland.h" #if TCL_MAJOR_VERSION >= 8 # define Objects #endif struct tcl_e {char *name; long value;}; char buf[0xffff]; static struct tcl_e domains[] = { {"PI_AF_PILOT", PI_AF_PILOT}, {"AF_PILOT", PI_AF_PILOT}, {"PILOT", PI_AF_PILOT}, {0,0}}; static struct tcl_e protocols[] = { {"PI_PF_DEV", PI_PF_DEV}, {"PI_PF_SLP", PI_PF_SLP}, {"PI_PF_SYS", PI_PF_SYS}, {"PI_PF_PADP", PI_PF_PADP}, {"PI_PF_NET", PI_PF_NET}, {"PI_PF_DLP", PI_PF_DLP}, {"PF_DEV", PI_PF_DEV}, {"PF_SLP", PI_PF_SLP}, {"PF_SYS", PI_PF_SYS}, {"PF_PADP", PI_PF_PADP}, {"PF_NET", PI_PF_NET}, {"PF_DLP", PI_PF_DLP}, {"DEV", PI_PF_DEV}, {"SLP", PI_PF_SLP}, {"SYS", PI_PF_SYS}, {"PADP", PI_PF_PADP}, {"NET", PI_PF_NET}, {"DLP", PI_PF_DLP}, {0,0}}; static struct tcl_e types[] = { {"PI_SOCK_STREAM", PI_SOCK_STREAM}, {"PI_SOCK_RAW", PI_SOCK_RAW}, {"SOCK_STREAM", PI_SOCK_STREAM}, {"SOCK_RAW", PI_SOCK_RAW}, {"STREAM", PI_SOCK_STREAM}, {"RAW", PI_SOCK_RAW}, {0,0}}; static int PisockCloseProc(ClientData instanceData, Tcl_Interp* interp); static int PisockInputProc(ClientData instanceData, char *buf, int bufSize, int *errorCodePtr); static int PisockOutputProc(ClientData instanceData, char *buf, int toWrite, int *errorCodePtr); static void PisockWatchProc(ClientData instanceData, int mask); #if TCL_MAJOR_VERSION >=8 static int PisockGetHandleProc(ClientData instanceData, int direction, ClientData *handlePtr); #else static Tcl_File OldPisockGetHandleProc(ClientData instanceData, int direction); static int PisockReadyProc(ClientData instanceData, int mask); #endif static Tcl_ChannelType pisockChannelType = { "pisock", /* Type name. */ NULL/*PisockBlockModeProc*/, /* Set blocking/nonblocking mode.*/ PisockCloseProc, /* Close proc. */ PisockInputProc, /* Input proc. */ PisockOutputProc, /* Output proc. */ NULL, /* Seek proc. */ NULL, /* Set option proc. */ NULL, /* Get option proc. */ PisockWatchProc, /* Initialize notifier. */ #if TCL_MAJOR_VERSION < 8 PisockReadyProc, OldPisockGetHandleProc, /* Get OS handles out of channel. */ #else PisockGetHandleProc, /* Get OS handles out of channel. */ #endif }; typedef void (Tcl_PisockAcceptProc)(ClientData,Tcl_Channel); typedef struct PisockState { Tcl_Channel channel; /* Channel associated with this file. */ int fd; /* The socket itself. */ int flags; /* ORed combination of the bitfields * defined below. */ Tcl_PisockAcceptProc *acceptProc; /* Proc to call on accept. */ ClientData acceptProcData; /* The data for the accept proc. */ } PisockState; #define TCP_ASYNC_SOCKET (1<<0) /* Asynchronous socket. */ #define TCP_ASYNC_CONNECT (1<<1) /* Async connect in progress. */ static int WaitForConnect(PisockState * statePtr, int * errorCodePtr); typedef struct AcceptCallback { char *script; /* Script to invoke. */ Tcl_Interp *interp; /* Interpreter in which to run it. */ } AcceptCallback; typedef int (*packcmd) _ANSI_ARGS_((Tcl_Interp*, char*, char *, int)); typedef void (*unpackcmd) _ANSI_ARGS_((Tcl_Interp*, char*, int)); struct Packer { char *name; packcmd pack, packai, packsi; unpackcmd unpack, unpackai, unpacksi; }; void MemoUnpackCmd(Tcl_Interp * interp, char * buf, int len) { struct Memo m; pi_buffer_t *record; record = pi_buffer_new(len); memcpy(record->data, buf, len); record->used = len; len = unpack_Memo(&m, record, len); pi_buffer_free(record); Tcl_AppendElement(interp, m.text); free_Memo(&m); } int MemoPackCmd(Tcl_Interp * interp, char * rec, char * buf, int len) { struct Memo m; pi_buffer_t *record; int used; record = pi_buffer_new(0); m.text = rec; pack_Memo(&m, record, memo_v1); if (record->used <= len) { memcpy(buf,record->data,record->used); used = record->used; } else { /* It didn't fit in their fixed size buffer */ used = 0; } pi_buffer_free(record); return used; } struct { char * name; packcmd pack, packai, packsi; unpackcmd unpack, unpackai, unpacksi; } DBPackers[] = { { "MemoDB", MemoPackCmd,0,0,MemoUnpackCmd,0,0}, { 0, 0,0,0,0,0,0}, }; struct Packer * pack = 0; int packers = 0; void register_sock(int sock) { int i; if (packers==0) { packers = sock+5; pack = malloc(sizeof(struct Packer)*packers); for(i=0;i= packers) { packers = sock+10; pack = realloc(pack, sizeof(struct Packer)*packers); for(i=sock;ifd, TCL_UNIX_FD) #else # define statePtr_fd statePtr->fd #endif static void AcceptCallbackProc _ANSI_ARGS_((ClientData callbackData, Tcl_Channel chan)); static void RegisterPisockServerInterpCleanup _ANSI_ARGS_((Tcl_Interp *interp, AcceptCallback *acceptCallbackPtr)); static void PisockAcceptCallbacksDeleteProc _ANSI_ARGS_(( ClientData clientData, Tcl_Interp *interp)); static void PisockServerCloseProc _ANSI_ARGS_((ClientData callbackData)); static void UnregisterPisockServerInterpCleanupProc _ANSI_ARGS_(( Tcl_Interp *interp, AcceptCallback *acceptCallbackPtr)); void Tcl_AppendInt(Tcl_Interp * interp, int result) { char buffer[20]; sprintf(buffer, "%d", result); Tcl_AppendElement(interp, buffer); } /* ARGSUSED */ static void PisockAcceptCallbacksDeleteProc(clientData, interp) ClientData clientData; /* Data which was passed when the assocdata * was registered. */ Tcl_Interp *interp; /* Interpreter being deleted - not used. */ { Tcl_HashTable *hTblPtr; Tcl_HashEntry *hPtr; Tcl_HashSearch hSearch; AcceptCallback *acceptCallbackPtr; hTblPtr = (Tcl_HashTable *) clientData; for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch); hPtr != (Tcl_HashEntry *) NULL; hPtr = Tcl_NextHashEntry(&hSearch)) { acceptCallbackPtr = (AcceptCallback *) Tcl_GetHashValue(hPtr); acceptCallbackPtr->interp = (Tcl_Interp *) NULL; } Tcl_DeleteHashTable(hTblPtr); ckfree((char *) hTblPtr); } static void RegisterPisockServerInterpCleanup(interp, acceptCallbackPtr) Tcl_Interp *interp; /* Interpreter for which we want to be * informed of deletion. */ AcceptCallback *acceptCallbackPtr; /* The accept callback record whose * interp field we want set to NULL when * the interpreter is deleted. */ { Tcl_HashTable *hTblPtr; /* Hash table for accept callback * records to smash when the interpreter * will be deleted. */ Tcl_HashEntry *hPtr; /* Entry for this record. */ int new; /* Is the entry new? */ hTblPtr = (Tcl_HashTable *) Tcl_GetAssocData(interp, "pisockAcceptCallbacks", NULL); if (hTblPtr == (Tcl_HashTable *) NULL) { hTblPtr = (Tcl_HashTable *) ckalloc((unsigned) sizeof(Tcl_HashTable)); Tcl_InitHashTable(hTblPtr, TCL_ONE_WORD_KEYS); (void) Tcl_SetAssocData(interp, "pisockAcceptCallbacks", PisockAcceptCallbacksDeleteProc, (ClientData) hTblPtr); } hPtr = Tcl_CreateHashEntry(hTblPtr, (char *) acceptCallbackPtr, &new); if (!new) { fprintf(stderr,"RegisterPisockServerCleanup: damaged accept record table"); abort(); } Tcl_SetHashValue(hPtr, (ClientData) acceptCallbackPtr); } static void UnregisterPisockServerInterpCleanupProc(interp, acceptCallbackPtr) Tcl_Interp *interp; /* Interpreter in which the accept callback * record was registered. */ AcceptCallback *acceptCallbackPtr; /* The record for which to delete the * registration. */ { Tcl_HashTable *hTblPtr; Tcl_HashEntry *hPtr; hTblPtr = (Tcl_HashTable *) Tcl_GetAssocData(interp, "pisockAcceptCallbacks", NULL); if (hTblPtr == (Tcl_HashTable *) NULL) { return; } hPtr = Tcl_FindHashEntry(hTblPtr, (char *) acceptCallbackPtr); if (hPtr == (Tcl_HashEntry *) NULL) { return; } Tcl_DeleteHashEntry(hPtr); } /* ARGSUSED */ static int PisockCloseProc(instanceData, interp) ClientData instanceData; /* The socket to close. */ Tcl_Interp *interp; /* For error reporting - unused. */ { PisockState *statePtr = (PisockState *) instanceData; int errorCode = 0; /* * Delete a file handler that may be active for this socket if this * is a server socket - the file handler was created automatically * by Tcl as part of the mechanism to accept new client connections. * Channel handlers are already deleted in the generic IO channel * closing code that called this function, so we do not have to * delete them here. */ Tcl_DeleteFileHandler(statePtr_fd); if (pi_close(statePtr->fd) < 0) { errorCode = errno; } ckfree((char *) statePtr); return errorCode; } /* ARGSUSED */ static int PisockInputProc(instanceData, buf, bufSize, errorCodePtr) ClientData instanceData; /* Socket state. */ char *buf; /* Where to store data read. */ int bufSize; /* How much space is available * in the buffer? */ int *errorCodePtr; /* Where to store error code. */ { PisockState *statePtr = (PisockState *) instanceData; int bytesRead, state; *errorCodePtr = 0; state = WaitForConnect(statePtr, errorCodePtr); if (state != 0) { return -1; } bytesRead = pi_recv(statePtr->fd, buf, bufSize, 0); if (bytesRead > -1) { return bytesRead; } if (errno == ECONNRESET) { /* * Turn ECONNRESET into a soft EOF condition. */ return 0; } *errorCodePtr = errno; return -1; } static int PisockOutputProc(instanceData, buf, toWrite, errorCodePtr) ClientData instanceData; /* Socket state. */ char *buf; /* The data buffer. */ int toWrite; /* How many bytes to write? */ int *errorCodePtr; /* Where to store error code. */ { PisockState *statePtr = (PisockState *) instanceData; int written; int state; /* Of waiting for connection. */ *errorCodePtr = 0; state = WaitForConnect(statePtr, errorCodePtr); if (state != 0) { return -1; } written = pi_send(statePtr->fd, buf, toWrite, 0); if (written > -1) { return written; } *errorCodePtr = errno; return -1; } static void PisockWatchProc(instanceData, mask) ClientData instanceData; /* The socket state. */ int mask; /* Events of interest; an OR-ed * combination of TCL_READABLE, * TCL_WRITABLE and TCL_EXCEPTION. */ { PisockState *statePtr = (PisockState *) instanceData; #if TCL_MAJOR_VERSION >=8 if (mask) { Tcl_CreateFileHandler(statePtr_fd, mask, (Tcl_FileProc *) Tcl_NotifyChannel, (ClientData) statePtr->channel); } else { Tcl_DeleteFileHandler(statePtr_fd); } #else Tcl_WatchFile(Tcl_GetFile((ClientData)statePtr->fd, TCL_UNIX_FD), mask); #endif } #if TCL_MAJOR_VERSION >= 8 /* ARGSUSED */ static int PisockGetHandleProc(instanceData, direction, handlePtr) ClientData instanceData; /* The socket state. */ int direction; /* Not used. */ ClientData *handlePtr; /* Where to store the handle. */ { PisockState *statePtr = (PisockState *) instanceData; *handlePtr = (ClientData)statePtr->fd; return TCL_OK; } #else /* ARGSUSED */ static Tcl_File OldPisockGetHandleProc(instanceData, direction) ClientData instanceData; /* The socket state. */ int direction; /* Not used. */ { PisockState *statePtr = (PisockState *) instanceData; return Tcl_GetFile((ClientData)statePtr->fd, TCL_UNIX_FD); } static int PisockReadyProc(instanceData, mask) ClientData instanceData; int mask; { PisockState *statePtr = (PisockState *) instanceData; return Tcl_FileReady(Tcl_GetFile((ClientData)statePtr->fd, TCL_UNIX_FD), mask); } #endif static int WaitForConnect(statePtr, errorCodePtr) PisockState *statePtr; /* State of the socket. */ int *errorCodePtr; /* Where to store errors? */ { #if 0 int timeOut; /* How long to wait. */ int state; /* Of calling TclWaitForFile. */ int flags; /* fcntl flags for the socket. */ /* * If an asynchronous connect is in progress, attempt to wait for it * to complete before reading. */ if (statePtr->flags & TCP_ASYNC_CONNECT) { if (statePtr->flags & TCP_ASYNC_SOCKET) { timeOut = 0; } else { timeOut = -1; } errno = 0; state = TclUnixWaitForFile(statePtr->fd, TCL_WRITABLE | TCL_EXCEPTION, timeOut); if (!(statePtr->flags & TCP_ASYNC_SOCKET)) { #ifndef USE_FIONBIO flags = fcntl(statePtr->fd, F_GETFL); flags &= (~(O_NONBLOCK)); (void) fcntl(statePtr->fd, F_SETFL, flags); #endif #ifdef USE_FIONBIO flags = 0; (void) ioctl(statePtr->fd, FIONBIO, &flags); #endif } if (state & TCL_EXCEPTION) { return -1; } if (state & TCL_WRITABLE) { statePtr->flags &= (~(TCP_ASYNC_CONNECT)); } else if (timeOut == 0) { *errorCodePtr = errno = EWOULDBLOCK; return -1; } } #endif return 0; } static void AcceptCallbackProc(callbackData, chan) ClientData callbackData; /* The data stored when the callback * was created in the call to * Tcl_OpenTcpServer. */ Tcl_Channel chan; /* Channel for the newly accepted * connection. */ { AcceptCallback *acceptCallbackPtr; Tcl_Interp *interp; char *script; int result; acceptCallbackPtr = (AcceptCallback *) callbackData; /* * Check if the callback is still valid; the interpreter may have gone * away, this is signalled by setting the interp field of the callback * data to NULL. */ if (acceptCallbackPtr->interp != (Tcl_Interp *) NULL) { script = acceptCallbackPtr->script; interp = acceptCallbackPtr->interp; Tcl_Preserve((ClientData) script); Tcl_Preserve((ClientData) interp); Tcl_RegisterChannel(interp, chan); result = Tcl_VarEval(interp, script, " ", Tcl_GetChannelName(chan), (char *) NULL); if (result != TCL_OK) { Tcl_BackgroundError(interp); Tcl_UnregisterChannel(interp, chan); } Tcl_Release((ClientData) interp); Tcl_Release((ClientData) script); } else { /* * The interpreter has been deleted, so there is no useful * way to utilize the client socket - just close it. */ Tcl_Close((Tcl_Interp *) NULL, chan); } } static void PisockServerCloseProc(callbackData) ClientData callbackData; /* The data passed in the call to * Tcl_CreateCloseHandler. */ { AcceptCallback *acceptCallbackPtr; /* The actual data. */ acceptCallbackPtr = (AcceptCallback *) callbackData; if (acceptCallbackPtr->interp != (Tcl_Interp *) NULL) { UnregisterPisockServerInterpCleanupProc(acceptCallbackPtr->interp, acceptCallbackPtr); } Tcl_EventuallyFree((ClientData) acceptCallbackPtr->script, TCL_DYNAMIC); ckfree((char *) acceptCallbackPtr); } static void PisockAccept(data, mask) ClientData data; /* Callback token. */ int mask; /* Not used. */ { PisockState *sockState; /* Client data of server socket. */ int newsock; /* The new client socket */ PisockState *newSockState; /* State for new socket. */ /*int len;*/ /* For accept interface */ char channelName[20]; sockState = (PisockState *) data; newsock = pi_accept(sockState->fd, 0, 0); if (newsock < 0) { return; } register_sock(newsock); /* * Set close-on-exec flag to prevent the newly accepted socket from * being inherited by child processes. */ /*(void) fcntl(newsock, F_SETFD, FD_CLOEXEC);*/ newSockState = (PisockState *) ckalloc((unsigned) sizeof(PisockState)); newSockState->flags = 0; newSockState->fd = newsock; newSockState->acceptProc = (Tcl_PisockAcceptProc *) NULL; newSockState->acceptProcData = (ClientData) NULL; sprintf(channelName, "pisock%d", newsock); newSockState->channel = Tcl_CreateChannel(&pisockChannelType, channelName, (ClientData) newSockState, (TCL_READABLE | TCL_WRITABLE)); /*Tcl_SetChannelOption((Tcl_Interp *) NULL, newSockState->channel, "-translation", "auto crlf");*/ if (sockState->acceptProc != (Tcl_PisockAcceptProc *) NULL) { (sockState->acceptProc) (sockState->acceptProcData, newSockState->channel); } } #ifdef Objects static long tcl_enumobj(Tcl_Interp *interp, Tcl_Obj *object, struct tcl_e * e) { int i; long result; char * str = Tcl_GetStringFromObj(object, 0); for(i=0;e[i].name;i++) { if (strcmp(e[i].name, str)==0) return e[i].value; } result = 0; Tcl_GetLongFromObj(interp, object, &result); return result; } #endif static int tcl_enum(Tcl_Interp *interp, char *str, struct tcl_e * e) { int i; int result; for(i=0;e[i].name;i++) { if (strcmp(e[i].name, str)==0) return e[i].value; } result = 0; Tcl_GetInt(interp, str, &result); return result; } #ifdef Objects static int tcl_socketobj(Tcl_Interp *interp, Tcl_Obj *object) { int fd= 0; Tcl_Channel c = Tcl_GetChannel(interp, Tcl_GetStringFromObj(object,0), 0); if (!c) { Tcl_GetIntFromObj(interp, object, &fd); } else { Tcl_GetChannelHandle(c, TCL_WRITABLE, (ClientData)&fd); } return fd; } #endif static int tcl_socket(Tcl_Interp *interp, char * arg) { int fd= 0; Tcl_Channel c = Tcl_GetChannel(interp, arg, 0); if (!c) { Tcl_GetInt(interp, arg, &fd); } else { #if TCL_MAJOR_VERSION >= 8 Tcl_GetChannelHandle(c, TCL_WRITABLE, (ClientData)&fd); #else return (int)Tcl_GetFileInfo(Tcl_GetChannelFile(c, TCL_WRITABLE), 0); #endif } return fd; } PisockState * CreateSocket(Tcl_Interp * interp, int protocol, char * remote, int server) { PisockState *statePtr; int result; int sock; int type; int domain = PI_AF_PILOT; struct pi_sockaddr * addr = 0; int alen = 0; statePtr = (PisockState *) ckalloc((unsigned) sizeof(PisockState)); statePtr->flags = 0; if (protocol == PI_PF_SLP) type = PI_SOCK_RAW; else type = PI_SOCK_STREAM; sock = pi_socket(domain, type, protocol); printf("Called pi_socket\n"); register_sock(sock); statePtr->fd = sock; if (domain == PI_AF_PILOT) { char * device; device = remote; alen = strlen(device)+1+4; addr = (struct pi_sockaddr*)malloc(alen); strcpy(addr->pi_device, device); addr->pi_family = PI_AF_PILOT; } printf("addr = %ld\n", (long)addr); result = plu_connect(); pi_listen(sock, 1); printf(" result = %d\n", result); return statePtr; } static Tcl_Channel ClientSocket(Tcl_Interp * interp, int protocol, char * remote) { PisockState *statePtr; char channelName[20]; statePtr = CreateSocket(interp, protocol, remote, 0); if (statePtr == NULL) { return NULL; } printf("Created socket\n"); statePtr->acceptProc = NULL; statePtr->acceptProcData = (ClientData) NULL; sprintf(channelName, "pisock%d", statePtr->fd); statePtr->channel = Tcl_CreateChannel(&pisockChannelType, channelName, (ClientData) statePtr, (TCL_READABLE|TCL_WRITABLE)); return statePtr->channel; } static Tcl_Channel ServerSocket(Tcl_Interp * interp, int protocol, char * remote, Tcl_PisockAcceptProc *acceptProc, ClientData acceptProcData) { PisockState *statePtr; char channelName[20]; statePtr = CreateSocket(interp, protocol, remote, 1); if (statePtr == NULL) { return NULL; } printf("Server: Created socket\n"); statePtr->acceptProc = acceptProc; statePtr->acceptProcData = (ClientData)acceptProcData; Tcl_CreateFileHandler(statePtr_fd, TCL_READABLE, PisockAccept, (ClientData) statePtr); sprintf(channelName, "pisock%d", statePtr->fd); statePtr->channel = Tcl_CreateChannel(&pisockChannelType, channelName, (ClientData) statePtr, 0); printf("Competed bounding\n"); return statePtr->channel; } int OpenSocketCmd(notUsed, interp, argc, argv) ClientData notUsed; /* Not used. */ Tcl_Interp *interp; /* Current interpreter. */ int argc; /* Number of arguments. */ char **argv; /* Argument strings. */ { int a, server; char *arg, *copyScript, *host, *script; int protocol = PI_PF_PADP; int async = 0; Tcl_Channel chan; AcceptCallback *acceptCallbackPtr; server = 0; script = NULL; for (a = 1; a < argc; a++) { arg = argv[a]; if (arg[0] == '-') { if (strcmp(arg, "-server") == 0) { if (async == 1) { Tcl_AppendResult(interp, "cannot set -async option for server sockets", (char *) NULL); return TCL_ERROR; } server = 1; a++; if (a >= argc) { Tcl_AppendResult(interp, "no argument given for -server option", (char *) NULL); return TCL_ERROR; } script = argv[a]; } else if (strcmp(arg, "-myprotocol") == 0) { a++; if (a >= argc) { Tcl_AppendResult(interp, "no argument given for -myprotocol option", (char *) NULL); return TCL_ERROR; } protocol = atoi(argv[a]); }/*else if (strcmp(arg, "-async") == 0) { if (server == 1) { Tcl_AppendResult(interp, "cannot set -async option for server sockets", (char *) NULL); return TCL_ERROR; } async = 1; }*/ else { Tcl_AppendResult(interp, "bad option \"", arg, "\", must be -myprotocol or -server", (char *) NULL); return TCL_ERROR; } } else { break; } } #if 0 if (server) { host = myaddr; /* NULL implies INADDR_ANY */ if (myport != 0) { Tcl_AppendResult(interp, "Option -myport is not valid for servers", NULL); return TCL_ERROR; } } else #endif if (a < argc) { host = argv[a]; a++; } else { /*wrongNumArgs:*/ Tcl_AppendResult(interp, "wrong # args: should be either:\n", argv[0], " ?-myprotocol protocol? ?-async? host\n", argv[0], " -server command ?-myprotocol protocol? host", (char *) NULL); return TCL_ERROR; } if (server) { acceptCallbackPtr = (AcceptCallback *) ckalloc((unsigned) sizeof(AcceptCallback)); copyScript = ckalloc((unsigned) strlen(script) + 1); strcpy(copyScript, script); acceptCallbackPtr->script = copyScript; acceptCallbackPtr->interp = interp; chan = ServerSocket(interp, protocol, host, AcceptCallbackProc, (ClientData) acceptCallbackPtr); if (chan == (Tcl_Channel) NULL) { ckfree(copyScript); ckfree((char *) acceptCallbackPtr); return TCL_ERROR; } /* * Register with the interpreter to let us know when the * interpreter is deleted (by having the callback set the * acceptCallbackPtr->interp field to NULL). This is to * avoid trying to eval the script in a deleted interpreter. */ RegisterPisockServerInterpCleanup(interp, acceptCallbackPtr); /* * Register a close callback. This callback will inform the * interpreter (if it still exists) that this channel does not * need to be informed when the interpreter is deleted. */ Tcl_CreateCloseHandler(chan, PisockServerCloseProc, (ClientData) acceptCallbackPtr); } else { printf("Protocol = %d, host = '%s'\n", protocol, host); chan = ClientSocket(interp, protocol, host); if (chan == (Tcl_Channel) NULL) { return TCL_ERROR; } printf("got channel!\n"); } Tcl_RegisterChannel(interp, chan); Tcl_AppendResult(interp, Tcl_GetChannelName(chan), (char *) NULL); return TCL_OK; } static int socketCmd(ClientData clientData, Tcl_Interp * interp, int argc, char * argv[]) { PisockState *statePtr; int result; int x,y,z; char channelName[40]; if (argc != 4) { Tcl_SetResult(interp, "Usage: x, y, z", TCL_STATIC); return TCL_ERROR; } x = tcl_enum(interp, argv[1], domains); y = tcl_enum(interp, argv[2], types); z = tcl_enum(interp, argv[3], protocols); result = pi_socket(x,y,z); register_sock(result); statePtr = (PisockState *) ckalloc((unsigned) sizeof(PisockState)); statePtr->flags = 0; statePtr->fd = result; /*statePtr = CreateSocket(interp, port, host, 0, myaddr, myport, async); if (statePtr == NULL) { return NULL; }*/ /*statePtr->acceptProc = NULL; statePtr->acceptProcData = (ClientData) NULL; Tcl_CreateFileHandler(statePtr->fd, TCL_READABLE, TcpAccept, (ClientData) statePtr);*/ sprintf(channelName, "pisock%d", statePtr->fd); statePtr->channel = Tcl_CreateChannel(&pisockChannelType, channelName, (ClientData) statePtr, (TCL_READABLE | TCL_WRITABLE)); /*return statePtr;*/ Tcl_RegisterChannel(interp, statePtr->channel); Tcl_AppendResult(interp, Tcl_GetChannelName(statePtr->channel), (char *) NULL); return TCL_OK; /* if (result == -1) { Tcl_SetResult(interp, Tcl_PosixError(interp), TCL_STATIC); return TCL_ERROR; } else { Tcl_SetIntObj(Tcl_GetObjResult(interp), result); return TCL_OK; }*/ } static int bindCmd(ClientData clientData, Tcl_Interp * interp, int argc, char * argv[]) { int result; int s; int family; char * device; struct pi_sockaddr * addr = 0; int alen = 0; if (argc != 4) { Tcl_SetResult(interp, "Usage: socket family device", TCL_STATIC); return TCL_ERROR; } Tcl_GetInt(interp, argv[1], &s); family = tcl_enum(interp, argv[2], domains); if (family == PI_AF_PILOT) { device = argv[3]; alen = strlen(device)+1+4; addr = (struct pi_sockaddr*)malloc(alen); strcpy(addr->pi_device, device); addr->pi_family = family; } result = plu_connect(); if (addr) free(addr); if (result == -1) { Tcl_SetResult(interp, Tcl_PosixError(interp), TCL_STATIC); return TCL_ERROR; } else { Tcl_AppendInt(interp, result); return TCL_OK; } } static int OpenConduitCmd(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { if (argc != 2) { Tcl_SetResult(interp, "Usage: Status socket", TCL_STATIC); return TCL_ERROR; } dlp_OpenConduit(tcl_socket(interp, argv[1])); return TCL_OK; } int invalid_socket(Tcl_Interp*interp, int sock) { if ((sock < 0) || (sock >= packers) || (pi_version(sock)==-1)) { Tcl_SetResult(interp, "Invalid socket", TCL_STATIC); return 1; } return 0; } static int OpenDBCmd(ClientData clientData, Tcl_Interp * interp, int argc, char*argv[]) { int result; int handle; int cardno=0,mode=0x80|0x40; int sock; int i; char * name; if ((argc < 3 )|| (argc > 5)) { Tcl_SetResult(interp, "Usage: Open socket name [card [mode]]", TCL_STATIC); return TCL_ERROR; } if (argc>=3) Tcl_GetInt(interp, argv[3], &cardno); if (argc>=4) { char * modestr = argv[4]; mode = 0; if (strchr(modestr, 'S') || strchr(modestr,'s')) mode |= dlpOpenSecret; if (strchr(modestr, 'E') || strchr(modestr,'e')) mode |= dlpOpenExclusive; if (strchr(modestr, 'W') || strchr(modestr,'w')) mode |= dlpOpenWrite; if (strchr(modestr, 'R') || strchr(modestr,'r')) mode |= dlpOpenRead; } name = argv[2]; sock = tcl_socket(interp, argv[1]); if (invalid_socket(interp, sock)) return TCL_ERROR; result = dlp_OpenDB(sock, cardno, mode, name, &handle); printf("Result = %d, name = '%s', mode = %x, card = %d, handle = %d\n", result, name, mode, cardno, handle); if (result<0) { Tcl_SetResult(interp, dlp_strerror(result), TCL_STATIC); return TCL_ERROR; } for(i=0; DBPackers[i].name && strcmp(DBPackers[i].name, name); i++) ; memset(&pack[sock], 0, sizeof(struct Packer)); if (DBPackers[i].name) { pack[sock].name = DBPackers[i].name; pack[sock].pack = DBPackers[i].pack; pack[sock].unpack = DBPackers[i].unpack; pack[sock].packai = DBPackers[i].packai; pack[sock].unpackai = DBPackers[i].unpackai; pack[sock].packsi = DBPackers[i].packsi; pack[sock].unpacksi = DBPackers[i].unpacksi; } Tcl_AppendInt(interp, handle); return TCL_OK; } #ifdef Objects Tcl_Obj * InvokeFunc(Tcl_Interp * interp, Tcl_Obj * cmd, Tcl_Obj * record) { Tcl_Obj * l = Tcl_NewListObj(0,0); int err; Tcl_ListObjAppendElement(interp, l, cmd); Tcl_ListObjAppendElement(interp, l, record); err = Tcl_EvalObj(interp, l); Tcl_DecrRefCount(l); if (err != TCL_OK) return 0; l = Tcl_GetObjResult(interp); Tcl_IncrRefCount(l); return l; } #endif static int GetRecordCmd(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { int result; int handle; int index; int sock; int len,attr,cat; recordid_t id_; if (argc != 4 ) { Tcl_SetResult(interp, "Usage: GetRecord socket dbhandle index", TCL_STATIC); return TCL_ERROR; } Tcl_GetInt(interp, argv[3], &index); Tcl_GetInt(interp, argv[2], &handle); sock = tcl_socket(interp, argv[1]); if (invalid_socket(interp, sock)) return TCL_ERROR; if (!pack[sock].unpack) { Tcl_SetResult(interp, "An unpacker must be defined", TCL_STATIC); return TCL_ERROR; } result = dlp_ReadRecordByIndex(tcl_socket(interp, argv[1]), handle, index, buf, &id_, &attr, &cat); if (result<0) { Tcl_SetResult(interp, dlp_strerror(result), TCL_STATIC); return TCL_ERROR; } pack[sock].unpack(interp, buf, len); Tcl_AppendInt(interp, index); Tcl_AppendInt(interp, id_); Tcl_AppendInt(interp, attr); Tcl_AppendInt(interp, cat); return TCL_OK; } static int SetRecordCmd(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { int result; int handle; int index; int sock; int len,attr,cat; recordid_t id_; if (argc != 7 ) { Tcl_SetResult(interp, "Usage: SetRecord socket dbhandle record id attr cat", TCL_STATIC); return TCL_ERROR; } Tcl_GetInt(interp, argv[2], &handle); sock = tcl_socket(interp, argv[1]); if (invalid_socket(interp, sock)) return TCL_ERROR; if (!pack[sock].pack) { Tcl_SetResult(interp, "An unpacker must be defined", TCL_STATIC); return TCL_ERROR; } Tcl_GetInt(interp, argv[4], &index); id_ = index; Tcl_GetInt(interp, argv[5], &attr); Tcl_GetInt(interp, argv[6], &cat); len = pack[sock].pack(interp, argv[3], buf, 0xffff); result = dlp_WriteRecord(sock, handle, attr, id_, cat, buf, len, &id_); free(buf); if (result<0) { Tcl_SetResult(interp, dlp_strerror(result), TCL_STATIC); return TCL_ERROR; } Tcl_AppendInt(interp, (int)id_); return TCL_OK; } static int AddSyncLogEntryCmd(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { if (argc != 3) { Tcl_SetResult(interp, "Usage: Log socket text", TCL_STATIC); return TCL_ERROR; } dlp_AddSyncLogEntry(tcl_socket(interp, argv[1]), argv[2]); return TCL_OK; } static int PackersCmd(ClientData clientData, Tcl_Interp * interp, int argc, char *argv[]) { int sock; int i; if ((argc < 2) || (argc>3)) { Tcl_SetResult(interp, "Usage: Packers socket [-none|dbname]", TCL_STATIC); return TCL_ERROR; } sock = tcl_socket(interp, argv[1]); if (invalid_socket(interp, sock)) return TCL_ERROR; if (argc==2) { Tcl_SetResult(interp, pack[sock].name ? pack[sock].name : "-none", TCL_STATIC); return TCL_OK; } memset(&pack[sock], 0, sizeof(struct Packer)); if ((argc==3) && (argv[2][0] == '-') && (strcmp(argv[2], "-none")==0)) { pack[sock].name = "-none"; return TCL_OK; } for(i=0; DBPackers[i].name && strcmp(DBPackers[i].name, argv[2]); i++) ; if (DBPackers[i].name) { pack[sock].name = DBPackers[i].name; pack[sock].pack = DBPackers[i].pack; pack[sock].unpack = DBPackers[i].unpack; pack[sock].packai = DBPackers[i].packai; pack[sock].unpackai = DBPackers[i].unpackai; pack[sock].packsi = DBPackers[i].packsi; pack[sock].unpacksi = DBPackers[i].unpacksi; return TCL_OK; } Tcl_SetResult(interp, "Unknown packer dbname", TCL_STATIC); return TCL_ERROR; } #ifdef Objects static struct { char * name; Tcl_ObjCmdProc *proc; } oprocs[] = { {0,0} }; #endif static struct { char * name; Tcl_CmdProc *proc; } procs[] = { {"dlpOpen", OpenDBCmd}, {"piOpen", OpenSocketCmd}, {"dlpLog", AddSyncLogEntryCmd}, {"dlpStatus", OpenConduitCmd}, {"piSocket", socketCmd}, {"piBind", bindCmd}, {"dlpGetRecord", GetRecordCmd}, {"dlpPackers", PackersCmd}, {"dlpSetRecord", SetRecordCmd}, {0,0} }; int Pitcl_Init(Tcl_Interp *interp) { int i; for(i=0;procs[i].name;i++) { Tcl_CreateCommand(interp, procs[i].name, procs[i].proc, 0, 0); } #ifdef Objects for(i=0;oprocs[i].name;i++) { Tcl_CreateObjCommand(interp, oprocs[i].name, oprocs[i].proc, 0, 0); } #endif Tcl_PkgProvide(interp, "Pitcl", PACKAGE_VERSION); return TCL_OK; } pilot-link-0.12.5-dfsg/config.guess0000755000175000017500000013105411274160642017427 0ustar rousseaurousseau#! /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, 2007, 2008, 2009 # Free Software Foundation, Inc. timestamp='2009-06-10' # 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, 2006, 2007, 2008 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 ;; sh5el) machine=sh5le-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 -q __ELF__ 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 ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; 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.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-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:*:[456]) 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 -q __LP64__ 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 ;; *: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 ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd | genuineintel) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-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:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi 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:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #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 -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu 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 ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-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" ;; 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.[02]*:*) 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 i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-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; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' 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; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*) 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 ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku 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 ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-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 ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros 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: pilot-link-0.12.5-dfsg/libpisync/0000755000175000017500000000000011333433323017072 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/libpisync/Makefile.in0000644000175000017500000004514611333433244021153 0ustar rousseaurousseau# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ target_triplet = @target@ subdir = libpisync DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/bluez.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/tcl.m4 \ $(top_srcdir)/m4/threads.m4 \ $(top_srcdir)/m4/vl_lib_readline.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/include/pi-md5.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libpisync_la_DEPENDENCIES = $(top_builddir)/libpisock/libpisock.la \ $(am__DEPENDENCIES_1) am_libpisync_la_OBJECTS = sync.lo util.lo libpisync_la_OBJECTS = $(am_libpisync_la_OBJECTS) libpisync_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libpisync_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libpisync_la_SOURCES) DIST_SOURCES = $(libpisync_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLUEZ_CFLAGS = @BLUEZ_CFLAGS@ BLUEZ_LIBS = @BLUEZ_LIBS@ CAT_ENTRY_END = @CAT_ENTRY_END@ CAT_ENTRY_START = @CAT_ENTRY_START@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOCBOOK_ROOT = @DOCBOOK_ROOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVA = @JAVA@ JAVABASE = @JAVABASE@ JAVAC = @JAVAC@ JAVA_VERSION = @JAVA_VERSION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PIC_LIBS = @PIC_LIBS@ PILOT_LINK_MAJOR = @PILOT_LINK_MAJOR@ PILOT_LINK_MINOR = @PILOT_LINK_MINOR@ PILOT_LINK_PATCH = @PILOT_LINK_PATCH@ PILOT_LINK_VERS = @PILOT_LINK_VERS@ PISOCK_AGE = @PISOCK_AGE@ PISOCK_CURRENT = @PISOCK_CURRENT@ PISOCK_REVISION = @PISOCK_REVISION@ PISYNC_AGE = @PISYNC_AGE@ PISYNC_CURRENT = @PISYNC_CURRENT@ PISYNC_REVISION = @PISYNC_REVISION@ PKG_CONFIG = @PKG_CONFIG@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ POPT_INCLUDES = @POPT_INCLUDES@ POPT_LIBS = @POPT_LIBS@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_H = @PYTHON_H@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RL_LIBS = @RL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ XML_CATALOG = @XML_CATALOG@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ builddir = @builddir@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ usb_libs = @usb_libs@ INCLUDES = \ -I../include \ -I$(top_srcdir)/include \ $(ICONV_CFLAGS) lib_LTLIBRARIES = libpisync.la libpisync_la_SOURCES = \ sync.c \ util.c libpisync_la_LIBADD = \ $(top_builddir)/libpisock/libpisock.la \ $(ICONV_LIBS) libpisync_la_LDFLAGS = \ -export-dynamic -version-info $(PISYNC_CURRENT):$(PISYNC_REVISION):$(PISYNC_AGE) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libpisync/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libpisync/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 $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libpisync.la: $(libpisync_la_OBJECTS) $(libpisync_la_DEPENDENCIES) $(libpisync_la_LINK) -rpath $(libdir) $(libpisync_la_OBJECTS) $(libpisync_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES # 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: pilot-link-0.12.5-dfsg/libpisync/util.c0000644000175000017500000001424610473567025020235 0ustar rousseaurousseau/* * sync.c: Implement generic synchronization algorithm * * Copyright (c) 2000, Helix Code Inc. * * Author: JP Rosevear * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "pi-util.h" #ifdef HAVE_ICONV #include #endif #define PILOT_CHARSET "CP1252" /*********************************************************************** * * Function: convert_ToPilotChar * * Summary: Convert any supported desktop text encoding to the Palm * supported encoding * * Summary: Convert from Palm supported encoding to a supported * desktop text encoding. The Palm charset is assumed to * be CP1252. This default can be overridden by the * 'PILOT_CHARSET' environment variable. * It is more efficient to use 'convert_ToPilotCharWithCharset' * if the pilot charset is known. * * Parameters: * charset iconv-recognised destination charset * text multibyte sequence in desktop charset * bytes maximum number of bytes from 'text' to convert * ptext (output) on success, 'ptext' will point to newly * allocated null-terminated array of converted * string. * * Returns: 0 on success, -1 on failure * ***********************************************************************/ int convert_ToPilotChar(const char *charset, const char *text, int bytes, char **ptext) { #ifdef HAVE_ICONV char* pcharset; if ((pcharset = getenv("PILOT_CHARSET")) == NULL) pcharset = PILOT_CHARSET; return convert_ToPilotChar_WithCharset(charset, text, bytes, ptext, pcharset); #else return -1; #endif } /*********************************************************************** * * Function: convert_ToPilotChar_WithCharset * * Summary: Convert any supported desktop text encoding to the * specified Palm supported encoding * * Summary: Convert from Palm supported encoding to a supported * desktop text encoding. The Palm charset is explicity * specified. * * Parameters: * charset iconv-recognised destination charset * text multibyte sequence in desktop charset * bytes maximum number of bytes from 'text' to convert * ptext (output) on success, 'ptext' will point to newly * allocated null-terminated array of converted * string. * pi_charset iconv-recognised pilot-charset identifier * * Returns: 0 on success, -1 on failure * ***********************************************************************/ int convert_ToPilotChar_WithCharset(const char *charset, const char *text, int bytes, char **ptext, const char * pi_charset) { #ifdef HAVE_ICONV char* ob; iconv_t cd; size_t ibl, obl; if(NULL==pi_charset){ pi_charset = PILOT_CHARSET; } cd = iconv_open(pi_charset, charset); if (cd==(iconv_t)-1) return -1; ibl = bytes; obl = bytes * 4 + 1; *ptext = ob = malloc(obl); if (iconv(cd, &text, &ibl, &ob, &obl) == (size_t)-1) return -1; *ob = '\0'; iconv_close(cd); return 0; #else return -1; #endif } /*********************************************************************** * * Function: convert_FromPilotChar * * Summary: Convert from Palm supported encoding to a supported * desktop text encoding. The Palm charset is assumed to * be CP1252. This default can be overridden by the * 'PILOT_CHARSET' environment variable. * It is more efficient to use 'convert_FromPilotCharWithCharset' * if the pilot charset is known. * * Parameters: * charset iconv-recognised destination charset * ptext multibyte sequence in pilot's charset * bytes maximum number of bytes from ptext to convert * text (output) on success, 'text' will point to newly * allocated null-terminated array of converted * string. * * Returns: 0 on success, -1 on failure * ***********************************************************************/ int convert_FromPilotChar(const char *charset, const char *ptext, int bytes, char **text) { #ifdef HAVE_ICONV char* pcharset; if ((pcharset = getenv("PILOT_CHARSET")) == NULL) pcharset = PILOT_CHARSET; return convert_FromPilotChar_WithCharset(charset, ptext, bytes, text, pcharset); #else return -1; #endif } /*********************************************************************** * * Function: convert_FromPilotChar_WithCharset * * Summary: Convert from specified Palm supported encoding to a supported * desktop text encoding * * Parameters: * charset iconv-recognised destination charset * ptext multibyte sequence in pilot's charset * bytes maximum number of bytes from ptext to convert * text (output) on success, 'text' will point to newly * allocated null-terminated array of converted * string. * pi_charset iconv-recognised pilot-charset identifier * * Returns: 0 on success, -1 on failure * ***********************************************************************/ int convert_FromPilotChar_WithCharset(const char *charset, const char *ptext, int bytes, char **text, const char * pi_charset) { #ifdef HAVE_ICONV char* ob; iconv_t cd; size_t ibl, obl; if(NULL==pi_charset){ pi_charset = PILOT_CHARSET; } cd = iconv_open(charset, pi_charset); if (cd==(iconv_t)-1) return -1; ibl = bytes; obl = bytes * 4 + 1; *text = ob = malloc(obl); if (iconv(cd, &ptext, &ibl, &ob, &obl) == (size_t)-1) return -1; *ob = '\0'; iconv_close(cd); return 0; #else return -1; #endif } /* vi: set ts=8 sw=4 sts=4 noexpandtab: cin */ /* Local Variables: */ /* indent-tabs-mode: t */ /* c-basic-offset: 8 */ /* End: */ pilot-link-0.12.5-dfsg/libpisync/Makefile.am0000644000175000017500000000052710205165017021131 0ustar rousseaurousseauINCLUDES = \ -I../include \ -I$(top_srcdir)/include \ $(ICONV_CFLAGS) lib_LTLIBRARIES = libpisync.la libpisync_la_SOURCES = \ sync.c \ util.c libpisync_la_LIBADD = \ $(top_builddir)/libpisock/libpisock.la \ $(ICONV_LIBS) libpisync_la_LDFLAGS = \ -export-dynamic -version-info $(PISYNC_CURRENT):$(PISYNC_REVISION):$(PISYNC_AGE) pilot-link-0.12.5-dfsg/libpisync/sync.c0000644000175000017500000006311710465410415020224 0ustar rousseaurousseau/* * sync.c: Implement generic synchronization algorithm * * Documentation of the sync cases is at: * http://www.palmos.com/dev/tech/docs/conduits/win/Intro_CondBasics.html#928692 * * Copyright (c) 2000-2001, Ximian Inc. * * Author: JP Rosevear * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "pi-dlp.h" #include "pi-sync.h" typedef enum { PILOT, DESKTOP, BOTH } RecordModifier; typedef struct _RecordQueueList RecordQueueList; typedef struct _RecordQueue RecordQueue; struct _RecordQueueList { DesktopRecord *drecord; PilotRecord *precord; RecordQueueList *next; }; struct _RecordQueue { int count; RecordQueueList *rql; }; #define PilotCheck(func) if (rec_mod == PILOT || rec_mod == BOTH) if ((result = func) < 0) return result; #define DesktopCheck(func) if (rec_mod == DESKTOP || rec_mod == BOTH) if ((result = func) < 0) return result; #define ErrorCheck(func) if ((result = func) < 0) return result; /*********************************************************************** * * Function: sync_NewPilotRecord * * Summary: Create a new, empty device record with the given buffer * size * * Parameters: None * * Returns: The new device record * ***********************************************************************/ PilotRecord *sync_NewPilotRecord(int buf_size) { PilotRecord *precord; precord = (PilotRecord *) malloc(sizeof(PilotRecord)); memset(precord, 0, sizeof(PilotRecord)); precord->buffer = malloc(buf_size); return precord; } /*********************************************************************** * * Function: sync_CopyPilotRecord * * Summary: Copies the given device record * * Parameters: None * * Returns: The device record passed by sync_NewPilotRecord * ***********************************************************************/ PilotRecord *sync_CopyPilotRecord(const PilotRecord * precord) { PilotRecord *new_record; new_record = sync_NewPilotRecord(sizeof(precord->buffer)); new_record->recID = precord->recID; new_record->catID = precord->catID; new_record->flags = precord->flags; memcpy(new_record->buffer, precord->buffer, precord->len); new_record->len = precord->len; return new_record; } /*********************************************************************** * * Function: sync_FreePilotRecord * * Summary: Free the memory of the given device record * * Parameters: The device record to free * * Returns: Nothing * ***********************************************************************/ void sync_FreePilotRecord(PilotRecord * precord) { if (precord->buffer) free(precord->buffer); free(precord); } /*********************************************************************** * * Function: sync_NewDesktopRecord * * Summary: Create a new, empty, desktop record * * Parameters: None * * Returns: The new, empty desktop record * ***********************************************************************/ DesktopRecord *sync_NewDesktopRecord(void) { DesktopRecord *drecord; drecord = (DesktopRecord *) malloc(sizeof(DesktopRecord)); memset(drecord, 0, sizeof(DesktopRecord)); return drecord; } /*********************************************************************** * * Function: sync_CopyDesktopRecord * * Summary: Copies the given desktop record * * Parameters: None * * Returns: The new desktop record (DesktopRecord) * ***********************************************************************/ DesktopRecord *sync_CopyDesktopRecord(const DesktopRecord * drecord) { DesktopRecord *new_record; new_record = sync_NewDesktopRecord(); *new_record = *drecord; return new_record; } /*********************************************************************** * * Function: sync_FreeDesktopRecord * * Summary: Free the memory of the given desktop record * * Parameters: None * * Returns: Nothing * ***********************************************************************/ void sync_FreeDesktopRecord(DesktopRecord * drecord) { free(drecord); } /*********************************************************************** * * Function: add_record_queue * * Summary: Add records to process to the queue, until no more * records exist * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void add_record_queue(RecordQueue * rq, PilotRecord * precord, DesktopRecord * drecord) { RecordQueueList *item; item = malloc(sizeof(RecordQueueList)); if (drecord != NULL) { item->drecord = drecord; item->precord = NULL; } else { item->drecord = NULL; item->precord = sync_CopyPilotRecord(precord); } if (rq) { item->next = rq->rql; rq->rql = item; } else { item->next = NULL; } rq->count++; } /*********************************************************************** * * Function: free_record_queue_list * * Summary: Free the list * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int free_record_queue_list(SyncHandler * sh, RecordQueueList * rql) { int result = 0; RecordQueueList *item; while (rql != NULL) { item = rql; rql = rql->next; if (item->drecord) ErrorCheck(sh->FreeMatch(sh, item->drecord)); if (item->precord) sync_FreePilotRecord(item->precord); free(item); } return 0; } /*********************************************************************** * * Function: delete_both * * Summary: Delete records from both Palm and desktop, same time * * Parameters: None * * Returns: negative number if error, otherwise 0 to indicate * success * ***********************************************************************/ static int delete_both(SyncHandler * sh, int dbhandle, DesktopRecord * drecord, PilotRecord * precord, RecordModifier rec_mod) { int result = 0; if (drecord != NULL) DesktopCheck(sh->DeleteRecord(sh, drecord)); if (precord != NULL) PilotCheck(dlp_DeleteRecord (sh->sd, dbhandle, 0, precord->recID)); return result; } /*********************************************************************** * * Function: store_record_on_pilot * * Summary: Store the new/modified record on the Palm * * Parameters: None * * Returns: 0 if success, otherwise negative number * ***********************************************************************/ static int store_record_on_pilot(SyncHandler * sh, int dbhandle, DesktopRecord * drecord, RecordModifier rec_mod) { int result = 0; PilotRecord precord; recordid_t id_; memset(&precord, 0, sizeof(PilotRecord)); result = sh->Prepare(sh, drecord, &precord); if (result != 0) return result; PilotCheck(dlp_WriteRecord(sh->sd, dbhandle, precord.flags & dlpRecAttrSecret, precord.recID, precord.catID, precord.buffer, precord.len, &id_)); DesktopCheck(sh->SetPilotID(sh, drecord, id_)); return result; } /*********************************************************************** * * Function: open_db * * Summary: Open a given database by handle for operation * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int open_db(SyncHandler * sh, int *dbhandle) { if (sh->secret) return dlp_OpenDB(sh->sd, 0, dlpOpenReadWrite && dlpOpenSecret, sh->name, dbhandle); else return dlp_OpenDB(sh->sd, 0, dlpOpenReadWrite, sh->name, dbhandle); } /*********************************************************************** * * Function: close_db * * Summary: Close a given database by handle * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int close_db(SyncHandler * sh, int dbhandle) { dlp_CleanUpDatabase(sh->sd, dbhandle); dlp_ResetSyncFlags(sh->sd, dbhandle); dlp_CloseDB(sh->sd, dbhandle); return 0; } /*********************************************************************** * * Function: sync_record * * Summary: Synchronize a record to the Palm * * Parameters: None * * Returns: 0 if success, otherwise return a negative number * ***********************************************************************/ static int sync_record(SyncHandler * sh, int dbhandle, DesktopRecord * drecord, PilotRecord * precord, RecordQueue * rq, RecordModifier rec_mod) { int parch = 0, pdel = 0, pchange = 0, darch = 0, ddel = 0, dchange = 0, result = 0; /* The state is calculated like this because the deleted and dirty pilot flags are not mutually exclusive */ if (precord) { parch = precord->flags & dlpRecAttrArchived; pdel = precord->flags & dlpRecAttrDeleted; pchange = (precord->flags & dlpRecAttrDirty) && (!pdel); } if (drecord) { darch = drecord->flags & dlpRecAttrArchived; ddel = drecord->flags & dlpRecAttrDeleted; dchange = (drecord->flags & dlpRecAttrDirty) && (!ddel); } /* Bail if the pilot record was created and deleted between syncs */ if (drecord == NULL && !parch && pdel) return 0; /* Sync logic */ if (precord != NULL && !parch && !pdel && drecord == NULL) { DesktopCheck(sh->AddRecord(sh, precord)); } else if (precord == NULL && drecord != NULL) { add_record_queue(rq, NULL, drecord); } else if (parch && ddel) { DesktopCheck(sh->ReplaceRecord(sh, drecord, precord)); DesktopCheck(sh->ArchiveRecord(sh, drecord, 1)); DesktopCheck(sh->SetStatusCleared(sh, drecord)); } else if (parch && !darch && !dchange && drecord != NULL) { DesktopCheck(sh->ArchiveRecord(sh, drecord, 1)); } else if (parch && drecord == NULL) { DesktopCheck(sh->AddRecord(sh, precord)); ErrorCheck(sh->Match(sh, precord, &drecord)); if (drecord == NULL) return -1; DesktopCheck(sh->ArchiveRecord(sh, drecord, 1)); ErrorCheck(sh->FreeMatch(sh, drecord)); } else if (parch && pchange && !darch && dchange) { int comp; comp = sh->Compare(sh, precord, drecord); if (comp == 0) { DesktopCheck(sh->ArchiveRecord(sh, drecord, 1)); PilotCheck(dlp_DeleteRecord (sh->sd, dbhandle, 0, precord->recID)); DesktopCheck(sh->SetStatusCleared(sh, drecord)); } else { PilotCheck(dlp_WriteRecord(sh->sd, dbhandle, 0, 0, precord->catID, precord->buffer, precord->len, &precord->recID)); DesktopCheck(sh->AddRecord(sh, precord)); add_record_queue(rq, NULL, drecord); DesktopCheck(sh->SetStatusCleared(sh, drecord)); } } else if (parch && !pchange && !darch && dchange) { PilotCheck(dlp_DeleteRecord (sh->sd, dbhandle, 0, precord->recID)); add_record_queue(rq, NULL, drecord); DesktopCheck(sh->SetStatusCleared(sh, drecord)); } else if (pchange && darch && dchange) { int comp; comp = sh->Compare(sh, precord, drecord); if (comp == 0) { PilotCheck(dlp_DeleteRecord (sh->sd, dbhandle, 0, precord->recID)); } else { DesktopCheck(sh->ArchiveRecord(sh, drecord, 0)); DesktopCheck(sh-> ReplaceRecord(sh, drecord, precord)); } DesktopCheck(sh->SetStatusCleared(sh, drecord)); } else if (pchange && darch && !dchange) { DesktopCheck(sh->ArchiveRecord(sh, drecord, 0)); DesktopCheck(sh->ReplaceRecord(sh, drecord, precord)); DesktopCheck(sh->SetStatusCleared(sh, drecord)); } else if (pchange && dchange) { int comp; comp = sh->Compare(sh, precord, drecord); if (comp != 0) { DesktopCheck(sh->AddRecord(sh, precord)); drecord->recID = 0; add_record_queue(rq, NULL, drecord); } DesktopCheck(sh->SetStatusCleared(sh, drecord)); } else if (pchange && ddel) { DesktopCheck(sh->ReplaceRecord(sh, drecord, precord)); DesktopCheck(sh->SetStatusCleared(sh, drecord)); } else if (pchange && !dchange) { DesktopCheck(sh->ReplaceRecord(sh, drecord, precord)); DesktopCheck(sh->SetStatusCleared(sh, drecord)); } else if (pdel && dchange) { add_record_queue(rq, NULL, drecord); DesktopCheck(sh->SetStatusCleared(sh, drecord)); } else if (pdel && !dchange) { DesktopCheck(delete_both (sh, dbhandle, drecord, precord, rec_mod)); DesktopCheck(sh->SetStatusCleared(sh, drecord)); } else if (!pchange && darch) { PilotCheck(dlp_DeleteRecord (sh->sd, dbhandle, 0, precord->recID)); DesktopCheck(sh->SetStatusCleared(sh, drecord)); } else if (!pchange && dchange) { PilotCheck(dlp_DeleteRecord (sh->sd, dbhandle, 0, precord->recID)); add_record_queue(rq, NULL, drecord); DesktopCheck(sh->SetStatusCleared(sh, drecord)); } else if (!pchange && ddel) { DesktopCheck(delete_both (sh, dbhandle, drecord, precord, rec_mod)); DesktopCheck(sh->SetStatusCleared(sh, drecord)); } return result; } /*********************************************************************** * * Function: sync_CopyToPilot * * Summary: Copy all desktop records to the Palm * * Parameters: None * * Returns: 0 on success, non-zero otherwise * ***********************************************************************/ int sync_CopyToPilot(SyncHandler * sh) { int dbhandle, slow = 0, result = 0; DesktopRecord *drecord = NULL; result = open_db(sh, &dbhandle); if (result < 0) goto cleanup; result = sh->Pre(sh, dbhandle, &slow); if (result < 0) goto cleanup; result = dlp_DeleteRecord(sh->sd, dbhandle, 1, 0); if (result < 0) goto cleanup; while (sh->ForEach(sh, &drecord) == 0 && drecord) { result = store_record_on_pilot(sh, dbhandle, drecord, BOTH); if (result < 0) goto cleanup; } result = sh->Post(sh, dbhandle); cleanup: close_db(sh, dbhandle); return result; } /*********************************************************************** * * Function: sync_CopyFromPilot * * Summary: Copy all device records from the Palm to the desktop * * Parameters: None * * Returns: 0 on success, non-zero otherwise * ***********************************************************************/ int sync_CopyFromPilot(SyncHandler * sh) { int dbhandle, i, slow = 0, result = 0; pi_buffer_t *recbuf; DesktopRecord *drecord = NULL; PilotRecord *precord = sync_NewPilotRecord(DLP_BUF_SIZE); result = open_db(sh, &dbhandle); if (result < 0) goto cleanup; result = sh->Pre(sh, dbhandle, &slow); if (result < 0) goto cleanup; while (sh->ForEach(sh, &drecord) == 0 && drecord) { result = sh->DeleteRecord(sh, drecord); if (result < 0) goto cleanup; } i = 0; recbuf = pi_buffer_new(DLP_BUF_SIZE); while (dlp_ReadRecordByIndex(sh->sd, dbhandle, i, recbuf, &precord->recID, &precord->flags, &precord->catID) > 0) { precord->len = recbuf->used; if (precord->len > DLP_BUF_SIZE) precord->len = DLP_BUF_SIZE; memcpy(precord->buffer, recbuf->data, precord->len); result = sh->AddRecord(sh, precord); if (result < 0) { pi_buffer_free(recbuf); goto cleanup; } i++; } pi_buffer_free (recbuf); result = sh->Post(sh, dbhandle); cleanup: close_db(sh, dbhandle); sync_FreePilotRecord (precord); return result; } /*********************************************************************** * * Function: sync_MergeFromPilot_process * * Summary: Try to be intelligent about merging data in a record * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static int sync_MergeFromPilot_process(SyncHandler * sh, int dbhandle, RecordQueue * rq, RecordModifier rec_mod) { int result = 0; RecordQueueList *item; for (item = rq->rql; item != NULL; item = item->next) { if (item->drecord != NULL) { store_record_on_pilot(sh, dbhandle, item->drecord, rec_mod); } else { PilotCheck(dlp_WriteRecord(sh->sd, dbhandle, 0, 0, item->precord->catID, item->precord->buffer, item->precord->len, &item->precord->recID)); } } free_record_queue_list(sh, rq->rql); return result; } /*********************************************************************** * * Function: sync_MergeFromPilot_fast * * Summary: er, fast merge from Palm to desktop * * Parameters: None * * Returns: 0 if success, nonzero otherwise * ***********************************************************************/ static int sync_MergeFromPilot_fast(SyncHandler * sh, int dbhandle, RecordModifier rec_mod) { int result = 0; PilotRecord *precord = sync_NewPilotRecord(DLP_BUF_SIZE); DesktopRecord *drecord = NULL; RecordQueue rq = { 0, NULL }; pi_buffer_t *recbuf = pi_buffer_new(DLP_BUF_SIZE); while (dlp_ReadNextModifiedRec(sh->sd, dbhandle, recbuf, &precord->recID, NULL, &precord->flags, &precord->catID) >= 0) { int count = rq.count; precord->len = recbuf->used; if (precord->len > DLP_BUF_SIZE) precord->len = DLP_BUF_SIZE; memcpy(precord->buffer, recbuf->data, precord->len); ErrorCheck(sh->Match(sh, precord, &drecord)); ErrorCheck(sync_record (sh, dbhandle, drecord, precord, &rq, rec_mod)); if (drecord && rq.count == count) ErrorCheck(sh->FreeMatch(sh, drecord)); } pi_buffer_free(recbuf); sync_FreePilotRecord(precord); result = sync_MergeFromPilot_process(sh, dbhandle, &rq, rec_mod); return result; } /*********************************************************************** * * Function: sync_MergeFromPilot_slow * * Summary: uh, slow merge from Palm to desktop * * Parameters: None * * Returns: 0 if success, nonzero otherwise * ***********************************************************************/ static int sync_MergeFromPilot_slow(SyncHandler * sh, int dbhandle, RecordModifier rec_mod) { int i, parch, psecret, result = 0; pi_buffer_t *recbuf; PilotRecord *precord = sync_NewPilotRecord(DLP_BUF_SIZE); DesktopRecord *drecord = NULL; RecordQueue rq = { 0, NULL }; i = 0; recbuf = pi_buffer_new(DLP_BUF_SIZE); while (dlp_ReadRecordByIndex (sh->sd, dbhandle, i, recbuf, &precord->recID, &precord->flags, &precord->catID) > 0) { int count = rq.count; precord->len = recbuf->used; if (precord->len > DLP_BUF_SIZE) precord->len = DLP_BUF_SIZE; memcpy(precord->buffer, recbuf->data, precord->len); ErrorCheck(sh->Match(sh, precord, &drecord)); /* Since this is a slow sync, we must calculate the flags */ parch = precord->flags & dlpRecAttrArchived; psecret = precord->flags & dlpRecAttrSecret; precord->flags = 0; if (drecord == NULL) { precord->flags = precord->flags | dlpRecAttrDirty; } else { int comp; comp = sh->Compare(sh, precord, drecord); if (comp != 0) { precord->flags = precord->flags | dlpRecAttrDirty; } } if (parch) precord->flags = precord->flags | dlpRecAttrArchived; if (psecret) precord->flags = precord->flags | dlpRecAttrSecret; ErrorCheck(sync_record (sh, dbhandle, drecord, precord, &rq, rec_mod)); if (drecord && rq.count == count) ErrorCheck(sh->FreeMatch(sh, drecord)); i++; } pi_buffer_free(recbuf); sync_FreePilotRecord(precord); result = sync_MergeFromPilot_process(sh, dbhandle, &rq, rec_mod); return result; } /*********************************************************************** * * Function: sync_MergeFromPilot * * Summary: Synchronize the device records to the desktop, but do * not alter the device records * * Parameters: None * * Returns: 0 on success, non-zero otherwise * ***********************************************************************/ int sync_MergeFromPilot(SyncHandler * sh) { int dbhandle, slow = 0, result = 0; result = open_db(sh, &dbhandle); if (result < 0) goto cleanup; result = sh->Pre(sh, dbhandle, &slow); if (result < 0) goto cleanup; if (!slow) { result = sync_MergeFromPilot_fast(sh, dbhandle, DESKTOP); if (result < 0) goto cleanup; } else { result = sync_MergeFromPilot_slow(sh, dbhandle, DESKTOP); if (result < 0) goto cleanup; } result = sh->Post(sh, dbhandle); cleanup: close_db(sh, dbhandle); return result; } /*********************************************************************** * * Function: sync_MergeToPilot_fast * * Summary: Fast merge from desktop to Palm * * Parameters: None * * Returns: 0 on success, non-zero otherwise * ***********************************************************************/ static int sync_MergeToPilot_fast(SyncHandler * sh, int dbhandle, RecordModifier rec_mod) { int result = 0; PilotRecord *precord = NULL; DesktopRecord *drecord = NULL; RecordQueue rq = { 0, NULL }; pi_buffer_t *recbuf = pi_buffer_new(DLP_BUF_SIZE); while (sh->ForEachModified(sh, &drecord) == 0 && drecord) { if (drecord->recID != 0) { precord = sync_NewPilotRecord(DLP_BUF_SIZE); precord->recID = drecord->recID; PilotCheck(dlp_ReadRecordById(sh->sd, dbhandle, precord->recID, recbuf, NULL, &precord->flags, &precord->catID)); precord->len = recbuf->used; if (precord->len > DLP_BUF_SIZE) precord->len = DLP_BUF_SIZE; memcpy(precord->buffer, recbuf->data, precord->len); } ErrorCheck(sync_record (sh, dbhandle, drecord, precord, &rq, rec_mod)); if (precord) sync_FreePilotRecord (precord); precord = NULL; } pi_buffer_free(recbuf); result = sync_MergeFromPilot_process(sh, dbhandle, &rq, rec_mod); return result; } /*********************************************************************** * * Function: sync_MergeToPilot_slow * * Summary: Slow merge from desktop to Palm * * Parameters: None * * Returns: 0 on success, non-zero otherwise * ***********************************************************************/ static int sync_MergeToPilot_slow(SyncHandler * sh, int dbhandle, RecordModifier rec_mod) { int darch, dsecret, result = 0; PilotRecord *precord = NULL; DesktopRecord *drecord = NULL; RecordQueue rq = { 0, NULL }; pi_buffer_t *recbuf = pi_buffer_new(DLP_BUF_SIZE); while (sh->ForEach(sh, &drecord) == 0 && drecord) { if (drecord->recID != 0) { precord = sync_NewPilotRecord(DLP_BUF_SIZE); precord->recID = drecord->recID; PilotCheck(dlp_ReadRecordById(sh->sd, dbhandle, precord->recID, recbuf, NULL, &precord->flags, &precord->catID)); precord->len = recbuf->used; if (precord->len > DLP_BUF_SIZE) precord->len = DLP_BUF_SIZE; memcpy(precord->buffer, recbuf->data, precord->len); } /* Since this is a slow sync, we must calculate the flags */ darch = drecord->flags & dlpRecAttrArchived; dsecret = drecord->flags & dlpRecAttrSecret; drecord->flags = 0; if (precord == NULL) { drecord->flags = drecord->flags | dlpRecAttrDirty; } else { int comp; comp = sh->Compare(sh, precord, drecord); if (comp != 0) { drecord->flags = drecord->flags | dlpRecAttrDirty; } } if (darch) drecord->flags = drecord->flags | dlpRecAttrArchived; if (dsecret) drecord->flags = drecord->flags | dlpRecAttrSecret; ErrorCheck(sync_record (sh, dbhandle, drecord, precord, &rq, rec_mod)); if (precord) sync_FreePilotRecord (precord); precord = NULL; } pi_buffer_free(recbuf); result = sync_MergeFromPilot_process(sh, dbhandle, &rq, rec_mod); return result; } /*********************************************************************** * * Function: sync_MergeToPilot * * Summary: Synchronize the desktop records to the pilot, but do * not alter the desktop records * * Parameters: None * * Returns: 0 on success, non-zero otherwise * ***********************************************************************/ int sync_MergeToPilot(SyncHandler * sh) { int dbhandle, slow = 0, result = 0; result = open_db(sh, &dbhandle); if (result < 0) goto cleanup; result = sh->Pre(sh, dbhandle, &slow); if (result < 0) goto cleanup; if (!slow) { sync_MergeToPilot_fast(sh, dbhandle, PILOT); if (result < 0) goto cleanup; } else { sync_MergeToPilot_slow(sh, dbhandle, PILOT); if (result < 0) goto cleanup; } result = sh->Post(sh, dbhandle); cleanup: close_db(sh, dbhandle); return result; } /*********************************************************************** * * Function: sync_Synchronize * * Summary: Synchronizes the pilot database and the desktop database * * Parameters: None * * Returns: 0 on success, non-zero otherwise * ***********************************************************************/ int sync_Synchronize(SyncHandler * sh) { int dbhandle, slow = 0, result = 0; result = open_db(sh, &dbhandle); if (result < 0) goto cleanup; result = sh->Pre(sh, dbhandle, &slow); if (result != 0) goto cleanup; if (!slow) { result = sync_MergeFromPilot_fast(sh, dbhandle, BOTH); if (result < 0) goto cleanup; result = sync_MergeToPilot_fast(sh, dbhandle, BOTH); if (result < 0) goto cleanup; } else { result = sync_MergeFromPilot_slow(sh, dbhandle, BOTH); if (result < 0) goto cleanup; result = sync_MergeToPilot_slow(sh, dbhandle, BOTH); if (result < 0) goto cleanup; } result = sh->Post(sh, dbhandle); cleanup: close_db(sh, dbhandle); return result; } pilot-link-0.12.5-dfsg/README0000644000175000017500000004005310474052171015763 0ustar rousseaurousseaupilot-link -- Palm Handheld Glue - http://www.pilot-link.org The code and other related files in this distribution are licensed under the GNU General Public License or "GPL", and the GNU Lesser Public License, or "LGPL". See http://www.fsf.org/copyleft/lesser.html for a copy of the LGPL. We will only accept changes into pilot-link if they comply with the proper licensing. There are many companies using pilot-link in their core products and are complying with the license. There are also others companies who don't believe that adhering to the licensing is that important, and violate the license instead. Please do not be one of these companies. This code is under active development. If you would like to contribute to the project, you can contact me, David A. Desrosiers, via email by sending an email to desrod@gnu-designs.com. We can also be reached on Internet Relay Chat, "irc", at irc.pilot-link.org in the channel #pilot-link. I go by the name "setuid" there, and there are a dozen or more helpful users and other developers that hang out there on a regular basis. From the main pilot-link website, you will find many links to helpful documents, HOWTOs, complementary projects that use pilot-link, and other resources to help you get the best use out of your Palm device on your platform of choice; Linux, BSD or Mac OS X. Main website........: http://www.pilot-link.org/ HOWTO Documents.....: http://howto.pilot-link.org/ Code documentation..: http://doxygen.pilot-link.org/ Reporting bugs......: http://bugs.pilot-link.org/ Mailing lists.......: http://lists.pilot-link.org/ We also have several mailing list that you can join. There are mailing lists for development-specific talk, general talk, announcements and commits. On the mailing list webpage, you will have the ability to subscribe and read the past lists archives and posts from thousands of other users. The architecture of pilot-link ------------------------------ There are several core parts of pilot-link: the libraries ------------- pilot-link communicates with Palm handhelds using several methods and functions specific to these devices. In order to facilitate these communications, the functions are stored in a library, which other applications can link to and gain access to those functions. J-Pilot is one example of an application that does exactly this. The core pilot-link libraries are in the 'libpisock' and 'libpisync' subdirectories of the project tree. The standard library for pilot-link is written in the C language, and is very easy to understand and extend if you need to do so. the conduits ------------ In pilot-link, there is also the notion of "conduits", that can be used to communicate directly with your Palm handheld. These "conduits" are the actual applications that you run directly. These are the "userspace" programs. These "conduits" are found in the 'src' subdirectory of the project tree. the language bindings --------------------- Along with the powerful libraries and conduits, pilot-link also provides the ability to communicate with your Palm handheld using your favorite language of choice. Currently, pilot-link includes language "bindings" in Perl, Python, Java, and Tcl. This means you can use those languages, instead of C directly, to talk to your Palm handheld device and communicate with it. Want to write a Java application that uses pilot-link's libraries? Simple! Just use the Java bindings. Want to talk to your Palm device using Perl code? Simply use the Perl bindings. Our hope is that more bindings will be added in the future, such as Ruby or Objective C. the tests --------- In order to make sure the code in pilot-link does what it should, we also include quite a bit of regression tests to check to make sure each function we use is operating properly. These tests will check each of these functions and report any errors or success as they are run. Building the project -------------------- pilot-link is developed primarily on Debian GNU/Linux and FreeBSD. It is expected to build cleanly on any POSIX-compliant platform. Some users have reported success building it under Cygwin on Windows. It will also build cleanly under Apple OSX, if you have the proper development environment installed and configured on your machine. Each of these will be explained in detail below. Building pilot-link on Linux/Unix systems ----------------------------------------- PLEASE READ THIS CAREFULLY! The worst thing you can do is the overly-common misuse of "configure, make, make install" to build and install pilot-link. There are so many customizations you can make to pilot-link, that you should almost never build pilot-link without options. Please make sure you use the --help option to "./configure" to make sure you're enabling all of the options you wish to use. If you have downloaded this code from the website, or as a tarball, simply unpack the tarball and run "./configure" in the top-level directory with your specific arguments. "./configure --help" will describe all of them. If you want to install in some place other than the default location of /usr/local, pass configure an argument such as: $ ./configure --prefix=/home/fred/pilot If configure ran successfully, you should run 'make' to build the software. $ make After the source builds, feel free to play around in the 'src' subdirectory, CAREFULLY. 'dlpsh' and 'pilot-xfer' are probably the most useful programs for you, and also the safest to use non-destructively. Once you have determined that pilot-link works and suits your needs by testing with these programs, switch to the super user, typically "root", to install the conduits, libraries, docs, and headers required for proper operation and development of pilot-link. $ su - root If you wish to include root's environment when you install (STRONGLY recommended), be sure to pass the '-' option when you su to root, as above. AFTER you test that the code works properly, run 'make install' to install the code into your specified prefix, or the default of /usr/local will be used. # make install If you are using a CVS version of pilot-link, you will have to run 'sh ./autogen.sh' instead, from the top-level directory, which will create and bootstrap the "./configure" script for you. You will also need to have your development environment set up, which will require such tools as automake, autoconf, libtool, some system headers, and others to be properly installed and configured on your machine first. If you are running a current Linux or Unix system, these common tools are probably packaged for you. Building pilot-link on OS/2 --------------------------- pilot-link on OS/2 only supports serial devices. USB is unsupported at this time. We would like volunteers to help us out porting pilot-link to work with USB on that platform. If you are skilled and interested in helping, please contact me directly. I can't seem to get the OS to run correctly on any hardware I have, so I need some help there. The steps are fairly straightforward. Run the os2configure.cmd script in the top-level directory. Run make -f Makefile.os2 Play around, CAREFULLY. pilot-xfer is probably the most useful program for you, and also the safest of all to use non-destructively. Also dlpsh is a good app to use to poke around in your Palm device. Run 'make install' if you you have tested thoroughly and are sure pilot-link works well for you. Note on pilot-debug: This program is a work-in-progress, and requires Tcl 7.5 (or greater) and optionally Tk 4.1 (or greater) and/or Readline 2.0. You'll need to modify Makefile to to use Readline 2.0, and if your Tcl or Tk aren't in standard places, you'll need to wiggle configure or the Makefile. You must have installed pilot-link or else run pilot-debug in the pilot-link source directory if you want the fancy images for the Remote UI window. Building pilot-link on Apple OSX/Darwin --------------------------------------- To build pilot-link on Apple OSX ("Darwin") systems, you will need to make sure you have some development tools installed first. These can all be found in the "Fink" package repository hosted on SourceForge. http://fink.sourceforge.net/ Download and install the latest Fink from there onto your OSX system. These will install into the $PREFIX of /sw on your machine. To gain access to the binaries it places in /sw/bin, export the proper /sw/bin path to the BEGINNING of your $PATH environment variable. Do NOT put it at the end: Correct method (for bash) ------------------------- export PATH=/sw/bin:$PATH Incorrect method (for bash) --------------------------- export PATH=$PATH:/sw/bin The reason we need it at the beginning, is so that we can make sure the GNU tools that Fink uses, are chosen first, and not the OSX tools which may carry the same name (libtool is one example). Now that you have Fink installed, and the $PATH exported properly, execute the following command (as root): # fink selfupdate This will update your newly-installed Fink to the latest version available for download. In many cases, the latest version for download may not be the latest version available. 'selfupdate' ensures that it is. From there, you will need to install some GNU tools. Please install the following packages, using the 'fink install ' syntax: automake autoconf libtool libtool-shlibs m4 readline readline-shlibs make When these are installed, you can then unpack pilot-link, and run the ./configure found inside with your custom arguments and parameters. REMEMBER: It is almost always incorrect to run ./configure without passing it any parameters. Please use './configure --help' first to see descriptions of the parameters you will need to use to customize pilot-link for your needs. After running ./configure, you should then be able to build it with the 'make' command. If it builds clean, PLEASE remember to test it first. The syntax to test pilot-link on OSX for USB devices is as follows: -p usb: [arguments..] One example of this is as follows: pilot-xfer --port usb: --list This should list the record and resource databases found on your Palm handheld device. Building pilot-link on Cygwin under Windows ------------------------------------------- FIXME: Unsupported at this time, but may run under Cygwin talking to COM1 through the Cygwin virtual serial port bridging. Some usage notes about pilot-link --------------------------------- read-ical and sync-ical will only run if you have ical-2.x installed and in the path. sync-plan is a full syncronization program, though it has some interesting quirks and requirements. You must running netplan from plan-1.6.1 (probably available at ). Future or later versions may work, but I cannot gaurantee this. Sync-plan does _not_ check the Palm's user name, so be very careful not to sync two Palms to the same Plan database. This will not work in a useful manner, at the moment. Sync-plan leaves a file, that has a name starting with "pilothash", in the current directory. This file must be present for all future syncs between that plan database and that Palm. As sync-plan is a work in progress, please contact me with any problems. The default connection rate is 9600 baud. You are welcome to try higher baud rates (19200, 38400, or 57600) by setting the PILOTRATE environment variable, but various machines have various limitations. (Be careful about 38400 on a Linux box if you've been using setserial to change the multiplier.) pilot-mail (which requires a Palm with the new Mail application, as well as sendmail and/or a POP3 server) is still in the experimental stage. Run with an argument of '-H' for help. While I don't expect it to lose data, (and by default mail is kept on both sides, not deleted) I can not and will not guarantee that you won't. Please back up your UNIX mailbox and Palm mailbox (via pilot-xfer) before experimenting. If you wish, you may easily change the default settings (pop host, password, etc.) for pilot-mail by editing the top of pilot-mail.c, as well as by setting the environment variables indicated in its help. Scott Grosch's "validate" program is included, and can be made via 'make validate', but it may not be of use to anyone but Scott. Debugging notes --------------- Please see doc/README.debugging for more detailed information describing how to debug pilot-link's core protocols and interfaces. Debugging pilot-link will allow us to make pilot-link work better on new devices and with new applications. USB Notes --------- Please see doc/README.usb for more detailed information on configuring your system to use USB-enabled Palm handheld devices using the standard Linux "visor" kernel module. If you would like to try the new libusb code, please see doc/README.libusb for details on how to get that working properly. FreeBSD Notes ------------- Please see doc/README.freebsd for more detailed information on setting up pilot-link to work with FreeBSD systems. In FreeBSD, you may have to set your ACLOCAL_FLAGS="-I /usr/local/share/aclocal/" before running autogen.sh. To use libusb, install the libusb port first and run configure. You will need to set LDFLAGS, CFLAGS and CPPFLAGS to let configure find the library, though. Something like this: $ ACLOCAL_FLAGS="-I /usr/local/share/aclocal/" $ LDFLAGS="-L/usr/local/lib" $ CFLAGS="-I/usr/local/include" $ CPPFLAGS="-I/usr/local/include" $ export ACLOCAL_FLAGS LDFLAGS CFLAGS CPPFLAGS Embedding information --------------------- As of 0.5.0, the headers in pilot-link have been rearranged slightly so that it should be easier and more reliable to use the libpisock.a library in external applications. If you want to use the pilot-link portability layer (configured via autoconf), then include pi-source.h. Otherwise, do not touch this file, as it sets up a mildly complex environment. For all normal operations, simply include the obvious files (pi-file for pdb and .prc file access, pi-dlp for DLP sync functions, etc.). pi-macros contains the portable byte-access routines. Reporting Bugs -------------- Any bugs you find with pilot-link can be easily reported in the online bug-tracking system found at http://bugs.pilot-link.org. From there, any issues reported can be updated, audited, commented on, and resolved. You can also attach files and patches any other relevant items to each bug report, to help our team solve the issues or add the features you report. PLEASE NOTE ----------- Please check the existing bugs in the system FIRST before reporting your bug. There may be an identical report from another user that matches your bug. If you find one that is similar, please add your notes and details to that existing report. Please try to be as specific as possible. If your bug is unique, and does not appear in the system, please fill out a new bug report and remember to be as detailed as possible when filling it out. Make sure to include your operating system, version of pilot-link, Palm handheld type and the PalmOS version running on the device, and any steps required to reproduce the bug. With this information, the developers can be well-informed with the information they'll need to help try to track down and fix your bug. License notes ------------- The utility programs, otherwise known collectively as "conduits" (pilot-xfer, dlpsh, sync-plan, etc.) are licensed for use under the GPL. For more information, please see the file COPYING included in this source tree. The libraries (libpisock, libpisync, libpisock++, and libcc) and the language bindings (Perl, Python, Java, and Tcl) are licensed for use under the LGPL. For more information, please see COPYING.LIB included in this source tree. All contained source is the copyright of its author(s). Please see the copyright notices in the individual files for more information on their individual copyrights. --------------------- Happy Hacking, The pilot-link Team --------------------- pilot-link was originally written by Kenneth Albanowski and others. pilot-link-0.12.5-dfsg/COPYING.LIB0000644000175000017500000006241007307363365016557 0ustar rousseaurousseau GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software -- to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Library 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. 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 library 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 of the License, or (at your option) any later version. This 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library rob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! pilot-link-0.12.5-dfsg/ChangeLog0000644000175000017500000201131411333433233016652 0ustar rousseaurousseau2010-01-16 19:38 judd * libpisock/calendar.c: Made code actually work with pi_buffer_t parameters. 2010-01-16 19:37 judd * tests/calendardb-test.c: Added code to test pack_CalendarAppInfo 2010-01-16 17:54 judd * tests/calendardb-test.c: Changed to pass a pi_buffer_t into unpack_CalendarAppInfo 2010-01-16 17:29 judd * include/pi-calendar.h, libpisock/calendar.c: Changed pack_CalendarAppInfo, and unpack_CalendarAppInfo to use pi_buffer_t to match the APIs of the other applications. 2009-12-10 20:48 judd * src/pilot-xfer.c: If a file is installed to VFS with the same filename as an existing file the tail of the previous file is still intact and at the end of the file. I added a dlp_VFSFileResize call to truncate the file size to zero before writing the new file. 2009-12-01 23:20 judd * src/pilot-xfer.c: fixed minor signed/unsigned compiler warnings 2009-12-01 23:15 judd * src/pilot-xfer.c: Fixed signed/unsigned comparisons that failed with cards larger than 4G or so. The code would incorrectly decide there wasn't enough free space to install. 2009-09-20 17:07 judd * libpisock/calendar.c: location flag was not being used. Added location flag and proper use of it. 2009-06-04 09:38 desrod * src/pilot-schlep.c: Oops, stupid mistake. creat(2) is always the last param. :) (Coding-on-the-train)-- 2009-06-04 09:32 desrod * libpisock/os2serial.c, src/pilot-xfer.c, src/pilot-addresses.c, src/pilot-foto-treo600.c, src/pilot-foto-treo650.c, src/pilot-schlep.c, src/pilot-csd.c, src/pilot-getrom.c, src/pilot-install-memo.c, src/pilot-read-todos.c: Cleaner O_CREAT modes (done right!) Writing explicit numbers for file permissions is bad practice. Not only is it not portable, it also requires that everyone who reads your source to remember what the bits mean. 2009-05-25 00:43 desrod * ChangeLog: Pushing ChangeLog back upstream 2009-05-25 00:40 desrod * include/Makefile.am, tests/Makefile.am: Last-minute fixes before releasing 0.12.4 2009-05-25 00:19 desrod * libpisock/usb.c: Fix for Sony SJ-22 device sync (fixes bug #1957 filed at bugs.pilot-link.org) 2009-05-25 00:16 desrod * doc/xml/pilot-xfer.xml: Updated documentation to reflect a cleaner layout and output (closes bug #1913 in the bugtracker at bugs.pilot-link.org 2009-02-23 06:59 nicholas * ChangeLog, include/pi-contact.h, libpisock/contact.c, tests/contactsdb-test.c: Integrate jpilot's contacts support. See http://lists.pilot-link.org/pipermail/pilot-link-devel/2009-February/001762.html . This is based on: =================================================================== File: jp-contact.c Status: Up-to-date Working revision: 1.10 Repository revision: 1.10 /cvs/jpilot/jpilot_src/jp-contact.c,v Sticky Tag: (none) Sticky Date: (none) Sticky Options: (none) =================================================================== File: jp-pi-contact.h Status: Up-to-date Working revision: 1.5 Repository revision: 1.5 /cvs/jpilot/jpilot_src/jp-pi-contact.h,v Sticky Tag: (none) Sticky Date: (none) Sticky Options: (none) 2009-02-22 17:54 nicholas * bindings/Python/.cvsignore: Add generated file to .cvsignore 2009-02-22 03:08 nicholas * include/Makefile.am, include/pi-blob.h, include/pi-calendar.h, include/pi-location.h, libpisock/Makefile.am, libpisock/blob.c, libpisock/calendar.c, libpisock/location.c, tests/.cvsignore, tests/Makefile.am, tests/calendardb-test.c, tests/locationdb-test.c: Adding CalendarDB support to pilot-link 2009-02-21 18:44 desrod * configure.ac: Adding minor tweak for m4 macro optimizations 2009-02-21 17:22 desrod * libpisock/contact.c: Minor fix for a buffer size miscalculation (from Nicholas Piper) 2009-02-07 11:09 desrod * include/Makefile.am: Adding missing newline at the end of the file. 2009-02-07 11:05 desrod * include/Makefile.am: Just testing a commit, debugging failure in CVS locks. Debian-- 2008-11-06 05:45 desrod * include/: pi-debug.h, pi-threadsafe.h: Cleaning up unnecessary references to config.h here. 2008-11-05 20:14 judd * configure.ac: Added pi-md5.h.in 2008-11-05 20:14 judd * include/pi-md5.h.in: generates pi-md5.h 2008-11-05 20:13 judd * include/pi-md5.h: Now autogenerated from pi-md5.h.in 2008-05-03 16:23 desrod * libpisock/bluetooth.c: Add minor fix for reported segfault when closing down bluetooth connection. This closes bug #1872 2007-12-17 22:03 judd * include/pi-md5.h: UINT32 was broken on 64-bit systems. This should fix it on most systems. 2007-12-17 20:56 desrod * ChangeLog: Increment ChangeLog to test/validate an LDAP permission issue with LockDir 2007-11-22 17:19 desrod * libpisock/usb.c: Implementing a Zire 22 fix from Tom Billiet 2007-11-12 13:42 desrod * configure.ac: Bump for 0.12.4 2007-11-12 13:01 desrod * configure.ac: [no log message] 2007-11-12 12:56 desrod * bindings/Perl/Pilot.xs: Added Aaron's fixes (oof! This has been in the queue for awhile. Sorry Aaron). This closes bug #1448. 2007-11-12 12:30 desrod * NEWS: Bump for 0.12.3 release 2007-11-12 11:58 desrod * ChangeLog: Bump ChangeLog to current 2007-11-12 11:28 desrod * doc/xml/: pilot-foto-treo600.xml, pilot-foto-treo650.xml: Adding manpages for renamed conduits 2007-11-12 11:25 desrod * doc/xml/pilot-link.docbook, doc/xml/pilot-link.xml, src/Makefile.am: Updated for new conduit renames and new manpages to follow them 2007-11-12 09:38 desrod * doc/: man/Makefile.am, xml/pilot-650foto.xml, xml/pilot-treofoto.xml: Removing legacy manpages for renamed conduits 2007-11-12 09:26 desrod * src/: pilot-650foto.c, pilot-read-todos.c, pilot-treofoto.c: Replaced pilot-650foto.c with pilot-foto-treo650.c and pilot-treofoto.c with pilot-foto-treo600.c. Fixed pilot-read-todos.c to allow reading files from outside its own directory 2007-11-09 11:01 desrod * src/pilot-addresses.c: Fix for devices > OS5. Instead of bailing out, we'll just report a warning for now until I can rewrite this. 2007-11-09 10:48 desrod * src/pilot-install-memo.c: Fix for installing files to Memo Pad when they aren't in the current working directory 2007-11-09 09:52 desrod * doc/xml/pilot-read-todos.xml: More clarity about what is and is not supported by this conduit. This closes bug #1837 2007-11-09 09:43 desrod * bindings/Java/Makefile.am: Update to allow parallel builds of pilot-link's Java bindings. This closes bug #1802. 2007-11-09 09:40 desrod * bindings/Java/Makefile.am: Updated Java bindings to fix unescaped vars. This prevents accidental installation of the Java bindings. 2007-11-09 09:35 desrod * configure.ac, m4/bluez.m4: Update to fix the BlueZ detection, also add a --without-bluez option to explicitly disable BlueZ for builds on systems where BlueZ is detected. This also closes bug #17795 and Debian bug 413051 in the Debian BTS 2007-11-09 09:07 desrod * src/pilot-csd.c: Minor fix for -H issue by Philipp Matthias Hahn. This closes #1824 in the pilot-link bugtracker and #430808 in the Debian BTS. 2007-11-09 08:59 desrod * libpisock/usb.c: Fix for Sony NR70 devices by Serguei Miridonov. This closes issue #1830 2007-10-11 12:02 desrod * configure.ac: Fixed a small cosmetic error with PNG detection (resolves bug #1804) 2007-07-30 00:56 desrod * src/pilot-addresses.c: Minor update to attempt to fix the > OS5 detection 2007-07-29 22:09 desrod * configure.ac, doc/Makefile.am: Updated the xsltproc check to only build when xsltproc is found, else skip This resolves bug #1805. 2007-07-29 22:05 desrod * configure.ac: Increment CURRENT and REVISION for libpisync as required by autoconf guidelines: http://sources.redhat.com/autobook/autobook/autobook_91.html 2007-05-31 21:13 desrod * doc/xml/pilot-install-netsync.xml, src/pilot-install-netsync.c: Clarified the network parameters which are allowed for this conduit. 2007-04-16 12:47 desrod * m4/bluez.m4: Trying to clean up the autoconf by moving to .m4 files. BlueZ is a mess :) 2007-03-17 15:15 desrod * src/pilot-install-datebook.c: Missed application of pi_buffer_new(). This closes bug #1789. 2007-03-17 15:04 desrod * bindings/Perl/Makefile.PL.in: Closing bug #1705 from 7-15, patched with Aaron's Perl fix 2007-03-08 12:54 desrod * configure.ac: Oops, that wasn't right, this one is. 2007-03-08 12:37 desrod * configure.ac: Bump pisock to the next level 2007-02-21 12:27 desrod * pilot-link.m4.in: This was here to test and debug a BlueZ problem, which has now been fixed by completely rewriting the autoconf test for it. This also closes pilot-link bug #1793 and Debian bug #411382 2007-02-19 08:59 desrod * libpisock/usb.c: Oops, forgot to commit Matt Davey's fix. This closes bug #1782. 2007-02-18 21:16 desrod * doc/xml/pilot-memos.xml: Closing Debian bug #391984 2007-02-16 23:26 desrod * doc/xml/: docbook.xsl.in, pilot-install-todo.xml, pilot-install-todos.xml: Updated documents: docbook.xsl.in: Can't have comments above the opening declaration pilot-install-todo[s].xml: Reference each other until we merge together 2007-02-16 21:40 desrod * bindings/Tcl/: Makefile.am, pitcl.c: Fixing Tcl bindings so they build clean. I don't know if they'll work, but this should at least fix them so they do not error out and crash a build when enabled. This also closes bug #1488 2007-02-16 13:42 desrod * doc/xml/pilot-link.docbook: Oops, can't have anything above the XML declaration. My bad. 2007-02-16 13:26 desrod * doc/: 60-libpisock.rules, CodingGuidelines, README, README.debugging, README.libusb, README.usb, TODO, xml/Makefile.am, xml/README, xml/catalog.xml.in, xml/docbook.xsl.in, xml/pilot-link.docbook: Updating some docs to add the CVS Id header, added README file at the top level to clarify where things are 2007-02-16 12:28 desrod * configure.ac: Fixes for xsltproc detection. Prior behavior was reporting a nonsensical error and continuing past it. This should report a useful error. 2007-02-16 11:16 desrod * pilot-link.m4.in: Fix unbalanced parens and brackets 2007-02-14 21:18 desrod * configure.ac: Fix for bluetooth argument not being properly passed at configure time. Closes bug #1791 2007-02-14 20:01 desrod * configure.ac, doc/xml/pilot-xfer.xml: Fixing another XML issue, how this got back in there post-release, I don't know, but its fixed and verified now. Also bumped for 0.12.3. 2007-02-11 15:17 desrod * NEWS: Oops! How did I forget to commit this? Bump for 0.12.2 NEWS items. 2007-02-09 17:00 desrod * configure.ac: Minor BlueZ retrofit 2007-02-09 15:52 desrod * doc/TODO, doc/xml/pilot-ietf2datebook.xml, doc/xml/pilot-link.xml, src/Makefile.am, src/ietf2datebook.PL, src/pilot-undelete.PL, src/sync-plan.PL: Updated more userland namespace issues 2007-02-09 15:43 desrod * bindings/Makefile.am: Hans Meine's fix for building Python in a sandbox environment ($DESTDIR) 2007-02-09 15:35 desrod * configure.ac: Minor fix for BlueZ output and config.h sanity 2007-02-09 13:49 desrod * ChangeLog: ChangeLog for 0.12.2 2007-02-09 12:58 desrod * bindings/: README, README.de: More extraneous Java cruft in the wrong dir, reformatted a README 2007-02-09 12:28 desrod * bindings/: libjpisock.h, test.java: More extraneous Java junk in the wrong directory 2007-02-09 12:27 desrod * bindings/: Makefile.am, libjpisock.c: I'm not sure why this was in the bindings directory, it belongs in the Java directory.. removed. 2007-02-09 11:16 desrod * bindings/Perl/Pilot.xs: Fix for using newSVpvn(buf,size) instead of newSVpv(buf,size) where necessary. This closes bug 1736 from Aaron. 2007-02-09 11:11 desrod * include/pi-usb.h: Solaris doesn't directly support uint8_t, uint16_t and uint32_t.. fixed. This closes bug 1759, reported by Jyu. 2007-02-09 11:06 desrod * libpisock/libusb.c: Fix for a missing define for __FUNCTION__ on Solaris; closes bug 1760 submitted by Jyu. 2007-02-09 11:01 desrod * doc/xml/: pilot-link.xml, pilot-schlep.xml: Small fixes here and there, just a dab of salt, a pinch of pepper.. 2007-02-09 10:51 desrod * doc/xml/docbook.xsl.in: We're already importing docbook.xsl which includes xref.xsl and lists.xsl from /html/, there's no reason to do it twice (closes pilot-link bug 1773). 2007-02-09 09:24 desrod * doc/60-libpisock.rules: Fix for a struct change in upstream udev from SYSFS to ATTRS. This also closes Debian bug #410152 for the same issue. 2007-02-08 12:08 desrod * doc/Makefile.am, doc/README.debugging, doc/xml/docbook.xsl.in, doc/xml/ietf2datebook.xml, doc/xml/pilot-650foto.xml, doc/xml/pilot-addresses.xml, doc/xml/pilot-clip.xml, doc/xml/pilot-csd.xml, doc/xml/pilot-debugsh.xml, doc/xml/pilot-dedupe.xml, doc/xml/pilot-dlpsh.xml, doc/xml/pilot-file.xml, doc/xml/pilot-foto.xml, doc/xml/pilot-getram.xml, doc/xml/pilot-getrom.xml, doc/xml/pilot-ietf2datebook.xml, doc/xml/pilot-getromtoken.xml, doc/xml/pilot-hinotes.xml, doc/xml/pilot-install-datebook.xml, doc/xml/pilot-install-expenses.xml, doc/xml/pilot-install-hinote.xml, doc/xml/pilot-install-memo.xml, doc/xml/pilot-install-netsync.xml, doc/xml/pilot-install-todo.xml, doc/xml/pilot-install-todos.xml, doc/xml/pilot-install-user.xml, doc/xml/pilot-link.xml, doc/xml/pilot-memos.xml, doc/xml/pilot-nredir.xml, doc/xml/pilot-read-expenses.xml, doc/xml/pilot-read-ical.xml, doc/xml/pilot-read-notepad.xml, doc/xml/pilot-read-palmpix.xml, doc/xml/pilot-read-screenshot.xml, doc/xml/pilot-read-todos.xml, doc/xml/pilot-read-veo.xml, doc/xml/pilot-reminders.xml, doc/xml/pilot-schlep.xml, doc/xml/pilot-treofoto.xml, doc/xml/pilot-wav.xml, doc/xml/pilot-xfer.xml, include/pi-bluetooth.h, libpisock/bluetooth.c, src/Makefile.am: Documentation bump for 0.12.2 2007-02-08 10:02 desrod * doc/CodingGuidelines: Update to add a few minor clarifications 2007-02-08 09:26 desrod * doc/syncabs.sgml: Removing deprecated syncabs information, needs to be rewritten based on the new changes in the 0.12.x codebase. 2007-02-06 10:17 desrod * libpisock/: libusb.c, usb.c: Fix for a Tungsten X issue. This will detect that the usb control message send has failed and skip the interface until the correct one appears, and the usb control message is successfully send/recieved. 2007-02-05 12:53 desrod * libpisock/Makefile.am: Last-minute fixes for BlueZ support from Daniel Gollub.. fixes an oopsie in userland conduits 2007-02-05 12:21 desrod * configure.ac, libpisock/Makefile.am: Incorporating Daniel Gollub's BlueZ patches and fixes 2007-02-04 20:57 desrod * configure.ac: Fix a small issue with libtool not creating ltmain.sh on a clean checkout 2007-02-04 20:47 desrod * doc/: man/Makefile.am, xml/pilot-read-todos.xml, xml/pilot-read-veo.xml: Fixing up some doc building issues 2007-02-04 18:05 desrod * doc/man/Makefile.am, doc/xml/ietf2datebook.xml, doc/xml/install-datebook.xml, doc/xml/install-hinote.xml, doc/xml/pilot-ietf2datebook.xml, doc/xml/install-memo.xml, doc/xml/install-netsync.xml, doc/xml/install-todo.xml, doc/xml/install-todos.xml, doc/xml/install-user.xml, doc/xml/pilot-650foto.xml, doc/xml/pilot-addresses.xml, doc/xml/pilot-clip.xml, doc/xml/pilot-csd.xml, doc/xml/pilot-debugsh.xml, doc/xml/pilot-dedupe.xml, doc/xml/pilot-dlpsh.xml, doc/xml/pilot-file.xml, doc/xml/pilot-getram.xml, doc/xml/pilot-getrom.xml, doc/xml/pilot-getromtoken.xml, doc/xml/pilot-hinotes.xml, doc/xml/pilot-install-datebook.xml, doc/xml/pilot-install-expenses.xml, doc/xml/pilot-install-hinote.xml, doc/xml/pilot-install-memo.xml, doc/xml/pilot-install-netsync.xml, doc/xml/pilot-install-todo.xml, doc/xml/pilot-install-todos.xml, doc/xml/pilot-install-user.xml, doc/xml/pilot-link.docbook, doc/xml/pilot-link.xml, doc/xml/pilot-memos.xml, doc/xml/pilot-nredir.xml, doc/xml/pilot-read-expenses.xml, doc/xml/pilot-read-ical.xml, doc/xml/pilot-read-notepad.xml, doc/xml/pilot-read-palmpix.xml, doc/xml/pilot-read-screenshot.xml, doc/xml/pilot-reminders.xml, doc/xml/pilot-schlep.xml, doc/xml/pilot-treofoto.xml, doc/xml/pilot-wav.xml, doc/xml/pilot-xfer.xml, doc/xml/read-expenses.xml, doc/xml/read-ical.xml, doc/xml/read-notepad.xml, doc/xml/read-palmpix.xml, doc/xml/read-todos.xml, doc/xml/read-veo.xml, src/Makefile.am, src/install-datebook.c, src/install-hinote.c, src/install-memo.c, src/install-netsync.c, src/install-todo.c, src/install-todos.c, src/install-user.c, src/pilot-install-netsync.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-notepad.c, src/pilot-read-palmpix.c, src/pilot-read-todos.c, src/pilot-read-veo.c, src/read-expenses.c, src/read-ical.c, src/read-notepad.c, src/read-palmpix.c, src/read-todos.c, src/read-veo.c: More renaming of userland conduits to avoid namespace pollution, cleaned the XML manpage sources to align with these changes. Whew! 2007-02-04 16:25 desrod * doc/: README.libusb, README.usb: Documentation cleanup with respect to usb and libusb connections. Needed to update and clarify some minor details reported by users. 2007-02-04 15:28 desrod * configure.ac, bindings/Java/Makefile.am, doc/xml/ietf2datebook.xml, doc/xml/install-datebook.xml, doc/xml/install-hinote.xml, doc/xml/install-memo.xml, doc/xml/install-netsync.xml, doc/xml/install-todo.xml, doc/xml/install-todos.xml, doc/xml/install-user.xml, doc/xml/pilot-addresses.xml, doc/xml/pilot-clip.xml, doc/xml/pilot-debugsh.xml, doc/xml/pilot-dedupe.xml, doc/xml/pilot-dlpsh.xml, doc/xml/pilot-file.xml, doc/xml/pilot-foto.xml, doc/xml/pilot-getram.xml, doc/xml/pilot-getrom.xml, doc/xml/pilot-getromtoken.xml, doc/xml/pilot-hinotes.xml, doc/xml/pilot-ietf2datebook.xml, doc/xml/pilot-install-datebook.xml, doc/xml/pilot-install-expenses.xml, doc/xml/pilot-install-hinote.xml, doc/xml/pilot-install-memo.xml, doc/xml/pilot-install-netsync.xml, doc/xml/pilot-install-todo.xml, doc/xml/pilot-install-todos.xml, doc/xml/pilot-install-user.xml, doc/xml/pilot-link.xml, doc/xml/pilot-memos.xml, doc/xml/pilot-read-expenses.xml, doc/xml/pilot-read-ical.xml, doc/xml/pilot-read-notepad.xml, doc/xml/pilot-read-palmpix.xml, doc/xml/pilot-read-screenshot.xml, doc/xml/pilot-read-todos.xml, doc/xml/pilot-schlep.xml, doc/xml/pilot-treofoto.xml, doc/xml/pilot-wav.xml, doc/xml/pilot-xfer.xml, doc/xml/read-expenses.xml, doc/xml/read-ical.xml, doc/xml/read-notepad.xml, doc/xml/read-palmpix.xml, doc/xml/read-todos.xml, doc/xml/pilot-read-veo.xml, doc/xml/read-veo.xml, include/pi-contact.h, libpisock/contact.c: 1. Updated some of the manpages (more to come) 2. Fixed a DESTDIR problem in bindings/Java/Makefile.am (thanks Hans Meine!) 3. Fixed up a problem with Python detection (thanks Nicholas Piper and Hans Meine) 4. Other miscellaneous cleanup as necessary 2007-02-02 06:55 desrod * libpisock/Makefile.am: Minor fix for building with bluetooth support, was missing a source file declaration. 2007-02-02 06:35 desrod * configure.ac, pilot-link.m4.in, src/pilot-dlpsh.c: Minor tweaks and fixes here and there.. trying to figure out a bluetooth autoconf issue, still unresolved. 2007-01-19 14:30 fpillet * libpisock/Makefile.am: missing WITH_BLUEZ test 2007-01-15 01:11 desrod * src/pilot-addresses.c: Fixed a minor typo, closes bug #1745 (thanks Ludovic!) 2007-01-10 09:07 fpillet * configure.ac, include/pi-bluetooth.h, libpisock/bluetooth.c: Applied dgollub's fix for BlueZ support. Fixes building pilot-link on Mac OS X 2006-12-13 11:06 desrod * doc/README.usb: oops, minor typo when copying the header from README.libusb back in 2006-11-22 17:52 adridg * include/pi-address.h, include/pi-appinfo.h, include/pi-datebook.h, include/pi-memo.h, include/pi-todo.h, libpisock/address.c, libpisock/appinfo.c, libpisock/datebook.c, libpisock/memo.c, libpisock/todo.c: Big batch of constness 2006-11-18 17:43 adridg * libpisock/Makefile.am: WITH_BLUEZ is not defined as a conditional, so automake 1.9.6 barfs on it. Remove it for now, since there's no way to get BLUEZ defined. 2006-11-09 05:26 fpillet * libpisock/darwinusb.c: forgot to undefine DEBUG_USB -- otherwise you get LOTS of traces 2006-11-09 04:42 fpillet * libpisock/darwinusb.c: Added support for high-speed USB devices (large packet sizes, 512 bytes). Somehow, with some versions of OS X on Intel Macs and depending on the machine the bulk packet maxsize may be bigger than 64. In this case the previous code was getting data overruns when reading. 2006-11-07 16:13 adridg * libpisock/: cmp.c, expense.c, socket.c: Warning suppression: use (void) foo for unused parameters foo [which demonstrates that expense packing and unpacking has interesting possible buffer overflows]; initialize the uninitialized; #if 0 unused debugging functions. (KPilot r. 502) 2006-11-07 15:42 adridg * include/pi-address.h, libpisock/address.c, libpisock/dlp.c, libpisock/socket.c: Typedef the Address fields enum so it has a name; add constness to some pack/unpack functions; remove C++ style comments from C code. (KPilot r.500) 2006-11-07 04:05 fpillet * libpisock/socket.c: Fix for RAW mode: protocol_queue_build was trying to build the protocol stack even though RAW mode is not supposed to have one 2006-11-07 04:03 fpillet * libpisock/darwinusb.c: Fix to support PPP connections over USB: recognize ppp_ function for USB endpoints 2006-11-02 09:54 desrod * src/: Makefile.am, pilot-read-screenshot.c: Removed conflicting option (-t == timeout, not type). Will clean up further. 2006-11-02 09:40 desrod * configure.ac, doc/man/Makefile.am, doc/xml/pilot-link.docbook, doc/xml/pilot-link.xml, doc/xml/pilot-read-screenshot.xml, doc/xml/read-screenshot.xml, src/Makefile.am: Screenshot renaming to avoid namespace pollution 2006-11-02 09:34 desrod * src/: pilot-read-screenshot.c, read-screenshot.c: Renamed read-screenshot to avoid some namespace pollution 2006-10-17 09:24 desrod * ChangeLog, doc/README.debugging, doc/README.libusb, doc/README.usb, doc/man/Makefile.am, doc/xml/ietf2datebook.xml, doc/xml/install-datebook.xml, doc/xml/install-hinote.xml, doc/xml/install-memo.xml, doc/xml/install-netsync.xml, doc/xml/install-todo.xml, doc/xml/install-todos.xml, doc/xml/install-user.xml, doc/xml/pilot-650foto.xml, doc/xml/pilot-addresses.xml, doc/xml/pilot-clip.xml, doc/xml/pilot-csd.xml, doc/xml/pilot-debugsh.xml, doc/xml/pilot-dedupe.xml, doc/xml/pilot-dlpsh.xml, doc/xml/pilot-file.xml, doc/xml/pilot-foto.xml, doc/xml/pilot-getram.xml, doc/xml/pilot-getrom.xml, doc/xml/pilot-getromtoken.xml, doc/xml/pilot-hinotes.xml, doc/xml/pilot-ietf2datebook.xml, doc/xml/pilot-install-datebook.xml, doc/xml/pilot-install-expenses.xml, doc/xml/pilot-install-hinote.xml, doc/xml/pilot-install-memo.xml, doc/xml/pilot-install-netsync.xml, doc/xml/pilot-install-todo.xml, doc/xml/pilot-install-todos.xml, doc/xml/pilot-install-user.xml, doc/xml/pilot-link.xml, doc/xml/pilot-memos.xml, doc/xml/pilot-nredir.xml, doc/xml/pilot-read-expenses.xml, doc/xml/pilot-read-ical.xml, doc/xml/pilot-read-notepad.xml, doc/xml/pilot-read-palmpix.xml, doc/xml/pilot-read-screenshot.xml, doc/xml/pilot-read-todos.xml, doc/xml/pilot-read-veo.xml, doc/xml/pilot-reminders.xml, doc/xml/pilot-schlep.xml, doc/xml/pilot-treofoto.xml, doc/xml/pilot-wav.xml, doc/xml/pilot-xfer.xml, doc/xml/read-expenses.xml, doc/xml/read-ical.xml, doc/xml/read-notepad.xml, doc/xml/read-palmpix.xml, doc/xml/read-screenshot.xml, doc/xml/read-todos.xml, doc/xml/read-veo.xml, include/pi-address.h, include/pi-appinfo.h, include/pi-args.h, include/pi-buffer.h, include/pi-cmp.h, include/pi-contact.h, include/pi-datebook.h, include/pi-debug.h, include/pi-dlp.h, include/pi-error.h, include/pi-expense.h, include/pi-file.h, include/pi-foto.h, include/pi-header.h, include/pi-hinote.h, include/pi-inet.h, include/pi-macros.h, include/pi-mail.h, include/pi-md5.h, include/pi-memo.h, include/pi-money.h, include/pi-net.h, include/pi-notepad.h, include/pi-padp.h, include/pi-palmpix.h, include/pi-serial.h, include/pi-slp.h, include/pi-sockaddr.h, include/pi-socket.h, include/pi-source.h, include/pi-sync.h, include/pi-sys.h, include/pi-syspkt.h, include/pi-threadsafe.h, include/pi-todo.h, include/pi-usb.h, include/pi-userland.h, include/pi-util.h, include/pi-veo.h, include/pi-versamail.h, src/install-hinote.c, src/install-memo.c, src/pilot-install-hinote.c, src/pilot-install-memo.c: This is what you do when your flight gets delayed several hours... just some general cleanup and maintenance housecleaning. 2006-10-16 13:57 fpillet * libpisock/socket.c: Following Matt Davey's advice on bluetooth: support: only allow the keyword to be used when bluetooth support is being linked in 2006-10-16 13:46 fpillet * libpisock/socket.c: Fixed port string matching for bt:/bluetooth: (thanks Matt) 2006-10-13 13:36 fpillet * include/pi-bluetooth.h, libpisock/bluetooth.c, include/Makefile.am, libpisock/Makefile.am, libpisock/socket.c: Linux bluetooth support (Bluez) contributed by Bastien Nocera 2006-10-13 05:56 fpillet * libpisock/socket.c: commented out the pi_dumpdata() call in protocol detection as I only use it for debugging this part 2006-10-13 05:52 fpillet * libpisock/: dlp.c, socket.c: dlp_ReadSysInfo() now updates the socket's dlpVersion and maxrecsize. We don't issue a separate dlp_ReadSysInfo() from pi_version() anymore as it can cause big trouble if called from within a DLP call. Tweaked pi_version(), and also tweaked protocol detection again for more accurate serial / bluetooth protocol detection 2006-10-13 05:52 fpillet * libpisock/: padp.c, slp.c: better logging for debug in padp/slp 2006-10-12 10:21 desrod * src/install-datebook.c, src/install-hinote.c, src/install-memo.c, src/install-netsync.c, src/install-todo.c, src/install-todos.c, src/pilot-install-datebook.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-netsync.c, src/pilot-install-todo.c, src/pilot-install-todos.c, src/install-user.c, src/kittykiller.c, src/pd-tty.c, src/pilot-650foto.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-debugsh.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-file.c, src/pilot-foto-treo600.c, src/pilot-foto-treo650.c, src/pilot-foto.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-getromtoken.c, src/pilot-hinotes.c, src/pilot-install-expenses.c, src/pilot-install-user.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-notepad.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-treofoto.c, src/pilot-wav.c, src/pilot-xfer.c, src/plu_args.c, src/read-expenses.c, src/read-ical.c, src/read-notepad.c, libpisock/address.c, libpisock/appinfo.c, libpisock/cmp.c, libpisock/connect.c, libpisock/contact.c, libpisock/darwinusb.c, libpisock/datebook.c, libpisock/debug.c, libpisock/dlp.c, libpisock/expense.c, libpisock/freebsdusb.c, libpisock/hinote.c, libpisock/inet.c, libpisock/libusb.c, libpisock/linuxusb.c, libpisock/mail.c, libpisock/md5.c, libpisock/memo.c, libpisock/money.c, libpisock/net.c, libpisock/notepad.c, libpisock/os2serial.c, libpisock/padp.c, libpisock/palmpix.c, libpisock/pi-buffer.c, libpisock/pi-file.c, libpisock/pi-header.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/sys.c, src/pilot-read-palmpix.c, src/pilot-read-screenshot.c, src/pilot-read-todos.c, src/pilot-read-veo.c, src/read-palmpix.c, src/read-screenshot.c, src/read-todos.c, src/read-veo.c, src/userland.c, libpisock/syspkt.c, libpisock/threadsafe.c, libpisock/todo.c, libpisock/unixserial.c, libpisock/usb.c, libpisock/utils.c, libpisock/veo.c, libpisock/versamail.c: Just some long-needed CVS house-cleaning.. 2006-10-12 09:02 fpillet * libpisock/: address.c, appinfo.c, cmp.c, connect.c, contact.c, datebook.c, debug.c, dlp.c, expense.c, freebsdusb.c, hinote.c, inet.c, libusb.c, linuxusb.c, mail.c, md5.c, memo.c, money.c, net.c, notepad.c, os2serial.c, padp.c, palmpix.c, pi-buffer.c, pi-file.c, pi-header.c, serial.c, slp.c, socket.c, sys.c, syspkt.c, threadsafe.c, todo.c, unixserial.c, usb.c, utils.c, veo.c, versamail.c: Add CVS Id to all source files, I hate it when I get an updated file and I don't know which release it originates from 2006-10-12 09:01 fpillet * libpisock/darwinusb.c: updated comment in USB entry 0830/0061 for Treo 650 2006-10-12 08:32 fpillet * libpisock/dlp.c: Integrated Scott Gruby's big record fix: reading records that have the maximum allowed size could lock up some devices. We now read maxRecordSize-100 and perform a second read if the record is large. Also some casts to make compilers happy, and a safeguard when reading username / password to properly terminate the strings. 2006-10-09 12:43 desrod * libpisock/usb.c: More sanity to catch both Sony models, including the NRxx series handhelds 2006-10-09 12:30 desrod * libpisock/usb.c: Minor fix for Sony Clie detection 2006-09-28 14:43 angusa * doc/xml/pilot-650foto.xml: Manual page for pilot-650foto 2006-09-28 14:38 angusa * ChangeLog: [no log message] 2006-09-28 01:41 angusa * src/Makefile.am: Added pilot-650foto 2006-09-28 01:35 angusa * src/: pilot-650foto.c, pilot-foto-treo650.c: Extract treo 650 photos 2006-09-21 16:23 warp * libpisock/usb.c: Fix a bug where we were looking at override_device instead of known_device[i]. Removed override_device, given that nothing sets it, anywhere. 2006-09-19 16:11 desrod * NEWS, doc/xml/install-expenses.xml, doc/xml/pilot-install-expenses.xml, doc/xml/pilot-link.docbook, doc/xml/pilot-link.xml, src/Makefile.am, src/install-expenses.c, src/pilot-install-expenses.c: More userland renaming to avoid clobbering any potential future binaries that might use or reuse the same naming conventions. Still quite a few left to go in here. 2006-09-04 15:16 desrod * ChangeLog, doc/xml/Makefile.am: Updates for 0.12.1 release 2006-08-28 20:57 desrod * ChangeLog, configure.ac, libpisock/cmp.c, libpisock/padp.c, src/ccexample.cc, src/install-datebook.c, src/install-expenses.c, src/install-hinote.c, src/install-memo.c, src/install-netsync.c, src/install-user.c, src/pilot-install-datebook.c, src/pilot-install-expenses.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-netsync.c, src/pilot-install-user.c: More cleanup for 0.12.1 2006-08-27 14:51 desrod * ChangeLog, include/pi-cmp.h, include/pi-foto.h, libpisock/darwinusb.c, libpisock/dlp.c, libpisock/freebsdusb.c, libpisock/inet.c, libpisock/libusb.c, libpisock/linuxusb.c, tests/dlp-test.c: Minor code cleanup, removing redundant calls to headers, some minor code docs going into place here. 2006-08-27 09:47 desrod * ChangeLog, configure.ac, doc/Makefile.am, doc/xml/Makefile.am: Fix for building as a non-root user with udev rules. They now go into $datadir/pilot-link/udev by default. 2006-08-26 18:53 desrod * NEWS, README, configure.ac, doc/60-libpisock.rules, doc/README.libusb, doc/xml/Makefile.am: A few more last-minute tweaks to get 0.12.0 out the door! 2006-08-25 13:57 desrod * configure.ac: Rolling to a .1 in CVS, preparing for a 0.12.0 release 2006-08-25 13:52 desrod * ChangeLog, configure.ac, doc/Makefile.am, doc/xml/Makefile.am, m4/xslt.m4, src/prc/Makefile.am: Updated a few things to get distcheck to function properly. Sigh. 2006-08-25 11:56 desrod * doc/Makefile.am: Remove extra terminating slash 2006-08-25 11:52 desrod * doc/: Makefile.am, libpisock.rules: CVS surgery to rename the libpisock.rules file to its proper 60-libpisock name per the udev documentation 2006-08-25 11:11 desrod * src/pilot-xfer.c: Oops, that wasn't supposed to go through, just a quick test of something new 2006-08-25 11:09 desrod * doc/60-libpisock.rules, doc/Makefile.am, doc/libpisock.rules, src/pilot-xfer.c: Adding libpisock.rules for the udev/libusb users who wish to try that 2006-08-25 10:54 desrod * ChangeLog, doc/xml/pilot-dlpsh.xml, include/pi-util.h, libpisync/util.c, src/pilot-dlpsh.c, src/pilot-xfer.c, tests/contactsdb-test.c: Some last minute tweaks, and the changes to facilitate the PILOT_CHARSET to be changed with an environment variable from the shell at runtime. 2006-08-25 10:29 desrod * doc/xml/: ietf2datebook.xml, install-datebook.xml, install-expenses.xml, install-hinote.xml, pilot-addresses.xml, pilot-csd.xml, pilot-dlpsh.xml, pilot-ietf2datebook.xml, pilot-install-datebook.xml, pilot-install-expenses.xml, pilot-install-hinote.xml, pilot-getromtoken.xml, pilot-read-notepad.xml, pilot-read-screenshot.xml, pilot-read-veo.xml, read-notepad.xml, read-screenshot.xml, read-veo.xml: More tweaks and pokes for the 0.12.0 release... its coming soon! 2006-08-25 10:06 desrod * doc/: man/Makefile.am, xml/pilot-debugsh.xml, xml/pilot-dlpsh.xml, xml/pilot-hinotes.xml, xml/pilot-memos.xml, xml/pilot-reminders.xml: Some last-minute fixes for the renaming of the userland binaries 2006-08-25 09:44 desrod * src/: install-user.c, pilot-install-user.c: Quick fix to properly parse the args as passed in. We were previously ignoring PILOTPORT in the process. This is a temporary quick-hack fix, and will be removed and replaced with a more elegant solution later. 2006-08-25 09:27 desrod * doc/xml/: debugsh.xml, dlpsh.xml, hinotes.xml, memos.xml, pi-csd.xml, pi-getram.xml, pi-getrom.xml, pi-getromtoken.xml, pi-nredir.xml, pilot-csd.xml, pilot-getram.xml, pilot-getrom.xml, pilot-getromtoken.xml, pilot-link.docbook, pilot-link.xml, pilot-nredir.xml, reminders.xml: Cleaned up the documentation to conform to the userland renaming pass 2006-08-25 09:26 desrod * src/: Makefile.am, debugsh.c, dlpsh.c, hinotes.c, memos.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-getromtoken.c, pi-nredir.c, pi-port.c, pilot-csd.c, pilot-debugsh.c, pilot-dlpsh.c, pilot-getram.c, pilot-getrom.c, pilot-getromtoken.c, pilot-hinotes.c, pilot-memos.c, pilot-nredir.c, pilot-port.c, pilot-reminders.c, reminders.c: Renamed several userland binaries to avoid clobbering of other application binaries when installed 2006-05-31 13:59 desrod * ChangeLog, configure.ac, bindings/Perl/Pilot.pm, bindings/Perl/Pilot.xs, bindings/Python/README, bindings/Python/setup-standalone.py.in, bindings/Python/setup.py.in, bindings/Python/src/general-maps.i, bindings/Python/src/helperfuncs.i, bindings/Python/src/pi-dlp-maps.i, bindings/Python/src/pi-error.i, bindings/Python/src/pi-file-maps.i, bindings/Python/src/pi-socket-maps.i, doc/man/README, doc/xml/debugsh.xml, doc/xml/dlpsh.xml, doc/xml/hinotes.xml, doc/xml/ietf2datebook.xml, doc/xml/install-datebook.xml, doc/xml/install-expenses.xml, doc/xml/install-hinote.xml, doc/xml/install-memo.xml, doc/xml/install-netsync.xml, doc/xml/install-todo.xml, doc/xml/install-todos.xml, doc/xml/install-user.xml, doc/xml/memos.xml, doc/xml/pi-csd.xml, doc/xml/pi-getram.xml, doc/xml/pi-getrom.xml, doc/xml/pi-getromtoken.xml, doc/xml/pi-nredir.xml, doc/xml/pilot-addresses.xml, doc/xml/pilot-clip.xml, doc/xml/pilot-csd.xml, doc/xml/pilot-debugsh.xml, doc/xml/pilot-dedupe.xml, doc/xml/pilot-dlpsh.xml, doc/xml/pilot-file.xml, doc/xml/pilot-foto.xml, doc/xml/pilot-getram.xml, doc/xml/pilot-getrom.xml, doc/xml/pilot-getromtoken.xml, doc/xml/pilot-hinotes.xml, doc/xml/pilot-ietf2datebook.xml, doc/xml/pilot-install-datebook.xml, doc/xml/pilot-install-expenses.xml, doc/xml/pilot-install-hinote.xml, doc/xml/pilot-install-memo.xml, doc/xml/pilot-install-netsync.xml, doc/xml/pilot-install-todo.xml, doc/xml/pilot-install-todos.xml, doc/xml/pilot-install-user.xml, doc/xml/pilot-memos.xml, doc/xml/pilot-nredir.xml, doc/xml/pilot-read-expenses.xml, doc/xml/pilot-read-ical.xml, doc/xml/pilot-read-notepad.xml, doc/xml/pilot-read-palmpix.xml, doc/xml/pilot-read-screenshot.xml, doc/xml/pilot-read-todos.xml, doc/xml/pilot-read-veo.xml, doc/xml/pilot-reminders.xml, doc/xml/pilot-schlep.xml, doc/xml/pilot-treofoto.xml, doc/xml/pilot-wav.xml, doc/xml/pilot-xfer.xml, doc/xml/read-expenses.xml, doc/xml/read-ical.xml, doc/xml/read-notepad.xml, doc/xml/read-palmpix.xml, doc/xml/read-screenshot.xml, doc/xml/read-todos.xml, doc/xml/read-veo.xml, doc/xml/reminders.xml, libpisock/darwinusb.c, libpisync/sync.c, libpisync/util.c, m4/socklen.m4, src/debugsh.c, src/dlpsh.c, src/pilot-debugsh.c, src/pilot-dlpsh.c, src/hinotes.c, src/ietf2datebook.PL, src/install-datebook.c, src/install-expenses.c, src/install-hinote.c, src/install-memo.c, src/install-netsync.c, src/install-todo.c, src/install-todos.c, src/install-user.c, src/kittykiller.c, src/memos.c, src/pd-tty.c, src/pi-csd.c, src/pi-getram.c, src/pi-getrom.c, src/pi-getromtoken.c, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-dedupe.c, src/pilot-file.c, src/pilot-foto-treo600.c, src/pilot-foto.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-getromtoken.c, src/pilot-hinotes.c, src/pilot-ietf2datebook.pl, src/pilot-install-datebook.c, src/pilot-install-expenses.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-netsync.c, src/pilot-install-todo.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-notepad.c, src/pilot-read-palmpix.c, src/pilot-read-screenshot.c, src/pilot-read-todos.c, src/pilot-read-veo.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-treofoto.c, src/pilot-wav.c, src/pilot-xfer.c, src/plu_args.c, src/read-expenses.c, src/read-ical.c, src/read-notepad.c, src/read-palmpix.c, src/read-screenshot.c, src/read-todos.c, src/read-veo.c, src/reminders.c, src/userland.c, tests/dlp-test.c, tests/vfs-test.c: Correcting FSF permanent address in all source files to bring to current. This is also reflected in the following GNOME bug entry: http://mail.gnome.org/archives/gtk-devel-list/2006-March/msg00087.html 2006-05-31 13:49 desrod * include/: pi-dlp.h, pi-file.h, pi-syspkt.h, pi-threadsafe.h, pi-versamail.h: Oops, forgot to commit these with the last batch. Good catch, Nicholas! 2006-05-24 14:49 desrod * libpisock/: dlp.c, expense.c, hinote.c, palmpix.c, pi-file.c, socket.c, syspkt.c, utils.c, versamail.c: Bunchafixes here, code cleanup, var renames, some oddball code taken out, fixing up some globals and other obvious faux pas. 2006-05-09 16:19 desrod * libpisock/serial.c: Minor fix where s_poll returns 0 on success, and the previous behavior would assume the packet was dropped. 2006-04-22 11:47 desrod * src/pilot-xfer.c: Just adding some notes, so I don't forget what needs to be added in the next point release. 2006-04-14 14:52 desrod * libpisock/libusb.c: Applied patch from Jijun Yu, fixes issue #1578 2006-04-14 14:50 desrod * libpisock/socket.c: Clean up empty else clause 2006-04-14 14:47 desrod * src/pilot-clip.c: Reformatting and some type renaming to avoid shadowing globals 2006-04-14 14:46 desrod * src/: pi-getrom.c, pilot-getrom.c: Just some minor (very minor) reformatting of the output. 2006-04-14 14:43 desrod * src/pilot-addresses.c: Added code to exit (for now) when an OS5 device is found. 2006-04-14 14:42 desrod * src/: pilot-sync-plan.pl, sync-plan.PL: Aaron's patch for bug 1535. Thanks Aaron! 2006-04-14 13:16 desrod * include/pi-userland.h, libpisock/socket.c, src/memos.c, src/pilot-memos.c, src/pilot-schlep.c, src/pi-nredir.c, src/pilot-nredir.c, src/pilot-xfer.c: Minor cleanup to fix some small buglets and warnings. No Breakage++ 2006-04-05 14:18 desrod * configure.ac: Minor fix when checking xslt in a CVS checked-out tree 2006-03-30 14:38 desrod * include/pi-socket.h: Minor typo fixed up 2006-03-30 14:26 desrod * include/pi-dlp.h: Minor doc cleanup, fixes doxygen output buglet 2006-03-24 15:11 desrod * bindings/Python/: NEWS, README, src/pisock.py, src/pisock_wrap.c: Some cleanup in the Python tree 2006-03-24 15:02 desrod * configure.ac, m4/python.m4: A better, cleaner, smaller Python check. This time we check if the user passes --with-python, THEN check for Python.h, so we can build the extension. If Python.h is NOT found, we disable python, even if the user passes the option to flag it on. 2006-03-24 14:45 neilw * ChangeLog, doc/xml/pilot-schlep.xml: Fix bug 1545, pilot-schlep summary 2006-03-24 14:24 neilw * ChangeLog, src/memos.c, src/pilot-memos.c: fix typo 2006-03-24 13:11 desrod * ChangeLog: Updated ChangeLog 2006-03-24 12:58 desrod * configure.ac, m4/python.m4: Minor fix for python to check for Python.h when python is flagged on 2006-03-17 00:10 desrod * src/pilot-sync-plan.pl, src/sync-plan.PL, bindings/Makefile.am: These slipped through the cracks.. (thanks Aaron for catching me asleep at the wheel again =) 2006-03-15 07:44 desrod * bindings/Perl/: Makefile.PL.in, Pilot.pm, Pilot.xs: Forgot that these needed to go with the others. DOH! 2006-03-14 12:43 desrod * ChangeLog, configure.ac: Rolling up ChangeLog and configure.ac in prep for a 0.12.0 final release 2006-03-14 12:19 desrod * bindings/Java/: MidiMgr.java, test.java, org/gnu/pilotlink/Record.java: Some minor Java fixes. This needs a revisit, there are quite a few places in here where some OOP constructs could keep things much cleaner. 2006-03-14 11:34 neilw * ChangeLog, configure.ac: Use CVS check instead of file check for manpage build 2006-03-14 10:58 desrod * configure.ac, bindings/Perl/h2xs-pilot-link, m4/xslt.m4: Fixes for userland conduits, xsltproc checks, and a big Perl commit (thanks Aaron!) 2006-02-27 18:22 neilw * ChangeLog: ChangeLog 2006-02-27 18:13 neilw * doc/xml/: README, debugsh.xml, dlpsh.xml, hinotes.xml, install-datebook.xml, install-expenses.xml, install-hinote.xml, install-memo.xml, install-netsync.xml, install-todo.xml, install-todos.xml, install-user.xml, memos.xml, pi-csd.xml, pi-getram.xml, pi-getrom.xml, pi-getromtoken.xml, pi-nredir.xml, pilot-addresses.xml, pilot-archive.xml, pilot-clip.xml, pilot-csd.xml, pilot-debugsh.xml, pilot-dedupe.xml, pilot-dlpsh.xml, pilot-file.xml, pilot-foto.xml, pilot-getram.xml, pilot-getrom.xml, pilot-getromtoken.xml, pilot-hinotes.xml, pilot-install-datebook.xml, pilot-install-expenses.xml, pilot-install-hinote.xml, pilot-install-memo.xml, pilot-install-netsync.xml, pilot-install-todo.xml, pilot-install-todos.xml, pilot-install-user.xml, pilot-memos.xml, pilot-nredir.xml, pilot-read-expenses.xml, pilot-read-ical.xml, pilot-read-notepad.xml, pilot-read-palmpix.xml, pilot-read-screenshot.xml, pilot-read-todos.xml, pilot-read-veo.xml, pilot-reminders.xml, pilot-schlep.xml, pilot-treofoto.xml, pilot-wav.xml, pilot-xfer.xml, read-expenses.xml, read-ical.xml, read-notepad.xml, read-palmpix.xml, read-screenshot.xml, read-todos.xml, read-veo.xml, reminders.xml: Update options list handling in each manpage to a more consistent formatting. 2006-02-27 18:10 neilw * doc/xml/docbook.xsl.in: Fix error reported by doclifter by Eric Raymond. %r/%p %s 2006-02-27 18:09 neilw * doc/xml/Makefile.am: Remove recursive loop. 2006-02-27 18:08 neilw * configure.ac: Fix test to look for a file, not directory. Fix the xsltproc check to find Mac OSX stylesheets. 2006-02-25 10:44 fpillet * libpisock/darwinusb.c: removed debug extended USB debug flag for release 2006-02-25 10:34 fpillet * include/pi-dlp.h: doc typo fixed 2006-02-23 04:05 fpillet * libpisock/pi-file.c: Flags was modified before being initialized, rendering the code useless 2006-02-13 09:52 fpillet * libpisock/darwinusb.c: tweaks for universal binary (intel / powerpc) compilation 2006-02-13 09:51 fpillet * libpisock/pi-header.c: updated copyright date range (who knows, we may release 0.12 before 2007) 2006-02-13 09:50 fpillet * libpisock/cmp.c: removed unused variable cmp_version 2006-01-26 07:34 fpillet * include/pi-userland.h, src/plu_args.c, src/userland.c: Patch coming from bug #1585: add new timeout option to userland tools so serial connection timeout issues can be investigated (matt Davey) 2006-01-26 06:06 fpillet * libpisock/serial.c: Patch for bug #1591 provided by Matt davey 2006-01-21 16:20 adridg * libpisock/: debug.c, memo.c: Reduce warnings: don't assign NULL to the bytes in a pi_buffer_t, and use the non-deprecated dumpline() function. 2006-01-13 09:20 warp * libpisock/libusb.c: Work around a change in behavior in the /proc/bus/usb to /dev/bus/usb change. 2006-01-02 05:18 fpillet * libpisock/darwinusb.c: big scary update: added support for TX and LifeDrive, initial support for KLSI (not complete yet but infrastructure is there), reworked the way a connection is declared live to better cope with clunky PalmOne devices like the LD 2005-12-28 03:39 warp * libpisock/libusb.c: Fix the index/control_index goof. Deals with #1577. 2005-10-19 20:43 warp * libpisock/libusb.c: Do this a little more portably. 2005-10-19 17:37 adridg * libpisock/datebook.c: Make documentation match reality. Some time back, we argued about whether these documentation bits should be in the header files -- which users of the p-l API can see -- or hidden in the C files. Was there ever a resolution of that? 2005-10-17 20:40 warp * libpisock/libusb.c: Fix a rare buffer leak in the libusb code. Put in an evil kluge for the case where we have a close, but the read call is wedged. 2005-10-17 17:53 warp * libpisock/usb.c: Er, try this. 2005-10-17 17:47 warp * libpisock/usb.c: Try to make the connect interface actually function with the usb backend. No promises that it actually _does_ though. 2005-10-17 16:14 adridg * include/pi-args.h, include/pi-buffer.h, include/pi-cmp.h, include/pi-contact.h, include/pi-debug.h, include/pi-dlp.h, include/pi-error.h, include/pi-file.h, include/pi-header.h, include/pi-inet.h, include/pi-macros.h, include/pi-net.h, include/pi-padp.h, include/pi-serial.h, include/pi-slp.h, include/pi-sockaddr.h, include/pi-socket.h, include/pi-source.h, include/pi-sync.h, include/pi-sys.h, include/pi-syspkt.h, include/pi-threadsafe.h, include/pi-usb.h, include/pi-userland.h, include/pi-util.h, libpisock/address.c, libpisock/appinfo.c, libpisock/cmp.c, libpisock/connect.c, libpisock/contact.c, libpisock/darwinusb.c, libpisock/datebook.c, libpisock/debug.c, libpisock/dlp.c, libpisock/expense.c, libpisock/freebsdusb.c, libpisock/hinote.c, libpisock/inet.c, libpisock/libusb.c, libpisock/linuxusb.c, libpisock/mail.c, libpisock/md5.c, libpisock/memo.c, libpisock/money.c, libpisock/net.c, libpisock/notepad.c, libpisock/os2serial.c, libpisock/padp.c, libpisock/palmpix.c, libpisock/pi-buffer.c, libpisock/pi-file.c, libpisock/pi-header.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/sys.c, libpisock/syspkt.c, libpisock/threadsafe.c, libpisock/todo.c, libpisock/unixserial.c, libpisock/usb.c, libpisock/utils.c, libpisock/veo.c, libpisock/versamail.c: Fix the address of the FSF in lots (but surely not all) places. 2005-10-10 17:06 adridg * libpisock/dlp.c: Also #define TraceX to empty when no debug 2005-10-10 16:58 adridg * libpisock/dlp.c: Typo - what's a ; doing there? 2005-10-10 16:57 adridg * libpisock/freebsdusb.c: CONBK is deprecated and gone 2005-10-10 16:52 adridg * include/pi-sys.h: Fix include guard for cases where you want syspkt and sys.h 2005-08-27 05:17 fpillet * libpisock/padp.c: Integrated fix provided by Marcelo Jimenez: padp's freeze_txid was not initialized 2005-08-17 11:12 desrod * ChangeLog, configure.ac, bindings/Java/Makefile.am, bindings/Java/libjpisock.c, libpisock/usb.c: Fixing up some java compilation problems on gcj (Bernhard Rosenkraenzer) 2005-08-16 12:57 desrod * src/pilot-xfer.c: Clean out an extra double-free that crashes on merge() (resolves #1529 from 'than') 2005-07-20 18:13 fpillet * libpisock/darwinusb.c: Reset the data toggle on error, it helps with some lockups on T5 and probably other devices 2005-07-20 08:17 fpillet * libpisock/serial.c: Missing local variable definition 2005-07-20 06:15 fpillet * libpisock/serial.c: shield against losing the first packet in serial 2005-07-20 06:13 fpillet * libpisock/socket.c: log invalid protocol in socket.c 2005-07-20 06:13 fpillet * libpisock/unixserial.c: minor fix to unixserial 2005-07-20 06:08 fpillet * libpisock/dlp.c: tweaked dlp_CallApplication logs 2005-07-13 17:42 desrod * ChangeLog, libpisock/linuxusb.c: Oops, missed two last CONBK calls. Fixed. 2005-07-06 12:26 fpillet * bindings/Python/src/pi-file-maps.i: oops.. left a minor error there 2005-07-06 12:26 fpillet * bindings/Python/src/pi-file-maps.i: allow other threads to run while dlp_FindDB performs its duty 2005-07-06 12:25 fpillet * include/pi-file.h, libpisock/pi-file.c: Don't use a temporary file for pi_file creation anymore. Instead, we use a pi_buffer_t* which both is faster and makes more sense (and also because I discovered that Python doesn't like tmpfile() being used, for some reason) 2005-07-06 06:03 fpillet * libpisock/darwinusb.c: updated to new defines from pi-source.h 2005-07-05 17:11 desrod * ChangeLog, include/pi-dlp.h, include/pi-source.h, include/pi-versamail.h, libpisock/dlp.c, libpisock/inet.c, libpisock/libusb.c, libpisock/net.c, libpisock/padp.c, libpisock/serial.c, libpisock/socket.c, libpisock/unixserial.c, libpisock/usb.c, libpisock/versamail.c, src/pi-nredir.c, src/pilot-nredir.c, src/plu_args.c, src/userland.c: Bright lights! Bright lights! Just closing some shadowed globals.. The other bit might break things temporarily, but it keeps the names clean and informative when being read. Other smallish fixes here. Builds clean. 2005-07-05 15:49 desrod * libpisock/socket.c: Removing extraneous pi_dumpdata() call 2005-07-05 15:43 desrod * ChangeLog, bindings/Perl/Makefile.PL.in: Fixing up a divide by zero error (and updating ChangeLog) 2005-07-04 09:12 fpillet * libpisock/darwinusb.c: Fixed a bug that could keep disconnected entry stay in the list forever if deconnection occured during u_poll() 2005-07-04 05:03 fpillet * libpisock/socket.c: Fixed protocol detection for cases where unixserial (with USB handhelds) is losing the first 6 bytes sent by the device 2005-07-03 17:40 neilw * doc/Makefile.am: removing README.freebsd from make dist now that it has been removed from CVS 2005-07-03 14:41 neilw * ChangeLog, configure.ac, doc/Makefile.am: improving conditional xsltproc manpage builds 2005-06-28 14:13 desrod * bindings/Perl/Makefile.PL.in: Attempt to fix and close issue #900. Still need to poke at this a bit more to get the other macros supported (MANDIR, DATADIR, BINDIR, and so on). 2005-06-28 13:40 desrod * ChangeLog, include/pi-address.h, include/pi-appinfo.h, include/pi-datebook.h, include/pi-memo.h, include/pi-todo.h, libpisync/sync.c: Update tree to handle more consistant C++ and preprocessor behavior for authors that are using C++ to talk to our API. 2005-06-28 13:31 fpillet * libpisock/: address.c, contact.c, datebook.c, todo.c: Loosened checks on pi_buffer_t, fixes bug #1508 2005-06-26 14:41 desrod * libpisock/address.c: Fixup for writing garbage memory to Palm, resolves #1509 from Mark G. Adams 2005-06-26 14:23 desrod * bindings/Perl/Pilot.xs: Added warning fixes from Aaron Kaplan (closes issue #1499) 2005-06-23 10:13 desrod * ChangeLog: Updated ChangeLog 2005-06-23 09:57 desrod * src/: pilot-read-palmpix.c, read-palmpix.c: Minor patch from Goffredo to write out the file with the same date and time as the photo itself. 2005-06-22 08:28 fpillet * libpisock/linuxusb.c: linuxusb doesn't implement wait_for_device() 2005-06-22 07:40 fpillet * include/pi-usb.h, libpisock/libusb.c, libpisock/usb.c: renamed poll_device() to wait_for_device() 2005-06-22 07:39 fpillet * libpisock/darwinusb.c: Fixed an issue I introduced recently with the matching notification not being properly armed. Added support for the new wait_for_device() semantics. 2005-06-21 14:06 desrod * doc/xml/: dlpsh.xml, hinotes.xml, ietf2datebook.xml, install-datebook.xml, install-expenses.xml, install-hinote.xml, install-memo.xml, install-netsync.xml, install-todo.xml, install-user.xml, memos.xml, pi-getram.xml, pi-getrom.xml, pilot-dlpsh.xml, pilot-foto.xml, pilot-getram.xml, pilot-getrom.xml, pilot-hinotes.xml, pilot-ietf2datebook.xml, pilot-install-datebook.xml, pilot-install-expenses.xml, pilot-install-hinote.xml, pilot-install-memo.xml, pilot-install-netsync.xml, pilot-install-todo.xml, pilot-install-user.xml, pilot-memos.xml, pilot-read-expenses.xml, pilot-read-ical.xml, pilot-read-notepad.xml, pilot-read-palmpix.xml, read-expenses.xml, read-ical.xml, read-notepad.xml, read-palmpix.xml: Minor adjustments to correct attribution on manpages 2005-06-21 13:54 desrod * doc/xml/: debugsh.xml, dlpsh.xml, hinotes.xml, ietf2datebook.xml, install-datebook.xml, install-expenses.xml, install-hinote.xml, install-memo.xml, install-netsync.xml, install-todo.xml, install-todos.xml, install-user.xml, memos.xml, pi-csd.xml, pi-getram.xml, pi-getrom.xml, pi-getromtoken.xml, pi-nredir.xml, pilot-addresses.xml, pilot-archive.xml, pilot-clip.xml, pilot-csd.xml, pilot-debugsh.xml, pilot-dedupe.xml, pilot-dlpsh.xml, pilot-file.xml, pilot-foto.xml, pilot-getram.xml, pilot-getrom.xml, pilot-getromtoken.xml, pilot-hinotes.xml, pilot-ietf2datebook.xml, pilot-install-datebook.xml, pilot-install-expenses.xml, pilot-install-hinote.xml, pilot-install-memo.xml, pilot-install-netsync.xml, pilot-install-todo.xml, pilot-install-todos.xml, pilot-install-user.xml, pilot-link.xml, pilot-memos.xml, pilot-nredir.xml, pilot-read-expenses.xml, pilot-read-ical.xml, pilot-read-notepad.xml, pilot-read-palmpix.xml, pilot-read-screenshot.xml, pilot-read-todos.xml, pilot-read-veo.xml, pilot-reminders.xml, pilot-schlep.xml, pilot-treofoto.xml, pilot-wav.xml, pilot-xfer.xml, read-expenses.xml, read-ical.xml, read-notepad.xml, read-palmpix.xml, read-screenshot.xml, read-todos.xml, read-veo.xml, reminders.xml: More cleanup, reformatted the manpages to try to unify the structure a bit, so they can be further templated out at a later time. 2005-06-21 10:37 desrod * configure.ac: Oops... was testing something and it slipped through. 2005-06-21 10:35 desrod * doc/README.debugging, doc/README.freebsd, doc/README.usb, doc/TODO, doc/doxygen.cfg.in, doc/doxygen_main_page.c, doc/dox/doxygen.css, doc/dox/footer.html, doc/dox/header.html, libpisock/socket.c: Documentation fixes, doxygen fixes, minor peeks and pokes here and there. 2005-06-21 09:28 neilw * Makefile.am, doc/Makefile.am: Ooops! copied the Makefile into the parent folder 2005-06-21 09:07 desrod * Makefile.am, configure.ac, doc/Makefile.am, doc/README.debugging, doc/doxygen.cfg.in: Fixing up some build breakage for building manpages from XML targets 2005-06-21 05:58 neilw * ChangeLog, Makefile.am, configure.ac: skip xml build when not from CVS 2005-06-21 03:41 neilw * ChangeLog, configure.ac, doc/.cvsignore, doc/Makefile.am, doc/doxygen.cfg.in, doc/doxygen_main_page.c, doc/man/Makefile.am, doc/man/README, doc/man/addresses.1.in, doc/man/debugsh.1.in, doc/man/dlpsh.1.in, doc/man/hinotes.1.in, doc/man/ietf2datebook.1.in, doc/man/install-datebook.1.in, doc/man/install-expenses.1.in, doc/man/install-hinote.1.in, doc/man/install-memo.1.in, doc/man/install-netsync.1.in, doc/man/install-todo.1.in, doc/man/install-todos.1.in, doc/man/install-user.1.in, doc/man/memos.1.in, doc/man/pi-csd.1.in, doc/man/pi-getram.1.in, doc/man/pi-getrom.1.in, doc/man/pi-getromtoken.1.in, doc/man/pi-nredir.1.in, doc/man/pilot-addresses.1.in, doc/man/pilot-archive.1.in, doc/man/pilot-clip.1.in, doc/man/pilot-dedupe.1.in, doc/man/pilot-file.1.in, doc/man/pilot-foto.1.in, doc/man/pilot-link.7.in, doc/man/pilot-schlep.1.in, doc/man/pilot-treofoto.1.in, doc/man/pilot-wav.1.in, doc/man/pilot-xfer.1.in, doc/man/read-expenses.1.in, doc/man/read-ical.1.in, doc/man/read-notepad.1.in, doc/man/read-palmpix.1.in, doc/man/read-screenshot.1.in, doc/man/read-todos.1.in, doc/man/read-veo.1.in, doc/man/reminders.1.in, doc/xml/.cvsignore, doc/xml/Makefile.am, doc/xml/README, doc/xml/catalog.xml.in, doc/xml/docbook.xsl.in, doc/xml/install-todos.xml, doc/xml/pilot-foto.xml, doc/xml/pilot-install-todos.xml, doc/xml/pilot-link.docbook, doc/xml/pilot-read-screenshot.xml, doc/xml/pilot-read-veo.xml, doc/xml/pilot-schlep.xml, doc/xml/pilot-treofoto.xml, doc/xml/pilot-wav.xml, doc/xml/read-screenshot.xml, doc/xml/read-veo.xml: Auto-generation of manpages using xsltproc, only in CVS builds 2005-06-17 09:49 desrod * src/: install-netsync.c, pilot-install-netsync.c: Fixed fubar'd example 2005-06-17 06:38 warp * include/pi-usb.h, libpisock/libusb.c, libpisock/usb.c: Add poll_device to the USB implementation structure, along with code to call it if it's set in usb.c. Move some code around in libusb.c (and add a bit of new code) to support poll_device, we will now loop trying to find a device instead of dying if none exists. Fix a minor bug in libusb's read loop dealing with timeout amounts. 2005-06-17 06:34 fpillet * libpisock/libusb.c: changed some protos, return PI_ERR_SOCK_DISCONNECTED when needed 2005-06-17 06:22 fpillet * libpisock/utils.c, include/pi-util.h: Added pi_timeout_to_timespec(), pi_timespec_to_timeout() and pi_timeout_expired() functions 2005-06-17 05:40 fpillet * include/pi-cmp.h: added type for extended CMP packets (not supported yet) 2005-06-16 17:53 fpillet * libpisock/socket.c: Left a bad bug: buffer wasn't clear before re-peeking to the message 2005-06-16 17:21 fpillet * libpisock/socket.c: Loosened rules for recognizing NET packets so that it works on Linux even if we missed the initial packet 2005-06-16 11:42 desrod * src/: debugsh.c, pilot-debugsh.c: Fixed minor typo... oops! 2005-06-16 06:05 fpillet * libpisock/: darwinusb.c, inet.c, serial.c: propagate PADP long packet format support 2005-06-16 05:24 fpillet * libpisock/cmp.c, libpisock/darwinusb.c, libpisock/usb.c, include/pi-cmp.h, include/pi-socket.h: more work on the long packet thing 2005-06-16 05:23 fpillet * libpisock/padp.c, include/pi-padp.h: moving towards full support for long packet format both ways, fixed a long packet fmt issue 2005-06-15 10:09 fpillet * darwin/build_framework.sh, include/pi-header.h, include/pi-padp.h, libpisock/contact.c, libpisock/dlp.c, libpisock/libusb.c, libpisock/net.c, libpisock/sys.c, src/debugsh.c, src/install-memo.c, src/install-todos.c, src/pi-csd.c, src/pi-getrom.c, src/pi-port.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-debugsh.c, src/pilot-getrom.c, src/pilot-install-memo.c, src/pilot-install-todos.c, src/pilot-port.c, src/pilot-read-expenses.c, src/read-expenses.c, tests/packers.c, tests/vfs-test.c: use pi_dumpdata() instead of dumpdata(). Some cleanup for compilation warnings. 2005-06-15 10:08 fpillet * libpisock/darwinusb.c: ongoing KLSI work 2005-06-15 10:07 fpillet * libpisock/cmp.c, libpisock/serial.c, libpisock/slp.c, libpisock/usb.c, include/pi-cmp.h, include/pi-serial.h, libpisock/padp.c, libpisock/unixserial.c: Factored out the code to read PILOTRATE. Changed some protos so as to take an int for the speed (use speed_t only when converting to a speed_t value for Linux). More general cleanup 2005-06-15 10:06 fpillet * include/pi-debug.h, include/pi-source.h, include/pi-util.h, libpisock/debug.c, libpisock/utils.c: dumpdata() and dumpline() become pi_dumpdata() and pi_dumpline(). Provide wrappers with the old names for compatibility 2005-06-15 03:21 fpillet * include/pi-util.h, libpisock/utils.c: Factored out get_pilot_rate function; slight code reorg 2005-06-14 13:39 fpillet * doc/README.usb: updated README.usb with Mac OS X instructions 2005-06-14 12:28 fpillet * libpisock/cmp.c: advertise same version of CMP than the device uses 2005-06-14 12:20 fpillet * libpisock/usb.c: change the baudrate if it's not 9600 after CMP negotiation 2005-06-14 12:19 fpillet * libpisock/slp.c: missing parenthesis 2005-06-14 12:00 fpillet * libpisock/slp.c: SLP code overhaul 2005-06-14 11:51 fpillet * include/pi-slp.h: oops removed dubious define I had added for testing 2005-06-14 11:49 fpillet * include/: pi-cmp.h, pi-slp.h: Added definition for CMP 1.3 2005-06-14 11:48 fpillet * libpisock/padp.c: tweaks to PADP 2005-06-14 10:29 fpillet * libpisock/socket.c: tweaked protocol detection again, much cleaner now 2005-06-14 10:26 fpillet * libpisock/cmp.c: tweaked log messages 2005-06-14 10:17 fpillet * libpisock/darwinusb.c: working klsi support 2005-06-13 10:15 desrod * configure.ac: Tagged tree as -pre4, rolled to -pre5 (which may become 0.12.0 final!) 2005-06-13 10:09 fpillet * libpisock/linuxusb.c: rx_byte doesn't exist in linuxusb (sorry, copy/paste syndrome) 2005-06-13 09:55 desrod * libpisock/connect.c: Oops, now they both match.. (are we even using connect.c anymore, now that we have the same structures in userland.c? Why the duplication? Will investigate later) 2005-06-13 09:51 desrod * libpisock/connect.c, src/userland.c: Reword a little bit to more-accurately match the current state of connect action 2005-06-13 09:31 desrod * ChangeLog, configure.ac, doc/man/Makefile.am, doc/man/README, doc/man/addresses.1.in, doc/man/debugsh.1.in, doc/man/dlpsh.1.in, doc/man/hinotes.1.in, doc/man/ietf2datebook.1.in, doc/man/install-datebook.1.in, doc/man/install-expenses.1.in, doc/man/install-hinote.1.in, doc/man/install-memo.1.in, doc/man/install-netsync.1.in, doc/man/install-todo.1.in, doc/man/install-todos.1.in, doc/man/install-user.1.in, doc/man/memos.1.in, doc/man/money2qif.1.in, doc/man/pi-csd.1.in, doc/man/pi-getram.1.in, doc/man/pi-getrom.1.in, doc/man/pi-getromtoken.1.in, doc/man/pi-nredir.1.in, doc/man/pilot-addresses.1.in, doc/man/pilot-archive.1.in, doc/man/pilot-clip.1.in, doc/man/pilot-dedupe.1.in, doc/man/pilot-file.1.in, doc/man/pilot-foto.1.in, doc/man/pilot-link.7.in, doc/man/pilot-schlep.1.in, doc/man/pilot-treofoto.1.in, doc/man/pilot-wav.1.in, doc/man/pilot-xfer.1.in, doc/man/read-expenses.1.in, doc/man/read-ical.1.in, doc/man/read-notepad.1.in, doc/man/read-palmpix.1.in, doc/man/read-screenshot.1.in, doc/man/read-todos.1.in, doc/man/read-veo.1.in, doc/man/reminders.1.in, doc/xml/addresses.xml, doc/xml/debugsh.xml, doc/xml/dlpsh.xml, doc/xml/hinotes.xml, doc/xml/ietf2datebook.xml, doc/xml/install-datebook.xml, doc/xml/install-expenses.xml, doc/xml/install-hinote.xml, doc/xml/install-memo.xml, doc/xml/install-netsync.xml, doc/xml/install-todo.xml, doc/xml/install-todos.xml, doc/xml/install-user.xml, doc/xml/memos.xml, doc/xml/money2qif.xml, doc/xml/pi-csd.xml, doc/xml/pi-getram.xml, doc/xml/pi-getrom.xml, doc/xml/pi-getromtoken.xml, doc/xml/pi-nredir.xml, doc/xml/pilot-addresses.xml, doc/xml/pilot-archive.xml, doc/xml/pilot-clip.xml, doc/xml/pilot-csd.xml, doc/xml/pilot-debugsh.xml, doc/xml/pilot-dedupe.xml, doc/xml/pilot-dlpsh.xml, doc/xml/pilot-file.xml, doc/xml/pilot-foto.xml, doc/xml/pilot-getram.xml, doc/xml/pilot-getrom.xml, doc/xml/pilot-getromtoken.xml, doc/xml/pilot-hinotes.xml, doc/xml/pilot-ietf2datebook.xml, doc/xml/pilot-install-datebook.xml, doc/xml/pilot-install-expenses.xml, doc/xml/pilot-install-hinote.xml, doc/xml/pilot-install-memo.xml, doc/xml/pilot-install-netsync.xml, doc/xml/pilot-install-todo.xml, doc/xml/pilot-install-todos.xml, doc/xml/pilot-install-user.xml, doc/xml/pilot-link.xml, doc/xml/pilot-memos.xml, doc/xml/pilot-nredir.xml, doc/xml/pilot-read-expenses.xml, doc/xml/pilot-read-ical.xml, doc/xml/pilot-read-notepad.xml, doc/xml/pilot-read-palmpix.xml, doc/xml/pilot-read-screenshot.xml, doc/xml/pilot-read-todos.xml, doc/xml/pilot-read-veo.xml, doc/xml/pilot-reminders.xml, doc/xml/pilot-schlep.xml, doc/xml/pilot-treofoto.xml, doc/xml/pilot-wav.xml, doc/xml/pilot-xfer.xml, doc/xml/read-expenses.xml, doc/xml/read-ical.xml, doc/xml/read-notepad.xml, doc/xml/read-palmpix.xml, doc/xml/read-screenshot.xml, doc/xml/read-todos.xml, doc/xml/read-veo.xml, doc/xml/reminders.xml, libpisock/libusb.c, src/Makefile.am, src/money2qif.c, src/pilot-reminders.c, src/reminders.c: Mostly a documentation update, minor fix for Florent's libusb typo, some deprecated conduits removed from the tree... more to come. 2005-06-13 05:34 fpillet * libpisock/darwinusb.c: preliminary KLSI adapter support. Not fully working yet (needs more testing) 2005-06-13 05:33 fpillet * libpisock/libusb.c: init changebaud to NULL for now 2005-06-13 05:32 fpillet * libpisock/usb.c: support for port speed ioctls if the platform driver supports it 2005-06-13 05:31 fpillet * include/pi-usb.h: added changebaud handler for usb dev, required to support serial adaptors on platforms where it's not going through a kernel-emulated tty 2005-06-13 05:30 fpillet * libpisock/slp.c: more readable code, removed unused variable 2005-06-13 05:29 fpillet * libpisock/linuxusb.c: proper implementation for PI_MSG_PEEK, modeled after unixserial. Log messages harmonization 2005-06-13 05:28 fpillet * libpisock/unixserial.c: harmonized log messages so it's easier to see what's going on 2005-06-12 15:35 fpillet * libpisock/socket.c: handle case where PILOT_LOG=0 2005-06-12 15:24 fpillet * libpisock/: socket.c, unixserial.c: two tiny ones 2005-06-12 15:05 fpillet * libpisock/unixserial.c: more log tweaks 2005-06-12 15:02 fpillet * libpisock/: socket.c, unixserial.c: tweaks & more logging 2005-06-12 14:25 fpillet * libpisock/unixserial.c: an endless stream of bug fixes might lead to eternal happiness 2005-06-12 14:14 fpillet * libpisock/unixserial.c: one more step towards a working implementation 2005-06-12 13:59 fpillet * libpisock/unixserial.c: Another fix for the PI_MSG_PEEK tricky issue 2005-06-12 13:55 fpillet * libpisock/socket.c: One more tiny fix for setuid 2005-06-12 13:38 fpillet * libpisock/socket.c: account for incomplete headers (on slow connection this makes a difference) 2005-06-12 13:18 fpillet * include/pi-dlp.h: removed unused sysFileTSlotDriver define (which has nothing to do here) and excluded more definitions from SWIG interfaces as they are for internal use only 2005-06-12 13:06 fpillet * libpisock/unixserial.c: oops forgot prototype 2005-06-12 13:05 fpillet * libpisock/unixserial.c: unixserial didn't properly honor PI_MSG_PEEK when reading from the readahead buffer 2005-06-12 13:03 fpillet * libpisock/linuxusb.c: Linuxusb didn't properly honor PI_MSG_PEEK when reading from the readahead buffer 2005-06-12 13:03 fpillet * libpisock/socket.c: Check the txid byte after all 2005-06-12 12:43 fpillet * libpisock/socket.c: More error checking and better readability for get/setsockopt. Less aggressive protocol detection (do not check the txid) 2005-06-12 09:29 desrod * bindings/Python/src/pisock_wrap.c: Small cleanup to eliminate a couple of warnings. 2005-06-11 05:48 fpillet * libpisock/socket.c: shiny new protocol detection code that checks more than one byte to make sure we don't fallback on the wrong protocol because of garbage. This also simplifies the protocol detection loop 2005-06-09 13:08 fpillet * libpisock/syspkt.c: removed unused static RPC_MemCardInfo 2005-06-09 12:59 desrod * src/: pilot-sync-plan.pl, sync-plan.PL: Update sync-plan.PL to merge with Aaron's changes in bug #1455 and align the API with the changes in 0.12.x 2005-06-09 12:59 fpillet * libpisock/padp.c: commented out a test that could never work 2005-06-09 12:44 desrod * src/Makefile.am: Oops, forgot one... 2005-06-09 12:39 fpillet * libpisock/socket.c: Tweaked the logs displayed while trying to identify the connection 2005-06-09 12:38 fpillet * libpisock/net.c: Patch to counter buffer overflows when the connection is sending garbage (i.e. serial) 2005-06-09 12:37 desrod * src/: pilot-sync-plan.pl, sync-plan.PL: Minor typo fixed 2005-06-09 10:33 desrod * src/pilot-foto.c: This is going to be a big diff, I re-indented the whole source file a bit, and added a small buffer overflow patch from Than Ngo at Red Hat. This closes bug #1497 2005-06-09 09:42 desrod * include/: Makefile.am, pi-address.h, pi-address.hxx, pi-appinfo.h, pi-appinfo.hxx, pi-datebook.h, pi-datebook.hxx, pi-dlp.hxx, pi-memo.h, pi-memo.hxx, pi-todo.h, pi-todo.hxx: Purged the final bits of libpisock++ from the tree 2005-06-09 05:57 fpillet * darwin/build_framework.sh: Build for PPC only for now, until I figure out all the issues with building a FAT framework 2005-06-07 08:34 adridg * doc/man/install-memo.1.in, src/install-memo.c, src/pilot-install-memo.c: Deal with recent report by making install-memo able to install more than one memo; this hasn't been tested yet. 2005-06-07 08:32 adridg * include/pi-todo.hxx: Remove use of memset so we don't need an extra header 2005-06-06 12:10 desrod * Makefile.am, configure.ac, include/Makefile.am, src/Makefile.am: Updated to cleanly purge CXX* and libpisock++ from the tree 2005-06-05 09:14 fpillet * configure.ac: Include CoreFoundation framework when compiling on Darwin. Fixes link issues on some layouts of the development system 2005-06-05 09:13 fpillet * libpisock/dlp.c: removed unused Expect macro 2005-06-03 14:42 desrod * configure.ac, m4/tcl.m4, m4/vl_lib_readline.m4: Disable C++ by default, auto-detect if enalbed with --with-cxx. Also clean up some formatting of the --help output, need more consistency in the macros as these get moved into separate .m4 files under ./m4/ 2005-06-03 10:14 desrod * ChangeLog: Updated ChangeLog to current.. 2005-06-03 06:57 fpillet * libpisock/libusb.c: Fix for bug #1483: the mutex wasn't being released on premature function return 2005-06-03 06:46 fpillet * bindings/Python/src/: pi-dlp-maps.i, pi-file-maps.i, pisock.i, pisock_wrap.c: Added mapping for dlp_ExpSlotEnumerate. Fixed pi-file-maps.i so that the C code is inserted with the rest of the wrapper code, fixing compilation issues with GCC 4 (and some GCC 3 warnings). 2005-06-03 04:15 fpillet * bindings/Makefile.am: Fix for bug #1478: the --root option passed to setup.py was confusing the installer. Removing it fixes the problem. 2005-06-02 12:23 fpillet * bindings/Python/src/pisock_wrap.c: updated pisock_wrap 2005-06-02 12:21 fpillet * bindings/Python/src/: pi-error.i, pi-file-maps.i, pisock.py, pisock_wrap.c: Fixed incorrect code that would crash the Python interpreter on error 2005-06-01 20:17 desrod * doc/TODO: Minor updates to bring TODO to "mostly current", still more to go.. 2005-06-01 05:09 fpillet * src/pilot-xfer.c: Added PACE cache files to the list of files to exclude from backup (creator=='a68k') 2005-05-31 09:20 fpillet * libpisock/pi-buffer.c: If trying to create a 0 byte buffer, allocate a small amount (16 bytes) as you are not supposed to malloc(0) 2005-05-28 12:46 warp * libpisock/pi-file.c: Unlink instead of overwriting. For the case of something along the lines of: cp -lav backup_2005_05_27 backup_2005_05_28 Then updating the new copy. 2005-05-24 08:49 fpillet * libpisock/darwinusb.c: Added a comment to make clear why we're setting opened to 0 in u_close 2005-05-24 08:47 fpillet * libpisock/usb.c: Don't decrement timeout by one second after sending a wakeup packet to the device. Incidentally, this fixes a bug where a timeout of 1 second would put the thread in forever wait mode if the wakeup packet was without effect 2005-05-24 08:44 fpillet * libpisock/darwinusb.c: Fixed a lockup bug in darwinusb where a new client thread could acquire a closing connection, therefore locking it into waiting forever on a deleted pthread_cond. Use relative timeouts in waiting threads (more explicit code), defined a new macros to avoid all the #ifdef DEBUG_USB in the code. 2005-05-18 18:17 warp * libpisock/usb.c: Oops. Minor fix I forgot to commit. 2005-05-16 05:35 fpillet * libpisock/: inet.c, serial.c, socket.c, usb.c: Devices don't do the pi_close() anymore on failure, it's socket.c's responsibility to do it (doesn't change the APIs behavior, just a transfer of responsibility) 2005-05-16 05:10 fpillet * libpisock/socket.c: removed comments obsoleted by the doxygen documentation in pi-socket.h 2005-05-16 05:06 fpillet * include/pi-socket.h: completed doxygen docs for pi-socket.h 2005-05-16 03:25 fpillet * libpisock/darwinusb.c: Fixed indentation 2005-05-16 02:48 fpillet * configure.ac: added setup-standalone.py to the templatized files 2005-05-15 13:53 fpillet * bindings/Python/src/: pi-dlp-maps.i, pisock.i, pisock.py: cleanup 2005-05-14 17:07 adridg * configure.ac: Apply patch from #1480; assume Florent will complain when this turns out to no-worky with MacOSX auto* 2005-05-13 18:25 fpillet * libpisock/socket.c: close the sd if the actual implementation didn't do it 2005-05-13 18:23 fpillet * libpisock/darwinusb.c: Make darwinusb properly close the socket descriptor 2005-05-13 18:23 fpillet * bindings/Python/src/: pi-dlp-maps.i, pisock_wrap.c: Fixed a problem with passing types/creators that was improperly returning an exception 2005-05-13 14:37 fpillet * bindings/Python/src/: pi-error.i, pisock.py, pisock_wrap.c, pisockextras.py: Fixed error management (there were memory leaks because of the early return). dlpErrNotFound now raises an exception 2005-05-13 11:29 fpillet * libpisock/dlp.c: Coherent trace names, more info displayed 2005-05-13 11:25 fpillet * libpisock/darwinusb.c: compute read times (microsecond resolution) 2005-05-13 10:08 fpillet * libpisock/net.c: bump timeout to 30s. Experience showed installs that can stall the device up to 16s (with a T5), so we need a longer timeout value to cope with that and legitimate long wait cases 2005-05-13 05:09 fpillet * libpisock/dlp.c: more extensive logging 2005-05-13 05:02 fpillet * libpisock/darwinusb.c: tweaks to fix a race condition issue. More logging. 2005-05-12 16:07 fpillet * bindings/Python/: README, setup-standalone.py.in, setup.py.in, src/Makefile, src/general-maps.i, src/helperfuncs.i, src/nonblocking_multithread.pl, src/pi-dlp-maps.i, src/pi-error.i, src/pi-file-maps.i, src/pi-socket-maps.i, src/pisock.py, src/pisock_wrap.c, src/pisockextras.py: Marked all files with LGPL license. Cleanup in some files. Removed the useless custom pi_bind() implementation 2005-05-11 16:27 fpillet * configure.ac: use AC_HELP_STRING instead of AS_HELP_STRING, which doesn't work with the version of autoconf shipping with Mac OS X 2005-05-11 10:20 fpillet * bindings/Python/src/pi-dlp-maps.i: one more TODO in the list 2005-05-11 10:19 fpillet * libpisock/darwinusb.c: refinements in u_close, removed superfluous LOG 2005-05-11 06:21 fpillet * bindings/Python/: README, setup-standalone.py.in, src/helperfuncs.i, src/pi-dlp-maps.i, src/pisock_wrap.c: Proper encoding conversion when reading/writing user info and reading database info 2005-05-10 10:29 warp * libpisock/: freebsdusb.c, libusb.c, linuxusb.c: u_poll returns > 0 on success, or <= 0 on timeout or error for the usb drivers. Fix comments to reflect this. Remove the usb_reset call in the libusb code, doesn't help anything. 2005-05-10 10:23 warp * libpisock/usb.c: Move stuff around to be a little cleaner. Fix failure in the linux case. Handle timeouts better. 2005-05-10 10:19 fpillet * libpisock/darwinusb.c: u_poll didn't return PI_ERR_SOCK_TIMEOUT if the connection was acquired but no data showed up (thanks, Mercury) 2005-05-10 09:37 fpillet * libpisock/socket.c: removed fprintfs 2005-05-10 05:18 fpillet * bindings/Python/: README, setup-standalone.py.in, setup.py.in: Added new standalone build script, updated readme 2005-05-10 05:07 fpillet * libpisock/darwinusb.c: oops, most people don't need #define DEBUG_USB 1 ;-) 2005-05-10 04:54 fpillet * libpisock/socket.c: added warning for bluetooth: case 2005-05-10 04:51 fpillet * libpisock/socket.c: Made pi_socket_setsd() code even more clear. 2005-05-10 04:51 adridg * libpisock/usb.c: Accidental whitespace and some additional logging 2005-05-10 04:48 adridg * libpisock/socket.c: Better check for error returns from dup2(), fcntl() and dup() as well 2005-05-10 04:34 fpillet * libpisock/socket.c: Fixed a major bug in pi_socket_setsd: the ps->sd was never updated with the duplicated pi_sd's value. If the duplicate didn't take the same value than the previous ps->sd, the connection was lost forever. Also fixed a strncmp and reindented some code 2005-05-10 04:11 fpillet * libpisock/debug.c: minor type. Flushing out the local mods I have 2005-05-10 04:10 fpillet * libpisock/usb.c: Mercury's evil kludge not needed on OSX. Rewrote it for clarity as well 2005-05-10 04:08 fpillet * libpisock/darwinusb.c: fixed bugs in refcount management. When closing the connection, set the socket state to PI_SOCK_CLOSE. This avoid subsequent calls to pi_close (i.e. from the onexit() handler) trying to access a closed connection. 2005-05-09 16:51 adridg * libpisock/freebsdusb.c: recv() -> back to read(), since recv() doesn't work on ugen devices 2005-05-09 13:09 fpillet * libpisock/darwinusb.c: another big change: added refcounting to the usb_connection_t struct. stop_listening() is called only when refcount reaches 0. This avoids issues where concurrent threads could clash on what to do, like the connection being closed while another thread was trying to write 2005-05-09 10:50 fpillet * include/pi-syspkt.h, libpisock/syspkt.c: Got rid of the sys_RPCerror variable. Now use pi_error(sd) in ALL cases to get the latest error. 2005-05-08 16:53 adridg * configure.ac: Use AS_HELP for help, and handle --disable-libusb as well 2005-05-08 16:30 adridg * README: Add extra notes for enabling libusb 2005-05-08 16:27 warp * configure.ac: Look for usb_open instead of main in libusb. 2005-05-08 10:53 warp * libpisock/usb.c: Send something that is hopefully even less likely to do evil things to the device. 2005-05-06 21:59 warp * libpisock/usb.c: Evil kluge. If we don't get any data the device may still be there. We try to wake it up by sending a 'garbage' packet or 5. (USB only.) 2005-05-06 18:13 warp * libpisock/: libusb.c, usb.c: Quietly fix (or at least alter) the vi settings for libusb.c and usb.c. 2005-05-05 14:36 fpillet * bindings/Python/src/: pi-dlp-maps.i, pisock_wrap.c: Added missing mappins for proper dlp_CallApplication() binding 2005-05-04 08:06 fpillet * bindings/Python/: pisockextras.py, src/pisockextras.py, test/pisocktests.py: Moved pisockextras.py to the src/ directory. Tweaked setup.py to go find Python files to include in the src directory. 2005-05-02 19:08 warp * libpisock/: inet.c, serial.c, usb.c: Make sure that we actually close the sd on errors in pi_foo_accept. 2005-05-02 17:45 adridg * src/: dlpsh.c, pilot-dlpsh.c: Fix for 1456: don't let popt mess with fixed-size buffers in structs; simplify code a little; put braces around python-style wishful indentation; remove AUTOHELP since it exits dlpsh; simplify help calls. 2005-05-02 16:32 adridg * src/: ietf2datebook.PL, pilot-ietf2datebook.pl: For #770 2005-05-02 16:19 adridg * src/: pilot-read-ical.c, read-ical.c: Patch from BR 1475, though I don't really see how it can help 2005-04-27 13:38 desrod * ChangeLog, configure.ac: Tagged -pre3, rolling to -pre4 for development, updated ChangeLog 2005-04-26 13:50 warp * configure.ac: Better handle libusb and thread safe stuff in configure. (Still needs work in the no-threads but libusb case.) 2005-04-26 13:44 warp * libpisock/Makefile.am: Fix --enable-threads without --enable-libusb. (Note, libusb should really depend on --enable-threads or something.) 2005-04-22 15:14 adridg * include/pi-expense.h, include/pi-hinote.h, include/pi-versamail.h, libpisock/expense.c, libpisock/hinote.c, libpisock/versamail.c: int -> size_t consistency 2005-04-22 15:01 adridg * libpisock/syspkt.c: Don't mix static and non-static (it's declared in pi-syspkt.h) 2005-04-22 09:25 adridg * include/pi-datebook.h, libpisock/datebook.c: Basic consistency -- still missing in lots of other cases, and ContactDB does it differently yet 2005-04-21 12:03 fpillet * configure.ac: propagate PNG_FLAGS to CPPFLAGS 2005-04-21 11:37 fpillet * include/pi-socket.h: Mo' doxygen documentation for socket calls 2005-04-21 11:21 desrod * tests/versamail-test.c: Oops, forgot this one too: pi_uid_t -> recordid_t 2005-04-21 11:19 desrod * src/: pilot-foto-treo600.c, pilot-foto.c, pilot-treofoto.c, pilot-wav.c: Minor fixes for pi_uid_t to recordid_t from Florent's changes in the lib 2005-04-21 08:21 fpillet * include/pi-file.h: completed doxygen documentation 2005-04-19 08:52 fpillet * libpisock/pi-file.c: fixed a bug I introduced in pi_file_append_resource() 2005-04-19 04:41 fpillet * libpisock/utils.c: properly escape % chars before handing the string to pi_log 2005-04-18 13:41 fpillet * bindings/Python/TODO: updated TODO 2005-04-18 13:40 fpillet * bindings/Python/src/: general-maps.i, pi-dlp-maps.i, pi-file-maps.i, pisock.i, pisock.py, pisock_wrap.c: add pi_file_install() and pi_file_retrieve() but use custom implementations instead of raw mappings to allow simply passing a file path for read/write 2005-04-18 13:37 fpillet * include/pi-dlp.h, libpisock/dlp.c: constified parameter to dlp_WriteUserInfo for better bindings generation with swig 2005-04-18 13:36 fpillet * include/pi-header.h: don't interface deprecated functions with swig 2005-04-18 13:34 fpillet * libpisock/darwinusb.c: avoid init race condition 2005-04-18 13:33 fpillet * libpisock/debug.c: prefix log entries with thread ID when compiled with --enable-threads 2005-04-18 13:32 fpillet * libpisock/pi-file.c: remove useless init 2005-04-18 13:30 fpillet * libpisock/utils.c: do atomic writes in dumpline() -- faster logging, and pi_log() won't interfer when it adds the thread ID when compiled with --enable-threads 2005-04-18 13:28 fpillet * include/pi-threadsafe.h, libpisock/threadsafe.c: added pi_thread_id() call 2005-04-15 08:00 fpillet * include/pi-file.h, libpisock/pi-file.c: Reorganized prototypes, documented functions for doxygen, improving things for bindings generation 2005-04-15 06:04 fpillet * include/pi-error.h: Added new error code 2005-04-14 03:12 fpillet * include/: pi-dlp.h, pi-file.h: more tweaks for swig generation 2005-04-13 05:31 fpillet * bindings/Python/: pisockextras.py, src/helperfuncs.i, src/pi-dlp-maps.i, src/pi-error.i, src/pi-socket-maps.i, src/pisock.i, src/pisock.py, src/pisock_wrap.c, test/pisocktests.py: mucho improvements in bindings 2005-04-12 11:47 fpillet * libpisock/dlp.c: clarify log message 2005-04-12 11:42 fpillet * configure.ac: define MACOSX when compiling on darwin. Do NOT define DARWIN as this would conflict with system headers 2005-04-12 11:42 fpillet * libpisock/serial.c: turn fragmentation off on serial for MACOSX only for now 2005-04-12 09:53 fpillet * include/pi-dlp.h: some exclusions for thing we don't need to interface in bindings 2005-04-12 06:36 nicholas * bindings/Python/src/: Makefile, nonblocking_multithread.pl, pisock.i, pisock.py, pisock_wrap.c: Put in use of %feature to see if it solves the interpreter lock when calling pisock functions in a cleaner way than a post-processor for the C code. Florent, can you see if you like this method? 2005-04-11 11:34 fpillet * libpisock/darwinusb.c: auto-enable multiple simultaneous connection support when compiling with --enable-threads. Lock the queue mutex in stop_listening to make sure we don't have an access conflict with u__read() 2005-04-11 05:22 fpillet * libpisock/debug.c: reduce code bloat by properly using pi-threadsafe.h macros 2005-04-11 05:20 fpillet * libpisock/debug.c: added mutex when compiling with HAVE__THREADS so that logfile writes are atomic. Open logfile in append mode so that multiple connections don't clear the logfile when the connection drops 2005-04-10 18:17 fpillet * libpisock/darwinusb.c: make sure another thread can't close same connection, better disconnection reporting, better logging 2005-04-10 16:46 fpillet * libpisock/dlp.c: freeze PADP txid during dlp_VFSFileRead 2005-04-10 16:45 fpillet * include/pi-padp.h, libpisock/padp.c, include/pi-socket.h: Added new sockopt to allow freezing the txid during large transfers (mainly for dlp_VFSFileRead) 2005-04-08 13:29 fpillet * libpisock/dlp.c: changed proto to match header 2005-04-08 13:29 fpillet * libpisock/usb.c: simplified code 2005-04-08 13:28 fpillet * libpisock/darwinusb.c: Added support for multiple simultaneous USB connections 2005-04-08 13:26 fpillet * include/: pi-dlp.h, pi-socket.h: swig and prototype tweaks 2005-04-08 13:26 fpillet * include/pi-usb.h: tweaks 2005-04-08 13:25 fpillet * bindings/Python/src/: Makefile, nonblocking_multithread.pl: some additions to postprocess pisock_wrap.c and make sure a multi-threaded python interpreter won't be completly blocked during C calls 2005-04-08 13:17 fpillet * bindings/Python/: pisockextras.py, src/general-maps.i, src/pi-dlp-maps.i, src/pi-dlp.i, src/pisock.i: Updating the interfaces to work with 0.12, lots of ongoing fixes 2005-04-05 12:35 fpillet * libpisock/darwinusb.c: more work to prepare for multiple simultaneous connection support 2005-04-04 18:06 fpillet * libpisock/darwinusb.c: Fixed the T5 connection issue that was bugging me 2005-04-02 16:16 neilw * src/: pilot-read-todos.c, read-todos.c: Fixing dlp_ReadRecordByIndex loop error 2005-03-23 11:28 fpillet * libpisock/darwinusb.c: reliability fixes, shielding against potential crashes if device disconnects before a read_completion is received 2005-03-22 11:50 fpillet * libpisock/darwinusb.c: even more tweaks 2005-03-22 11:17 fpillet * libpisock/darwinusb.c: tweak tweak tweakatitweak 2005-03-22 10:40 fpillet * libpisock/darwinusb.c: added dumpdata to try figuring out the info that the Treo 90 returns 2005-03-22 10:19 fpillet * libpisock/darwinusb.c: small fixes, trying to get the Treo 90 working 2005-03-16 17:34 fpillet * src/: dlpsh.c, pilot-dlpsh.c: fix minor alignment problem in df command, add 'dtp' command that's showed in help but not implemented, add 'bye' alias to quit/exit 2005-03-16 11:10 fpillet * libpisock/syspkt.c: this variable can't be global (it isn't anyway) -- causes ld to fail when building the framework on OS X 2005-03-16 04:15 fpillet * libpisock/darwinusb.c: Fixed an issue with finding the pipes on some handhelds 2005-03-14 20:21 desrod * libpisock/syspkt.c: Oops, this is a better fix for gcc4 2005-03-14 20:14 desrod * libpisock/syspkt.c: Smallish fix for gcc4 2005-03-09 05:39 fpillet * libpisock/darwinusb.c: tweaked comments and changed some code for better T5 compatibility (probably more to come) 2005-03-08 07:40 fpillet * libpisock/darwinusb.c: moved trying to get pipe info by reading from pipes in the find_interfaces() function, as configure_device() doesn't have the interface open yet 2005-03-08 06:52 fpillet * libpisock/darwinusb.c: Revised (once more) device configuration & pipe search. After some extensive USB tracing, I found out why my Sony wasn't connecting -- looks like the device didn't like to be re-configured while it had already been configured by the OS. This seems to work well with others as well. Also improved configuration reading using VISOR format, which is what Sony OS 3/4 devices use. T615C now works. TapWave connects faster and doesn't need USBReset() anymore. 2005-03-08 04:49 fpillet * libpisock/pi-file.c: Fixed issue with appInfo not being read on some files like AddressDB on T3: this was because the size returned by HotSync (this also happens straight on Palm OS, check it with Filez) is wrong -- it says there is no appInfo block whereas there is one. See comments in the code. 2005-03-06 12:36 fpillet * libpisock/dlp.c: deprecated -129 as a legitimate return code -- functions now properly return PI_ERR_DLP_UNSUPPORTED 2005-03-06 12:26 fpillet * libpisock/pi-file.c: fixed bug recently introduced in pi_file_retrieve() that prevented it from working properly on devices prior Palm OS 3.0 2005-03-06 07:46 nicholas * bindings/Tcl/pitcl.c, include/pi-address.h, include/pi-datebook.h, include/pi-memo.h, include/pi-todo.h, libpisock/address.c, libpisock/contact.c, libpisock/datebook.c, libpisock/memo.c, libpisock/pi-buffer.c, libpisock/todo.c, src/install-datebook.c, src/install-todo.c, src/install-todos.c, src/memos.c, src/pilot-addresses.c, src/pilot-install-datebook.c, src/pilot-install-todo.c, src/pilot-install-todos.c, src/pilot-memos.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/read-ical.c, src/read-todos.c, src/reminders.c, src/validate.cc, tests/contactsdb-test.c, tests/packers.c: Switch the packer/unpacker functions over to use pi-buffer-t instead of static buffers. Makes the arguments for them all match each other. 2005-03-06 06:23 fpillet * libpisock/darwinusb.c: removed the USBReset() call which was causing problems with m515, m500 and possibly other devices. Conditionalized it to presence of a Zodiac, which seems to be the only device still requiring it (hopefully I'll find a workaround soon) 2005-03-04 13:11 fpillet * libpisock/dlp.c: integrated fix provided by Scott Gruby: Tapwave Zodiac may return wrong command index during dlpFuncReadRecord/dlpFuncReadRecordEx calls 2005-03-04 09:06 fpillet * libpisock/darwinusb.c: prepared darwinusb for multiple simultaneous connection support 2005-03-04 06:09 fpillet * include/pi-cmp.h, include/pi-net.h, include/pi-padp.h, include/pi-serial.h, include/pi-slp.h, include/pi-source.h, include/pi-sys.h, include/pi-usb.h, libpisock/cmp.c, libpisock/darwinusb.c, libpisock/freebsdusb.c, libpisock/inet.c, libpisock/libusb.c, libpisock/padp.c, libpisock/slp.c, libpisock/sys.c, libpisock/unixserial.c: revised constness accross the board 2005-03-04 05:52 fpillet * libpisock/net.c: change declaration of fixed handshake blocks, make message parameter to net_tx const 2005-03-03 13:35 fpillet * configure.ac: update, small bugfix on 'enable-debug' 2005-03-03 13:34 fpillet * include/Makefile.am, include/pi-threadsafe.h, libpisock/Makefile.am, libpisock/socket.c, libpisock/threadsafe.c: Added thread-safe code so that access to socket linked lists is thread safe 2005-03-03 13:09 fpillet * libpisock/darwinusb.c: revised pipe-detection code 2005-03-03 10:11 nicholas * include/pi-userland.h, libpisock/darwinusb.c, libpisock/datebook.c, libpisock/debug.c, libpisock/dlp.c, libpisock/expense.c, libpisock/freebsdusb.c, libpisock/hinote.c, libpisock/inet.c, libpisock/libusb.c, libpisock/linuxusb.c, libpisock/mail.c, libpisock/md5.c, libpisock/memo.c, libpisock/money.c, libpisock/net.c, libpisock/notepad.c, libpisock/os2serial.c, libpisock/padp.c, libpisock/palmpix.c, libpisock/pi-buffer.c, libpisock/pi-file.c, libpisock/pi-header.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/sys.c, libpisock/syspkt.c, libpisock/todo.c, libpisock/unixserial.c, libpisock/usb.c, libpisock/utils.c, libpisock/veo.c, libpisock/versamail.c, libpisync/util.c, src/debugsh.c, src/hinotes.c, src/install-datebook.c, src/install-hinote.c, src/install-memo.c, src/install-netsync.c, src/install-todo.c, src/kittykiller.c, src/pd-tty.c, src/pi-port.c, src/pilot-debug.c, src/pilot-debugsh.c, src/pilot-dedupe.c, src/pilot-foto-treo600.c, src/pilot-hinotes.c, src/pilot-install-datebook.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-netsync.c, src/pilot-install-todo.c, src/pilot-port.c, src/pilot-read-ical.c, src/pilot-read-palmpix.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-treofoto.c, src/plu_args.c, src/read-ical.c, src/read-palmpix.c, src/reminders.c: Add emacs local variables to every place that has vi ones. This is to stop emacs trying to indent stuff a different way. 2005-03-02 17:36 fpillet * configure.ac, m4/threads.m4: added --enable-threads flag for thread-safe support 2005-03-02 11:25 fpillet * libpisock/dlp.c: disable RX timeouts during dlp_CallApplication() 2005-03-02 11:24 fpillet * libpisock/: net.c, padp.c: honor the PI_SOCK_HONOR_RX_TIMEOUT sockopt when waiting for packets so that we don't timeout on lengthy operations which don't tickle the connection 2005-03-02 10:51 fpillet * include/pi-dlp.h: complete documenting the known HotSync bug in VFSDirEntryEnumerate() 2005-03-02 10:50 fpillet * include/pi-socket.h, libpisock/socket.c: added PI_SOCK_HONOR_RX_TIMEOUT socket level option, so that we can disable RX timeouts when the device is going to perform a lengthy operation (mainly for dlp_CallApplication() use) 2005-03-01 14:54 desrod * include/pi-usb.h, libpisock/usb.c: Fix typos with SONY_CILE device.. closes bug-and-a-half #1452 2005-03-01 14:33 warp * libpisock/libusb.c: Take into consideration race conditions for reading, which nicely kills a hanging bug. Kill a few other bugs. 2005-02-22 10:40 fpillet * include/pi-buffer.h, libpisock/pi-buffer.c: constified parameters where possible 2005-02-21 17:53 nicholas * bindings/Python/pisockextras.py, bindings/Python/src/pi-dlp-maps.i, bindings/Python/src/pi-socket-maps.i, bindings/Python/src/pisock.i, bindings/Python/src/pisock.py, bindings/Python/src/pisock_wrap.c, bindings/Python/test/pisocktests.py, include/pi-socket.h: Pass tests for dlp_ReadSysInfo, dlp_ReadStorageInfo, dlp_ReadUserInfo, dlp_ReadFeature. Rework a few bits of python code. 2005-02-21 14:18 fpillet * libpisock/darwinusb.c: added a third pass to find the USB pipes -- turns out the Tungsten W has one 64-bytes channel and one 32-byte. Couldn't get it working yet, but at least it finds the pipes 2005-02-21 10:19 fpillet * bindings/Python/test/pisocktests.py: more tests. Need help with these funcs that take a ptr as argument 2005-02-21 08:40 fpillet * bindings/Python/test/pisocktests.py: new tests, show what's happening, took off offlinesuite from online tests because it fails when online 2005-02-21 08:39 fpillet * bindings/Python/pisockextras.py: tweaks 2005-02-21 08:20 fpillet * bindings/Python/pisockextras.py: fixed loop as dlp_ReadDBList_ can return None 2005-02-21 05:57 fpillet * bindings/Python/src/pisock.i: restored proper indentation for Python code 2005-02-20 18:59 fpillet * bindings/Python/src/pi-dlp-maps.i: tweaks, fixed a few bugs: dlp_ReadAppPreference's parameter had changed, removed a typemap that was causing a parameter to not be taken as input 2005-02-20 18:34 fpillet * bindings/Python/src/pi-dlp-maps.i: reindent, tweak 2005-02-20 18:32 fpillet * bindings/Python/src/pisock.i: picky picky: make sure static object ptrs are set to NULL; reindented code 2005-02-20 18:31 fpillet * bindings/Python/src/pi-error.i: better error mgmt: defer error processing to a func, this reduces the wrapper codesize 2005-02-20 18:30 fpillet * bindings/Python/src/general-maps.i: improved pi_buffer_t* handling so as not to leak in case of early termination 2005-02-20 10:07 fpillet * bindings/Python/src/pi-dlp-maps.i: More structured file 2005-02-20 06:53 fpillet * libpisock/socket.c: cast parameter as the protocol func isn't constified yet 2005-02-20 06:52 fpillet * include/pi-dlp.h: DLP functions now return PI_ERR, this eases swig integration. Try to harmonize prototypes as well, using meaningful and identical names where parameters are the same kind 2005-02-20 06:25 fpillet * bindings/Python/src/: general-maps-errorhandling.i, pi-dlp-maps-errorhandling.i: removed obsolete errorhandling files 2005-02-20 06:25 fpillet * bindings/Python/src/pisock.i: now use pi-error.i 2005-02-20 06:15 nicholas * bindings/Python/src/pi-error.i: Provide (weak) error strings to the caller 2005-02-20 06:10 fpillet * include/pi-error.h: new type PI_ERR 2005-02-20 05:54 fpillet * bindings/Python/src/pi-error.i: preparing interfaces for proper error handling 2005-02-19 11:03 nicholas * bindings/Python/: pisockextras.py, setup.py.in, test.py, test.sh, src/general-maps-errorhandling.i, src/pi-dlp-maps-errorhandling.i, src/pi-dlp-maps.i, src/pisock.i, src/pisock.py, src/pisock_wrap.c, test/pisocktests.py, test/run.sh: Better error handling, create pisockextras.py to provide nicer interfaces (see dlp_ReadDBList for example), start of unit ttest suite. 2005-02-18 13:57 fpillet * include/pi-dlp.h, libpisock/dlp.c: preparing prototypes for swig 2005-02-18 13:56 fpillet * include/pi-socket.h, libpisock/socket.c: updated data constness on pi_send() and pi_write() 2005-02-18 13:17 fpillet * darwin/build_framework.sh: framework build doesn't require libicon anymore 2005-02-17 19:05 nicholas * bindings/Python/: README, setup.py.in: Rebrand as Rob hasn't touched the code for a few years. 2005-02-17 19:04 nicholas * bindings/Python/src/pi-file.i: This file is not needed anymore 2005-02-17 17:58 nicholas * bindings/Python/src/: general-maps-errorhandling.i, general-maps.i, pi-dlp-maps-errorhandling.i, pi-dlp-maps.i, pisock.i, pisock_wrap.c: Make typemaps that are not specific to python be used for all languages, so maybe we can start to use this same files for perl. Put back exception checking for the dlp_ calls, in a new way. 2005-02-17 17:19 nicholas * bindings/Python/src/general-maps.i, bindings/Python/src/pi-dlp-maps.i, bindings/Python/src/pi-dlp.i, bindings/Python/src/pi-socket-maps.i, bindings/Python/src/pisock.i, include/pi-dlp.h: Python swig bindings no longer have their own copies of the prototypes. They are also a bit broken, but let's fix them as we write tests or code that uses them. This needed a little rename in pi-dlp.h. Error handling is even worse now, but see DLPERROR in pi-dlp-maps.i for the form of the start of a fix. 2005-02-17 17:14 nicholas * bindings/Python/src/: pisock_wrap.c, pisock.py: Doing this commit seperately, see my real commit in a few seconds time. This is to make the actual diff readable, as this is just a large autogenerated file. 2005-02-17 14:04 fpillet * libpisock/: Makefile.am, util.c: Removed util.c as convert_FromPilotChar and convert_ToPilotChar don't belong to libpisock 2005-02-17 14:01 fpillet * libpisync/: Makefile.am, util.c: moved util.c from libpisock as it really belongs to here 2005-02-16 19:58 nicholas * bindings/Python/test.py, bindings/Python/test.sh, bindings/Python/src/pi-dlp.i, bindings/Python/src/pi-header.i, bindings/Python/src/pi-socket-maps.i, bindings/Python/src/pi-socket.i, bindings/Python/src/pi-source.i, bindings/Python/src/pisock.i, bindings/Python/src/pisock.py, bindings/Python/src/pisock_wrap.c, include/pi-socket.h: Clean up some inconsistant names in pi-socket.h ; Have swig read pi-socket.h directly ; update python test.py to not use pilot_connect() 2005-02-12 19:50 desrod * ChangeLog: Re-gen ChangeLog 2005-02-12 01:53 warp * libpisock/libusb.c: Some warning cleanup. 2005-02-11 19:12 fpillet * include/pi-dlp.h: document a bug in HotSync for dlp_VFSDirEntryEnumerate() 2005-02-11 18:33 fpillet * libpisock/debug.c, libpisock/dlp.c, include/pi-debug.h, include/pi-source.h: more constness where possible 2005-02-11 15:27 fpillet * libpisock/dlp.c: removed comments, updated dlp_WriteRecord proto 2005-02-11 04:12 fpillet * include/pi-dlp.h: minor tweaks, constified data passed to dlp_WriteRecord 2005-02-10 13:55 fpillet * bindings/Python/src/: pi-socket.i, pisock.py, pisock_wrap.c: mapped additional socket functions 2005-02-10 13:49 fpillet * bindings/Python/src/: pi-dlp-maps.i, pi-dlp.i, pisock.py, pisock_wrap.c: updated Python bindings, need to get rid of pilot_connect() and map the new plu_() stuff instead 2005-02-10 12:09 nicholas * bindings/Python/src/: pi-dlp.i, pisock_wrap.c: Add missing file, and regenerate pisock_wrap.c 2005-02-10 05:04 fpillet * include/: pi-args.h, pi-cmp.h, pi-dlp.hxx, pi-error.h, pi-file.h, pi-header.h, pi-inet.h, pi-macros.h, pi-net.h, pi-padp.h, pi-serial.h, pi-slp.h, pi-sockaddr.h, pi-socket.h, pi-source.h, pi-sync.h, pi-sys.h, pi-syspkt.h, pi-usb.h: more doxyfication, all-around pass to add missing license information 2005-02-10 03:22 fpillet * libpisock/pi-buffer.c: removed docs here as the documentation is in pi-buffer.h. pi_buffer_clear() now shrinks buffer to a reasonable size if it's too big 2005-02-10 03:21 fpillet * include/pi-buffer.h: more docs 2005-02-10 03:14 fpillet * include/pi-buffer.h: doxyfied pi-buffer.h 2005-02-09 13:29 fpillet * bindings/Python/src/pi-dlp-maps.i: updated maps to include new flags 2005-02-09 13:14 fpillet * include/pi-error.h: updated tab size 2005-02-09 13:14 fpillet * include/pi-socket.h: started doxyfication of pi-socket.h 2005-02-09 13:13 fpillet * src/pilot-xfer.c: updated pilot-xfer to use the new transfer callback format 2005-02-09 13:12 fpillet * include/pi-file.h, libpisock/pi-file.c: modified transfer progress callback to pass a pi_progress_t instead of a bunch of arguments 2005-02-09 11:25 fpillet * src/: install-hinote.c, pilot-install-hinote.c: removed unused variable buf 2005-02-09 06:51 fpillet * include/pi-error.h: proper doxyfication of pi-error.h 2005-02-09 06:40 fpillet * include/pi-dlp.h: reorganized and created groups so as to make doxy documentation clear and straightforward 2005-02-09 06:19 fpillet * include/pi-dlp.h, libpisock/dlp.c: completed pi-dlp.h doxyfication 2005-02-08 12:06 fpillet * libpisock/pi-file.c: Set dlpDBMiscFlagRamBased in pi_file_open() since we can't install a database to ROM, so if the database is going to be installed it will be in RAM 2005-02-08 10:12 fpillet * include/pi-dlp.h, libpisock/dlp.c: even more doxygen 2005-02-08 06:29 fpillet * libpisock/dlp.c: renamed some parameters, added a check to dlp_htopdate for zero dates 2005-02-08 06:28 fpillet * include/pi-dlp.h: more [d]oxygen for us 2005-02-07 18:43 fpillet * include/pi-dlp.h: Properly documenting for Doxygenation 2005-02-07 18:38 fpillet * include/pi-dlp.h, libpisock/dlp.c: Properly documenting for Doxygenation 2005-02-07 06:12 fpillet * bindings/Python/src/pisock_wrap.c: prevent python bindings from creating a DB with the Open flag 2005-02-07 06:02 fpillet * bindings/Python/src/pisock_wrap.c: added missing db flags from dlp_ReadDBList 2005-02-05 04:11 fpillet * libpisock/darwinusb.c: try several device configurations if one fails 2005-02-04 10:18 desrod * doc/: man/pilot-link.7.in, xml/pilot-link.xml: Fixing minor typos, closes Debian bug 289234 2005-02-04 10:10 desrod * doc/: man/pilot-xfer.1.in, xml/pilot-xfer.xml: Closing Debian bug 293474 2005-02-04 10:00 desrod * doc/man/pilot-xfer.1.in: Fixed mistake with @VERSION@ macro being prematurely expanded 2005-02-04 10:00 desrod * doc/: man/pilot-link.7.in, xml/pilot-link.xml: Fixed small omission, closes Debian bug 293225. Also cleaned up conduit formatting. 2005-02-04 09:21 desrod * doc/: man/pilot-xfer.1.in, xml/pilot-xfer.xml: Fix small typo, closes upstream Debian bug 283593 2005-02-02 12:21 desrod * libpisock/contact.c: Slightly cleaner version of the FreeBSD 4.x fix 2005-02-02 10:25 desrod * bindings/Python/src/pisock_wrap.c: Updated to reflect change of dlpDBFlagClipping to dlpDBFlagLaunchable, for properly detecting PQA resources. 2005-02-02 07:20 adridg * configure.ac: Do it right 2005-02-01 02:06 adridg * configure.ac, libpisock/contact.c: For 4-stable (Fernan's mail) 2005-01-31 01:20 desrod * configure.ac: Bumping to -pre3 for new changes 2005-01-31 00:57 desrod * ChangeLog: Updating ChangeLog 2005-01-31 00:55 desrod * configure.ac: Updated for latest manpage additions 2005-01-31 00:39 desrod * doc/man/: Makefile.am, debugsh.1.in, install-todos.1.in, money2qif.1.in, pi-csd.1.in, pi-nredir.1.in, pilot-clip.1.in, pilot-dedupe.1.in, pilot-file.1.in, pilot-schlep.1.in, pilot-treofoto.1.in, pilot-wav.1.in, read-screenshot.1.in, reminders.1.in: Adding missing manpages for -pre2 2005-01-31 00:30 desrod * doc/man/: addresses.1.in, dlpsh.1.in, hinotes.1.in, ietf2datebook.1.in, install-datebook.1.in, install-expenses.1.in, install-hinote.1.in, install-memo.1.in, install-netsync.1.in, install-todo.1.in, install-user.1.in, memos.1.in, pi-getram.1.in, pi-getrom.1.in, pi-getromtoken.1.in, pilot-addresses.1.in, pilot-archive.1.in, pilot-foto.1.in, pilot-link.7.in, pilot-xfer.1.in, read-expenses.1.in, read-ical.1.in, read-notepad.1.in, read-palmpix.1.in, read-todos.1.in, read-veo.1.in: Updated manpages from converted XML files in ../xml 2005-01-31 00:25 desrod * doc/xml/: addresses.xml, debugsh.xml, dlpsh.xml, hinotes.xml, ietf2datebook.xml, install-datebook.xml, install-expenses.xml, install-hinote.xml, install-memo.xml, install-netsync.xml, install-todo.xml, install-todos.xml, install-user.xml, memos.xml, money2qif.xml, pi-csd.xml, pi-getram.xml, pi-getrom.xml, pi-getromtoken.xml, pi-nredir.xml, pilot-addresses.xml, pilot-archive.xml, pilot-clip.xml, pilot-csd.xml, pilot-debugsh.xml, pilot-dedupe.xml, pilot-dlpsh.xml, pilot-file.xml, pilot-foto.xml, pilot-getram.xml, pilot-getrom.xml, pilot-getromtoken.xml, pilot-hinotes.xml, pilot-ietf2datebook.xml, pilot-install-datebook.xml, pilot-install-expenses.xml, pilot-install-hinote.xml, pilot-install-memo.xml, pilot-install-netsync.xml, pilot-install-todo.xml, pilot-install-todos.xml, pilot-install-user.xml, pilot-link.xml, pilot-memos.xml, pilot-nredir.xml, pilot-read-expenses.xml, pilot-read-ical.xml, pilot-read-notepad.xml, pilot-read-palmpix.xml, pilot-read-screenshot.xml, pilot-read-todos.xml, pilot-read-veo.xml, pilot-reminders.xml, pilot-schlep.xml, pilot-treofoto.xml, pilot-wav.xml, pilot-xfer.xml, read-expenses.xml, read-ical.xml, read-notepad.xml, read-palmpix.xml, read-screenshot.xml, read-todos.xml, read-veo.xml, reminders.xml: Adding XML versions of the manpages to the tree. These will not be disted but will remain in CVS for continuous editing and updating. Thanks to Neil Williams for the first big push, with major modifications of his work on my part to unify them and clean them up a bit. 2005-01-28 13:52 desrod * bindings/Java/Makefile.am: Oops, commented line here causes java_files to go undefined, breaking the build. Fixed. 2005-01-26 16:49 nicholas * bindings/Python/: TODO, test.py, src/pi-socket.i, src/pisock.i, src/pisock.py, src/pisock_wrap.c: Expose pisock.error exception 2005-01-25 10:48 fpillet * libpisock/pi-file.c: check error in dlp_ReadAppBlock in pi_file_retrieve 2005-01-25 10:39 fpillet * libpisock/pi-file.c: Get info about the database first in all cases, and try to get the appBlock only if its size is > 0. This fixes a Treo 600 crash on some ROM files where you can't get their appBlock without crashing HotSync 2005-01-25 09:01 fpillet * src/pilot-xfer.c: updated to properly detect PQA files. Previous method using the Launchable flag was improper, as other files may also be launchable without being web clippings 2005-01-25 08:42 fpillet * include/pi-dlp.h: added new DB flag definitions up to (and including) OS 6 database flags. Renamed dlpDBFlagClipping to dlpDBFlagLaunchable as it is the official function of this bit 2005-01-24 12:28 fpillet * libpisock/linuxusb.c: Fixed typo 2005-01-23 13:48 nicholas * bindings/Python/: TODO, test.py, src/general-maps.i, src/pi-dlp-maps.i, src/pi-file.i, src/pi-header.i, src/pi-socket-maps.i, src/pi-socket.i, src/pi-source.i, src/pisock.i, src/pisock.py, src/pisock_wrap.c: * Moved entries out of pisock.i into several different files, to start to improve maintainability * Have dlp_ReadDBList() return a list of dicts * Catch up with changes that broke compiling against 0.12 pre1 (may still be lots of other issues around here) * Removed most of the by-hand wrapping and improved swig typemaps to replace it * Put a little hack in test.py so that it can run against an uninstalled version of the pisock module 2005-01-20 17:02 adridg * src/pilot-xfer.c: Don't use asprintf since it isn't available everywhere (or we could have gone the route of providing a portability library). Fix a corner case where lack of memory could cause you to free a const string. 2005-01-20 16:30 adridg * configure.ac: Fix for 1416, 1418, I hope 2005-01-20 16:07 adridg * libpisock/inet.c, m4/socklen.m4: Typenames not for the squeamish 2005-01-20 16:03 adridg * libpisock/: connect.c, contact.c: More header-file madness 2005-01-20 15:51 adridg * libpisock/contact.c: stdint not everywhere 2005-01-20 15:03 adridg * libpisock/freebsdusb.c: Build 2005-01-20 14:58 adridg * include/pi-serial.h, libpisock/inet.c, libpisock/serial.c, libpisock/unixserial.c: Remove socklen_t from the API, and map to kde_socklen_t (the 'right' type for the third argument for accept(2)) where needed (only in inet.c). 2005-01-20 14:50 adridg * README: Remind for folks building from source on BSD 2005-01-20 13:19 fpillet * libpisock/: freebsdusb.c, inet.c, linuxusb.c: more flush() fixes 2005-01-20 13:03 fpillet * libpisock/libusb.c: added flush() support to libusb 2005-01-20 11:59 fpillet * libpisock/freebsdusb.c: added missing parameter to recv() in freebsdusb 2005-01-20 11:55 fpillet * libpisock/unixserial.c: fixed bug in my unixserial changes (doesn't seem to like using recv() instead of read()) 2005-01-20 11:13 fpillet * libpisock/serial.c: forgot to duplicate the flush() ptr in pi_protocol_dup 2005-01-20 10:20 fpillet * libpisock/: darwinusb.c, linuxusb.c, unixserial.c, usb.c, freebsdusb.c, inet.c: flush() implementation at interface level, bug fixes 2005-01-20 10:20 fpillet * libpisock/: cmp.c, net.c, padp.c, slp.c, sys.c, serial.c: flush() implementation in the protocol stack 2005-01-20 10:18 fpillet * include/: pi-serial.h, pi-source.h, pi-usb.h: added flush() call to protocol 2005-01-20 10:18 fpillet * include/pi-dlp.h: added constness to dlp_CallApplication() parameter, numbered DLP error codes to easy debugging 2005-01-20 10:17 fpillet * libpisock/dlp.c: flush input buffer before issuing a new DLP call to make sure we don't get an answer to a previous request 2005-01-20 10:16 fpillet * include/pi-socket.h, libpisock/socket.c: added pi_flush() call 2005-01-19 16:02 adridg * configure.ac: Check for ifaddrs.h (not present on Solaris) -- adding a new AC_CHECK_HEADERS call instead of editing old, because this causes a smaller diff :) 2005-01-19 15:58 adridg * configure.ac, m4/socklen.m4: Configure check for socklen_t, which doesn't exist everywhere. 2005-01-19 15:25 adridg * src/pilot-read-screenshot.c, src/pilot-read-veo.c, src/read-screenshot.c, src/read-veo.c, tests/contactsdb-test.c: No stdint needed (or exists) on 4-stable 2005-01-19 15:18 adridg * src/: install-todo.c, pi-csd.c, pilot-csd.c, pilot-install-todo.c, pilot-read-palmpix.c, pilot-xfer.c, read-palmpix.c: More gcc 2.95 / 4-stable stuff 2005-01-19 15:11 adridg * src/: install-netsync.c, pilot-install-netsync.c: Another 4-stable fix: need sys/types for sys/socket; previous commit used HAVE_, but I see it's included unconditionally in other files, so do same here. 2005-01-19 15:08 adridg * src/: dlpsh.c, pilot-dlpsh.c: gcc 2.95: no statements between declarations 2005-01-19 14:26 adridg * src/: dlpsh.c, pilot-dlpsh.c: For Fernan: #include dependent system header for 4-stable 2005-01-19 14:21 adridg * src/pilot-addresses.c: Constness, which I stumbled over when #including this file in a C++ program (KPilot, which needs compatible CSV output) 2005-01-14 20:39 adridg * doc/man/install-datebook.1.in, src/install-datebook.c, src/pilot-install-datebook.c: For bug 1411: bail on file error _before_ connecting to the Pilot; improve manpage to state that exactly one file is read. 2005-01-14 12:50 desrod * configure.ac: Cut over to -pre2, so there is no confusion between HEAD and the current -pre1 release version. 2005-01-10 17:34 adridg * src/: pilot-read-notepad.c, read-notepad.c: Default to a value that does not cause a warning when the value is left default 2005-01-10 08:06 knghtbrd * src/: pilot-read-notepad.c, read-notepad.c: Default to png. If you don't have libpng and don't specify that you want ppm, you'll get a warning about getting ppm instead of png. I figure that is reasonable, pending a rewrite of this program which supports installing new notepad pages. 2005-01-10 07:57 fpillet * libpisock/net.c: dump invalid header as hex bytes when NET header not recognized 2005-01-10 07:55 fpillet * libpisock/socket.c: my bad -- need to wake up. Properly applied Aaron's patch this time 2005-01-10 07:50 fpillet * libpisock/: socket.c: Aaron's fix: reset pi_buffer_t in protocol_queue_build() after reading a first byte when protocol wasn't immediately recognized 2005-01-10 06:03 fpillet * libpisock/dlp.c: log error and dump invalid data in dlp_response_read if # bytes invalid 2005-01-09 06:42 knghtbrd * include/pi-contact.h, libpisock/contact.c, tests/contactsdb-test.c: Turned ContactsAppInfo_t labels field into an opaque pi_buffer_t. Fixed a typeo in the name of free_ContactsAppInfo, and modified contactsdb_test accordingly. 2005-01-09 06:06 knghtbrd * include/pi-contact.h, libpisock/contact.c, tests/contactsdb-test.c: structs ContactsAppInfo and Contact have _t typedefs now. Added numCustoms field to ContactsAppInfo and removed the addr/im/phone labels (how they're done will change soon). Packing a ContactsAppInfo now copies the customLabels field back in to the labels array before writing (you should treat labels and internal as opaque!) Added freeContactsAppInfo for disposing of allocated data in the structure. Added more error checking where it was needed. Fixed up Copyright headers and included proper attributions. Moved function documentation from contact.c to pi-contact.h, where it will do more good. 2005-01-06 02:12 knghtbrd * src/pilot-foto.c: Check your pointers before you dereference them! 2005-01-05 15:09 adridg * src/: install-todo.c, pilot-install-todo.c: Avoid printing possible uninitialized buffer. 2005-01-02 19:44 adridg * src/pilot-addresses.c: Make --delete-all work 2005-01-02 06:15 knghtbrd * include/pi-contact.h, libpisock/contact.c, tests/contactsdb-test.c: Tweaked the handling of the picture field of a Contact. We have enough information now to process and recreate the header, so we now do so in the pack/unpack functions. The picture field will contain only the JPEG data now, and the pictype field has been added to help future-proof the structure. Currently accepted values for pictype are cpic_none and cpic_jpeg. I also cleaned up some function headers. 2004-12-31 01:58 knghtbrd * include/pi-contact.h, libpisock/contact.c, tests/contactsdb-test.c: The next stage of my libpisock Contacts code rewrite. All functions now take pi_buffer_t's instead of seperate buffers/lens and return 0 or -1 on error. The only function not completely rewritten from the ContactsDB code contributed by ... who contributed it? ... is pack_Contact, which is going to remain as-is until I add AddressDB handling to this code. Please note, while I was able to promise byte-for-byte AppInfo, there are a couple of unused nybbles whose (unused) contents are not reproduced. 2004-12-23 12:28 knghtbrd * tests/contactsdb-test.c: contactsdb-test now uses the libpisock code because I needed to be sure that the libpisock code actually worked on all devices I could test. 2004-12-23 12:24 knghtbrd * include/pi-contact.h, libpisock/contact.c: Support for all versions of ContactsDB, plus some minor bugfixes for the existing support for Tungsten E/T3. I can't myself use this format, so expect it to change between now and 0.12's final release to be more similar to the format I cooked up for my own use. 2004-12-22 19:30 desrod * src/Makefile.am: More cruft-removal 2004-12-22 19:27 desrod * autogen.sh: Remove some unused cruft (actually, this is a stealthy attempt to test the commit log emails, shh!) 2004-12-22 19:22 desrod * autogen.sh: This should really be refactored a bit, it isn't self-healing or scalable, but for the short term, this will do. 2004-12-22 17:57 adridg * src/: Makefile.am, addresses.c, pilot-archive.c: Remove addresses(1) and pilot-archive(1) 2004-12-22 15:00 adridg * src/: pilot-read-todos.c, read-todos.c: Fix for #1230 2004-12-21 19:03 adridg * src/: pilot-archive.c, pilot-read-todos.c, read-todos.c: Deprecate silly -archive and merge into read-todos. 2004-12-21 18:14 adridg * src/pilot-addresses.c: Fix dangerously misleading help text 2004-12-21 18:12 adridg * configure.ac: Give NULL_DEVICE a good default value 2004-12-21 17:32 adridg * src/: pilot-foto-treo600.c, pilot-read-expenses.c, pilot-reminders.c, pilot-treofoto.c, read-expenses.c, reminders.c: Add -w (mandatory) to all 2004-12-21 17:10 adridg * src/pilot-addresses.c: Allow --write - to go to stdout, to mimic old addresses(1) behavior 2004-12-21 17:01 adridg * src/: pilot-addresses.c, pilot-archive.c, pilot-foto-treo600.c, pilot-read-expenses.c, pilot-reminders.c, pilot-treofoto.c, read-expenses.c, reminders.c, userland.c: Remove remainder of wonky no-args handling 2004-12-21 16:58 adridg * include/pi-userland.h, src/addresses.c, src/dlpsh.c, src/pilot-dlpsh.c: dlpsh needs <-i|-c> now. 2004-12-21 16:28 adridg * src/: pi-nredir.c, pilot-nredir.c: Back out previous 'fix': you _must_ specify -n now to get pi-nredir to function. Calling it with no args will print usage. 2004-12-21 15:03 adridg * src/pilot-xfer.c: pilot-xfer needs an argument to indicate action, so let it bail with no args just like everyone else 2004-12-21 14:51 adridg * include/pi-userland.h, src/addresses.c, src/pi-nredir.c, src/pilot-archive.c, src/pilot-foto-treo600.c, src/pilot-nredir.c, src/pilot-read-expenses.c, src/pilot-reminders.c, src/pilot-treofoto.c, src/read-expenses.c, src/reminders.c, src/userland.c: Another thing slapped into userland. For the conduits that don't _need_ any arguments, if there is a port set somewhere else (for the time being: in PILOTPORT), don't bail out but do your stuff. 2004-12-20 18:50 fpillet * src/: memos.c, pilot-memos.c: fixed incorrect casts 2004-12-20 18:43 desrod * include/pi-userland.h: Arg! There's always one last file missing at commit/release time. DOH! 2004-12-20 17:54 desrod * ChangeLog: Update ChangeLog to current with all commit changes to date 2004-12-20 17:37 desrod * pilot-link.m4.in: More strict auto* checking on the macros we're carrying inbound 2004-12-20 17:36 desrod * src/: addresses.c, dlpsh.c, hinotes.c, install-datebook.c, install-expenses.c, install-hinote.c, install-memo.c, install-netsync.c, install-todo.c, install-todos.c, pilot-dlpsh.c, pilot-hinotes.c, pilot-install-datebook.c, pilot-install-expenses.c, pilot-install-hinote.c, pilot-install-memo.c, pilot-install-netsync.c, pilot-install-todo.c, pilot-install-todos.c, install-user.c, memos.c, money2qif.c, pi-csd.c, pi-getrom.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-archive.c, pilot-clip.c, pilot-csd.c, pilot-dedupe.c, pilot-file.c, pilot-foto-treo600.c, pilot-foto.c, pilot-getrom.c, pilot-install-user.c, pilot-memos.c, pilot-nredir.c, pilot-port.c, pilot-read-expenses.c, pilot-read-ical.c, pilot-read-notepad.c, pilot-read-palmpix.c, pilot-read-screenshot.c, pilot-read-todos.c, pilot-read-veo.c, pilot-reminders.c, pilot-schlep.c, pilot-treofoto.c, pilot-wav.c, pilot-xfer.c, plu_args.c, read-expenses.c, read-ical.c, read-notepad.c, read-palmpix.c, read-screenshot.c, read-todos.c, read-veo.c, reminders.c, userland.c: Update userland to handle the relocation of userland.h to include/pi-userland.h 2004-12-20 17:34 desrod * autogen.sh: Some useful fixes for systems with multiple versions of auto* and friends installed (from Neil Williams) 2004-12-20 17:27 adridg * configure.ac, libpisock/Makefile.am: Fix for following: /usr/bin/ld: .libs/unixserial.o: relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC 2004-12-20 17:15 desrod * include/: pi-datebook.hxx, pi-serial.h, pi-source.h: Remove the last bits of WIN32 from the tree, these might return later in another shape and form. 2004-12-20 17:06 desrod * src/userland.h: Removing userland.h, its up in ../include now, as pi-userland.h 2004-12-20 17:05 desrod * configure.ac, include/Makefile.am: Moving libpiuserland headers into the includes dir, non-installable 2004-12-20 16:20 desrod * bindings/Perl/Pilot.xs: Adding changes from Aaron Kaplan to keep the Perl bindings in lockstep with the API changes in 0.12 2004-12-20 15:54 adridg * libpisock/: connect.c, pi-header.c: Marked as deprecated, warn the user about is as well. 2004-12-20 15:52 adridg * include/pi-header.h: Remove prototypes for functions never created, and mark the remainder deprecated. These prototypes cover functions in connect.c and pi-header.c 2004-12-20 15:50 adridg * include/pi-util.h: Add a means to mark functions as deprecated 2004-12-20 15:49 adridg * include/pi-version.h.in: Add a PILOT_LINK_IS macro for doing conditional compilation based on version number (used extensively in KPilot, for one thing, which keeps compatibility with 0.11 and 0.12) 2004-12-20 14:36 desrod * libpisock/: Makefile.am, winserial.c: Removed references to winserial.c, these might return later, or maybe not. 2004-12-20 14:35 desrod * libpisock/: inet.c, serial.c, slp.c, socket.c, syspkt.c, utils.c: Remove any references to legacy WIN32 serial support and NeXT support. When or if someone helps us port this back to Windows, with serial and USB support, these can return, but will need to be rewritten from the ground-up anyway. 2004-12-20 14:22 fpillet * libpisock/serial.c: commented out the frag. off code, until we figure out how to determine whether the connection is bluetooth or usb/linux 2004-12-20 13:17 fpillet * libpisock/serial.c: turn fragmentation off when NET protocol detected 2004-12-20 13:17 fpillet * libpisock/unixserial.c: use memmove() rather than memcpy() where there are potential buffer overlaps 2004-12-20 13:13 fpillet * libpisock/: freebsdusb.c, linuxusb.c: use memmove() rather than memcpy() where there are potential buffer overlaps 2004-12-20 11:55 fpillet * libpisock/inet.c: properly set sockopt on both command and non-command instances of the net protocol 2004-12-20 11:40 desrod * bindings/Java/: Makefile.am, MidiMgr.java: One missing file, one modified file, and a TODO in a pear tree. 2004-12-20 11:16 fpillet * libpisock/inet.c: use the right socket number when setting options 2004-12-20 11:09 desrod * bindings/Java/: Makefile.am, README, README.de, TestTodos.java, adrtest.java, build.xml, datebooktst.java, libjpisock.c, libjpisock.h, test.java, org/gnu/pilotlink/AddressAppInfo.java, org/gnu/pilotlink/AddressRecord.java, org/gnu/pilotlink/AppInfo.java, org/gnu/pilotlink/DBInfo.java, org/gnu/pilotlink/DatabaseExistsException.java, org/gnu/pilotlink/DatabaseNotFoundException.java, org/gnu/pilotlink/DatebookAppInfo.java, org/gnu/pilotlink/DatebookRecord.java, org/gnu/pilotlink/FTB3CostCatRecord.java, org/gnu/pilotlink/FTB3TripRecord.java, org/gnu/pilotlink/FTB3VehicleRecord.java, org/gnu/pilotlink/MemoRecord.java, org/gnu/pilotlink/MidiRecord.java, org/gnu/pilotlink/PilotLink.java, org/gnu/pilotlink/PilotLinkException.java, org/gnu/pilotlink/RawRecord.java, org/gnu/pilotlink/Record.java, org/gnu/pilotlink/ToDoRecord.java, org/gnu/pilotlink/User.java, org/gnu/pilotlink/Version.java: Updating Java bindings to match in lockstep with Stephan Bösebeck's changes 2004-12-20 05:34 fpillet * libpisock/net.c: added useful comment so we don't lose track of why these values are here 2004-12-19 06:51 knghtbrd * tests/contactsdb-test.c: Satisfy any legal weenies who might protest my "license", and make it damned clear that you don't get stuff I didn't write under it. 2004-12-18 20:04 adridg * src/pilot-archive.c: Nothing to CSV here, folks. Move along. 2004-12-18 19:58 adridg * src/pilot-clip.c: Fix up option descriptions. 2004-12-17 16:40 adridg * src/: install-expenses.c, pilot-install-expenses.c: Useful names for STRING parameters 2004-12-17 15:05 desrod * Makefile.am: Bump automake version check down by one 2004-12-17 12:18 fpillet * libpisock/pi-file.c: fixed dlp_ReadAppBlock call 2004-12-17 09:10 fpillet * include/pi-serial.h, libpisock/serial.c, libpisock/unixserial.c: Converted the printfs to LOG messages. Fixed issues in initalizing the protocol structs. Removed buggy ref ptr which was being improperly read in unixserial and would cause some code to be sporadically executed 2004-12-17 09:04 knghtbrd * libpisock/: inet.c, net.c: Okay, new palmOne devices use a USB chip that is broken. Florent already applied a workaround to the code, but it had to be enabled. However, there is no good way to know when to do this. So we will always enable it, except when we know we don't need it. Performance cost? A few (less than ten) miliseconds per megabyte. You won't notice. Really, you won't. 2004-12-17 08:59 knghtbrd * tests/contactsdb-test.c: Erm, how did this get not inited properly? 2004-12-17 06:36 adridg * libpisock/pi-header.c: Use right option explanation; why the heck is this in the library _anyway_ 2004-12-16 01:04 warp * include/pi-dlp.hxx: Let the c++ headers compile again, someone missed something. 2004-12-15 11:24 fpillet * src/: pilot-addresses.c, pilot-archive.c, pilot-read-expenses.c, pilot-read-ical.c, pilot-read-notepad.c, pilot-read-screenshot.c, pilot-read-todos.c, pilot-read-veo.c, read-expenses.c, read-ical.c, read-notepad.c, read-screenshot.c, read-todos.c, read-veo.c: completed updating code for new dlp_ReadAppBlock prototype 2004-12-15 11:14 fpillet * src/: addresses.c, hinotes.c, install-expenses.c, install-hinote.c, install-memo.c, memos.c, money2qif.c, pilot-hinotes.c, pilot-install-expenses.c, pilot-install-hinote.c, pilot-install-memo.c, pilot-memos.c: updating code for new prototype of dlp_ReadAppBlock 2004-12-15 11:03 fpillet * tests/: contactsdb-test.c, dlp-test.c: updated use of dlp_ReadAppBlock and dlp_ReadSortBlock 2004-12-15 10:55 fpillet * include/pi-dlp.h, libpisock/dlp.c: moved dlp_ReadAppBlock and dlp_ReadSortBlock to return data in pi_buffer_t*. Added some more logging to dlp_ReadDBList. Reordered code managing date conversion 2004-12-14 03:53 knghtbrd * libpisock/socket.c: I recall there being more use of NUL and /dev/null in here. Oh well. 2004-12-14 03:44 knghtbrd * configure.ac, src/Makefile.am, src/getopt.c, src/getopt.h, src/getopt1.c, src/pilot-mail.c: Added (currently unused) NULL_DEVICE define to pilot-link, should be set to a string containing whatever your system calls /dev/null. Currently always /dev/null because I don't know the host strings for win32 and OS/2 off the top of my head--but this is okay because support for those platforms needs a rewrite anyway. Also consigned getopt and the long-deprecated pilot-mail to the attic. 2004-12-13 02:40 knghtbrd * tests/contactsdb-test.c: Okay, now contactsdb-test is done. Prints out the data in a useful format that's easy enough to read, and includes actually names the fields properly. 2004-12-13 01:15 knghtbrd * tests/contactsdb-test.c: Now fully dumps ContactsDB-PAdd data for all versions of the file. For the sake of sanity, doesn't hexprint photos, just their size. 2004-12-12 18:14 adridg * doc/man/pilot-addresses.1.in: Match current code 2004-12-12 18:02 adridg * src/pilot-addresses.c: Avoid handing category -1 to dlp_DeleteCategory 2004-12-12 17:48 adridg * src/pilot-addresses.c: Do progress reporting, and suppress totally empty entries (which crop up if you read in a DOS-style CRLF file) 2004-12-12 17:30 adridg * src/pilot-addresses.c: pilot-addresses is now compatible with itself again. yay. read _and_ write 21-field entries now, handle showphone referencing properly. if you use un-augmented entries, all you lose is the showphone property. this is _not_ compatible with PD-output, i think, since PD puts the phoneLabel in brackets after the entry. 2004-12-12 16:03 adridg * src/pilot-addresses.c: Remove -T; #-comment lines are standard, so just generate them unequivocally. 2004-12-12 15:55 adridg * src/pilot-addresses.c: Make encodechars default and mandatory, since we generate _really_ broken CSV otherwise. 2004-12-12 10:50 desrod * autogen.sh, configure.in: Deprecate configure.in in favor of the preferred (and recommended) configure.ac file format 2004-12-12 10:47 desrod * configure.ac: Stay in lockstep with configure.in's most-recent change, oops! 2004-12-12 10:45 desrod * configure.ac: Will deprecate configure.in when this has been tested fully 2004-12-12 10:41 desrod * Makefile.am: Bump minimum required version of automake, because of the added autoconf strict checking 2004-12-11 14:14 adridg * src/pilot-addresses.c: Some code docs; numbers -> enum constants; improve an error message. 2004-12-11 09:27 adridg * src/pilot-addresses.c: Buffer overflow protection, from one of the bugreports closed last night 2004-12-11 05:47 fpillet * include/pi-dlp.h, libpisock/dlp.c: turn id_ into recuid, makes things more explicit (I already had this mod in my local tree) 2004-12-10 19:25 adridg * src/pilot-addresses.c: Fix for 1085; --delete-all wasn't working. 2004-12-10 19:14 adridg * src/pilot-addresses.c: Simplify, simplify, and fix #28, #1073, #717, and lots of others in one go. 2004-12-10 18:18 adridg * src/pilot-addresses.c: Skip comments properly (#830, #1093). Set the fields in the address structure so that you can actually install an address entry from CSV. Remove spurious while() that was probably left over from when this was a do-loop. 2004-12-10 15:46 adridg * src/pilot-addresses.c: Deal with bug #830: every other line is skipped. This looks like a half-finished bugfix on CSV reading -- the fgets() reads a line and it is neatly split into fields, but the _rest_ of the code is still using getc() to read characters directly from the file. Dumped the fgets stuff, so that it at least reads all the lines in the file (doesn't do anything useful with them, though, see all the other address bugs). 2004-12-10 15:35 adridg * src/pilot-addresses.c: Provide more useful --help and --usage 2004-12-10 08:34 adridg * src/pilot-xfer.c: Don't use OpenConduit during a transfer 2004-12-10 04:34 knghtbrd * tests/contactsdb-test.c: One of my random trees had an uncommitted contactsdb-test with the AppInfo decoding finished. Keep in mind, this is brute force and does not use the functions in libpisock to decode ContactsDB, but it also works on every "modern" palmOne device I have, including the Tungsten T5. That'd be more impressive if it actually did something useful--anyone know how we can tell what country numbers are? 23 (0x17) is apparently the United States. 2004-12-09 19:31 knghtbrd * bindings/libjpisock.c, bindings/Java/libjpisock.c, bindings/Tcl/pitcl.c, include/pi-address.hxx, include/pi-dlp.h, include/pi-file.h, include/pi-foto.h, include/pi-header.h, include/pi-slp.h, include/pi-usb.h, libpisock/dlp.c, libpisock/net.c, libpisock/padp.c, libpisock/pi-file.c, libpisock/serial.c, libpisock/slp.c, libpisock/usb.c, libpisync/sync.c, src/debugsh.c, src/memos.c, src/pi-port.c, src/pilot-debug.c, src/pilot-debugsh.c, src/pilot-dedupe.c, src/pilot-file.c, src/pilot-foto.c, src/pilot-mail.c, src/pilot-memos.c, src/pilot-port.c, src/pilot-read-ical.c, src/pilot-wav.c, src/pilot-xfer.c, src/read-ical.c, tests/dlp-test.c: Changes from MarkSpace that are useful. Need to talk to Scott Gruby or someone from MarkSpace about the rest. People using 0.12 will find compile errors with this in their own code (*pilot) around the id -> id_ changes, but they're minor (and important for Objective-C). 2004-12-09 18:47 adridg * src/pilot-xfer.c: * Rename pilot_cardinfo palm_cardinfo, matching all the other functions in pilot-xfer. * Send some error messages to stderr. * -f does VFS, too so mention it in the help string. 2004-12-09 14:36 knghtbrd * include/pi-contact.h: At least provide a warning to people reading the header that they can't trust the functions contained therein to work on later devices. No sense in failing to document what we know. 2004-12-05 12:33 knghtbrd * configure.in: Given that people keep asking where the binaries are and we're done breaking them while we implement VFS, it's safe to reenable them by default. 2004-12-03 19:27 adridg * doc/man/: pi-getram.1.in, pi-getrom.1.in, pi-getromtoken.1.in, pilot-link.7.in: 1) Mention common options in pilot-link (7) 2) Refer to them in a few manpages 3) Add a manpage for getromtoken (1) 4) Mention the new --sysinfo flavor of getrom (1) TODO) Merge all the pi-get* manpages, since it's one executable as well. 2004-12-03 16:38 adridg * doc/man/pi-getram.1.in: Use the correct appname. Two issues come to mind with the manpages: 1) Since all of userland takes --help, --usage, --port, --quiet, perhaps those command-line args should be in pilot-link (7) to save space in the rest. 2) Do we really want the manpages to be (C) FSF? 2004-12-03 16:19 desrod * configure.in, src/hinotes.c, src/install-datebook.c, src/install-expenses.c, src/install-hinote.c, src/install-netsync.c, src/install-todo.c, src/install-todos.c, src/money2qif.c, src/pi-getrom.c, src/pilot-dedupe.c, src/pilot-foto.c, src/pilot-getrom.c, src/pilot-hinotes.c, src/pilot-install-datebook.c, src/pilot-install-expenses.c, src/pilot-install-hinote.c, src/pilot-install-netsync.c, src/pilot-install-todo.c, src/pilot-install-todos.c, src/pilot-schlep.c, src/pilot-wav.c, src/pi-nredir.c, src/pilot-nredir.c, src/pilot-read-notepad.c, src/pilot-read-todos.c, src/read-notepad.c, src/read-todos.c: Bump version from -rc16 to -pre0 for now, to lessen the confusion with bug reporting. Also fixed the serial:/dev/ttyUSB0 issue in userland conduits 2004-12-03 13:54 knghtbrd * src/pilot-xfer.c: A bit inefficient (but pretty output routines usually are), and I need to do something with the little static functions, but all the same the output here is pretty cool.. 2004-12-02 17:28 adridg * src/: pi-getrom.c, pilot-getrom.c: Minuscule feature: printing SysInfo. The ram/rom/token conduit seemed like the most sensible place to fit this in, since they're printing or retrieving pretty non-volatile stuff from the device already. 2004-12-01 10:37 adridg * include/pi-dlp.hxx: Make dlp.hxx compile again 2004-12-01 10:26 fpillet * include/pi-net.h, include/pi-socket.h, libpisock/net.c: added two new sockopt options for NET sockets to allow spliting writes (NET header + data) and also split data in chunks when appropriate (i.e. for USB writes on some devices) 2004-12-01 10:23 fpillet * include/pi-args.h: added shielding against multiple inclusions 2004-12-01 05:30 fpillet * libpisock/net.c: tentative fix for USB issues: as seen on the Windows USB log, write NET header first (6 bytes) then DLP packet split into 4k chunks. This will hopefully fix the Zire 72 and T5 issues. If this work, we can afford using this technique on USB and when connected through other means (inet, bluetooth) then perform single-writes to speedup data transfers. 2004-11-28 15:03 knghtbrd * src/pilot-xfer.c: pilot-xfer -D / -l will now list the root of the default VFS volume, if there is a default. (Adriaan's logic is that there is a default when there is exactly one VFS volume--I intend to change that, but haven't yet.) This means that -l can no longer provide VFS card info. Which is fine, because you can now use pilot-xfer -C for that purpose. 2004-11-28 13:21 knghtbrd * src/pilot-xfer.c: Remove the -d short option for --delete. Things that delete should not have short options. 2004-11-27 14:33 fpillet * libpisock/dlp.c: no C++-style comments 2004-11-27 13:29 fpillet * libpisock/dlp.c: properly set second parameter to WriteRecord to 0x80, indicating that the record data is included in the packet 2004-11-27 08:51 knghtbrd * libpisock/dlp.c: A bit more error logging to try and track down Zire 72 and Tungsten T5 errors. 2004-11-26 09:44 fpillet * include/pi-dlp.h, libpisock/dlp.c: Changed prototype of dlp_CallApplication to use pi_buffer_t to return data 2004-11-25 19:28 desrod * libpisock/: contact.c, usb.c: C++ style comments, tsk tsk. 2004-11-24 05:47 fpillet * libpisock/dlp.c: Take two on previous patch. I think that in the long run, we may need to drop this request != result command check since DLP is processing only one request at a time, and palm software engineers seem to often fail to return proper codes (probably a code cut-and-paste side effect) 2004-11-24 05:40 fpillet * libpisock/dlp.c: Tungsten T5 returns wrong command (dlpFuncEndOfSync) for dlpFuncWriteResource 2004-11-23 06:00 fpillet * libpisock/dlp.c: Added LOG in dlp_exec to track down cases where the result command code is not the same than the request's (may give us a lead to T5 issues). Fixed error code returned by dlp_WriteAppPreference 2004-11-21 16:55 adridg * src/pilot-xfer.c: Make fetch progress reporting obey --quiet; note that without progress reporting, cancels are not detected -- this is something to fix in the library functions. Split the VFS fetch into a function suitable for a library and a userland part (just like with install). Do progress reporting with it as well. 2004-11-21 15:44 adridg * src/pilot-xfer.c: Possible progress reporting for --fetch; I don't think pi_file_retrieve calls the progress function, though. 2004-11-21 15:35 adridg * src/: install-user.c, pilot-install-user.c: Cleanup usage message; basically, the first bit of the string set in OtherOptionHelp immediately follows the usage output that summarizes the options -- it should not contain any of the flags or options, but at most contain a name for the 'remaining arguments' like "FILES ...". Nearly all conduits use \n\n here, since there's no sensible remaining arguments. Make the conduit obey --quiet. Add a --list to avoid the usage-if-no-args scenario for folks with PILOT_PORT set. Follow coding conventions, I think. Fix vi modeline. Add obsequious message to sync log on Palm also when just listing user. 2004-11-21 13:09 desrod * src/: install-user.c, pilot-install-user.c: Rolled back to the previous example output of this conduit. There be bugs here with the --help and --usage output doubling up, and reporting out of order. The output looks horrible. Must fix soon. 2004-11-20 20:10 adridg * src/pilot-xfer.c: Obey --quiet to suppress progress reporting (maybe also want to suppress more); handle cancels by stopping install (tested with internal memory only). 2004-11-20 19:35 adridg * src/pilot-xfer.c: Progress reporting when installing to internal or VFS memory, uses pi_file_install's progress function with a bit of a hack around pi_file_open (which doesn't set the filename). Code shuffled about so that there is a pi_file_install_VFS which might be ripe for inclusion in libpisock. 2004-11-17 17:48 adridg * src/: install-expenses.c, install-hinote.c, install-memo.c, memos.c, pilot-install-expenses.c, pilot-install-hinote.c, pilot-install-memo.c, pilot-memos.c: Factor out category-finding code and use userland. 2004-11-17 11:30 warp * src/: install-memo.c, pilot-install-memo.c: Fix it to work again instead of writing empty memos. When using -t only have the filename as the title, not the full path given. 2004-11-17 11:07 warp * src/: memos.c, pilot-memos.c: Minor indentation fix. Make the save memos to directories thing work. 2004-11-17 10:59 warp * libpisock/socket.c, src/memos.c, src/pilot-memos.c: Zero init a byte buffer. Fix an annoying infinite loop bug in memos.c. 2004-11-16 19:09 adridg * src/pilot-xfer.c: Progress reporting while installing or fetching with VFS (since this is where you'd be putting really big files). I think I've tested fetch enough now, let someone else try next. 2004-11-16 18:49 adridg * include/pi-versamail.h, libpisock/dlp.c, tests/vfs-test.c: Warnings------ 2004-11-15 18:15 adridg * src/: memos.c, money2qif.c, pilot-addresses.c, pilot-memos.c, userland.c, userland.h: Move out some more category searching code. Try to make the code in userland more generic (if only to reflect the variations in the userland conduits themselves before factoring out). I think in the long run the category matching should be standardized on one set of flags. 2004-11-15 18:13 adridg * src/plu_args.c: Warnings--, thanks Matt 2004-11-14 18:34 adridg * src/pilot-xfer.c: VFS fetching appears to work now. Make backups before testing. Shouldn't the size argument to VFSGetSize be a size_t, to be consistent with the rest of the API? 2004-11-14 18:02 adridg * src/: dlpsh.c, pilot-dlpsh.c: -Wall -Werror should be the default 2004-11-14 18:01 adridg * src/: dlpsh.c, pilot-dlpsh.c: Userlandify 2004-11-14 17:57 adridg * src/: pi-port.c, pilot-port.c: Userlandify (even though it's not compiled) 2004-11-14 17:49 adridg * src/pilot-wav.c: Userlandify 2004-11-14 17:38 adridg * src/: Makefile.am, pilot-prc.c: Remove broken and deprecated pilot-prc 2004-11-14 17:19 adridg * src/pilot-dedupe.c: Userland 2004-11-14 17:15 adridg * src/pilot-clip.c: Userlandify 2004-11-14 17:07 adridg * src/: dlpsh.c, install-datebook.c, pilot-dlpsh.c, pilot-file.c, pilot-foto-treo600.c, pilot-install-datebook.c, pilot-treofoto.c: -Wall -Werror based fixes 2004-11-14 16:53 adridg * src/: dlpsh.c, pilot-dlpsh.c: Whitespace 2004-11-14 16:51 adridg * src/: pilot-clip.c, pilot-dedupe.c: Whitespace before the storm 2004-11-14 16:33 adridg * src/pilot-schlep.c: Userland patch from Matt, with some minor tweaks from me. 2004-11-14 16:06 adridg * src/pilot-archive.c: Userlandify. Remove totally bogus if() that implies that it once was possible to read a local .pdb file. 2004-11-14 16:02 adridg * src/pilot-file.c: Userlandify. Make options orthogonal, introduce aliases. Handle more than one filename argument. 2004-11-14 16:01 adridg * src/pilot-archive.c: Whitespace crud 2004-11-14 12:06 adridg * src/pilot-xfer.c: Initial VFS-fetch code. For God's sake, don't try this at home. 2004-11-14 11:41 adridg * src/: install-netsync.c, money2qif.c, pi-csd.c, pi-nredir.c, pilot-csd.c, pilot-install-netsync.c, pilot-nredir.c: Userlandify 2004-11-14 05:36 knghtbrd * libpisock/connect.c, src/userland.c: I thought that I wasn't seeing the press hotsync message because Florent's USB code was doing things in pi_bind that should be done in pi_listen. It is true that he is, but then he's not the only one. All it takes to make the message get printed, though, is to fflush stdout. While I was at it, I made plu_connect a little more intelligent. Didn't bother to mirror the change to pilot_connect since we're not going to be using it for long. 2004-11-14 05:33 knghtbrd * libpisock/socket.c: Rename a static function to be clearer as to its purpose since the symbol is not exported. Part of trying to chart the socket code. 2004-11-14 05:31 knghtbrd * doc/TODO: A couple of TODO notes. There's some stuff in here that's perhaps a bit dated now, but I don't want to make additions or changes to the file without discussing them. 2004-11-13 18:46 adridg * src/: install-expenses.c, pilot-install-expenses.c, pilot-read-expenses.c, read-expenses.c: Use the global string tables from pi-expense.c in libpisock. Do some more argument checking -- hopefully this is correct, to avoid NULL amount strings, for instance. I don't have a copy of Expenses to test with. 2004-11-13 18:28 adridg * src/: install-expenses.c, pilot-install-expenses.c: Userlandify. Removed short option for replace, since it does delete data. install-expenses now installs _an_ expense record even if you give it --replace or --category, which it didn't do recently. Still needs some better argument checking and indent. 2004-11-13 18:21 adridg * src/: pilot-read-expenses.c, read-expenses.c: Straightforward userlandification 2004-11-13 10:12 knghtbrd * src/: hinotes.c, install-datebook.c, install-expenses.c, install-hinote.c, install-netsync.c, install-todo.c, install-todos.c, install-user.c, money2qif.c, pi-getrom.c, pi-nredir.c, pi-port.c, pilot-clip.c, pilot-dedupe.c, pilot-foto.c, pilot-getrom.c, pilot-hinotes.c, pilot-install-datebook.c, pilot-install-expenses.c, pilot-install-hinote.c, pilot-install-netsync.c, pilot-install-todo.c, pilot-install-todos.c, pilot-install-user.c, pilot-nredir.c, pilot-port.c, pilot-read-expenses.c, pilot-read-todos.c, pilot-schlep.c, pilot-wav.c, read-expenses.c, read-todos.c: Removed all mention to /dev/pilot in src! serial:/dev/ttyUSB0 is used instead, just because it's probably a little more obvious that you shouldn't be making random symlinks as newbies keep trying to do for /dev/pilot. Of course, it means that as soon as the device specs are finished being hashed out as part of my planned attack on socket code, someone will have to write some docs to explain it so people don't ask silly questions like why you would use serial: to talk to a Palm with a USB cradle with Linux and visor.ko. I'll worry about that when I'm ready. 2004-11-13 10:03 knghtbrd * libpisock/connect.c, src/plu_args.c: Just a couple of comment cleanups. Note pilot_connect() is deprecated, since it really doesn't belong in libpisock. We should not remove it now because the underlying API may change (that would annoy people) and because we have no good incentive for getting rid of it yet. Multiple transport listens, config files, etc may change that. 2004-11-13 09:20 knghtbrd * include/pi-net.h, libpisock/net.c: Add the sd to net logs. Trying to unbreak pi-nredir. 2004-11-13 08:48 adridg * src/: pi-getram.c, pi-getrom.c, pi-getromtoken.c, pilot-getram.c, pilot-getrom.c, pilot-getromtoken.c: Merge these conduits - still produce 3 executables, but all relevant code is in pi-getrom.c, and you can do pi-getromtoken --ram filename to get the RAM dump if you like. 2004-11-13 07:36 adridg * src/: pi-getram.c, pilot-getram.c: Typo (shortly to be mooted by merging get{ram,rom,romtoken}) 2004-11-13 07:22 knghtbrd * libpisock/connect.c, libpisock/socket.c, src/userland.c: And for /dev/pilot, I see DEATH. Regarding the error message, checking for a null port on a bad result is a bandaid. Since I realised pilot_connect would eventually go away, I kinda painted myself into a corner with my changes to pi_bind. plu_connect is basically a copy of pilot_connect with the same flaw, so it gets the same bandaid. I need to revisit this problem later, but there's some socket level stuff that needs to happen first so that we can actually report useful error messages. 2004-11-13 07:00 adridg * src/: pi-getram.c, pi-getrom.c, pilot-getram.c, pilot-getrom.c, userland.c, userland.h: Factor the rom-version-getting code out of pi-get* into userland. Userlandify pi-getram. Use the new functions in getram and getrom. The version check was for any ROM version >= 5 and with minor version 0. That doesn't make sense to me, unless RPC is reinstated in 5.1 and removed in 6.0 again. 2004-11-12 18:34 adridg * src/: pi-getrom.c, pilot-getrom.c: Userlandify. Move the retrieving-of-majorVersion above the testing-of-majorVersion so it makes sense. Still no OS5 support. 2004-11-12 18:15 adridg * src/: pi-getromtoken.c, pilot-getromtoken.c: Don't commit while discussing the impossibility of the code actually working 2004-11-12 18:13 adridg * src/: pi-getromtoken.c, pilot-getromtoken.c: Userlandify 2004-11-12 17:44 adridg * src/pilot-foto.c: Message sense must make, no? 2004-11-12 17:44 adridg * src/pilot-foto.c: Have a break. Have a kit-kat (tm). 2004-11-12 17:39 adridg * src/pilot-foto.c: Userlandify 2004-11-12 17:38 adridg * include/pi-file.h, libpisock/pi-file.c: Move these two into the public API, conduits have been using them for ages 2004-11-12 16:56 adridg * src/: Makefile.am, pilot-foto-treo600.c, pilot-treofoto.c: Wild stab at userlandification; this conduit just dumps everything to ./, could use a -w or -f. 2004-11-11 17:47 adridg * src/: pilot-read-palmpix.c, read-palmpix.c: Userlandify. The usual stuff, except for the exciting function pointer "action", while everyone else uses an enum and then calls based on that. 2004-11-11 17:29 adridg * src/: pilot-read-notepad.c, pilot-read-palmpix.c, pilot-read-screenshot.c, pilot-read-veo.c, read-notepad.c, read-palmpix.c, read-screenshot.c, read-veo.c: Finish being sidetracked: remove broken protect_files, use userland one, actually check return values, indent bits touched properly and with braces. 2004-11-11 17:15 adridg * src/: pilot-foto-treo600.c, pilot-foto.c, pilot-read-palmpix.c, pilot-treofoto.c, read-palmpix.c: Whitespace crud before actual fix 2004-11-11 17:12 adridg * src/: userland.c, userland.h: Factor out protect_files into userland; make it not leak memory. Make it produce sensible error messages. Make it not buffer-overflow (or perhaps: less often). Remove special-casing from when it produced files a-z and A-Z instead of just numbered 01..99. 2004-11-10 23:59 knghtbrd * src/.cvsignore: Ignore all .lo files 2004-11-10 20:40 knghtbrd * include/pi-dlp.h: filesystem and media types 2004-11-10 18:43 adridg * src/: pilot-read-screenshot.c, pilot-read-veo.c, read-screenshot.c, read-veo.c: Userlandify. Could use a reindent, too. The functon protect_files is common to lots of conduits, should be factored out into userland (and made to be sensible, like using mkstemp(3)). 2004-11-10 17:44 adridg * src/: pilot-read-notepad.c, read-notepad.c: A fair chunk of accidental whitespace changes, also userlandification. This file needs a total reindent anyway. 2004-11-10 17:36 adridg * src/: install-todo.c, pilot-install-todo.c, pilot-read-todos.c, read-todos.c: no cookie. wish that the initial poptification had been consistent in naming the poptContext & the variable used to scan the args 2004-11-10 17:33 adridg * src/: install-todo.c, install-todos.c, pilot-install-todo.c, pilot-install-todos.c, pilot-read-todos.c, read-todos.c: Remember to complain about unhandled options (indicates programming error -- popt table says to return value and it's not handled. 2004-11-10 16:21 adridg * src/: install-todo.c, install-todos.c, pilot-install-todo.c, pilot-install-todos.c, pilot-read-todos.c, read-todos.c: Userlandify. Normalize error messages. This stuff needs refactoring, especially since install-todo -f and install-todos -f overlaps so much. 2004-11-09 17:56 adridg * src/: hinotes.c, install-hinote.c, pilot-hinotes.c, pilot-install-hinote.c: Userlandification of both; standardize error messages. Bail if < 2 args. Could make use of findcategory in plu_, though also uses "feature" of numbered categories. Hinotes deserves an outdent. 2004-11-09 01:02 knghtbrd * src/pilot-xfer.c: Add MMC support to pilot-xfer's VFS listing. The other part of the diff is a suggested Berkeley-style indentation format for David to look over. Then wound up in the same commit just because I hadn't committed the latter change yet. 2004-11-08 18:43 adridg * src/: memos.c, pilot-memos.c: Simplify option processing with popt magic; move processing outside of args loop. Normalize error messages. Do better cleanup. 2004-11-08 18:37 adridg * src/: install-memo.c, pilot-install-memo.c: usage string; bail if no args 2004-11-08 18:03 adridg * src/: pilot-read-ical.c, read-ical.c: Userlandification. Make error messages consistent. Bail if no args. Would like to bail if no ical, but can't detect it reliably. 2004-11-08 17:05 adridg * src/: install-datebook.c, pilot-install-datebook.c: Complain if no-args 2004-11-08 17:00 adridg * src/: pilot-reminders.c, reminders.c: userlandification, error messages now consistent. 2004-11-08 16:49 adridg * src/: pilot-read-ical.c, pilot-read-palmpix.c, pilot-read-veo.c, pilot-wav.c, read-ical.c, read-palmpix.c, read-veo.c: poptification from Matt & Larry 2004-11-07 16:58 adridg * src/addresses.c: Bail with --usage if no arguments; make otheroption help work in --usage. 2004-11-07 16:48 adridg * src/pilot-addresses.c: pilot-addresses.c 2004-11-07 05:02 knghtbrd * src/pilot-xfer.c: Mostly mechanical implementation of my understanding of what David wants for indenting. Only applied to pilot-xfer because pilot-xfer is both long enough to showcase about every situation that we've got in the code but short enough (one file) to be reverted if it's totally wrong. While I'm not sure this is totally wrong, I am sure it's not exactly right. Will wait for input before doing anything further. 2004-11-07 00:56 knghtbrd * src/: Makefile.am, addresses.c, install-datebook.c, install-memo.c, install-netsync.c, install-todo.c, install-todos.c, install-user.c, memos.c, pilot-addresses.c, pilot-install-datebook.c, pilot-install-memo.c, pilot-install-netsync.c, pilot-install-todo.c, pilot-install-todos.c, pilot-install-user.c, pilot-memos.c, pilot-xfer.c, plu_args.c, userland.c, userland.h: Split arg parsing out of userland.c into its own file. Still need to clean up userland.h a little, but have decided that seperate headers probably should be avoided if possible. David doesn't like the plu_ namespace, but didn't have a better suggestion. plu_args.c may get renamed if he comes up with one, along with a sed. Tried not to make significant other changes this run, but I did remove a couple of highly-unwise exit() calls without bothering to close the link to the PDA..oops! 2004-11-06 21:23 desrod * src/: memos.c, pilot-memos.c, userland.c: Still needs a bit of cleanup here, but we have to make sure we're spitting out USEFUL messages when the user presents the conduit with some sort of error condition, such as a bad option. This does that... The other problem here (not fixed in this commit) is that we're trying to connect to a bogus, non-existant port, when no options are specified. This has to be fixed! Any conduit run without options, should report --help or --usage. 2004-11-06 18:34 desrod * libpisock/utils.c, tests/versamail-test.c: Minor fix for buggy compiler warnings with certain locales. We probably need this anyway, going forward, as more and more non-English Palm devices come out. This prevents the compiler from yield a 2 or 4 digit year depending on the locale currently active. 2004-11-06 17:00 adridg * src/: install-datebook.c, pilot-install-datebook.c: Userlandification, accidental whitespace 2004-11-06 16:44 adridg * src/pilot-addresses.c: Userlandification, rename some options and add deprecated warnings; remove short -D option because earing all data shouldn't _have_ a short option. 2004-11-06 16:41 adridg * src/pilot-xfer.c: Move --booger to userland under a better name 2004-11-06 16:39 adridg * src/: userland.c, userland.h: Add support for aliasing and deprecated option handling 2004-11-06 13:39 adridg * src/Makefile.am: Add userland lib everywhere where it will eventually be needed. 2004-11-06 13:35 adridg * src/: Makefile.am, addresses.c: Port to userland 2004-11-06 04:47 adridg * src/pilot-xfer.c: Test after committing. 2004-11-06 03:28 knghtbrd * src/pilot-xfer.c: Good idea to test before you commit, people. pilot-xfer was broken because sd was never assigned. The error is still not caught in a meaningful way, but at least after connecting we now actually use the sd.. 2004-11-06 02:56 knghtbrd * src/: Makefile.am, pilot-xfer.c: Memos uses the new userland convenience lib. Removed unused variable progname from pilot-xfer. 2004-11-05 19:27 adridg * src/: memos.c, pilot-memos.c: Use userland. See conduit status for what's totally wrong here. 2004-11-05 19:23 adridg * src/: userland.c, userland.h: Add a findcategory function, since this is common in conduits -- however, no two seem to do it the same, there's a weird mishm,ash of strcasecmp, strcmp, and I wonder if the n (=15) is really needed here. Nothing uses this yet. 2004-11-05 17:45 adridg * src/: Makefile.am, install-memo.c, pilot-install-memo.c: Port to popt / userland. This was a bit of a mess, seems earlier it handled multiple files, which has been mercilessly ripped out (and made buggy in the process). TODO: Check if the WriteUserInfo is needed. 2004-11-05 16:56 adridg * src/: install-netsync.c, pilot-install-netsync.c: Port to userland, modify arg setting a little (needs test) 2004-11-05 16:55 adridg * src/Makefile.am: Remove getopt stuff; add magic for updating makefile when Makefile.am is changed (works with gmake, mostly) 2004-11-05 16:24 adridg * src/pilot-xfer.c: Port to userland lib, remove --verbose which didn't actually do anything of note. 2004-11-05 16:18 adridg * src/: install-todo.c, pilot-install-todo.c: - port to userland lib - fix breakages from popt porting - fix example strings TODO: figure out if the WriteUserInfo call is needed (or indeed, doesn't totally break the Pilot by not having a username set). 2004-11-05 16:04 adridg * src/: userland.c, userland.h: Rename quiet to userland_quiet, make accessible from outside (so conduits can obey it). 2004-11-05 04:14 knghtbrd * src/.cvsignore: Update .cvsignore for new piuserland library droppings 2004-11-05 04:12 knghtbrd * src/Makefile.am: Er, oops--make before cvs ci! 2004-11-05 04:08 knghtbrd * src/Makefile.am: Make libpiuserland a proper (static only) libtool library. Much easier this way. 2004-11-05 03:39 adridg * src/Makefile.am: Rename lib to libpiuserland to avoid name clash; don't link this static lib to anything else for now. 2004-11-04 19:26 adridg * src/: Makefile.am, install-todos.c, pilot-install-todos.c: Port install-todos to userland. TODO: fix indent, change reader function to user fgets() instead of reading entire file into memory. 2004-11-04 19:06 adridg * src/: Makefile.am, install-user.c, pilot-install-user.c: Port install-user to new factored-out userland lib. 2004-11-04 19:01 adridg * src/: Makefile.am, userland.c, userland.h: Initial teensy userland library. This will spur the factoring-out of common option handling code. 2004-11-04 16:58 adridg * src/pilot-xfer.c: First of many (next one will be bundled, though): consolidate common options, deprecate -v for --version, use -v for verbose where applicable. Let popt do the help stuff. Minor string tweaks. 2004-11-04 00:56 knghtbrd * src/pilot-xfer.c: Use /cardX rather than /slotX, it's more in keeping with Palm's way of doing things. 2004-11-04 00:50 knghtbrd * src/pilot-xfer.c: pilot-xfer -D / -l (list VFS volumes) now gives you some useful information about unknown filesystems and media types. Used this new feature to add support for the internal VFS memory devices of the Tapwave Zodiac and Tungsten T5. Adding information for Sony devices should be trivial if someone's willing to run this on them. 2004-11-03 19:55 adridg * src/pilot-xfer.c: * Introduce cleverness to allow aliasing. * Introduce aliases for -FOI and --List(all). * Complain about all the deprecated names with secret hidden argument --booger. Was unable to be mature enough to invent a different name. * Reduce cleverness by exploiting more popt features, complaining earlier about mixed media; distinguish -bus until the time comes to actually call palm_backup(). * Correct various messages. 2004-11-03 19:10 knghtbrd * src/.cvsignore: Update .cvsignore to inclue pilot-treofoto 2004-11-03 18:56 knghtbrd * src/: pilot-read-notepad.c, read-notepad.c: Fix minor compile niggle (no progname in that function). Raises interesting question for error messages, but not one worth answering right now. 2004-11-02 19:56 desrod * src/: dlpsh.c, hinotes.c, install-datebook.c, install-expenses.c, install-hinote.c, install-netsync.c, install-todo.c, install-todos.c, install-user.c, memos.c, money2qif.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-getromtoken.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-archive.c, pilot-clip.c, pilot-csd.c, pilot-dedupe.c, pilot-dlpsh.c, pilot-file.c, pilot-foto-treo600.c, pilot-foto.c, pilot-getram.c, pilot-getrom.c, pilot-getromtoken.c, pilot-hinotes.c, pilot-install-datebook.c, pilot-install-expenses.c, pilot-install-hinote.c, pilot-install-netsync.c, pilot-install-todo.c, pilot-install-todos.c, pilot-install-user.c, pilot-memos.c, pilot-nredir.c, pilot-port.c, pilot-prc.c, pilot-read-expenses.c, pilot-read-notepad.c, pilot-read-screenshot.c, pilot-read-todos.c, pilot-read-veo.c, pilot-reminders.c, pilot-schlep.c, pilot-treofoto.c, pilot-wav.c, pilot-xfer.c, read-expenses.c, read-notepad.c, read-screenshot.c, read-todos.c, read-veo.c, reminders.c: Fixing some of the const'ness issues, cleaned up some whitespace and indenting in other areas. More to come... 2004-11-02 17:56 adridg * src/pilot-xfer.c: Use symbolic constants instead; fix breakage of --update and --sync; setting flags for restore makes no sense. 2004-11-02 17:22 desrod * configure.in, src/Makefile.am, src/pix/Makefile.am, src/prc/Makefile.am: Change the action to build the userland conduits to default to OFF. 2004-11-02 16:29 adridg * src/pilot-xfer.c: Produce consistent error messages 2004-11-02 16:19 adridg * src/pilot-xfer.c: Cleverness reduction by relying on popt feature to set bits in a bitfield 2004-11-02 16:04 adridg * src/pilot-xfer.c: Fix up file listings to rememble ls, correct help string. 2004-11-02 15:33 adridg * src/pilot-xfer.c: Restore -lL honoring -D by removing cleverness from mediatype handling; except for -L -D, which mixes ROM with VFS, everything is disallowed. Also cleans up things like -b dir -O -F (whut?). 2004-11-01 21:58 knghtbrd * src/pilot-xfer.c: Make -l and -L sortof work. Still won't honour -D with -l and -L, but it's at least not dereferencing NULL anymore. 2004-11-01 21:52 desrod * src/pilot-xfer.c: Minor updates: - Renamed all CamelCap functions to align them with the rest of userland - Updated the popt clause indenting - Fixed the const'ness of argv and other values (cleaned a warning out) - Fixed erroneous flag breakage with BACKUP and UPDATE and SYNC. Sync is still broken, but I'll get to that next 2004-11-01 19:32 adridg * src/pilot-xfer.c: After much discussion, back and forth, modify pilot-xfer's argument handling _again_; it now does: * Sanity checking before connecting. * Accepts exactly _one_ of the -bursimfdlL flags and complains otherwise. * -burs still take a . * -imfd don't take a particular argument, but apply to all the leftovers. This covers cases like --install foo.prc --port /dev/pilot --install *.prc --port /dev/pilot --install --port /dev/pilot --vfsdir /slot1/ *.prc You can't mix them, though -- this was deemed too compilcated and unused anyway, so no --install *.prc --delete *.mp3. * -lL don't take any extra arguments, and will complain if they are found. * --Purge, if present, is done after -bursimfdlL. I do not claim to have tested all combinations of arguments that are possible, and there are many that do not even make sense (like --backup with --vfsdir) that are not complained about. The --exec option is now left in a strange position. When pilot-xfer acted upon each argument in turn from left (argv[1]) to right (argv[argc-1]), doing a system() between two other actions might have made sense. Now, since we collect arguments and act on them _after_ initial processing where the position of the options is lost, --exec doesn't have a specific spot where it should be executed, eg. --port /dev/pilot *.prc --exec /bin/halt *.pdb --install is also a valid command-line, and there's no way to tell that that exec was "supposed" to happen between the prcs and the pdbs. 2004-10-31 18:54 adridg * src/: Makefile.am, dlpsh.c, install-expenses.c, install-todos.c, memos.c, money2qif.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-nredir.c, pilot-addresses.c, pilot-archive.c, pilot-clip.c, pilot-csd.c, pilot-dlpsh.c, pilot-file.c, pilot-foto.c, pilot-getram.c, pilot-getrom.c, pilot-install-expenses.c, pilot-install-todos.c, pilot-mail.c, pilot-memos.c, pilot-nredir.c, pilot-prc.c, pilot-read-expenses.c, pilot-read-screenshot.c, pilot-read-todos.c, pilot-read-veo.c, pilot-wav.c, read-expenses.c, read-screenshot.c, read-todos.c, read-veo.c: Merge remaining popt fixes from Larry, so we can get down to serious bickering about what the options to pilot-xfer mean. 2004-10-29 16:19 adridg * src/pilot-xfer.c: Distinguish backup/restore/sync/update behavior from Swiss-army-knife behavior with messages; all SAK actions can be specified multiple times, so you can do -D /slot1/ -i foo.c -i bar.c -d blurfl.c -P to install two files to SD card, delete one, then purge databases. 2004-10-29 15:27 adridg * src/pilot-xfer.c: You can now -i(nstall) more than one file, just like merge and delete. Removed totalsize calculation bug. Introduced silly message at end if all you do is install files. Next up: discombobulate functionality into _either_ -burs, all of which run only once after option processing, _or_ -ifmd which may perform many actions on the device. 2004-10-29 03:48 adridg * src/Makefile.am, src/hinotes.c, src/install-datebook.c, src/pilot-hinotes.c, src/pilot-install-datebook.c, src/install-hinote.c, src/pi-getromtoken.c, src/pi-port.c, src/pilot-dedupe.c, src/pilot-getromtoken.c, src/pilot-install-hinote.c, src/pilot-port.c, src/pilot-read-notepad.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-notepad.c, src/reminders.c, tests/Makefile.am: All around the mulberry bush .. popt goes the weasel. Merge patches from Matt for popt support in most places. Tested on pilot-xfer, not on the rest. 2004-10-28 16:07 adridg * src/pilot-xfer.c: All your whitespace are belong to us 2004-10-27 17:52 adridg * src/pilot-xfer.c: Apply coelecanth-B-gone (tm), don't duplicate filenames, check target for dir-ness. 2004-10-27 17:26 adridg * src/pilot-xfer.c: This VFS code works (leave coelecanth in for the time being, though); don't make -l or -L reset the media type if -D already given. 2004-10-27 04:57 adridg * src/pilot-xfer.c: Speak the truth about VFS file install until I can figure out what goes on (or copy code from vfs-test to do the install) 2004-10-26 19:04 adridg * libpisock/dlp.c: 64-bit safeness - use defined stop value 2004-10-26 19:02 adridg * include/: pi-dlp.h, pi-macros.h: 64-bit safeness - this feels like LISP, with all the (). Basically, get_long would return sign-extended values otherwise. 2004-10-26 19:00 adridg * tests/vfs-test.c: Bail if device can't be opened. 2004-10-26 17:54 adridg * src/pilot-xfer.c: fix off-by-one that ate setuid's SD card 2004-10-25 13:35 fpillet * include/pi-dlp.h: re-added vfsModeReadWrite to the enum 2004-10-24 18:09 adridg * src/pilot-xfer.c: Install to VFS with -D /vfs/dir -i file -- however, it doesn't work and every attempt returns error code -301 from the dlp_exec() call in dlp_VFSFileWrite(). 2004-10-24 16:25 adridg * src/pilot-xfer.c: Lose --time; use centralized pi_mktag and friend. Try to get a reasonable date result in listing files. 2004-10-24 14:18 adridg * include/pi-util.h: #defube is a BSD extension, for sure 2004-10-24 14:13 desrod * src/: pilot-foto-treo600.c, pilot-treofoto.c: Remove unnecessary headers 2004-10-24 09:24 adridg * src/pilot-xfer.c: Refactor a little to a VFSRootPath finder that is reusable; start on VFS install support. Once this is done, I'd like to factor the install and list parts out into something more library-like (ie. no dependence on global varialbes like sd and vfsdir) so that it's immediately reusable in the GUI bits. 2004-10-24 08:14 adridg * include/pi-util.h: One I'm not entirely sure about: define pi_mktag and an inverse in one central place, so we could lose the defines in (almost) every userland conduit, as well as bits of code here and there (like piloe-xfer.c:451). 2004-10-24 08:11 adridg * src/pilot-xfer.c: Lose the remaining non-symbol constants for pathname lengths 2004-10-24 08:08 adridg * src/pilot-xfer.c: Add docs all over, remove dead code. 2004-10-24 01:33 desrod * src/: Makefile.am, pilot-foto-treo600.c, pilot-treofoto.c: Added new conduit to pull photos from the Treo. Need to popt this a bit to take port and image arguments. 2004-10-24 01:26 desrod * src/: addresses.c, debugsh.c, dlpsh.c, hinotes.c, install-datebook.c, install-expenses.c, install-hinote.c, install-memo.c, install-netsync.c, install-todo.c, install-todos.c, install-user.c, kittykiller.c, memos.c, money2qif.c, pd-tty.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-getromtoken.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-archive.c, pilot-clip.c, pilot-csd.c, pilot-debug.c, pilot-debugsh.c, pilot-dedupe.c, pilot-dlpsh.c, pilot-file.c, pilot-foto.c, pilot-getram.c, pilot-getrom.c, pilot-getromtoken.c, pilot-hinotes.c, pilot-install-datebook.c, pilot-install-expenses.c, pilot-install-hinote.c, pilot-install-memo.c, pilot-install-netsync.c, pilot-install-todo.c, pilot-install-todos.c, pilot-install-user.c, pilot-mail.c, pilot-memos.c, pilot-nredir.c, pilot-port.c, pilot-prc.c, pilot-read-expenses.c, pilot-read-ical.c, pilot-read-notepad.c, pilot-read-palmpix.c, pilot-read-screenshot.c, pilot-read-todos.c, pilot-read-veo.c, pilot-reminders.c, pilot-schlep.c, pilot-wav.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-notepad.c, read-palmpix.c, read-screenshot.c, read-todos.c, read-veo.c, reminders.c: Updated mode lines to ensure proper indenting going forward (for those that use a real editor) 2004-10-24 01:21 desrod * libpisock/: darwinusb.c, datebook.c, debug.c, dlp.c, expense.c, freebsdusb.c, hinote.c, inet.c, libusb.c, linuxusb.c, mail.c, md5.c, memo.c, money.c, net.c, notepad.c, os2serial.c, padp.c, palmpix.c, pi-buffer.c, pi-file.c, pi-header.c, serial.c, slp.c, socket.c, sys.c, syspkt.c, todo.c, unixserial.c, usb.c, util.c, utils.c, veo.c, versamail.c, winserial.c: Just adding editor modelines, to keep the indenting proper going forward 2004-10-23 23:57 desrod * include/pi-dlp.h: More indenting/formatting fixes for readibility 2004-10-23 23:47 desrod * libpisock/dlp.c: Cleaned up function doc header info, reindenting fixes here and there 2004-10-23 21:59 desrod * src/pilot-xfer.c: Some indenting cleanup, remove useless novsf calls, added missing option in --help output, other minor bits. 2004-10-23 20:01 adridg * src/pilot-xfer.c: Initial VFS support. Add a -D /vfs/dir option, in order to indicate that whatever operation is selected for pilot-xfer should apply to VFS instead of the usual (databases, I guess). Implemented for listing (-L) only, so far. Usage: pilot-xfer -L -D / Lists the "fake root" of VFS dirs on the Pilot. This will show the SD slots and whatnot returned by VFSVolumeEnumerate. For each slot, the slot number is used as a directory name _and_ the volume label, if any. In addition, slot information is printed. pilot-xfer -L -D /slot1/ Lists the root directory of the card in slot 1. Alternatively, if the FS in that slot has a volume label, you can use the name of the volume. pilot-xfer -L -D /slot1/DCIM/100MLT08/ Lists the files in that directory. As a special case, if there is exactly one slot (test case: T5? Tapwave?) and the first path component matches none of the slots / volumes present, it is assumed to be a path in /slot1 (ie. if all else fails, use /slot1 as root), so the following works as well: pilot-xfer -L -D /DCIM/100MLT08 Not visible in pilot-xfer help yet. 2004-10-23 19:52 adridg * include/pi-dlp.h: Whoops, missed the existing #defines; moved into the enum to make style more consistent. 2004-10-23 18:54 adridg * include/pi-dlp.h: Add the constants from the Palm SDK for VFSFileOpen to pi-dlp. 2004-10-21 03:14 knghtbrd * tests/contactsdb-test.c: The good news is that Contacts 1.2 (Tungsten T5) uses the same data format as Contacts 1.1 (Zire 72/31). 2004-10-19 12:48 knghtbrd * libpisock/freebsdusb.c, src/Makefile.am: Adriaan's make_it_compile patch for FreeBSD, also fixes a SNAFU for popt. 2004-10-19 12:45 knghtbrd * tests/contactsdb-test.c: Change the guess about unknown data in contactsdb (not a big deal).. 2004-09-28 01:57 knghtbrd * libpisock/serial.c: Matt Davey reports that the timeout value passed to impl.poll should be in miliseconds, not seconds. Patched. 2004-09-27 00:59 angusa * src/: pilot-read-screenshot.c, read-screenshot.c: fixed width and height being reversed CV: ---------------------------------------------------------------------- 2004-09-23 08:03 fpillet * include/pi-dlp.h: added vfs volume attribute definitions 2004-09-22 10:57 knghtbrd * tests/: .cvsignore, Makefile.am, contactsdb-test.c: Elementary test for ContactsDB AppInfo structure. It's very brute force, still incomplete, and doesn't even try to use Nicholas' parser functions. The good news is that they parse the appinfo for both PalmOS 5.2.1 and 5.2.8 PalmOne PDAs, which happen to use completely different formats for the file, naturally. ;p Nicholas' parser functions will probably need significant tweaking to work with both formats, and there are other considerations as well. 2004-09-15 08:44 knghtbrd * libpisock/pi-file.c, src/pilot-xfer.c: I have a great idea! Let's have a filename which can be at most 256 chars long. Let's also do an unsafe sprintf into a buffer which is only 70 bytes long and includes the filename! I made the buffer a lot longer than it needed to be, but *shrug* a little futureproofing can't hurt. 2004-09-12 10:56 desrod * doc/TODO: Updates for documentation changes 2004-09-11 06:40 knghtbrd * src/pilot-addresses.c: Removed some dead code. This doesn't improve pilot-addresses much, but it at least guarantees that there is one track for the code to follow. Yet unresolved issues are: - table headings may be broken still (didn't check) - The augment option produces completely useless output still - The option not to escape data produces broken CSV, so it probably should be disabled. - CSV is braintead and useless as an interchange format since it's so completely mind-numbingly useless that everyone seems to have their own idea of how to "support" things it was never designed to. - Given the above, no amount of work on this codebase will ever make it useful and bug-free, ever. The optimal solution is to cease using CSV data, with prejudice. 2004-09-10 13:52 desrod * configure.in: Removing pilot-datebook entries 2004-09-10 09:02 fpillet * libpisock/dlp.c: it's better if we actually USE the variables we just defined... 2004-09-10 08:51 fpillet * include/pi-dlp.h, libpisock/dlp.c: added dlp_set_protocol_version() func so that client apps can chose their own compatibility level (i.e. setting to 2.1 allows connecting to Palm OS 6) 2004-09-10 08:50 fpillet * libpisock/darwinusb.c: minor tweaks to device table 2004-09-09 01:17 desrod * src/pilot-xfer.c: Minor output tweak, no double \n for failed files. 2004-09-08 23:57 desrod * Makefile.am, src/Makefile.am: Archive pilot-datebook for now.. will rewrite later 2004-09-04 14:09 desrod * configure.in: Minor fixes 2004-09-04 13:35 knghtbrd * configure.in, m4/vl_lib_readline.m4: AC_CHECK_LIB adds the checked thing to LIBS. Stupid autoconf. Also, I apparently got too clever with vl_lib_readline.m4, reverted. David wanted --disable-userland to still have output for the unused (and therefore unchecked) libs, output provided. 2004-09-04 12:58 knghtbrd * configure.in, m4/vl_lib_readline.m4, src/Makefile.am, src/pix/Makefile.am, src/prc/Makefile.am: New configure argument --disable-userland, makes make in src make only make output. =) 2004-09-03 12:13 desrod * configure.in: Minor indenting removal 2004-09-03 12:05 knghtbrd * configure.in: This should make --with-included-popt actually include popt. =) 2004-09-03 10:54 desrod * configure.in: Fix flags so they don't bark about 'implicit declaration' when I'm including the right header. gnu99 give us c99 + POSIX + GNU 2004-09-02 16:50 knghtbrd * configure.in: popt check should no work properly and fail gracefully if your popt installation isn't useful. 2004-09-02 13:55 desrod * configure.in: Added saner pedantic flags, fixed a 1-char typo which SHOULD have caused this to fail completely. 2004-09-02 12:20 fpillet * libpisock/net.c: updated copyright in net.c (a little fame doesn't hurt ;-)) 2004-09-02 12:11 fpillet * libpisock/dlp.c: some casts and a couple additional tests inspired by Mark/Space's incredible work on 0.11.8 ;-) 2004-08-31 18:27 fpillet * libpisock/darwinusb.c: added Sony NR70V/U to known devices matrix 2004-08-31 18:26 fpillet * libpisock/dlp.c: fixed argid mask 2004-08-29 11:41 knghtbrd * include/pi-socket.h, libpisock/connect.c, libpisock/freebsdusb.c, libpisock/inet.c, libpisock/linuxusb.c, libpisock/socket.c, src/debugsh.c, src/pi-nredir.c, src/pilot-debugsh.c, src/pilot-nredir.c: Here's the prefix patch from -future. Small API change to pi_bind and pi_connect, but it's minor. pilot-link's userland has been updated to work with the changes. 2004-08-27 12:27 knghtbrd * popt/: COPYING, README, popt.c: values.h is obsolete, float.h is the standard nowadays. 2004-08-27 08:47 fpillet * libpisock/dlp.c: make dlp_VFSFileRead return the total number of bytes read on success 2004-08-27 03:32 fpillet * libpisock/net.c: log tickle packets 2004-08-27 01:06 desrod * src/: Makefile.am, install-todo.c, pilot-install-todo.c: Converted install-todo over to popt, added Makefile.am poke for POPT_LIBS and fixed a few smaller logic flow issues in the conduit. 2004-08-26 22:46 desrod * src/: install-memo.c, pilot-install-memo.c: Silly non-portable basename() hack 2004-08-26 22:20 desrod * src/: Makefile.am, install-memo.c, pilot-install-memo.c: Converted install-memo over to popt, incremented changes in Makefile, fixed some common logic flow problems in the conduit itself, added a parameter for passing in a filename. 2004-08-26 14:51 desrod * src/: install-netsync.c, pilot-install-netsync.c: Moved globals out 2004-08-26 12:01 fpillet * libpisock/dlp.c: fixed a Sony protocol bug: their dlp_VFSDirEntryEnumerate() returns a short flags value per file, whereas a long is expected. We detect this and properly modify the flag so it's transparent for the caller application 2004-08-26 10:30 fpillet * tests/vfs-test.c: don't fail dirList test if directory is empty 2004-08-26 09:18 fpillet * tests/vfs-test.c: fixed error testing 2004-08-26 01:14 desrod * src/: Makefile.am, addresses.c, install-netsync.c, install-user.c, pilot-install-netsync.c, pilot-install-user.c: More popt conversions... still more to go. 2004-08-26 00:33 desrod * src/: install-netsync.c, pilot-install-netsync.c: Completed the first phase of the popt migration from getopt_long. Only a few more tweaks to go in here for robustness. 2004-08-25 12:36 desrod * src/: install-netsync.c, pilot-install-netsync.c: Converted the option/arg parsing over to popt from getopt_long 2004-08-25 11:15 desrod * popt/popt.c: Fix an upstream popt problem, missing include for values.h 2004-08-25 11:06 desrod * popt/: findme.c, findme.h, popt.c, popt.h, poptconfig.c, popthelp.c, poptint.h, poptparse.c, system.h: Updating popt to current, which hopefully didn't just break everything =) 2004-08-25 10:32 desrod * configure.in: Moving to -rc14 2004-08-25 10:03 knghtbrd * libpisock/net.c: Proofread carefully to see if you anything out. (Typo fix) 2004-08-24 04:13 fpillet * include/pi-socket.h, libpisock/socket.c: moved version and maxrecsize out of pi_socket_list_t and back into pi_socket_t where they belong. version is renamed dlpversion (clients use pi_version() to access it) 2004-08-24 04:11 fpillet * include/pi-dlp.h, include/pi-usb.h, libpisock/dlp.c: fixed prototypes to not use 'index' as a parameter name, as it shadows the global index() function 2004-08-24 03:58 fpillet * libpisock/usb.c: properly enclose LOG macro in a block (more) 2004-08-24 03:57 fpillet * libpisock/usb.c: properly enclose LOG macro in a block 2004-08-23 20:01 fpillet * libpisock/pi-file.c: more fixes, one place where result code was not properly set, minor tweaks for compiler warnings 2004-08-23 19:46 fpillet * libpisock/inet.c: one cast can make a compiler happy 2004-08-23 19:45 fpillet * libpisock/darwinusb.c: minor tweaks 2004-08-23 17:04 fpillet * libpisock/dlp.c: fixed several compile warnings 2004-08-23 16:38 fpillet * libpisock/pi-file.c: fixed pi_buffer leak in pi_file_retrieve() 2004-08-23 16:14 desrod * libpisock/usb.c: Static variables are initialized to zero at compile-time, this cleans up two remaining warnings there. 2004-08-23 16:10 desrod * libpisock/usb.c: Minor fixes, indentation to improve readibility 2004-08-23 12:00 fpillet * libpisock/socket.c: fixed a bug I just introduced in ps_list_append 2004-08-23 11:59 fpillet * src/pilot-foto.c: open dest files in 'wb' mode, reformated do_fetch() 2004-08-23 11:58 fpillet * libpisock/dlp.c: when reading records & resources, always request the max possible size (don't require callers to pre-allocate buffer size) 2004-08-23 11:42 fpillet * libpisock/: serial.c, usb.c: properly clear ps->sd when closing the device. this change is propagated from inet.c. This eliminates risks of double-closing 2004-08-23 11:36 fpillet * libpisock/socket.c: fixed a subtle bug in pi_close: the list elem must be removed from the queuest before we call the device's close() function, because when the close() function clears the device's sd, ps_list_remove() wouldn't find it in the list anymore and we end up with a double close() when the onexit() handler is called 2004-08-23 09:15 fpillet * libpisock/freebsdusb.c: return proper error code when u_read fails 2004-08-22 03:32 knghtbrd * libpisock/: connect.c, serial.c: The tests performed on serial devices by pilot_connect actually belong down in the serial code. Moved them there. (Actually, I suspect that they need to move further down into the UNIX serial code, but I'll wait for some clue how to handle OS/2 and Win32 first..) 2004-08-21 10:22 knghtbrd * libpisock/serial.c: I think Florent may have missed an error check. This error basically is never -1 anymore. I get ... -501. Simple enough fix. 2004-08-21 10:17 knghtbrd * libpisock/connect.c: Remove some cruft from pilot_connect. Changes what you'll see if you try to pilot_connect without -p or PILOTPORT, but should not have any ill effects. 2004-08-21 05:14 knghtbrd * src/.cvsignore: added read-screenshot to .cvsignore 2004-08-17 11:37 fpillet * libpisock/dlp.c: make dlp_VFSFileWrite return the actual number of bytes written in case of success 2004-08-11 09:07 fpillet * libpisock/socket.c: changes static installedexit variable to public pi_sock_installedexit so that library clients can choose not to have an exit function installed (it causes lots of trouble for threaded clients, as exit function would be called from the main thread while other threads would be working with the socket being closed) 2004-08-11 09:05 fpillet * libpisock/inet.c: minor tweaks 2004-08-09 05:36 nicholas * include/pi-contact.h: I presume we should really include a time.h as tm is used 2004-08-06 10:00 fpillet * libpisock/padp.c, include/pi-padp.h: Added patch to fix bug #1032 (plus a couple cleanups). PLEASE RETEST as I can't test padp communications here (yet) 2004-08-06 06:26 fpillet * libpisock/socket.c: Integrated Aaron's fix for bug 1173: on PADP protocols, tickling the socket would send the wrong command 2004-08-06 05:36 fpillet * src/pilot-xfer.c: use malloc() instead of fixed-size stack buffer for file paths in Backup(). unlink() file if pi_file_retrieve() failed. Exit if socket is disconnected before end of backup. 2004-08-05 14:51 fpillet * libpisock/slp.c: Fixed bug #244: allocate slp_buf using malloc() instead of the stack to guarantee proper alignment (was segfaulting on sparc) 2004-08-05 14:30 fpillet * libpisock/net.c: Integrated patch for bug #1174 (receiving a PI_TICKLE would disrupt reception of the answer to the last query) 2004-08-05 11:32 fpillet * bindings/Perl/Pilot.xs, bindings/Python/src/pisock.i, bindings/Python/src/pisock_wrap.c, src/memos.c, src/pilot-file.c, src/pilot-memos.c, src/pilot-prc.c, src/pilot-read-palmpix.c, src/pilot-read-todos.c, src/read-palmpix.c, src/read-todos.c, tests/versamail-test.c: updated code to take modifications in pi-file into account 2004-08-05 11:30 fpillet * include/pi-file.h, libpisock/pi-file.c: updated pi-file to return explicit error codes 2004-08-05 11:30 fpillet * include/pi-dlp.h: updated dlp errors 2004-08-05 09:38 fpillet * include/pi-error.h: new error codes 2004-08-05 08:56 nicholas * bindings/Python/src/: pisock.i, pisock_wrap.c: Compiles again, but _untested_. I thought compiling was at least better than not compiling. Need to look into dealing with callback functions too, should be straight forward, but I've zero copious free time. 2004-08-04 10:14 fpillet * include/pi-socket.h, libpisock/socket.c: added pi_socket_connected() entry point 2004-08-04 10:00 fpillet * include/pi-error.h, libpisock/dlp.c: cleaned up error codes coming from a prototype version of my error reporting stuff 2004-08-03 11:12 fpillet * libpisock/dlp.c: record_dump was buggy when used from dlp_WriteRecord and didn't support large records. Fixed this. 2004-08-03 03:58 fpillet * src/: dlpsh.c, pilot-dlpsh.c: properly check for end of dlp_ReadDBList after change in error reporting 2004-08-03 03:57 fpillet * tests/vfs-test.c: updated code to properly take improved err reporting into account 2004-08-03 03:56 fpillet * libpisock/: cmp.c, connect.c, darwinusb.c, dlp.c, freebsdusb.c, inet.c, linuxusb.c, net.c, padp.c, serial.c, slp.c, socket.c, sys.c, syspkt.c, unixserial.c, usb.c: big commit with improved error reporting 2004-08-02 18:13 fpillet * include/pi-error.h: updated error list 2004-08-02 18:13 fpillet * src/pilot-xfer.c: fixed the display bugs when backing up files (files where stat()ed before being created) 2004-08-02 04:25 fpillet * libpisock/socket.c, include/pi-socket.h: added pi_error() stuff to socket.c, fixed a problem with the PEEK init sequence which was counting too much on an obscure feature of PI_MSG_PEEK on most platforms, fixed another issue with pi_close(). 2004-08-02 04:03 fpillet * include/Makefile.am: added pi-error.h to make rules 2004-08-02 04:03 fpillet * include/pi-error.h: New pi-error.h file, holding the error code definitions as returned by pi_error() (see pi-socket.h for pi_error()) 2004-08-02 04:02 fpillet * include/pi-usb.h: removed the 'pos' member of the pi_usb_data structure, nobody uses it 2004-08-02 04:01 fpillet * libpisock/freebsdusb.c: rewrote freebsdusb's u_read() function. Note: there was NO timeout handling in either u_read() or u_write() in the original freebsdusb code. I didn't put it back in from the linuxusb source, but someone who can test on freebsd should definitely do it. 2004-08-01 18:52 adridg * libpisock/freebsdusb.c: Update function prototypes to support Florent's pi_buffer_t (and so it compiles); u_read is horribly broken though, since it doesn't actually _do_ any of the pi_buffer_t management. 2004-08-01 18:50 fpillet * libpisock/unixserial.c: fixed a wrong memcpy I left when I converted unixserial to use pi_buffer_t 2004-07-29 11:39 fpillet * libpisock/inet.c: minor cleanup 2004-07-29 11:33 fpillet * libpisock/net.c: minor fix to net_protocol_dup, and streamlined some code 2004-07-29 07:39 fpillet * libpisock/dlp.c: Several fixes in this commit: fixed issues in dlp_request_new/free, dlp_response_new/free; turned a few fprintf()s into LOG; fixed a segfault when receiving >64k records from Palm OS 5 devices under certain conditions 2004-07-27 12:24 desrod * bindings/Perl/Pilot.xs: Fix the last two remaining errors and clean up the invalid pointer, using the new pi_buffer_t and the ugliest cast I've ever seen ;) 2004-07-27 04:56 fpillet * include/pi-file.h, libpisock/pi-file.c: modified progress callback prototype to return a int. Callbacks can return either PI_TRANSFER_CONTINUE or PI_TRANSFER_STOP, effectively allowing the callback to interrupt a transfer (at least between individual record downloads / uploads) 2004-07-27 02:49 desrod * bindings/Perl/Pilot.xs: Crikey, who indented this mess. I'll fix it! 2004-07-27 01:16 desrod * bindings/Perl/Pilot.xs: Updating Perl bindings to handle the pi_buffer_* API, only 2 errors left to go 2004-07-26 20:53 desrod * include/pi-cmp.h, include/pi-net.h, include/pi-padp.h, include/pi-slp.h, include/pi-sys.h, libpisock/cmp.c, libpisock/freebsdusb.c, libpisock/inet.c, libpisock/net.c, libpisock/padp.c, libpisock/palmpix.c, libpisock/slp.c, libpisock/sys.c: ssize_t/size_t vs. int fixes for warning-free compilation on 64-bit arch, from Adriaan de Groot 2004-07-26 20:47 desrod * bindings/Perl/Makefile.PL.in: Fix for installing Pilot.so against system libs, instead of local build-tree libs. Closes #1122 2004-07-26 17:45 desrod * src/pilot-xfer.c: Minor fixes to make sure we're not off-by-one, and reporting the right file sizes 2004-07-26 17:44 desrod * include/pi-socket.h: Minor cleanup fix from Adriaan de Groot 2004-07-26 16:33 fpillet * libpisock/pi-file.c: hardened checks against invalid files in pi_file_open() 2004-07-26 14:26 fpillet * src/: pi-nredir.c, pilot-nredir.c: fixed issue in pi-nredir: was not rewriting the right piece of data to the distant socket (my bad: was writing buffer instead of buffer->data) 2004-07-23 17:27 knghtbrd * src/Makefile.am: use $(POPT_LIBS), not $(top_builddir)/popt/libpopt.la - it might not get built! 2004-07-23 12:49 fpillet * bindings/Python/src/pisock_wrap.c, include/pi-file.h, libpisock/pi-file.c, src/pilot-foto.c, src/pilot-xfer.c: Implemented progress callbacks support for pi_file_install(), pi_file_merge() and pi_file_retrieve() 2004-07-23 10:51 fpillet * libpisock/dlp.c: ENH: added support for dlpDBListMultiple in dlp_FindDBInfo to speed up operations 2004-07-23 06:15 fpillet * libpisock/dlp.c, include/pi-dlp.h: Added support for download and upload of large records. Works/tested with TapWave Zodiac and Palm OS 6 simulator. 2004-07-19 16:35 angusa * src/: pilot-read-screenshot.c, read-screenshot.c, pilot-read-veo.c, read-veo.c: Fixed HAVE_PNG defines 2004-07-19 13:46 angusa * src/: pilot-read-screenshot.c, read-screenshot.c: Changed some unsigned char buffers to pi_buffer_t Added support for version 1 screenshots and grayscale 2004-07-19 11:04 desrod * configure.in, src/Makefile.am, src/pilot-read-screenshot.c, src/read-screenshot.c: Bump to rc12, add read-screenshot 2004-07-18 21:08 desrod * src/: install-netsync.c, pilot-install-netsync.c: Negate popt for now, lets keep it building instead. 2004-07-15 05:43 fpillet * include/pi-file.h, libpisock/pi-file.c: revised constness on some function prototypes 2004-07-02 17:24 fpillet * libpisock/dlp.c: fixed DLP version check in dlp_VFSFileSize and dlp_VFSFileResize 2004-07-02 09:50 fpillet * libpisock/dlp.c: make sure numVols is set to 0 if nothing else in dlp_VFSVolumeEnumerate 2004-06-28 14:08 fpillet * libpisock/dlp.c: Fixed improper conversion from DLP date to time_t in dlp_ptohdate(). Due to improper conversion, most dates returned were -1. Dates are not correctly returned as a time_t expressed in the machine's current timezone. 2004-06-28 14:07 fpillet * ChangeLog: Updated ChangeLog 2004-06-16 18:34 warp * libpisock/libusb.c: Update to use the new buffer stuff, whoops, forgot to commit this before. 2004-06-07 18:45 fpillet * libpisock/socket.c: added missing byte_buf reinit 2004-06-07 15:16 fpillet * include/pi-dlp.h: added comment about the maxRecSize member of DBSizeInfo 2004-06-07 15:15 fpillet * libpisock/dlp.c: factored out response decoding in the three dlp_FindDB variants, fixed several bugs that crashed both the desktop side and the palm side 2004-06-07 10:52 fpillet * include/pi-cmp.h, include/pi-dlp.h, include/pi-dlp.hxx, include/pi-net.h, include/pi-padp.h, include/pi-serial.h, include/pi-slp.h, include/pi-socket.h, include/pi-source.h, include/pi-sys.h, include/pi-usb.h, libpisock/Makefile.am, libpisock/cmp.c, libpisock/darwinusb.c, libpisock/dlp.c, libpisock/inet.c, libpisock/linuxusb.c, libpisock/net.c, libpisock/padp.c, libpisock/pi-file.c, libpisock/slp.c, libpisock/socket.c, libpisock/sys.c, libpisock/syspkt.c, libpisock/unixserial.c, libpisock/versamail.c, libpisync/sync.c, src/addresses.c, src/debugsh.c, src/dlpsh.c, src/hinotes.c, src/install-netsync.c, src/memos.c, src/money2qif.c, src/pi-nredir.c, src/pilot-addresses.c, src/pilot-archive.c, src/pilot-debugsh.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-foto.c, src/pilot-hinotes.c, src/pilot-install-netsync.c, src/pilot-mail.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-notepad.c, src/pilot-read-palmpix.c, src/pilot-read-todos.c, src/pilot-read-veo.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-wav.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-notepad.c, src/read-palmpix.c, src/read-todos.c, src/read-veo.c, src/reminders.c, tests/dlp-test.c, tests/versamail-test.c, tests/vfs-test.c: BIG COMMIT: changed several prototypes to take and return a pi_buffer_t*, so as to be able to download and upload records and resources bigger than 64k. Several other tweaks as well. 2004-06-02 10:22 fpillet * darwin/build_framework.sh: added prebinding support when building framework (see usage notes at top of script) 2004-06-01 06:13 nicholas * bindings/Python/: README, pisock.py, setup.py.in, src/pisock.i, src/pisock.py, src/pisock_wrap.c: Updated Python bindings to work with Florent's patch (v3), and Swig 1.3.21 2004-05-31 07:49 fpillet * darwin/build_framework.sh: fixed linking and internal symlinks 2004-05-30 17:59 warp * libpisock/pi-file.c: Er, oops. Now /this/ is a stupid mistake. 2004-05-30 09:02 fpillet * include/Makefile.am: added pi-buffer.h to c_headers 2004-05-29 12:50 warp * include/pi-dlp.h, libpisock/dlp.c: Make the dbname argument to dlp_FindDBInfo const, possibly the first of many such changes. 2004-05-28 18:20 fpillet * include/pi-buffer.h: new pi_buffer_t type 2004-05-28 18:20 fpillet * libpisock/: pi-buffer.lo, pi-buffer.o: stupid .* commit, sorry 2004-05-28 18:19 fpillet * libpisock/: pi-buffer.c, pi-buffer.lo, pi-buffer.o: new pi_buffer_t type and accessor functions 2004-05-27 21:41 knghtbrd * Makefile.am, configure.in: Renamed --with-cpp to --with-cxx to avoid confusion with the preprocessor and made it actually use the compiler argument. Removed LIBCXX and the check for libstdc++ since the latter isn't portable anyway. In theory, this should work for everyone. In practice, the C++ check will probably need to be altered to check a whole bunch of things like the readline check does once people start reporting what breaks. *sigh* 2004-05-27 18:46 knghtbrd * Makefile.am, configure.in, tcl.m4, darwin/.cvsignore, darwin/Makefile.am, m4/tcl.m4, popt/Makefile.am: More autoconf/automake fixes: make dist works properly again, modern versions of automake no longer complain about unquoted function names in macro declarations, tcl.m4 is no longer installed to the system, and both included and system popt now work. 2004-05-26 15:38 knghtbrd * Makefile.am, configure.in, src/Makefile.am: Rewrote the popt configure.in stuff a bit so that it actually works the way it should. (There may be a residual bug or two, working on them!) 2004-05-26 03:28 knghtbrd * configure.in, m4/vl_lib_readline.m4: Made the readline check better.. 2004-05-26 01:32 knghtbrd * libpisock/: darwinusb.c, usb.c: The Zire 72 shares 0061 with the 31. 2004-05-25 03:29 knghtbrd * configure.in, src/dlpsh.c, src/pilot-dlpsh.c: Fix potential NULL dereference (readline returns NULL at EOF) 2004-05-25 03:09 knghtbrd * Makefile.am, acinclude.m4, autogen.sh, m4/tcl.m4, m4/vl_lib_readline.m4, src/dlpsh.c, src/pilot-dlpsh.c: Made some changes to auto* build system: - Created m4/ and moved tcl.m4 into it (gets rid of acinclude.m4) - Added m4/vl_lib_readline.m4 - better readline finding - made existing stuff work with new readline detection - configure --without-cpp no longer forces you to have libstdc++ anyway 2004-05-25 01:50 knghtbrd * libpisock/connect.c: Add missing " 2004-05-24 09:15 desrod * libpisock/connect.c: Minor formatting changes (actually, just forcing a commit to track a cvs history bug also) 2004-05-21 10:02 warp * include/pi-socket.h, include/pi-source.h, libpisock/connect.c, libpisock/inet.c, libpisock/libusb.c, libpisock/serial.c, libpisock/socket.c, libpisock/usb.c, src/dlpsh.c, src/pilot-dlpsh.c: Fixed the fd leak problem with a chainsaw, removing all device duplication code. Reverted connect.c to the pre-mace version, with some changes. NOTE! This changes the pi_accept API, it now returns the sd passed to it, instead of making a duplicate of it and returning that, this will have an impact on all programs which try to treat the 'parent' sd and the 'client' sd differently. Fixed a libusb reopening bug. Added the (very hacky) reopen command to dlpsh, to test reopening the link to the PDA. 9 files changed, 108 insertions(+), 395 deletions(-) 2004-05-21 03:30 warp * libpisock/libusb.c: Whoops, fix a little bug. 2004-05-20 01:20 angusa * libpisock/palmpix.c: Added histogram and colour correction. Also fixed interpolation 2004-05-20 01:19 angusa * include/pi-palmpix.h: Added colour correction and histogram flags 2004-05-20 01:18 angusa * src/: pilot-read-palmpix.c, read-palmpix.c: Added histogram, bias and colour correction options 2004-05-20 01:15 angusa * doc/man/read-veo.1.in: Fixed portable network graphic references 2004-05-20 01:14 angusa * doc/man/read-palmpix.1.in: Added histogram, colour correct and bias 2004-05-20 01:00 desrod * Makefile.am: Add popt to SUBDIRS target 2004-05-20 00:40 desrod * src/: addresses.c, dlpsh.c, hinotes.c, install-datebook.c, install-expenses.c, install-hinote.c, install-memo.c, install-netsync.c, install-todo.c, install-todos.c, install-user.c, memos.c, money2qif.c, pilot-dlpsh.c, pilot-hinotes.c, pilot-install-datebook.c, pilot-install-expenses.c, pilot-install-hinote.c, pilot-install-memo.c, pilot-install-netsync.c, pilot-install-todo.c, pilot-install-todos.c, pilot-install-user.c, pilot-memos.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-getromtoken.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-archive.c, pilot-clip.c, pilot-csd.c, pilot-dedupe.c, pilot-file.c, pilot-foto.c, pilot-getram.c, pilot-getrom.c, pilot-getromtoken.c, pilot-mail.c, pilot-nredir.c, pilot-port.c, pilot-prc.c, pilot-read-expenses.c, pilot-read-ical.c, pilot-read-notepad.c, pilot-read-palmpix.c, pilot-read-todos.c, pilot-read-veo.c, pilot-reminders.c, pilot-schlep.c, pilot-wav.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-notepad.c, read-palmpix.c, read-todos.c, read-veo.c, reminders.c: Remove unnecessary prototype references, fix up existing calls to match the new const declarations in pi-header.h 2004-05-20 00:25 warp * libpisock/: libusb.c, usb.c: Some minor cleanups in usb.c. Make the libusb open much more verbose, and make the reset logic more robust for the case of the device not immediately reappearing on reset. (2.4) 2004-05-19 11:38 desrod * include/pi-header.h, libpisock/connect.c: Possible fixes for pilot_connect from Miah Gregory 2004-05-19 09:26 desrod * libpisock/connect.c: Fix leaking parent_sd fd.. (Miah Gregory) 2004-05-19 09:06 desrod * README: Fix minor typo (caught by mace) 2004-05-18 17:49 desrod * src/Makefile.am: More getopt deprecation, popt additions 2004-05-18 16:31 desrod * popt/.cvsignore: Ignore these critters 2004-05-18 16:25 desrod * popt/Makefile.am: Forgot to add Makefile.am 2004-05-18 16:06 desrod * configure.in: Oops, we don't need -rc9-popt there 2004-05-18 16:01 desrod * popt/CHANGES: We don't need this file in our tree 2004-05-18 16:00 desrod * configure.in, popt/CHANGES, popt/COPYING, popt/README, popt/findme.c, popt/findme.h, popt/popt.c, popt/popt.h, popt/poptconfig.c, popt/popthelp.c, popt/poptint.h, popt/poptparse.c, popt/system.h: Moving to a possible popt conversion 2004-05-18 12:59 angusa * src/: pilot-read-veo.c, read-veo.c: Added better colour correction algorithm and bias to adjust the brightness. 2004-05-18 12:56 angusa * doc/man/read-veo.1.in: Added colour correction and name output flags. Alphabetized the options 2004-05-18 12:42 fpillet * libpisock/dlp.c: normalized // comments to /* */ 2004-05-18 08:47 warp * libpisock/libusb.c: Use the new common code. Clean up the debugging messages for the case of no debugging being enabled. Clean up the double close error. Handle some error cases better. Change the peek to only read one byte at a time. Reset the device before use. Probably other stuff that I'm forgetting. 2004-05-18 08:44 warp * include/pi-usb.h, libpisock/usb.c: The new common USB code for init and identification, not completely done, but functional. Should not break anything. 2004-05-18 08:00 desrod * configure.in: Starting the popt conversion 2004-05-18 07:56 desrod * src/pilot-xfer.c: More minor indenting cleanups, prior to the popt injection 2004-05-18 06:23 warp * src/pilot-xfer.c: Fix restore. Clean up some space vs tab indentation issues. 2004-05-17 19:30 desrod * libpisock/pi-file.c: Remove erroneous \n that was screwing up userland 2004-05-17 15:13 desrod * tests/vfs-test.c: Added unistd.h to bring in size_t on non-GNU systems. 2004-05-17 15:03 desrod * src/: pi-getram.c, pi-getrom.c, pilot-getram.c, pilot-getrom.c: Add quick checks to quit if OS5 or later is found, so we don't crash the user's device with a nice RPC error + reset. 2004-05-16 18:38 knghtbrd * configure.in: Removed a couple stray lines that were harmless, but also needless. 2004-05-15 15:24 knghtbrd * configure.in: Er, CFLAGS goes with CFLAGS, CXXFLAGS goes with CXXFLAGS, doh. 2004-05-15 05:22 knghtbrd * configure.in: Changes related to CFLAGS and friends: Moved/rewrote the MacOS X fink test, added compiler defaults for GCC, removed AC_SUBST of compiler flags because it's not necessary, added CPPFLAGS to configure summary. 2004-05-14 22:29 desrod * configure.in: Bump to rc8, soname bump 2004-05-14 22:00 desrod * include/pi-dlp.h, libpisock/dlp.c: Florent Pillet's DLP fixes and updates. 2004-05-14 21:08 knghtbrd * src/pilot-addresses.c: Hans Meine's fix for pilot-addresses (or half of it, anyway.) 2004-05-13 10:55 angusa * include/pi-veo.h: Added command for single file output 2004-05-12 15:28 knghtbrd * .cvsignore, bindings/Python/.cvsignore, src/.cvsignore, tests/.cvsignore: Updated .cvsignore files 2004-05-12 14:53 desrod * include/pi-net.h, libpisock/net.c: (Patch from Florent Pillet) - adds bounds checking to net_rx (see comments I added to the net_rx function) - fixes issue where receive buffer needed to add 6 bytes for temporary header (the packet header is now read into a separate buffer). You'd get a crash if you call pi_read() with a buffer of the exact expected size, for example. 2004-05-12 04:25 fpillet * include/pi-dlp.h: added opcode values next to dlp func defines to ease reading packet traces 2004-05-10 20:07 knghtbrd * configure.in: Fix my half-edited --help test for configure 2004-05-10 19:56 fpillet * include/pi-dlp.h, libpisock/dlp.c, tests/vfs-test.c: VFS functions tested & fixed 2004-05-10 17:27 angusa * src/: pilot-read-veo.c, read-veo.c: Added png output. Single picture output Histogram adjustment Comments 2004-05-10 04:35 fpillet * libpisock/darwinusb.c: comments & define tweaks 2004-05-09 20:30 knghtbrd * libpisock/darwinusb.c: Some comments got lost in moving things around. I don't have Florent's more verbose comments in front of me, but this will help make some sense of the variables. 2004-05-09 20:28 knghtbrd * configure.in: Better handling of -Werror set in the environment 2004-05-09 06:26 knghtbrd * include/pi-palmpix.h, include/pi-sync.h, libpisock/palmpix.c, src/install-memo.c, src/memos.c, src/pi-getromtoken.c, src/pi-nredir.c, src/pilot-addresses.c, src/pilot-archive.c, src/pilot-file.c, src/pilot-foto.c, src/pilot-getromtoken.c, src/pilot-install-memo.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-prc.c, src/pilot-wav.c, src/pilot-read-notepad.c, src/pilot-read-palmpix.c, src/pilot-read-todos.c, src/pilot-xfer.c, src/read-notepad.c, src/read-palmpix.c, src/read-todos.c, tests/versamail-test.c: Most compiler warnings issued with -Wall are fixed. test-versamail and pilot-datebook still have a few, but perhaps someone else can squash them? 2004-05-08 19:01 knghtbrd * configure.in, darwin/build_framework.sh, include/Makefile.am, include/darwinusbcore.h, libpisock/Makefile.am, libpisock/darwinusb.c, libpisock/darwinusbcore.cpp: Need to commit this so I can move on. It seems to break nothing, although it undoes one small change Florent made to Darwin's USB code which broke it for me. 2004-05-08 05:52 knghtbrd * libpisock/: connect.c, inet.c, net.c, socket.c: Excepting darwinusb (which is waiting on Florent and David to test my patch), this will make libpisock -Wall -Werror clean on a Mac. 2004-05-08 04:57 knghtbrd * include/pi-serial.h, include/pi-socket.h, include/pi-usb.h, libpisock/address.c, libpisock/cmp.c, libpisock/connect.c, libpisock/serial.c, libpisock/usb.c, libpisock/util.c, src/addresses.c, src/dlpsh.c, src/pilot-addresses.c, src/pilot-dlpsh.c, src/pilot-xfer.c: Some compiler warning fixes from Florent that got lost in the shuffle.. 2004-05-08 04:40 knghtbrd * configure.in: AC_TYPE_SIGNAL produces a compiler warning. If -Werror is set, this warning can cause RETSIGTYPE to be set to int on systems where it should be void. This causes the code to issue a warning, which produces a compile error. Vicious cycle go splat! (The workaround is a bit hackish, but it's autoconf--what can you do?) 2004-05-07 21:59 warp * configure.in, libpisock/Makefile.am, libpisock/libusb.c: libusb support, use --enable-libusb. 2004-05-07 02:51 fpillet * libpisock/darwinusbcore.cpp: use the regular InterfaceInterface (don't need v182), fixed a leak in start_listening, added check for PalmConnect USB, fixed a return request buffer size for close notification 2004-05-07 02:49 fpillet * libpisock/darwinusb.c: fixed prototypes in darwinusb (patch not applied by David) 2004-05-06 16:23 knghtbrd * configure.in, libpisock/Makefile.am, src/install-netsync.c, src/pilot-install-netsync.c: pilot-link now compiles on MacOS X, though with many warnings yet. This code walks over one of Florent's unapplied patches a bit, but is the more correct fix anyway. Darwin users *must* make distclean; ./autogen.sh all over again to ensure that libtool works. 2004-05-06 15:40 warp * autogen.sh: Fix it some more. 2004-05-06 15:16 warp * autogen.sh, src/pilot-xfer.c: Fix autogen on my box. Actually increment totalsize. 2004-05-06 15:10 desrod * include/pi-foto.h: Oops, missing. 2004-05-06 14:10 desrod * darwin/build_framework.sh: Added Florent's build_framework.sh 2004-05-06 14:06 desrod * src/pilot-xfer.c: Kill strndup 2004-05-06 13:34 desrod * Makefile.am, acinclude.m4, autogen.sh, configure.in, pilot-link.m4.in, bindings/Java/Makefile.am, bindings/Java/README, bindings/Java/README.de, bindings/Java/libjpisock.c, bindings/Java/libjpisock.h, bindings/Java/test.java, bindings/Perl/dump.pl, bindings/Perl/test.pl, bindings/Python/src/pisock_wrap.c, doc/man/addresses.1.in, doc/man/dlpsh.1.in, doc/man/hinotes.1.in, doc/man/ietf2datebook.1.in, doc/man/install-datebook.1.in, doc/man/install-expenses.1.in, doc/man/install-hinote.1.in, doc/man/install-memo.1.in, doc/man/install-netsync.1.in, doc/man/install-todo.1.in, doc/man/install-user.1.in, doc/man/memos.1.in, doc/man/pi-getram.1.in, doc/man/pi-getrom.1.in, doc/man/pilot-addresses.1.in, doc/man/pilot-foto.1.in, doc/man/pilot-link.7.in, doc/man/pilot-xfer.1.in, doc/man/read-expenses.1.in, doc/man/read-ical.1.in, doc/man/read-notepad.1.in, doc/man/read-palmpix.1.in, doc/man/read-todos.1.in, doc/man/read-veo.1.in, include/Makefile.am, include/darwinusbcore.h, include/pi-address.h, include/pi-appinfo.h, include/pi-cmp.h, include/pi-datebook.h, include/pi-debug.h, include/pi-dlp.h, include/pi-dlp.hxx, include/pi-expense.h, include/pi-file.h, include/pi-hinote.h, include/pi-inet.h, include/pi-mail.h, include/pi-memo.h, include/pi-money.h, include/pi-net.h, include/pi-notepad.h, include/pi-padp.h, include/pi-serial.h, include/pi-slp.h, include/pi-socket.h, include/pi-source.h, include/pi-sys.h, include/pi-syspkt.h, include/pi-todo.h, include/pi-usb.h, include/pi-veo.h, libpisock/Makefile.am, libpisock/address.c, libpisock/appinfo.c, libpisock/cmp.c, libpisock/connect.c, libpisock/darwinusb.c, libpisock/darwinusbcore.cpp, libpisock/datebook.c, libpisock/debug.c, libpisock/dlp.c, libpisock/expense.c, libpisock/freebsdusb.c, libpisock/hinote.c, libpisock/inet.c, libpisock/linuxusb.c, libpisock/mail.c, libpisock/md5.c, libpisock/memo.c, libpisock/money.c, libpisock/net.c, libpisock/notepad.c, libpisock/os2serial.c, libpisock/padp.c, libpisock/palmpix.c, libpisock/pi-file.c, libpisock/pi-header.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/sys.c, libpisock/syspkt.c, libpisock/todo.c, libpisock/unixserial.c, libpisock/usb.c, libpisock/util.c, libpisock/utils.c, libpisock/veo.c, libpisock/winserial.c, src/Makefile.am, src/addresses.c, src/ccexample.cc, src/debugsh.c, src/dlpsh.c, src/hinotes.c, src/pilot-debugsh.c, src/pilot-dlpsh.c, src/pilot-hinotes.c, src/install-datebook.c, src/install-expenses.c, src/install-hinote.c, src/install-netsync.c, src/install-todo.c, src/install-todos.c, src/install-user.c, src/kittykiller.c, src/memos.c, src/money2qif.c, src/pd-tty.c, src/pi-csd.c, src/pi-nredir.c, src/pilot-addresses.c, src/pilot-archive.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-dedupe.c, src/pilot-file.c, src/pilot-foto.c, src/pilot-install-datebook.c, src/pilot-install-expenses.c, src/pilot-install-hinote.c, src/pilot-install-netsync.c, src/pilot-install-todo.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-mail.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-notepad.c, src/pilot-read-todos.c, src/pilot-read-veo.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-wav.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-notepad.c, src/read-todos.c, src/read-veo.c, src/reminders.c, src/validate.cc, tests/dlp-test.c, tests/vfs-test.c: Enormous commit, bring it up to hopefully current 2004-04-29 10:03 desrod * README: Updated README to bring it to current. Still a few pokes left to go. 2004-04-18 15:48 desrod * ChangeLog, src/pilot-xfer.c: Some ugly changes to pilot-xfer.c, will throw most of this away soon. 2004-04-16 12:27 nicholas * ChangeLog, include/pi-versamail.h, libpisock/versamail.c, tests/versamail-test.c: Cope a bit better with versamail mail with attachments 2004-04-16 08:29 desrod * tests/Makefile.am, include/Makefile.am, libpisock/Makefile.am: Added Nicholas Piper's versamail to Makefile.am to bootstrap 2004-04-15 13:03 nicholas * ChangeLog, include/pi-contact.h, libpisock/contact.c: First cut of Contacts support 2004-04-15 12:58 nicholas * ChangeLog, include/pi-versamail.h, libpisock/versamail.c, tests/versamail-test.c: First cut of versamail support 2004-02-24 21:29 desrod * ChangeLog, libpisock/dlp.c: Fix comments 2004-02-20 12:22 desrod * src/parsedate.c: Removing autogenerated file 2004-02-20 10:19 desrod * src/: install-memo.c, pilot-install-memo.c: Oops, one more minor verbage fix 2004-02-20 10:18 desrod * src/: install-memo.c, pilot-install-memo.c: Logic fixes, fix for minor getopt bug where 't' required an empty arg, small verbage and usability fixes, etc. 2004-02-20 09:42 desrod * libpisock/connect.c: Minor visual fix. 2004-02-09 22:04 desrod * tcl.m4, m4/tcl.m4, src/Makefile.am: Fixed up pilot-debug, tcl.h path detection, error check output 2004-02-09 18:45 desrod * src/pilot-debug.c: What a mess. This should be turned inside out, with straight TCL, and inline C inside that. One thing at a time. 2004-02-09 14:13 desrod * src/pilot-prc.c: Remove unnecessary globals, fix broken invalid function defs. 2004-01-22 17:20 desrod * doc/README.usb: Corrected some missing paragraph content, added info about the new method to load visor.o wth vendor/product dynamically. 2004-01-22 17:11 desrod * doc/README.usb: Updated verbage for newer devices, fixed links to the wiki, added more current information about compiling modules directly without kernel compile, more. 2004-01-18 11:26 desrod * src/: pilot-read-palmpix.c, read-palmpix.c: Deallocate the arg instead of losing it 2004-01-18 10:48 desrod * ChangeLog, src/pilot-read-veo.c, src/read-veo.c: Code formatting changes, added function doc headers, misc. cleanups 2004-01-18 10:00 desrod * src/: install-netsync.c, pilot-install-netsync.c: Revert priv_strdup() back out. 2004-01-18 09:58 desrod * src/: install-netsync.c, pilot-install-netsync.c: Revert priv_strdup back out. 2004-01-18 09:57 desrod * libpisock/: address.c, datebook.c, dlp.c, expense.c, hinote.c, inet.c, mail.c, memo.c, net.c, notepad.c, palmpix.c, pi-file.c, slp.c, socket.c, todo.c, utils.c: Revert the priv_strdup back out. 2004-01-18 09:25 desrod * src/: pi-csd.c, pilot-csd.c: inet_pton() in case we need to go IPv6, fixed some minor pedantic problems 2004-01-17 20:08 desrod * ChangeLog: Updated changelog for 01-17-2004 2004-01-17 18:42 desrod * src/: install-netsync.c, install-user.c, pilot-install-netsync.c, pilot-install-user.c: Code refactoring, cleanup. 2004-01-17 18:14 desrod * libpisock/: address.c, datebook.c, expense.c, hinote.c, mail.c, memo.c, notepad.c, pi-file.c, socket.c, todo.c: Update source to use our private strdup() function, and ignore any global copy. 2004-01-17 18:13 desrod * libpisock/utils.c: Use priv_strdup() instead of making it a global. Refactor the strdup function a bit. 2004-01-17 18:12 desrod * src/pilot-wav.c: Added missing function documentation headers, missing prototypes. 2004-01-05 14:49 desrod * doc/man/pilot-archive.1.in: Updated wording on the pilot-archive manpage 2004-01-05 14:41 desrod * configure.in: Added new manpage for pilot-archive 2004-01-05 14:40 desrod * doc/man/Makefile.am: Added manpage for pilot-archive 2004-01-05 14:39 desrod * ChangeLog, doc/man/pilot-archive.1.in, src/pilot-archive.c: Cleaned up code, removed unused headers, unused vars. Added new manpage for pilot-archive. 2004-01-03 14:52 desrod * tests/vfs-test.c: Minor cleanup, removed unused headers, reformatted initializers. 2004-01-03 14:44 desrod * tests/vfs-test.c: Remove unused code that was copied from dlp-test.c 2004-01-02 11:07 desrod * ChangeLog: [no log message] 2004-01-02 11:07 desrod * src/pilot-xfer.c: More code cleanup, more on the way. 2004-01-02 11:06 desrod * libpisock/connect.c: Add appropriate flushing to try to work around the printf() problem in userland. Might be temporary. 2004-01-01 09:56 desrod * src/pilot-xfer.c: sd should be 0, not -1, oops. 2003-12-30 18:32 desrod * src/: Makefile.am, debugsh.c, pilot-debugsh.c, kittykiller.c, money2qif.c, pi-getromtoken.c, pilot-addresses.c, pilot-debug.c, pilot-file.c, pilot-getromtoken.c, pilot-read-expenses.c, pilot-reminders.c, read-expenses.c, reminders.c: Minor formatting, removal of unused headers, misc. 2003-12-30 18:19 desrod * src/: pilot-read-palmpix.c, read-palmpix.c: Added function doc headers 2003-12-30 18:19 desrod * src/: pi-nredir.c, pilot-nredir.c: Removed unnecessary header, display_help cleanup. 2003-12-30 18:17 desrod * src/: pilot-read-todos.c, read-todos.c, pilot-wav.c: Minor formatting cleanup 2003-12-30 18:13 desrod * src/: memos.c, pilot-memos.c: Minor formatting 2003-12-30 18:10 desrod * src/: pilot-read-notepad.c, read-notepad.c: Support for "compressed" Notepad records 2003-12-30 18:09 desrod * src/: pilot-read-veo.c, read-veo.c: C99 comments, minor type fixes, remove unused vars 2003-12-30 18:09 desrod * src/: install-todo.c, pilot-install-todo.c: Fix closing cleanup, missing WriteUserInfo call, cleaned up sd call, remove cruft. 2003-12-30 18:09 desrod * src/: dlpsh.c, pilot-dlpsh.c: Minor reformatting/cleanup 2003-12-30 18:08 desrod * src/pilot-xfer.c: Flags instead of running functions in the switch, remove crufty code, not completed yet (rewrites-aplenty) 2003-12-30 18:08 desrod * src/: install-user.c, pilot-install-user.c: Minor type cleanups 2003-12-30 18:08 desrod * src/addresses.c: More descriptive structure members: s/a/addr/, removed incorrect argument in the example, minor SyncLog output fixes. 2003-12-30 18:07 desrod * ChangeLog, libpisock/connect.c: Make sure we are a valid tty before printing the connect messages, so redirection to files works properly. 2003-12-21 15:10 desrod * ChangeLog: Fix a check for >255 id, closes bug 829 2003-12-21 15:05 desrod * ChangeLog, configure.in: Remove check for UID == 0/root check. 2003-12-21 14:44 desrod * ChangeLog, src/install-user.c, src/pilot-install-user.c: Enforce a positive UserID, even if a negative was passed in. 2003-12-21 13:23 desrod * include/pi-notepad.h, src/pilot-read-notepad.c, src/read-notepad.c: Support for "compressed" Notepad records, closes issue #913 2003-12-11 12:00 desrod * ChangeLog, include/pi-dlp.h: Revert DLP_BUF_SIZE for now 2003-12-10 13:04 desrod * ChangeLog, configure.in: Small fix to check for uid=0 2003-11-26 17:47 desrod * ChangeLog, doc/man/read-ical.1.in: Updated read-ical manpage 2003-11-26 17:41 desrod * ChangeLog, libpisock/connect.c: Minor error in connect.c, rolling up into cvs snapshots with this commit. 2003-11-11 22:36 desrod * ChangeLog: Updated ChangeLog 2003-11-11 22:01 desrod * ChangeLog, configure.in: Updated version, added poke to fix a Gentoo bug 2003-10-17 08:29 desrod * ChangeLog, tests/vfs-test.c: Test conduit for VFS devices 2003-10-06 12:38 desrod * src/pilot-xfer.c: Oops, a68k doesn't belong in there. 2003-10-06 12:37 desrod * ChangeLog, src/pilot-xfer.c: Ignore ARMlet files which can't be restored back to the Palm anyway 2003-10-06 10:20 desrod * libpisock/dlp.c: DLP_BUF_SIZE cleanup 2003-10-06 10:12 desrod * include/pi-dlp.h: Oops, typo 2003-10-06 10:04 desrod * include/pi-dlp.h: Increment DLP_BUF_SIZE 2003-10-06 08:15 desrod * ChangeLog, doc/man/dlpsh.1.in, doc/man/memos.1.in, doc/man/pi-getram.1.in, doc/man/pilot-addresses.1.in, doc/man/pilot-link.7.in: Fixing up some typos in the manpages 2003-10-06 07:54 desrod * ChangeLog, bindings/Python/src/pisock_wrap.c, include/pi-file.h, libpisock/pi-file.c, src/ccexample.cc, src/pilot-read-ical.c, src/read-ical.c: Closing some outstanding Debian bugs 2003-10-06 07:17 desrod * ChangeLog, src/pilot-wav.c: New conduit to sync Voice Memo files from Tungsten devices (David Turner) 2003-10-05 19:02 desrod * src/: pilot-sync-plan.pl, sync-plan.PL: Starting a cleanup, in preparation for a rewrite to bring to current 2003-10-05 18:40 desrod * src/: pilot-sync-plan.pl, sync-plan.PL: Fix to work around disconnect/IO errors (Aaron, closes #415) 2003-10-05 17:58 desrod * ChangeLog, include/pi-dlp.h, libpisock/dlp.c, src/pilot-xfer.c, tests/Makefile.am: First pass at VFS functions 2003-10-04 07:41 desrod * ChangeLog: Test commit, ignore. 2003-09-23 18:00 desrod * ChangeLog, doc/man/memos.1.in, src/memos.c, src/pilot-memos.c: Fixes to turn the output file into a "real" mbox file, so other MUAs can load it as one. This closes Debian bug #212229 2003-08-18 18:43 desrod * ChangeLog, libpisync/Makefile.am: Missing libpisock in libpisync, closes bug #767. 2003-08-18 17:48 desrod * ChangeLog: Fix for incorrect types, closes #773 2003-08-18 17:42 desrod * ChangeLog, configure.in: Fixes for libstdc++, closes bug #768 (needs testing and validation) 2003-08-18 15:59 desrod * ChangeLog, doc/man/pilot-addresses.1.in: Fixed erroneous blank line, closes bug #765 2003-08-18 15:55 desrod * ChangeLog, configure.in: Added AM_MAINTAINER_MODE, closes bug #760 2003-07-21 15:15 angusa * ChangeLog, doc/man/read-palmpix.1.in, doc/man/read-veo.1.in, include/Makefile.am, include/pi-veo.h, libpisock/Makefile.am, libpisock/veo.c, src/Makefile.am, src/pilot-read-veo.c, src/read-veo.c: New conduit read-veo and support files added Makefiles changed to compile new conduit read-palmix documentation updated 2003-07-18 12:15 jpr * ChangeLog, include/pi-dlp.h, libpisock/dlp.c, tests/dlp-test.c: 2003-07-18 JP Rosevear * tests/dlp-test.c (main): update FindDBBy calls * libpisock/dlp.c (dlp_FindDBByName): return the localid and dbhandle if requested, check dlp version (dlp_FindDBByOpenHandle): return localid if requested (dlp_FindDBByTypeCreator): return card, localid and dbhandle if requested, check dlp version * include/pi-dlp.h: update prototypes 2003-07-14 11:50 jpr * ChangeLog, include/pi-dlp.h, libpisock/dlp.c, src/pilot-xfer.c, tests/dlp-test.c: 2003-07-14 JP Rosevear * src/pilot-xfer.c (main): remove unused var * libpisock/dlp.c (dlp_FindDBByName): implement (dlp_FindDBByOpenHandle): ditto (dlp_FindDBByTypeCreator): ditto * include/pi-dlp.h: add find db option and search flags, add protos * tests/dlp-test.c (main): add testing of dlp 1.2 FindDB functions 2003-07-07 19:57 desrod * pilot-link.pc.in: Updated description in pkgconfig file 2003-07-07 19:08 desrod * ChangeLog, src/pilot-xfer.c: More refactoring cleanups 2003-07-07 15:21 desrod * src/pilot-xfer.c: A refactoring we will go! Minor cleanup, removed redundant code, move to using flags instead of ints, so we can extend it for ROM, RAM, VFS, etc. 2003-07-05 13:16 desrod * configure.in: Wrong order for exports, fixed. 2003-07-05 12:19 desrod * configure.in: More minor OSX fixes, starting IOKit migration 2003-07-05 09:59 desrod * ChangeLog, autogen.sh, configure.in: Fixed READLINE check, glibtool vs. libtool on OSX 2003-07-04 12:03 desrod * NEWS: Updated NEWS for 0.11.9 release 2003-07-04 11:52 desrod * configure.in: Bump versions up by one for the 0.11.9 release 2003-07-04 11:51 desrod * src/pilot-xfer.c: Small fix 2003-07-04 11:40 desrod * ChangeLog: Oops 2003-07-04 11:40 desrod * src/pilot-xfer.c: Corrected a screen output buglet 2003-07-04 11:31 desrod * NEWS, bindings/Java/README: Updated NEWS and README to reflect proper attribution. 2003-07-02 10:51 jpr * .cvsignore, ChangeLog, include/pi-dlp.h, libpisock/dlp.c, libpisock/socket.c, tests/dlp-test.c: 2003-07-02 JP Rosevear * tests/dlp-test.c (main): test SetDBInfo * include/pi-dlp.h: add proto * libpisock/socket.c (ps_list_find_elem): return the list element rather than the socket (pi_version): improve implementation so we differentiate between dlp 1.1 and higher, cache result (ps_list_append): set the version to 0 by default * libpisock/dlp.c (dlp_SetDBInfo): implement 2003-07-01 16:04 jpr * bindings/Tcl/Makefile.in: Remove generated file. 2003-07-01 16:03 jpr * bindings/: Java/.cvsignore, Tcl/.cvsignore, Tcl/Makefile.in: shush 2003-07-01 15:59 desrod * doc/man/read-todos.1.in: Added missing read-todos manpage 2003-07-01 15:55 desrod * doc/man/memos.1.in: Added memos manpage 2003-07-01 15:55 jpr * ChangeLog, Makefile.am: 2003-07-01 JP Rosevear * Makefile.am: only install the -pp pkgconfig file if c++ is enabled 2003-07-01 15:43 jpr * ChangeLog, Makefile.am, configure.in, pilot-link-pp.pc.in, pilot-link.pc.in: 2003-07-01 JP Rosevear * configure.in: output the pkgconfig files * Makefile.am: dist the pkgconfig files and install them 2003-07-01 15:08 desrod * configure.in: Added missing manpages to AC_OUTPUT 2003-07-01 14:55 desrod * ChangeLog, NEWS, pilot-link.m4.in, bindings/Makefile.am, bindings/Tcl/Makefile.in, doc/man/Makefile.am, libpisock/socket.c, src/dlpsh.c, src/pilot-dlpsh.c: Final commits for 0.11.8 release 2003-07-01 14:46 desrod * configure.in: Added missing Java and Tcl version reports 2003-07-01 14:30 desrod * src/: pilot-read-todos.c, read-todos.c: Fixed a non-exit issue when no arguments were passed 2003-07-01 13:07 jpr * ChangeLog, bindings/Tcl/Makefile.am, bindings/Tcl/Makefile.in: 2003-07-01 JP Rosevear * bindings/Tcl/Makefile.am: define package version 2003-07-01 12:54 jpr * ChangeLog, tcl.m4, m4/tcl.m4: 2003-07-01 JP Rosevear * tcl.m4: remove the private header stuff and cygpath related stuff for public headers 2003-07-01 12:34 jpr * ChangeLog, configure.in, bindings/Tcl/Makefile.am: 2003-07-01 JP Rosevear * configure.in: subst TCL_INCLUDES * bindings/Tcl/Makefile.am: include TCL_INCLUDES 2003-07-01 12:18 desrod * src/: install-user.c, pilot-install-user.c, pilot-xfer.c: Small output changes, corrected syntax example 2003-07-01 11:19 jpr * configure.in, tcl.m4, bindings/Makefile.am, m4/tcl.m4: 2003-07-01 JP Rosevear * configure.in: only call subsequent tcl macros if we could find the tcl config, show enable/disable message properly * tcl.m4: allow passing of "no" to --with-tcl to disable tcl build * bindings/Makefile.am: conditionally compile the tcl dir 2003-06-30 17:03 jpr * ChangeLog, acinclude.m4, configure.in, bindings/Tcl/Makefile.am, bindings/Tcl/Makefile.in, bindings/Tcl/pitcl.c: 2003-06-30 JP Rosevear * configure.in: update tcl check * bindings/Tcl/pitcl.c: update for current libpisock * bindings/Tcl/Makefile.am: automakize 2003-06-30 15:51 desrod * src/: dlpsh.c, pilot-dlpsh.c: Fixed non-exiting exit bug 2003-06-30 15:16 desrod * libpisock/pi-file.c: display_rate() off for now 2003-06-30 14:56 desrod * configure.in, tcl.m4, m4/tcl.m4: Tcl m4 macros 2003-06-30 14:56 jpr * ChangeLog, include/pi-util.h: 2003-06-30 JP Rosevear * include/pi-util.h: fix comment 2003-06-30 14:50 desrod * libpisock/: datebook.c, expense.c, mail.c, notepad.c, pi-file.c, todo.c: Revert / vs. pi-tconfig.h code. 2003-06-30 14:46 desrod * src/pilot-xfer.c: Revert / vs. pi-tconfig.h code. 2003-06-30 14:44 desrod * include/: pi-datebook.h, pi-expense.h, pi-mail.h, pi-tconfig.h, pi-todo.h: Reverted vs. pi-tconfig.h code 2003-06-17 19:05 desrod * src/: dlpsh.c, install-todo.c, kittykiller.c, pilot-dlpsh.c, pilot-install-todo.c, pilot-xfer.c: Minor code cleanup 2003-06-17 18:26 desrod * NEWS: Updated for 0.11.8 release 2003-06-17 17:55 desrod * ChangeLog: Removed caller to tcl.m4 for now 2003-06-17 17:43 desrod * ChangeLog, libpisock/serial.c, libpisock/socket.c: Fixed a leak in the socket structures (Robert L Krawitz) 2003-06-17 17:37 desrod * bindings/Java/TODO: Added TODO for Java bindings 2003-06-17 17:22 desrod * doc/man/install-datebook.1.in: Fixed a small typo 2003-06-17 17:14 desrod * configure.in: Added pilot-foto manpage to dist 2003-06-17 17:09 desrod * bindings/Java/Makefile.am: Updated Makefile.am for new files 2003-06-17 16:59 desrod * configure.in: Removed TCL checks for now, pending implementation of proper m4 macros 2003-06-17 16:53 desrod * bindings/Java/: README.de, libjpisock.c, libjpisock.h, test.java, org/gnu/pilotlink/AddressRecord.java, org/gnu/pilotlink/AppInfo.java, org/gnu/pilotlink/DatebookRecord.java, org/gnu/pilotlink/MemoRecord.java, org/gnu/pilotlink/PilotLink.java, org/gnu/pilotlink/RawAppInfo.java, org/gnu/pilotlink/RawRecord.java, org/gnu/pilotlink/Record.java, org/gnu/pilotlink/SysInfo.java, org/gnu/pilotlink/User.java: New Java bindings 2003-06-17 16:48 desrod * bindings/: README.de, libjpisock.c, libjpisock.h, test.java: Adding new Java buildout 2003-06-17 16:43 desrod * bindings/Java/: .cvsignore, Jni.c, doConstants.c, test.java: Java replacement by John Mitchell 2003-06-17 16:35 desrod * libpisock/: datebook.c, expense.c, mail.c, notepad.c, todo.c: Cleaning up redundant HAVE_SYS_TIME_H cruft. 2003-06-17 16:34 desrod * include/: pi-datebook.h, pi-expense.h, pi-mail.h, pi-notepad.h, pi-tconfig.h, pi-todo.h, pi-util.h: Cleaned redundant cruft with HAVE_SYS_TIME_H, probably should go in a more permanent place soon.. consider this temporary. 2003-06-17 15:42 desrod * src/pilot-foto.c: Refactoring, getopt_long'ified. 2003-06-17 13:20 desrod * doc/man/: Makefile.am, pilot-foto.1.in: New manpage for pilot-foto, to convert images from Palm's 'Foto' application 2003-06-17 13:01 desrod * src/: Makefile.am, pilot-foto.c: New conduit to fetch images from Palm handhelds with the CreatorID of 'Foto' such as those produced by the Zire handheld. 2003-06-17 09:58 desrod * bindings/Tcl/: README, test.tcl: Minor edits to bring to current: s/cua3/ttyS0/ 2003-05-14 13:23 desrod * src/pilot-xfer.c: Minor code fixes, removed DEBUG in Restore() (not used) 2003-05-14 10:32 desrod * src/: addresses.c, dlpsh.c, getopt.c, getopt1.c, hinotes.c, install-datebook.c, install-expenses.c, install-hinote.c, install-memo.c, pilot-dlpsh.c, pilot-hinotes.c, pilot-install-datebook.c, pilot-install-expenses.c, pilot-install-hinote.c, pilot-install-memo.c, install-netsync.c, install-todo.c, install-todos.c, install-user.c, memos.c, money2qif.c, parsedate.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-getromtoken.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-archive.c, pilot-clip.c, pilot-csd.c, pilot-dedupe.c, pilot-file.c, pilot-getram.c, pilot-getrom.c, pilot-getromtoken.c, pilot-install-netsync.c, pilot-install-todo.c, pilot-install-todos.c, pilot-install-user.c, pilot-mail.c, pilot-memos.c, pilot-nredir.c, pilot-port.c, pilot-prc.c, pilot-read-expenses.c, pilot-read-ical.c, pilot-read-notepad.c, pilot-read-palmpix.c, pilot-read-todos.c, pilot-reminders.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-notepad.c, read-palmpix.c, read-todos.c, reminders.c: Lots of code cleanups, added missing 'default' in switch, fixed pilot-xfer exclude buglet 2003-05-14 10:31 desrod * ChangeLog: Update changelog 2003-05-14 07:36 desrod * bindings/Perl/README: Documentation update 2003-05-14 07:27 desrod * bindings/Perl/Pilot.pm: Cleanup, refactoring, will reduce later. 2003-05-10 14:59 desrod * doc/man/: pi-getram.1.in, pi-getrom.1.in: Updated manpages to deprecate the CoPilot switches. Use Palm OS Emulator instead 2003-05-10 14:58 desrod * src/: pi-getrom.c, pilot-getrom.c: Deprecate CoPilot switch (not used here anyway), Palm OS Emulator exceeds it in functionality 2003-05-10 14:57 desrod * src/: pi-getram.c, pilot-getram.c: Deprecate CoPilot switches, no longer used, Palm OS Emulator/POSE exceeds it. 2003-05-10 14:51 desrod * doc/man/: addresses.1.in, dlpsh.1.in, hinotes.1.in, install-datebook.1.in, install-expenses.1.in, install-hinote.1.in, install-memo.1.in, install-netsync.1.in, install-todo.1.in, install-user.1.in, pi-getram.1.in, pi-getrom.1.in, pilot-addresses.1.in, pilot-link.7.in, pilot-xfer.1.in, read-expenses.1.in, read-ical.1.in, read-notepad.1.in, read-palmpix.1.in: Updated manpages 2003-04-07 16:05 desrod * ChangeLog, configure.in: Remove -Werror for now, which breaks Python builds due to upstream swig inconsistancies. The whole -Werror logic flow needs a rethink. 2003-04-03 11:22 desrod * configure.in: Bump these voodoo current, revision, age values Ref: http://sources.redhat.com/autobook/autobook/autobook_91.html 2003-04-03 08:44 jpr * doc/man/.cvsignore: Shush 2003-04-01 11:34 jpr * ChangeLog, libpisync/sync.c: 2003-04-01 JP Rosevear * libpisync/sync.c (store_record_on_pilot): preserve the secret flag for the record 2003-03-27 07:14 desrod * ChangeLog, bindings/Perl/Pilot.xs: Fix to remove 'not a hash reference' errors on Perl 5.x built with debug (bug #440 and #219) (Jonathan Mark) 2003-03-27 06:59 desrod * ChangeLog, configure.in: Fix to find libpng on Solaris systems (Simon Burr) 2003-03-14 16:48 desrod * configure.in, src/Makefile.am: Major rework over the last commit. Proper tcl/tk detection, removed itcl (we weren't using it anyway), fixed the Python version detection stringio mess. 2003-03-14 14:54 desrod * configure.in, src/Makefile.am: Maintenance cleanups, deprecate tcl/itcl/tk support (for now?), fix up the Perl, Python, and Java tests, readline tests, readibility cleanups 2003-03-02 14:38 desrod * libpisock/: connect.c, notepad.c: Small -Wall cleanups 2003-02-23 18:54 desrod * src/getrom.c: Purge, no for real this time (damn you cvs!) 2003-02-23 18:52 desrod * src/getrom.c: Purged getrom, deprecated by pi-getrom 2003-02-23 14:38 desrod * src/: dlpsh.c, pilot-dlpsh.c: Minor output format change 2003-02-22 12:04 desrod * libpisock/connect.c: Use real macro calls, not numeric resolvers 2003-02-22 11:30 desrod * libpisock/connect.c: Oops, unused int() removed 2003-02-22 11:21 desrod * libpisock/connect.c: Small formatting nit. 2003-02-22 11:07 desrod * libpisock/connect.c: Small bit of code to sleep(2)*5 until portname is found 2003-02-20 18:51 desrod * libpisock/connect.c: More sensible error messages to report the permissions on symlinked nodes 2003-02-20 15:06 desrod * bindings/Makefile.am: Minor error that prevented the Perl bindings from building correctly 2003-02-20 14:50 desrod * ChangeLog, configure.in: More verbose errors when things aren't found during configure 2003-02-20 14:07 desrod * src/: dlpsh.c, hinotes.c, install-todo.c, pilot-addresses.c, pilot-dlpsh.c, pilot-hinotes.c, pilot-install-todo.c, pilot-read-notepad.c, pilot-read-todos.c, pilot-xfer.c, read-notepad.c, read-todos.c: Fixed a minor segfault problem in pilot-addresses, other minor cleanups 2003-01-15 00:12 desrod * ChangeLog, configure.in: Fixed a bug where $LIBS was getting clobbered on BSD systems when gnugetopt was called 2003-01-15 00:05 desrod * ChangeLog, include/pi-datebook.h, include/pi-expense.h, include/pi-mail.h, include/pi-todo.h: Cleaned up some missing include directives 2003-01-08 04:26 desrod * ChangeLog, doc/README.usb: Change Zire to ttyUSB1 not ttyUSB0 (close #442) 2003-01-06 19:04 desrod * ChangeLog, bindings/Makefile.am: Yet another fix for Perl's $DESTDIR, this one from a Gentoo patch 2003-01-06 13:03 desrod * src/pilot-mail.c: Small patch to change the default location of sendmail. Ideally, this should search for $SENDMAIL and set it, but pilot-mail is deprecated. 2003-01-06 10:06 desrod * doc/man/: addresses.1.in, dlpsh.1.in, hinotes.1.in, ietf2datebook.1.in, install-datebook.1.in, install-expenses.1.in, install-hinote.1.in, install-memo.1.in, install-netsync.1.in, install-todo.1.in, install-user.1.in, pi-getram.1.in, pi-getrom.1.in, pilot-addresses.1.in, pilot-link.7.in, pilot-xfer.1.in, read-ical.1.in, read-notepad.1.in, read-palmpix.1.in: manpage updates 2003-01-06 06:47 desrod * ChangeLog, configure.in, doc/man/Makefile.am: New install-todo manpage 2003-01-06 06:41 desrod * doc/man/: addresses.1.in, dlpsh.1.in, hinotes.1.in, ietf2datebook.1.in, install-datebook.1.in, install-expenses.1.in, install-hinote.1.in, install-memo.1.in, install-netsync.1.in, install-todo.1.in, install-user.1.in, pi-getram.1.in, pi-getrom.1.in, pilot-addresses.1.in, pilot-link.7.in, pilot-xfer.1.in, read-ical.1.in, read-notepad.1.in, read-palmpix.1.in: Updated the strings in the "Author" field, added new manpage for install-todo 2003-01-05 18:44 desrod * NEWS, configure.in: Updated for 0.11.7 release, pending. 2003-01-05 18:39 desrod * ChangeLog, configure.in: Added doc/man/*.in files for automagic generation 2003-01-05 18:38 desrod * doc/man/: addresses.1, dlpsh.1, ietf2datebook.1, install-datebook.1, install-expenses.1, install-hinote.1, install-memo.1, install-netsync.1, install-user.1, pi-getram.1, pi-getrom.1, pilot-addresses.1, pilot-link.7, pilot-xfer.1, read-ical.1, read-notepad.1, read-palmpix.1: Remove static manpages, preference to auto-generated versions 2003-01-05 18:36 desrod * doc/man/: Makefile.am, addresses.1.in, dlpsh.1.in, hinotes.1.in, ietf2datebook.1.in, install-datebook.1.in, install-expenses.1.in, install-hinote.1.in, install-memo.1.in, install-netsync.1.in, install-user.1.in, pi-getram.1.in, pi-getrom.1.in, pilot-addresses.1.in, pilot-link.7.in, pilot-xfer.1.in, read-ical.1.in, read-notepad.1.in, read-palmpix.1.in: Converted all the manpages to cleaner format, added @VERSION@ to each one 2003-01-04 10:54 desrod * configure.in: Changed $PREFIX to default to /usr/local if not specified 2003-01-04 10:49 desrod * configure.in: Bump to 0.11.7 2003-01-04 10:48 desrod * ChangeLog, doc/man/Makefile.am, doc/man/addresses.1, doc/man/ietf2datebook.1, doc/man/read-palmpix.1: Added manpage for addresses (more to come), s/stdout/STDOUT/ on two others 2003-01-04 10:32 desrod * ChangeLog, configure.in, libpisock/dlp.c: $UID doesn't work on Solaris, geteuid() does, we'll use that in 0.11.8 $instead, minor patch to add \n in PI_LOG events 2003-01-02 22:51 desrod * ChangeLog, configure.in: Fixed a mixup with exit() vs exit; 2002-12-29 12:35 desrod * configure.in: Still not right, more readline fixes 2002-12-29 12:24 desrod * configure.in: Minor readline fixup 2002-12-29 12:11 desrod * configure.scan: Remove deprecated file, not needed 2002-12-29 09:49 desrod * configure.in: Throw warning, not a fatal error. 2002-12-29 09:12 desrod * configure.in: Fix incorrect error condition 2002-12-29 09:08 desrod * ChangeLog, configure.in: Fix C++ conftest problem when readline isn't found 2002-12-24 21:24 desrod * NEWS: Updated for 0.11.6 release 2002-12-24 21:23 desrod * ChangeLog, src/dlpsh.c, src/pilot-dlpsh.c: Changed 'df' layout for 16mb and greater devices 2002-12-24 21:04 desrod * ChangeLog: Updated for padp.c change 2002-12-24 21:02 desrod * libpisock/padp.c: Added error message regarding port speed issues when PILOTRATE is set too high 2002-12-24 20:42 desrod * doc/TODO: Removed closed/deprecated TODO items 2002-12-24 20:39 desrod * doc/README.usb: Updated for new devices, ports, kernel versions 2002-12-24 19:12 desrod * src/: dlpsh.c, hinotes.c, install-expenses.c, install-hinote.c, install-memo.c, install-netsync.c, install-todo.c, install-todos.c, pi-getromtoken.c, pilot-archive.c, pilot-dlpsh.c, pilot-getromtoken.c, pilot-hinotes.c, pilot-install-expenses.c, pilot-install-hinote.c, pilot-install-memo.c, pilot-install-netsync.c, pilot-install-todo.c, pilot-install-todos.c, pilot-read-notepad.c, pilot-read-palmpix.c, pilot-read-todos.c, pilot-reminders.c, pilot-xfer.c, read-notepad.c, read-palmpix.c, read-todos.c, reminders.c: Minor reformatting (sorry Angus =) and cleanup for 0.11.6 release 2002-12-24 17:29 desrod * ChangeLog, src/install-memo.c, src/pilot-install-memo.c: Many fixes to remove malloc() and cast bugs, check file sizes before syncronization, fixed missing 't' argument specifier. 2002-12-24 11:42 desrod * configure.in: Remove unnecessary log comment 2002-12-24 11:39 desrod * configure.in: Check for UID0, exit clean 2002-12-22 21:47 desrod * configure.in: Fixed --enable-debug/--disable-debug clause 2002-12-22 19:43 desrod * configure.in: Fixed $withval on --with-efence 2002-12-22 17:16 desrod * ChangeLog, configure.in: Cleaning up deprecated headers 2002-12-22 16:17 desrod * configure.in: Small syntax error change, die if --with-efence used, but efence not found 2002-12-20 16:07 desrod * configure.in: Small efence fix, disabled by default, propagate into $LIBS 2002-12-20 13:16 desrod * ChangeLog, configure.in: Added ElectricFence check 2002-12-18 07:49 desrod * bindings/Python/test.py: Fixed port, added shebang 2002-12-18 07:48 desrod * ChangeLog, bindings/Python/test.py: Added test.py for real this time, whoops. 2002-12-18 07:43 desrod * ChangeLog, bindings/Python/README, bindings/Python/README.txt, bindings/Python/src/pisock.i, bindings/Python/src/pisock_wrap.c: Code cleanups from Nicholas Piper, new test script, deprecate README.txt 2002-12-17 13:09 desrod * ChangeLog, src/pilot-xfer.c: Minor Connect() misplacement 2002-12-16 10:35 desrod * src/pilot-xfer.c: Added a leaner output for Backup()/Install() for now, until better arrives 2002-12-16 10:26 desrod * src/pilot-xfer.c: Remove -q [quiet] and -c [count] options, unused and will be replaced by verbose options later 2002-12-14 08:37 desrod * ChangeLog, libpisock/inet.c: Small fix for BSD 2002-12-12 13:47 desrod * ChangeLog: Fixed small typo 2002-12-11 12:50 desrod * configure.in: Added minor check for CVS directory, spit warning if found 2002-12-11 11:13 desrod * ChangeLog, src/pilot-archive.c: Added new conduit skeleton for archiving Palm records to desktop (not finished yet) 2002-12-11 10:45 desrod * ChangeLog, src/Makefile.am: Deprecate pilot-mail build. The conduit will stay around as a skeleton to help others learn how to write conduits, but pilot-mailsync should be used instead. 2002-12-10 12:37 desrod * ChangeLog, autogen.sh: UnixWare fixes for testing glibtool vs. libtool 2002-12-08 11:54 desrod * ChangeLog, autogen.sh: More fixes for OSX libtool problems (glibtool vs. libtool) 2002-12-05 13:20 desrod * ChangeLog, src/install-todo.c, src/pilot-install-todo.c: Change the author name on install-todo.c, oops, sorry Martin! =) 2002-12-04 08:49 desrod * src/pilot-addresses.c: s/MemoDB.pdb/AddressDB.pdb/ silly copy/paste typo somewhere in the past 2002-12-03 16:19 desrod * autogen.sh: Updated package locations, versions required in autogen.sh builds 2002-12-03 09:52 desrod * configure.in: Minor verbage change to configure.in to report CURRENT.AGE.REVISION instead of CURRENT.REVISION.AGE 2002-12-03 09:27 desrod * src/pilot-xfer.c: Updated fix to properly detect (and avoid) OS3.3 versions when setting the date/time on the device. 2002-12-03 06:49 desrod * ChangeLog, src/pilot-xfer.c: Added feature to sync time with the desktop, properly excluding OS3.3 devices which are known to hard-reset when SetSysDate is called (known PalmOS bug) 2002-12-02 10:27 jpr * ChangeLog: Remove conflict marker. 2002-12-02 10:25 jpr * ChangeLog, configure.in, include/pi-version.h.in: 2002-12-02 JP Rosevear * include/pi-version.h.in: remove HOST_OS substitution, its in config.h now * configure.in: define HOST_OS here 2002-12-02 10:17 desrod * bindings/Python/src/pisock_wrap.c, libpisock/pi-header.c: s/display_splash/print_splash/ 2002-12-02 09:46 angusa * ChangeLog: OS 5 changes for notepad 2002-12-02 09:46 angusa * libpisock/notepad.c: fixed odd length buffer read added OS5 version 2 notepad support 2002-12-02 09:45 angusa * include/pi-notepad.h: added OS5 version 2 notepad support 2002-12-02 09:43 angusa * src/: pilot-read-notepad.c, read-notepad.c: added support for OS5 version 2 notepad 2002-12-02 09:41 desrod * include/pi-header.h: s/display_splash/print_splash/ 2002-12-02 09:39 desrod * configure.in: Bump libpisock by one 2002-12-02 09:38 desrod * src/: addresses.c, dlpsh.c, getrom.c, hinotes.c, install-datebook.c, install-expenses.c, install-hinote.c, install-memo.c, install-netsync.c, install-todo.c, install-todos.c, install-user.c, memos.c, money2qif.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-getromtoken.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-csd.c, pilot-dedupe.c, pilot-dlpsh.c, pilot-file.c, pilot-getram.c, pilot-getrom.c, pilot-getromtoken.c, pilot-hinotes.c, pilot-install-datebook.c, pilot-install-expenses.c, pilot-install-hinote.c, pilot-install-memo.c, pilot-install-netsync.c, pilot-install-todo.c, pilot-install-todos.c, pilot-install-user.c, pilot-mail.c, pilot-memos.c, pilot-nredir.c, pilot-port.c, pilot-prc.c, pilot-read-expenses.c, pilot-read-ical.c, pilot-read-notepad.c, pilot-read-palmpix.c, pilot-read-todos.c, pilot-reminders.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-notepad.c, read-palmpix.c, read-todos.c, reminders.c: s/display_splash/print_splash/ for now, restores binary compatibility NOTE: this *WILL* change in a future release, to display_splash again 2002-12-01 21:36 desrod * ChangeLog, NEWS, bindings/Makefile.am, bindings/Python/src/pisock_wrap.c, doc/man/Makefile.am, include/pi-header.h, libpisock/pi-file.c, libpisock/pi-header.c, src/addresses.c, src/getrom.c, src/install-datebook.c, src/install-expenses.c, src/install-hinote.c, src/install-memo.c, src/install-netsync.c, src/install-user.c, src/kittykiller.c, src/money2qif.c, src/pi-csd.c, src/pi-getram.c, src/pi-getrom.c, src/pi-getromtoken.c, src/pi-nredir.c, src/pi-port.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-dedupe.c, src/pilot-file.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-getromtoken.c, src/pilot-install-datebook.c, src/pilot-install-expenses.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-netsync.c, src/pilot-install-user.c, src/pilot-mail.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-prc.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-notepad.c, src/pilot-read-palmpix.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/read-expenses.c, src/read-ical.c, src/read-notepad.c, src/read-palmpix.c, src/read-todos.c, src/reminders.c: Pedantic cleanups, cleaned up location of getopt_long() structures, added all missing --long options, etc. and a bunch of things I probably forgot I added. 2002-12-01 21:35 desrod * src/pilot-xfer.c: Added feature to close bug #265. pilot-xfer will now check available space on the Palm before each file is installed. If the target file is larger than available space, it will be skipped. Need to clean up symantics between Install and Restore functions here. 2002-12-01 21:34 desrod * README: Cleaned up verbage to be more concise per-platform 2002-12-01 21:33 desrod * doc/man/install-expenses.1: Added new manpage for install-expenses 2002-12-01 21:32 desrod * src/pilot-addresses.c: Cleaned up location of tabledelim values (silly bug!) 2002-12-01 21:31 desrod * src/: dlpsh.c, pilot-dlpsh.c: Fixed CreatorID printf() confusion 2002-12-01 21:31 desrod * libpisock/connect.c: Better error reporting, minor formatting changes 2002-12-01 21:31 desrod * src/: hinotes.c, pilot-hinotes.c: Pedantic cleanups 2002-12-01 21:30 desrod * doc/README.freebsd: Minor changes to handle non-Handspring handhelds 2002-12-01 21:30 desrod * include/pi-version.h.in: Export HOST_OS to assist debugging 2002-12-01 21:30 desrod * src/: install-todos.c, pilot-install-todos.c: Expanded display_help() slightly 2002-12-01 21:29 desrod * src/: memos.c, pilot-memos.c: Pedantic cleanups, chasing deleted memo bug (#359) 2002-12-01 21:29 desrod * src/pilot-debug.c: Fix for TCL version detection (again?) I need testers or TCL gurus to test/validate this for me. Anyone? 2002-12-01 21:28 desrod * src/Makefile.am: Added install-todo 2002-12-01 21:28 desrod * configure.in: Added CFLAGS, CXXFLAGS, exported HOST_OS 2002-12-01 21:28 desrod * src/: install-todo.c, pilot-install-todo.c: Added new ToDo conduit from Robert A. Kaplan, code cleanup 2002-11-26 16:40 desrod * configure.in: Fixing another minor oopsie. 2002-11-24 10:13 desrod * ChangeLog, configure.in: Fixed AC_INIT in configure.in to allow compatibility with autoconf 2.13 and 2.53 2002-11-23 04:50 desrod * configure.in: Removed AC_PREREQ and -devel tag 2002-11-20 17:37 desrod * configure.in: Small typo change for clarity: s/linux/Linux/, s/freebsd/FreeBSD/ 2002-11-20 17:33 desrod * ChangeLog, configure.in, libpisock/connect.c, src/pilot-xfer.c: Fixes to stop autoconf warnings, fixes to eliminiate lockups on BSD, changes to totalsize() output on Install and Backup targets in pilot-xfer 2002-11-20 17:12 desrod * acconfig.h: Removed deprecated need for acconfig.h 2002-11-20 10:43 desrod * ChangeLog, src/pilot-xfer.c: Fix for calculating totalsize() 2002-11-20 10:33 desrod * ChangeLog, libpisock/connect.c: Minor fixes to connect, so we don't lose the client (or parent) sockets 2002-11-17 13:38 desrod * ChangeLog, libpisock/pi-header.c: Minor verbage changes 2002-11-15 22:03 davidh * ChangeLog: Oops. Forgot to update this when I checked in my earlier changes. 2002-11-15 21:23 davidh * libpisock/dlp.c: Generic organizational comments. Header for dlp_ReadNextModifiedRecInCategory(). 2002-11-15 19:19 davidh * libpisock/dlp.c: Header for dlp_ReadRecordByIndex(). 2002-11-01 13:28 desrod * ChangeLog, configure.in: Fix --no-verify error on BSD systems 2002-10-28 08:14 desrod * ChangeLog, src/pilot-mail.c: Fixed an error when characters between 128 and 255 are received. 2002-10-28 08:03 desrod * ChangeLog, configure.in: Added a small fix for testing for unistd.h for getopt on Mac OSX systems (Bill Janssen) 2002-10-28 07:57 desrod * ChangeLog, configure.in: Added a better test for readline support through termlib, ncurses, etc. More portable solution. 2002-10-28 07:08 desrod * ChangeLog, bindings/Makefile.am: Fixed the DESTDIR target in the perl-install prefix (Ben Darnell), added DESTDIR for the python-instal target (Mike Frysinger). 2002-10-11 14:32 jpr * ChangeLog, libpisock/dlp.c: 2002-10-11 JP Rosevear * libpisock/dlp.c (dlp_response_read): don't depend on the return arguments starting at a certain number 2002-10-11 14:28 jpr * ChangeLog, libpisock/dlp.c: 2002-10-11 JP Rosevear * libpisock/dlp.c (dlp_GetROMToken): add trace to getromtoken call (dlp_WriteRecord): use record_dump call 2002-10-11 14:25 jpr * ChangeLog, configure.in: 2002-10-11 JP Rosevear * configure.in: put a space in between putenv and sigaction so they functions are correctly checked for; update png check to look for png setjmp support 2002-10-03 11:06 jpr * ChangeLog, src/pilot-xfer.c: 2002-10-03 JP Rosevear * src/pilot-xfer.c: initialize totalsize to 0 2002-10-02 11:01 jpr * ChangeLog, src/Makefile.am: 2002-10-02 JP Rosevear * src/Makefile.am: dist getopt sources * src/pilot-datebook/Makefile.am: ditto 2002-09-28 15:14 desrod * ChangeLog, configure.in: Small typo 2002-09-28 15:02 desrod * NEWS, doc/README.usb: Updated documentation or 0.11.5 release 2002-09-28 14:07 desrod * ChangeLog, include/pi-datebook.hxx: Remove use of antiquated header for libpisock++ builds on {c|g}++ 3.x systems 2002-09-27 09:08 desrod * ChangeLog, bindings/Python/src/pisock.i: Added pilot_connect() 2002-09-26 09:39 jpr * ChangeLog, libpisock/dlp.c: 2002-09-26 JP Rosevear * libpisock/dlp.c (dlp_CallApplication): check result before using response (Owen Stenseth ) 2002-09-25 11:31 desrod * ChangeLog, bindings/Python/src/pisock.i: Fix for 'name' and 'nameLength' member errors (Nicholas Piper) 2002-09-23 17:27 jpr * ChangeLog, bindings/Java/Makefile.am: 2002-09-23 JP Rosevear * bindings/Java/Makefile.am: revert includes change 2002-09-23 15:44 jpr * configure.in: Actually commit file. 2002-09-23 15:40 jpr * ChangeLog, src/Makefile.am: 2002-09-23 JP Rosevear * src/Makefile.am: add in getopt sources to binaries if needed * configure.in: change check for getopt_long to not involve libobjs at all * src/pilot-datebook/Makefile.am: ditto 2002-09-20 10:57 desrod * ChangeLog, bindings/Java/Makefile.am: We should be testing for JAVA_HOME, not JAVABASE 2002-09-17 17:18 desrod * ChangeLog, configure.in: Check for snprintf() 2002-09-17 17:17 desrod * ChangeLog, src/pilot-schlep.c: Fixed an incorrect help string 2002-09-17 15:51 desrod * ChangeLog, src/Makefile.am: Fixed a typo on bin_SCRIPTS, missing end \ 2002-09-17 12:01 desrod * ChangeLog, configure.in: Updated to fix some Irix issues, expose HOST_OS for later inclusion 2002-09-17 08:25 desrod * doc/Makefile.am: Missing README.freebsd file 2002-09-17 01:29 jpr * ChangeLog, src/Makefile.am: 002-09-17 JP Rosevear * src/pilot-datebook/Makefile.am: dist getopt*.c files because LIBOBJS works differently now (broken for non-gnu platforms) * src/Makefile.am: ditto 2002-09-16 11:53 desrod * NEWS: Updated to add one known bug 2002-09-16 11:43 desrod * ChangeLog, NEWS: Updated NEWS file to sync up with current release 2002-09-16 11:13 desrod * ChangeLog, doc/README.freebsd: Added Anish Mistry's README.freebsd for FreeBSD sync'ing 2002-09-16 10:51 desrod * bindings/Perl/Pilot.xs: Quick hack to allow the Perl bindings to compile on perl 5.8 with gcc 3.x 2002-09-16 09:52 jpr * ChangeLog, configure.in, include/pi-version.h.in: 2002-09-13 JP Rosevear * include/pi-version.h.in: remove the nano version stuff * configure.in: remove nano version stuff, bump to 0.11.4 2002-09-13 15:19 jpr * ChangeLog, doc/Makefile.am: 2002-09-13 JP Rosevear * doc/Makefile.am: stop disting dead file 2002-09-13 15:11 jpr * ChangeLog, configure.in, src/Makefile.am, src/pilot-read-notepad.c, src/pilot-read-palmpix.c, src/read-notepad.c, src/read-palmpix.c: 2002-09-13 JP Rosevear * src/pilot-datebook/Makefile.am: remove LIBOBJS from LDADD * src/Makefile.am: include PNG_CFLAGS * src/read-palmpix.c: conditionally include config.h and don't force undef of HAVE_PNG * src/read-notepad.c: same * configure.in: Update libpng check to also check for header file and take arg for libpng location 2002-09-11 07:25 desrod * ChangeLog, configure.in, src/Makefile.am: Updated to only link -lpng to the binaries which require it, read-notepad and read-palmpix (Ben Darnell, bug 0000289) 2002-08-31 08:49 desrod * ChangeLog, configure.in: autoconf fixes for LIBOBJS and getopt 2002-08-30 17:29 desrod * ChangeLog, src/pilot-read-notepad.c, src/pilot-read-palmpix.c, src/read-notepad.c, src/read-palmpix.c: Added missing unistd.h include for F_OK 2002-08-30 17:16 desrod * ChangeLog, src/Makefile.am, src/pilot-read-notepad.c, src/pilot-read-palmpix.c, src/read-notepad.c, src/read-palmpix.c: AC_LIBOBJ fix for autoconf 2.5x builds, various fixes for AIX 4.3.3 users 2002-08-30 15:44 desrod * ChangeLog, libpisock/net.c: Fix for Network Sync failures 2002-08-30 15:43 desrod * ChangeLog, src/pd-tty.c: Fixed ifdef for tcl/tk in pd-tty.c (akkana@shallowsky.com) 2002-08-30 15:40 jpr * ChangeLog, configure.in: 2002-08-30 JP Rosevear * configure.in: define conditionals for usb support properly 2002-08-21 12:14 jpr * ChangeLog, pilot-link.m4.in: 2002-08-21 JP Rosevear * pilot-link.m4.in: fix typo 2002-08-21 11:11 desrod * ChangeLog, configure.in: Updated output 2002-08-20 09:14 desrod * doc/: README-Win32.txt, TODO: Removed dead README-Win32.txt file, url is dead, all links to Win32 version of pilot-xfer are dead, and Tilo Christ's email addresses are no longer valid. 2002-08-16 12:11 davidh * ChangeLog, libpisock/connect.c: Zapped redundant pilot_connect() prototype. Wrote function header for pilot_connect(). 2002-08-16 12:01 desrod * include/pi-header.h, libpisock/connect.c: Removed const definition to flatten proto and remove conflicting type 2002-08-16 11:54 desrod * include/pi-header.h: Oops, why didn't this get committed. Fixed proto. 2002-08-16 11:31 desrod * libpisock/connect.c: Removed unnecessary header 2002-08-16 11:30 desrod * libpisock/connect.c: Removed last conflicting proto 2002-08-16 10:18 desrod * ChangeLog, src/addresses.c, src/dlpsh.c, src/hinotes.c, src/install-datebook.c, src/install-expenses.c, src/install-hinote.c, src/install-memo.c, src/install-netsync.c, src/install-todos.c, src/install-user.c, src/memos.c, src/money2qif.c, src/pd-tty.c, src/pi-csd.c, src/pi-getram.c, src/pi-getrom.c, src/pi-getromtoken.c, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-file.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-getromtoken.c, src/pilot-hinotes.c, src/pilot-install-datebook.c, src/pilot-install-expenses.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-netsync.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-mail.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-notepad.c, src/pilot-read-palmpix.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-notepad.c, src/read-palmpix.c, src/read-todos.c, src/reminders.c: Relocated static proto for pilot_connect(); 2002-08-15 14:01 jpr * ChangeLog, libpisock/usb.c: 002-08-15 JP Rosevear * libpisock/usb.c (pi_usb_device_dup): make the ref null, since we don't currently use it (pi_usb_device): set the ref to null (pi_usb_close): don't dec the ref count 2002-08-15 13:59 jpr * ChangeLog: Tidy. 2002-08-15 13:57 jpr * ChangeLog, src/dlpsh.c, src/pilot-dlpsh.c: 2002-08-15 JP Rosevear * src/dlpsh.c (ls_fn): make sure tag is initialiazed and is based on type properly 2002-08-10 16:55 angusa * ChangeLog: read-notepad changes 2002-08-10 16:52 angusa * src/: pilot-read-notepad.c, read-notepad.c: Fixed bug 240 2002-08-10 14:03 angusa * ChangeLog: read-notepad and read-palmpix updates 2002-08-10 13:09 angusa * src/: pilot-read-notepad.c, read-notepad.c, pilot-read-palmpix.c, read-palmpix.c: Added protect_files so that already exsisting files don't get overwritten. 2002-08-09 09:43 jpr * ChangeLog, libpisock/serial.c: 2002-08-09 JP Rosevear * libpisock/serial.c (pi_serial_device_free): only free the ref memory if its 0 (pi_serial_device): init the ref count to 1 2002-08-07 10:23 desrod * configure.in: Updated to 0.11.3 2002-08-06 19:38 desrod * ChangeLog, configure.in, src/pilot-xfer.c: More terminal fixes, bumped libpisock version 2002-08-06 18:10 jpr * ChangeLog, include/pi-dlp.h: 2002-08-06 JP Rosevear * include/pi-dlp.h: add missing error code 2002-08-06 12:38 desrod * bindings/README: Updated legacy README 2002-08-06 12:21 desrod * ChangeLog, configure.in: BSD/OS 4.3 and TCL fixes provided by Jeffrey C Honig 2002-08-06 10:29 desrod * ChangeLog, src/pilot-xfer.c: Fixed the -q (quiet) option. This still needs more work. 2002-08-06 04:51 desrod * bindings/Perl/test.pl, libpisock/freebsdusb.c, src/install-todos.c, src/pilot-install-todos.c, src/pilot-sync-plan.pl, src/pilot-xfer.c, src/sync-plan.PL: Last minute fixes before 0.11.2 release 2002-08-02 07:17 desrod * ChangeLog, src/pilot-addresses.c: Fixed field length ordering to exactly match the Windows Palm Desktop output csv file format (minus categories) 2002-07-31 15:19 desrod * ChangeLog, bindings/Perl/test.pl: Mail doesn't have categories 2002-07-31 13:33 desrod * ChangeLog, src/pilot-xfer.c: Terminal corruption fixes 2002-07-30 19:10 desrod * ChangeLog, src/pilot-sync-plan.pl, src/sync-plan.PL: Fix for incorrect time being restored (localtime vs. gmtime) 2002-07-30 18:34 desrod * doc/TODO: Updated TODO 2002-07-30 18:33 desrod * configure.in, include/pi-address.h, include/pi-address.hxx, src/pilot-addresses.c: pilot-addresses field ordering fix 2002-07-30 11:52 desrod * ChangeLog, doc/CodingGuidelines, doc/man/pilot-xfer.1, include/pi-usb.h, libpisock/address.c, libpisock/appinfo.c, libpisock/cmp.c, libpisock/datebook.c, libpisock/dlp.c, libpisock/expense.c, libpisock/freebsdusb.c, libpisock/hinote.c, libpisock/inet.c, libpisock/linuxusb.c, libpisock/mail.c, libpisock/memo.c, libpisock/money.c, libpisock/os2serial.c, libpisock/padp.c, libpisock/pi-file.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/sys.c, libpisock/syspkt.c, libpisock/todo.c, libpisock/unixserial.c, libpisock/usb.c, libpisock/util.c, libpisock/utils.c, libpisock/winserial.c, libpisync/sync.c, src/dlpsh.c, src/install-expenses.c, src/memos.c, src/pd-tty.c, src/pi-csd.c, src/pi-port.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-file.c, src/pilot-install-expenses.c, src/pilot-memos.c, src/pilot-port.c, src/pilot-prc.c, src/pilot-read-expenses.c, src/pilot-xfer.c, src/read-expenses.c: Cleanup, typos fixed, Perl $prefix fix, FreeBSD updates 2002-07-30 10:57 desrod * ChangeLog, bindings/Makefile.am: Fixed incorrect 'install' target inside the perl-build rule 2002-07-30 07:26 desrod * ChangeLog, bindings/Makefile.am: Temporary workaround for Perl and Python bindings 2002-07-29 22:42 desrod * ChangeLog, src/pilot-xfer.c: Minor usability additions to pilot-xfer 2002-07-29 10:27 jpr * ChangeLog, libpisock/dlp.c: 2002-07-29 JP Rosevear * libpisock/dlp.c (dlp_request_write): ensure that exec_buf is always freed (dlp_ReadSysInfo): check that response, not request, has atleast one arg (dlp_ReadNetSyncInfo): free response (dlp_ReadNextModifiedRec): free request (dlp_ReadRecordByIndex): free response 2002-07-28 21:47 desrod * ChangeLog, libpisock/dlp.c: Temporary fix for J-Pilot issues, need to investigate better solutions 2002-07-23 15:09 desrod * ChangeLog, doc/man/pilot-link.7: Fixed typos that broke man2html 2002-07-23 12:20 desrod * ChangeLog: Fixed indenting, function comments, GPL banner, copyright 2002-07-23 11:02 desrod * ChangeLog, libpisock/dlp.c, src/install-datebook.c, src/pilot-install-datebook.c: Fixes for wrong number of fields encountered, updated to getopt_long, cleansed 2002-07-22 21:40 desrod * src/: dlpsh.c, install-netsync.c, install-user.c, pilot-dlpsh.c, pilot-install-netsync.c, pilot-install-user.c: More C89 fixes 2002-07-21 20:39 desrod * src/pilot-mail.c: signedness fixes 'unsigned char *)buffer' 2002-07-21 12:49 desrod * src/: addresses.c, dlpsh.c, getrom.c, hinotes.c, install-expenses.c, install-hinote.c, install-memo.c, install-netsync.c, install-todos.c, install-user.c, memos.c, money2qif.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-getromtoken.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-csd.c, pilot-debug.c, pilot-dedupe.c, pilot-dlpsh.c, pilot-file.c, pilot-getram.c, pilot-getrom.c, pilot-getromtoken.c, pilot-hinotes.c, pilot-install-expenses.c, pilot-install-hinote.c, pilot-install-memo.c, pilot-install-netsync.c, pilot-install-todos.c, pilot-install-user.c, pilot-mail.c, pilot-memos.c, pilot-nredir.c, pilot-port.c, pilot-prc.c, pilot-read-expenses.c, pilot-read-ical.c, pilot-read-notepad.c, pilot-read-palmpix.c, pilot-read-todos.c, pilot-reminders.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-notepad.c, read-palmpix.c, read-todos.c, reminders.c: More C89 fixes, s/print_help/display_help, also s/return/exit(0)/ to return error to caller 2002-07-21 11:09 desrod * src/: pilot-read-palmpix.c, read-palmpix.c: Missing in pilot-datebook-update, fixed C89 warnings, missing proto for write_png in read-palmpix 2002-07-20 15:50 angusa * src/: pilot-read-notepad.c, read-notepad.c: fixed typo 2002-07-19 16:10 jpr * ChangeLog, configure.in: 2002-07-19 JP Rosevear * configure.in: correct libpisock library versioning 2002-07-19 16:09 angusa * ChangeLog: [no log message] 2002-07-19 14:49 angusa * src/: pilot-read-palmpix.c, read-palmpix.c: Cleaned out some old junk 2002-07-19 14:48 angusa * libpisock/palmpix.c: Added [u]int*_t defines 2002-07-19 11:48 jpr * ChangeLog, include/pi-debug.h, libpisock/cmp.c, libpisock/dlp.c, libpisock/freebsdusb.c, libpisock/inet.c, libpisock/linuxusb.c, libpisock/net.c, libpisock/padp.c, libpisock/palmpix.c, libpisock/pi-file.c, libpisock/slp.c, libpisock/socket.c, libpisock/sys.c, libpisock/unixserial.c, tests/dlp-test.c: 2002-07-19 JP Rosevear * libpisock/unixserial.c: Update for LOG changes * libpisock/sys.c: ditto * libpisock/socket.c: ditto * libpisock/slp.c: ditto * libpisock/pi-file.c: ditto * libpisock/padp.c: ditto * libpisock/net.c: ditto * libpisock/linuxusb.c: ditto * libpisock/inet.c: ditto * libpisock/freebsdusb.c: ditto * libpisock/dlp.c: ditto * libpisock/cmp.c: ditto * tests/dlp-test.c: change CHECK to CHECK_RESULT so we don't conflict with the debug macro, reflect LOG define changes * include/pi-debug.h: redefine LOG so it is not a variadic macro 2002-07-19 11:22 jpr * ChangeLog, include/pi-hinote.h: 2002-07-19 JP Rosevear * include/pi-hinote.h: remove include of non-existant file and // style comment 2002-07-19 11:20 jpr * ChangeLog, configure.in: 2002-07-19 JP Rosevear * configure.in: turn c++ support back on by default 2002-07-19 09:50 jpr * include/Makefile.am: 2002-07-18 JP Rosevear * include/Makefile.am: handle the case where c++ is not built correctly 2002-07-19 09:46 jpr * ChangeLog, src/pilot-xfer.c: 2002-07-19 JP Rosevear * src/pilot-xfer.c: use instead of 2002-07-18 16:17 desrod * ChangeLog, libpisock/dlp.c: Fix for missing ENOMSG on BSD and Darwin systems (Ian Darwin) 2002-07-18 16:07 desrod * ChangeLog, libpisock/connect.c: Fix for QNX/Solaris builds, should be , fixes a mistake on 2-25 commit 2002-07-18 14:52 jpr * ChangeLog, bindings/Makefile.am: 2002-07-18 JP Rosevear * bindings/Makefile.am: add dist hook to remove the CVS dirs from the tarball 2002-07-18 13:14 desrod * include/pi-notepad.h: // comment fixes 2002-07-18 13:05 desrod * NEWS: Increment release name 2002-07-18 13:04 desrod * ChangeLog, NEWS, doc/TODO: Updating remaining documentation for 0.11.1 release 2002-07-18 13:04 desrod * libpisock/dlp.c, libpisock/notepad.c, libpisock/palmpix.c, src/pilot-addresses.c, src/pilot-debug.c, src/pilot-mail.c, src/pilot-read-palmpix.c, src/pilot-xfer.c, src/read-palmpix.c: Fixed erroneous use of // in C comments 2002-07-18 11:45 desrod * ChangeLog, autogen.sh, configure.in, bindings/Makefile.am, libpisock/inet.c: Last minute fixes, disable all bindings by default to 'off', fixed some missing strings in autogen.sh, corrected an uninitialized 'port' in inet.c, s/PERL5/PERL/ in Makefile.am, since we're testing vesion anyway. 2002-07-17 19:46 desrod * configure.in, src/pilot-addresses.c: More -pedantic fixes, contributed patch from Akkana Peck. 2002-07-17 18:54 desrod * ChangeLog, src/pilot-xfer.c: 1/2 fix for non-writable local files with 'pilot-xfer -f' 2002-07-17 18:02 desrod * ChangeLog, bindings/Python/src/pisock_wrap.c: Clean up remaining swig warnings 2002-07-17 12:57 desrod * bindings/Python/setup.py: Removed stale setup.py file 2002-07-17 12:55 desrod * ChangeLog, configure.in, bindings/Python/setup.py.in: Added fixes for Python autoconf version propagation 2002-07-17 07:54 desrod * ChangeLog, libpisock/Makefile.am: Removed trailing space in pilot-datebook's Makefile.am, added $(usb_FILES) for BSD users in ./libpisock/Makefile.am 2002-07-16 19:03 desrod * ChangeLog, bindings/Perl/Makefile.PL.in: Fixed Perl binding to handle autoconf version propagation 2002-07-16 18:08 desrod * ChangeLog, src/memos.c, src/pilot-memos.c: Removed redundant call to print_splash(), fixed print_help() options string (akkana@shallowsky.com) 2002-07-16 17:58 angusa * doc/man/read-palmpix.1: Added png output type 2002-07-16 17:56 angusa * doc/man/read-notepad.1: changed output type definition 2002-07-16 17:54 angusa * src/pilot-read-palmpix.c, src/read-palmpix.c, include/pi-palmpix.h: Added png output 2002-07-16 17:18 jpr * ChangeLog, autogen.sh, configure.in: 2002-07-16 JP Rosevear * configure.in (set_compile_warnings): use the more standard --enable-compiler-warnings * autogen.sh: don't enable compiler warnings by default 2002-07-16 16:58 jpr * ChangeLog, configure.in, include/pi-socket.h, libpisock/net.c: 2002-07-16 JP Rosevear * configure.in: don't enable extra warnings by default and add pedantic when we do * libpisock/net.c (net_tx_handshake): use unsigned char type for the buffer * include/pi-socket.h: removing unneccessary comma 2002-07-16 16:52 angusa * src/: pilot-read-notepad.c, read-notepad.c: Fixed bad ifdef 2002-07-16 16:48 angusa * src/: pilot-read-notepad.c, read-notepad.c: Added notepad qualifier to filename. 2002-07-16 15:45 angusa * doc/man/read-notepad.1: Added output type 2002-07-16 15:44 angusa * src/: pilot-read-notepad.c, read-notepad.c: Added -t for output type 2002-07-14 10:09 jpr * ChangeLog, libpisock/dlp.c: 2002-07-14 JP Rosevear * libpisock/dlp.c (dlp_FindDBInfo): don't bail out unless the return value is less than 0 from dlp_ReadDBList 2002-07-13 14:39 desrod * NEWS, src/pilot-xfer.c: Updated version and data info in NEWS file, fixed misplaced string in pilot-xfer.c 2002-07-12 14:18 desrod * ChangeLog, include/pi-notepad.h: Changed dataLen to unsigned int 2002-07-12 14:07 desrod * ChangeLog: Fixed missing headers 2002-07-12 13:50 desrod * configure.in, pilot-link.m4.in: Reverting PILOT_LINK_NANO changes for 0.11 release 2002-07-12 13:33 angusa * doc/man/read-notepad.1: Merged ppm usage notes 2002-07-12 13:16 desrod * ChangeLog, libpisock/sys.c: Fixed error reporting in sys.c 2002-07-12 13:06 desrod * doc/man/Makefile.am: Added new manpages to install target 2002-07-12 13:03 desrod * doc/man/: dlpsh.1, ietf2datebook.1, install-datebook.1, install-hinote.1, install-memo.1, install-netsync.1, install-user.1, pi-getram.1, pi-getrom.1, pilot-addresses.1, pilot-xfer.1, read-ical.1, read-notepad.1, read-palmpix.1: lc($header) and s/FSF/Free Software Foundation/ in doc/man 2002-07-12 12:33 desrod * doc/man/: pi-getram.1, pi-getrom.1: New manpages 2002-07-12 12:22 desrod * doc/man/install-datebook.1: Updated install-datebook manpage 2002-07-12 12:19 desrod * doc/man/: pilot-addresses.1, pilot-link.7, read-ical.1: Updates, fixed some typos 2002-07-12 11:57 desrod * doc/man/: install-memo.1, install-netsync.1, install-user.1: Fixing up AUTHORS section 2002-07-12 11:53 desrod * doc/man/: ietf2datebook.1, install-hinote.1, install-memo.1, pilot-addresses.1, read-notepad.1, read-palmpix.1: Fixed minor typos 2002-07-12 11:46 desrod * ChangeLog, src/ietf2datebook.PL, src/pilot-ietf2datebook.pl: Updated perl, removed CVS dreck headers 2002-07-12 11:37 desrod * doc/man/dlpsh.1: Typo 2002-07-12 11:36 desrod * ChangeLog, doc/man/dlpsh.1: Updated manpage to current 2002-07-12 11:22 desrod * ChangeLog, src/install-hinote.c, src/pilot-install-hinote.c, src/pilot-read-notepad.c, src/pilot-read-palmpix.c, src/read-notepad.c, src/read-palmpix.c: getopt_long fixes, minor formatting fixes 2002-07-12 11:12 desrod * bindings/: Perl/Makefile.PL.in, Python/setup.py: Incremented version number to 0.11.0. FIXME: Need to propagate this through autoconf in the future 2002-07-12 11:10 desrod * doc/man/: install-hinote.1, install-user.1, pilot-addresses.1, pilot-xfer.1: Updated manpages 2002-07-12 11:07 desrod * src/: install-netsync.c, pilot-install-netsync.c: Oops, fixed argument propagation 2002-07-12 11:04 desrod * src/: install-hinote.c, install-netsync.c, install-user.c, pilot-install-hinote.c, pilot-install-netsync.c, pilot-install-user.c: Changed minor options to be a bit more intuitive 2002-07-12 11:03 desrod * ChangeLog, doc/man/install-netsync.1, doc/man/read-notepad.1, doc/man/read-palmpix.1: New manpages for read-notepad, read-palmpix, install-netsync 2002-07-12 08:49 desrod * configure.in: Small change to report library version, fix pilot-link $VERSION output for 0.11 release (FIXME) 2002-07-12 08:40 desrod * bindings/Perl/Pilot.xs, include/pi-dlp.h, libpisock/dlp.c, src/pi-getromtoken.c, src/pilot-getromtoken.c, src/Makefile.am: Added dlp_GetROMToken patch (Owen Stenseth) 2002-07-12 07:29 desrod * ChangeLog, libpisock/todo.c: Added maximum length #defines for Description and Note length, will add check code later 2002-07-11 20:36 desrod * bindings/Perl/test.pl: Redundant exit() call 2002-07-11 17:59 desrod * ChangeLog, src/memos.c, src/pilot-memos.c: Use current date/time in output of "mail" headers, fixed placement of '\0' at the end of -c processing, added code to allow -c to be used when reading from a file (Michael Hartwig) 2002-07-11 16:18 desrod * ChangeLog, bindings/Perl/test.pl: Rewrite of perl binding test, do not dump records to STDOUT. Need to test return of $dlp 2002-07-11 15:29 angusa * src/: pilot-read-notepad.c, read-notepad.c: Fixed for PNG libs >= 1.0.12 2002-07-11 14:34 desrod * ChangeLog, bindings/Perl/Pilot.xs, bindings/Perl/dump.pl: Added strict fixes to dump.pl, fixed an incorrect ref test in Pilot.xs 2002-07-11 14:06 desrod * ChangeLog, configure.in, libpisock/dlp.c: Beginning of fixes for OSX/NeXT ENOMSG issue with errno.h (EINVAL instead) 2002-07-11 13:35 desrod * ChangeLog, src/pilot-read-palmpix.c, src/read-palmpix.c: Changed 'struct U' to 'struct User' and s/&U/&User/ to match the other conduits 2002-07-11 13:24 desrod * ChangeLog, src/pilot-addresses.c: WriteUserInfo fix to prevent clobbering the username on the device 2002-07-09 16:42 angusa * src/: pilot-read-notepad.c, read-notepad.c: Fixed output to PPM 2002-07-09 13:10 angusa * src/: pilot-read-notepad.c, read-notepad.c: Added PNG conversion 2002-07-09 13:08 angusa * configure.in: Added PNG lib checking 2002-07-09 13:05 angusa * acconfig.h: Added HAVE_PNG define - AA 2002-07-03 14:59 jpr * ChangeLog, configure.in, libpisock/palmpix.c: 2002-07-03 JP Rosevear * configure.in: check for stdint.h and inttypes.h * libpisock/palmpix.c: include stdint.h or inttypes.h as necessary 2002-07-03 14:26 jpr * ChangeLog, libpisock/usb.c: 2002-07-03 JP Rosevear * libpisock/usb.c (pi_usb_accept): don't actually set the baudrate, just use dummy values 2002-07-03 14:24 jpr * ChangeLog, libpisock/usb.c: 2002-07-03 JP Rosevear * libpisock/usb.c (pi_usb_accept): handle a cmp connection 2002-07-02 13:38 jpr * src/.cvsignore: Shush 2002-07-02 13:35 jpr * ChangeLog, libpisock/syspkt.c: 2002-07-02 JP Rosevear * libpisock/syspkt.c (sys_RPC): parse the return buffer correctly 2002-07-02 13:18 jpr * ChangeLog, include/pi-socket.h, libpisock/dlp.c, libpisock/serial.c, libpisock/socket.c, libpisock/sys.c, libpisock/syspkt.c, src/debugsh.c, src/pilot-debugsh.c: 2002-07-02 JP Rosevear * libpisock/serial.c (pi_serial_connect): set the data rate to 57600 for a sys socket (pi_serial_connect): set the baud rate for the device for all command queue types * libpisock/dlp.c (dlp_request_new): don't malloc a 0 size array (dlp_request_new_with_argid): ditto (dlp_response_new): ditto (dlp_request_free): don't free a 0 size array (dlp_response_free): ditto (dlp_exec): set the result to NULL in case we never read a result * libpisock/syspkt.c (sys_QueryState): only write 2 bytes (sys_RemoteEvent): don't write the slp info, just the event info (sys_RPC): ditto * libpisock/sys.c (sys_tx): transmit on the console socket type * src/debugsh.c (main): create the SYS socket and connect 2002-06-30 09:14 desrod * ChangeLog, libpisock/connect.c: Fixed the dlp_OpenConduit call, was put in the wrong place. Passwords should now work again. 2002-06-28 14:41 desrod * ChangeLog: [no log message] 2002-06-28 14:41 desrod * libpisock/palmpix.c: Fixed a missing prototype for DecodeRow 2002-06-28 14:31 desrod * ChangeLog, configure.in, bindings/Java/Jni.c, include/Makefile.am, include/pi-address.h, include/pi-notepad.h, include/pi-palmpix.h, libpisock/Makefile.am, libpisock/connect.c, libpisock/inet.c, libpisock/notepad.c, libpisock/palmpix.c, libpisock/serial.c, libpisock/socket.c, libpisock/usb.c, src/Makefile.am, src/pilot-addresses.c, src/pilot-read-notepad.c, src/pilot-read-palmpix.c, src/read-notepad.c, src/read-palmpix.c, tests/dlp-test.c: NEW CONDUITS: read-palmpix, read-notepad (Angus Ainslie) src/pilot-datebook: New datebook replacement (Matthias Hessler) configure.in: pilot-datebook pokes added src/Makefile.in: pilot-datebook pokes added src/pilot-addresses.c: Fixed a field-order error between 0.9.5 and 0.10.99 CSV export files. Fixed the -i/-c discrepancy again. bindings/Java/Jni.c: s/s.name/s.prodID/ libpisock/usb.c: Fixed missing prototype for pi_socket_init() libpisock/socket.c: ditto libpisock/serial.c: ditto libpisock/inet.c: ditto 2002-06-28 11:56 jpr * ChangeLog, libpisock/dlp.c: 2002-06-28 JP Rosevear * libpisock/dlp.c: oops, remove old dlp_exec function 2002-06-28 11:54 jpr * ChangeLog, include/pi-dlp.h, libpisock/dlp.c: 2002-06-28 JP Rosevear * include/pi-dlp.h: tidy protos * libpisock/dlp.c: rename dlp_exec_new to dlp_exec 2002-06-28 10:45 jpr * ChangeLog, NEWS, configure.in, pilot-link.m4.in, include/pi-version.h.in: 2002-06-28 JP Rosevear * NEWS: update * pilot-link.m4.in: handle nano version when doing configuration check * configure.in: bump version * include/pi-version.h.in: handle a nano version as well 2002-06-28 10:23 jpr * ChangeLog, bindings/Perl/Pilot.xs, bindings/Python/src/pisock_wrap.c: 2002-06-28 JP Rosevear * bindings/Perl/Pilot.xs: reflect name->prodID renaming in SysInfo * bindings/Python/src/pisock_wrap.c: ditto 2002-06-28 10:21 jpr * ChangeLog, src/Makefile.am, src/iambicexample.cc, tests/Makefile.os2: 2002-06-28 JP Rosevear * src/Makefile.am: don't build iambicexample.cc * src/iambicexample.cc: remove because lib support is gone * tests/Makefile.os2: remove unused file 2002-06-28 10:19 jpr * ChangeLog, include/Makefile.am, include/pi-address.h, include/pi-appinfo.h, include/pi-datebook.h, include/pi-expense.h, include/pi-file.h, include/pi-hinote.h, include/pi-iambicExpense.h, include/pi-iambicExpense.hxx, include/pi-inetserial.h, include/pi-mail.h, include/pi-md5.h, include/pi-memo.h, include/pi-money.h, include/pi-sync.h, include/pi-syspkt.h, include/pi-todo.h: 2002-06-28 JP Rosevear * libpisock++/Makefile.am: don't build iambicExpense.cc * libpisock++/iambicExpense.cc: kill at request of author * Revert format only changes to the headers, remove dead headers 2002-06-25 10:28 jpr * ChangeLog, include/pi-dlp.h, libpisock/dlp.c, libpisock/socket.c, tests/.cvsignore, tests/Makefile.am, tests/dlp-test.c: Merging dlp-arg-rewrite-branch to the main line. 2002-06-24 14:09 jpr * ChangeLog, libpisock/dlp.c, tests/dlp-test.c: 2002-06-24 JP Rosevear * tests/dlp-test.c (main): add tests for the remaining 1.1 DLP calls * libpisock/dlp.c (dlp_WriteAppPreference): set the reserved byte to 0 not 11 and copy the buffer to the request, not the response 2002-06-24 12:26 jpr * ChangeLog, tests/dlp-test.c: 2002-06-24 JP Rosevear * tests/dlp-test.c: Make logging more consistent 2002-06-24 12:02 jpr * ChangeLog, libpisock/dlp.c, tests/dlp-test.c: 2002-06-24 JP Rosevear * tests/dlp-test.c: add copyright, improve docs, write a more complete test of records, finishes all the 1.0 DLP calls i'm going to do * libpisock/dlp.c (dlp_ReadOpenDBInfo): this has 1 arg, not 0 (dlp_ReadRecordIDList): the arg is 6 bytes long, also set the max value (dlp_WriteRecord): get the new record id properly (dlp_DeleteRecord): create the request with the right command (dlp_DeleteCategory): bitwise and instead of boolean and (dlp_WriteAppPreference): this has 1 arg, not 0 (dlp_ReadNextModifiedRecInCategory): ditto 2002-06-22 18:35 desrod * ChangeLog, doc/README.usb: Updated to include the USB->kernel device mapping for the visor driver 2002-06-21 16:42 jpr * ChangeLog, include/pi-dlp.h, libpisock/dlp.c, tests/.cvsignore, tests/Makefile.am, tests/dlp-test.c: 2002-06-21 JP Rosevear * libpisock/dlp.c (dlp_request_new_with_argid): to create a request starting at something other than the first argid (dlp_response_read): simplify (dlp_request_write): make sure to write the correct argid (dlp_exec_new): don't return 0 if there was a dlp error (dlp_ReadStorageInfo): the manufacturer and name lengths are only 1 byte long (dlp_ReadSysInfo): read from the response data (dlp_ReadDBList): ditto (dlp_OpenDB): card number and mode are only 1 byte (dlp_DeleteDB): ditto (dlp_CreateDB): allow space for the null string char (dlp_CloseDB_All): start at argid 0x21 (dlp_CallApplication): ditto and remove old undeleted code (dlp_AddSyncLogEntry): copy in the entry to the request data (dlp_EndOfSync): use correct function enum (dlp_RPC): make dlp_buf local to here (dlp_DeleteCategory): use the 0 arg offset rather than 1 (dlp_ReadResourceByType): ditto (dlp_ReadResourceByIndex): ditto (dlp_ReadAppBlock): ditto (dlp_ReadSortBlock): ditto (dlp_DeleteResource): use correct function enum (dlp_ReadNextRecInCategory): get data from response (dlp_WriteAppPreference): make dlp_buf local to here (dlp_ReadRecordByIndex): use request data and start argid at 0x21 * include/pi-dlp.h: new proto * tests/dlp-test.c: regression test for dlp * tests/Makefile.am: add dlp-test to the build 2002-06-06 13:27 jpr * ChangeLog, include/pi-dlp.h, libpisock/dlp.c: 2002-06-06 JP Rosevear * libpisock/dlp.c: convert all functions over to new arg system 2002-05-29 08:39 desrod * ChangeLog, libpisock/socket.c, src/pilot-xfer.c: Adjust size of realloc protocol_queue_add in socket.c (jhmark) Added -x/--exec option to allow intermediate scripts to be executed "during" the sync. Fixed typo in 'Usage' in pilot-xfer.c (Greg Alexander) 2002-05-10 18:18 desrod * ChangeLog, libpisync/Makefile.am: Fixed multiple definitions of libpisync_la_LIBADD (Björn Torkelsson) 2002-05-07 15:59 desrod * ChangeLog, doc/Makefile.am: Fixed minor typo that broke dist. s/Guideline/Guidelines/ 2002-05-07 15:23 desrod * ChangeLog, doc/Makefile.am: Added new docs to EXTRA_DIST 2002-05-06 08:46 desrod * ChangeLog, src/pilot-mail.c, src/pilot-xfer.c: Fixed remaining PilotUser structs 2002-05-05 23:31 desrod * ChangeLog, doc/CodingGuidelines: Fixed bad URL 2002-05-05 23:29 desrod * ChangeLog, doc/CodingGuidelines: Small changes to doc/CodingGuidelines (user-submitted suggestions) 2002-05-05 23:23 desrod * ChangeLog, doc/README.usb: Minor readability adjustments to doc/README.usb 2002-05-05 23:20 desrod * ChangeLog, doc/README.usb, include/pi-datebook.hxx, src/ccexample.cc, src/iambicexample.cc: Fixed a namespace typing problem with gcc 3.x.x builds (Sergei Pachkov), began a draft for the pilot-link USB howto 2002-04-29 14:17 jpr * include/pi-dlp.h, libpisock/dlp.c, libpisock/socket.c: Committing some rewrite stuff before it gets out of hand. 2002-04-28 15:46 desrod * ChangeLog, doc/man/install-datebook.1: Fixed some typos, changed around some formatting a bit. (#180, bgdarnell) 2002-04-25 11:15 jpr * libpisock/dlp.c, libpisock/net.c, src/install-user.c, src/pilot-install-user.c: 2002-04-25 JP Rosevear * libpisock/connect.c (pilot_connect): read the system info * libpisock/dlp.c (dlp_ReadSysInfo): write a dlp version of 1.3 out when reading system info * libpisock/net.c (net_rx_handshake): make buffers unsigned chars (net_tx_handshake): ditto (net_tx): print correct debugging info * bindings/Python/setup.py: fix compilation (but only when build dir == src dir) * src/install-user.c (main): exit nicely when we are just printing out the user info 2002-04-25 03:01 jpr * ChangeLog, bindings/Python/setup.py, libpisock/connect.c: 2002-04-25 JP Rosevear * libpisock/connect.c (pilot_connect): read the system info * libpisock/dlp.c (dlp_ReadSysInfo): write a dlp version of 1.3 out when reading system info * libpisock/net.c (net_rx_handshake): make buffers unsigned chars (net_tx_handshake): ditto (net_tx): print correct debugging info * bindings/Python/setup.py: fix compilation (but only when build dir == src dir) * src/install-user.c (main): exit nicely when we are just printing out the user info 2002-04-20 11:52 desrod * ChangeLog, configure.in: Removed "development version" warning 2002-04-18 21:16 jpr * ChangeLog, bindings/Makefile.am: 2002-04-18 JP Rosevear * bindings/Makefile.am: better dependency rule 2002-04-18 16:30 jpr * libpisync/.cvsignore: Shush. 2002-04-18 16:29 jpr * ChangeLog, Makefile.am, configure.in: 2002-04-18 JP Rosevear * Makefile.am: add libpisync as a subdir * configure.in: AC_SUBST the version info 2002-04-18 16:09 jpr * ChangeLog, configure.in, libpisock/Makefile.am, libpisock/sync.c, libpisync/Makefile.am, src/pi-getram.c, src/pi-getrom.c, src/pilot-getram.c, src/pilot-getrom.c: 2002-04-18 JP Rosevear * src/pi-getram.c (main): fix compilation * src/pi-getrom.c (main): fix compilation * libpisync/sync.c: move * libpisync/Makefile.am: Compile libpisync library * libpisock/Makefile.am: remove sync.c from sources * configure.in: add sync library version 2002-04-18 10:28 jpr * ChangeLog, acconfig.h, configure.in, bindings/Python/src/pisock.i, bindings/Python/src/pisock_wrap.c, doc/Makefile.am, include/Makefile.am, include/pi-usb.h, libpisock/Makefile.am, libpisock/freebsdusb.c, libpisock/linuxusb.c, libpisock/serial.c, libpisock/socket.c, libpisock/usb.c, src/pilot-xfer.c: 2002-04-18 JP Rosevear * doc/Makefile.am: dist extra doc stuff * libpisock/socket.c (pi_connect): add usb device (pi_bind): ditto * libpisock/freebsdusb.c: freebsd usb device implementation * libpisock/linuxusb.c: linux usb device implementation * libpisock/usb.c: generic usb device * libpisock/Makefile.am: compile usb sources if needed * include/Makefile.am: install new pi-usb.h header * acconfig.h: add HAVE_USB * configure.in: clean up configure checks slightly, check for usb platforms 2002-04-18 00:15 desrod * ChangeLog, src/addresses.c, src/dlpsh.c, src/install-datebook.c, src/install-expenses.c, src/install-hinote.c, src/install-memo.c, src/install-netsync.c, src/install-user.c, src/memos.c, src/money2qif.c, src/pi-getram.c, src/pi-getrom.c, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-install-datebook.c, src/pilot-install-expenses.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-netsync.c, src/pilot-install-user.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c: Removed extraneous error strings in 'error:', since they are duplicated in libpisock/connect.c 2002-04-17 23:48 desrod * ChangeLog, bindings/Makefile.am: Typo in bindings/Makefile.am, s/buildir/builddir/, remove LD_LIBRARY_PATH which is ignored by distutils anyway (David Gibson) 2002-04-17 23:47 desrod * ChangeLog, src/pi-getram.c, src/pi-getrom.c, src/pilot-getram.c, src/pilot-getrom.c: More granular error control, reporting in pi-getr?m.c 2002-04-16 22:50 jpr * ChangeLog, libpisock/socket.c: 2002-04-16 JP Rosevear * libpisock/socket.c (onalarm): use RETSIGTYPE 2002-04-12 17:11 desrod * bindings/Python/src/pisock_wrap.c: Updated swig build 2002-04-12 17:10 desrod * bindings/Python/src/pisock.i: Removed references to PalmHeader() and pi_setmaxspeed so the module will properly import. 2002-04-12 17:10 desrod * bindings/Python/setup.py: Fixed libdir 2002-04-12 17:01 desrod * src/pilot-xfer.c: Fixed a bug in Restore() when the directory is missing, fixed a permission problem when the target directory is not writable. 2002-04-12 17:01 desrod * ChangeLog, libpisock/connect.c: Small error/perror() cleanups 2002-04-10 15:25 desrod * src/pilot-xfer.c: No need for F_OK test twice in Backup() 2002-04-10 15:23 desrod * src/pilot-xfer.c: One small fix to change the directory creation if it doesn't already exist. 2002-04-10 15:11 desrod * ChangeLog, src/pilot-xfer.c: Backup().. directory must be writable before we Connect() and write data. 2002-04-10 13:48 desrod * ChangeLog, libpisock/connect.c, src/pilot-xfer.c: Fixed a bug in pilot-xfer in Restore() when the directory did not exist. Added minor cleanups to connect.c, perror(), misc. 2002-04-10 12:44 desrod * bindings/Python/src/pisock_wrap.c: Oops, forgot to run swig on that last update. 2002-04-10 12:42 desrod * ChangeLog, bindings/Python/setup.py, bindings/Python/src/pisock.i, bindings/Python/src/pisock_wrap.c: Updated the Python bindings to fix an import problem with unresolved symbols. Removed the deprecated reference to PalmHeader() and pi_setmaxspeed. 2002-04-03 16:01 jpr * include/pi-usb.h: oops. 2002-04-03 14:48 jpr * ChangeLog, acconfig.h, configure.in, doc/Makefile.am, include/Makefile.am, libpisock/Makefile.am, libpisock/freebsdusb.c, libpisock/linuxusb.c, libpisock/serial.c, libpisock/socket.c, libpisock/usb.c: 2002-04-03 JP Rosevear * libpisock/socket.c (pi_connect): add usb device (pi_bind): ditto * libpisock/freebsdusb.c: freebsd usb device implementation * libpisock/linuxusb.c: linux usb device implementation * libpisock/usb.c: generic usb device * libpisock/Makefile.am: compile usb sources if needed * include/Makefile.am: install new pi-usb.h header * acconfig.h: add HAVE_USB * configure.in: clean up configure checks slightly, check for usb platforms 2002-04-02 13:58 desrod * ChangeLog, src/pilot-addresses.c: Fixed field names to align with labels in write_file() 2002-04-02 10:11 desrod * ChangeLog, src/memos.c, src/pilot-memos.c: Forgot some braces in memos.c, exit(0) would never be parsed 2002-03-30 09:15 jpr * ChangeLog, libpisock/unixserial.c: 2002-03-30 JP Rosevear * libpisock/unixserial.c (s_read): Check to make sure the read was successful before writing to the buffer 2002-03-30 09:14 jpr * ChangeLog, bindings/Perl/Makefile.PL.in: 2002-03-30 JP Rosevear * bindings/Perl/Makefile.PL.in: Use the right libdir 2002-03-20 17:22 desrod * NEWS: Minor cleanups to NEWS 2002-03-20 17:15 jpr * ChangeLog, NEWS: 2002-03-20 JP Rosevear * NEWS: update 2002-03-20 16:27 jpr * ChangeLog, NEWS: 2002-03-20 JP Rosevear * NEWS: update 2002-03-20 16:21 jpr * ChangeLog, NEWS, configure.in, bindings/Perl/Makefile.PL.in, bindings/Python/setup.py: 2002-03-20 JP Rosevear * NEWS: update * configure.in: bump version to 0.10.99 * bindings/Perl/Makefile.PL.in: Bump version * bindings/Java/org/gnu/pdapilot/Constants.java: ditto * bindings/Python/setup.py: ditto 2002-03-20 15:37 desrod * ChangeLog, src/pilot-xfer.c: Another small tweak to pilot-xfer to handle "double extensions" such as those created by Adobe Palm Reader. 2002-03-20 15:30 desrod * ChangeLog: Forgot to update ChangeLog 2002-03-20 15:28 desrod * ChangeLog, README: Minor change to README to remove bug-reporting redundancy 2002-03-20 15:22 desrod * README: Moved a section down 2002-03-20 15:17 desrod * README, doc/README.debugging: Minor documentation updates for README and doc/README.debugging 2002-03-20 15:00 jpr * ChangeLog, include/pi-padp.h, include/pi-slp.h, libpisock/padp.c, libpisock/slp.c, libpisock/socket.c: 2002-03-20 JP Rosevear * libpisock/slp.c (slp_tx): make the buffer the size of the header/footer and mtu (slp_rx): ditto * libpisock/padp.c (padp_tx): ditto (padp_rx): ditto * include/pi-slp.h: ditto * include/pi-padp.h: don't include the header in the MTU value * libpisock/socket.c (pi_close): even if closing the device fails, free the queue and device 2002-03-20 14:26 desrod * ChangeLog, src/pilot-xfer.c: When using -f, also allow 'File.ext' as well as 'File' to be specified. (Robert Cortopassi) 2002-03-20 12:53 jpr * ChangeLog, libpisock/padp.c, libpisock/slp.c: 2002-03-20 JP Rosevear * libpisock/padp.c (padp_tx): only check for a memory error after we ensure the packet it the correct ack, return the proper length count when the data response arrives instead of the ack, add logging, use PADP_MTU for buffer size (padp_rx): remove excessive read calls, add logging, use PADP_MTU for buffer size * libpisock/slp.c (slp_rx): correctly check for when packet length exceeds buffer length, add some logging 2002-03-19 23:15 jpr * ChangeLog, libpisock/padp.c, libpisock/slp.c: 2002-03-19 JP Rosevear * libpisock/padp.c (padp_rx): ensure that all bytes are read in * libpisock/slp.c (slp_rx): return 0 on bad checksum (header or packet) 2002-03-19 18:14 jpr * ChangeLog, libpisock/dlp.c, libpisock/slp.c: 2002-03-19 JP Rosevear * libpisock/slp.c (slp_dump_header): print out checksum correctly * libpisock/dlp.c (dlp_exec): check for an error from the read call 2002-03-19 16:33 jpr * ChangeLog, libpisock/socket.c: 2002-03-19 JP Rosevear * libpisock/socket.c: include pi-sys.h 2002-03-19 15:34 jpr * ChangeLog, include/Makefile.am: 2002-03-19 JP Rosevear *include/Makefile.am: only install c++ headers if we built the c++ lib 2002-03-19 15:31 jpr * ChangeLog, include/Makefile.am: 2002-03-19 JP Rosevear * include/Makefile.am (c_headers): add pi_sys.h 2002-03-19 15:05 jpr * ChangeLog, include/pi-socket.h, include/pi-source.h, include/pi-sys.h, include/pi-syspkt.h, libpisock/Makefile.am, libpisock/padp.c, libpisock/socket.c, libpisock/sys.c, libpisock/syspkt.c: 002-03-19 JP Rosevear * include/pi-sys.h: for new sys protocol * include/pi-syspkt.h: remove protos * include/pi-source.h: remove dead struct * include/pi-socket.h: add PI_PF_SYS and PI_LEVEL_SYS * libpisock/sys.c: implement the sys protocol * libpisock/socket.c (protocol_queue_build): handle PI_PF_SYS * libpisock/syspkt.c: remove syspkt_tx and syspkt_rx * libpisock/Makefile.am: build sys.c * libpisock/padp.c (padp_tx): remove useless unsigned char casts 2002-03-19 14:04 jpr * ChangeLog, include/pi-slp.h, include/pi-socket.h, libpisock/padp.c, libpisock/slp.c, libpisock/socket.c: 2002-03-19 JP Rosevear * libpisock/slp.c (slp_protocol): use new defines * libpisock/padp.c (padp_rx): ditto (padp_tx): ditto * include/pi-slp.h: create slp socket defines * include/pi-socket.h: remove obsolete defines * libpisock/socket.c (pi_getsockopt): use correct field name 2002-03-19 13:52 jpr * ChangeLog, include/pi-socket.h, libpisock/socket.c, src/pi-nredir.c, src/pilot-nredir.c: 2002-03-19 JP Rosevear * include/pi-socket.h: add a SOCK level and options * src/pi-nredir.c (main): set both sockets to PI_SOCK_CONEN because the disconnect will have already gone through * libpisock/socket.c (pi_getsockopt): handle the sock level and sock state option (pi_setsockopt): ditto 2002-03-19 13:18 desrod * ChangeLog, src/pilot-xfer.c: Cleaned up print_help() and some other minor formatting changes. 2002-03-19 13:16 desrod * ChangeLog, libpisock/connect.c: Updated connect() with a slightly better error handling of /dev/pilot fallbacks. Also removed the putenv() call, since we don't need it inside connect.c (unless children need access to it, but they don't). 2002-03-18 21:50 desrod * ChangeLog, src/pilot-xfer.c: Added a top limit for numexclude. We don't want to oob this array. This prevents that. 2002-03-18 21:39 desrod * ChangeLog, src/install-user.c, src/pilot-install-user.c: Exit cleanly when no arguments are passed to install-user. Previously would remove UserInfo. Bad, and fixed now. 2002-03-18 19:20 jpr * ChangeLog, src/dlpsh.c, src/pilot-dlpsh.c: 2002-03-18 JP Rosevear * src/dlpsh.c (strtoke): don't run past the end of the string on the last token 2002-03-18 17:29 jpr * ChangeLog, src/dlpsh.c, src/pilot-dlpsh.c: 2002-03-18 JP Rosevear * src/dlpsh.c (strtoke): end the string in the right spot if it was delimited 2002-03-18 15:24 jpr * ChangeLog, libpisock/slp.c: 2002-03-18 JP Rosevear * libpisock/slp.c (slp_rx): correct bit mask again, d'oh 2002-03-18 15:15 jpr * ChangeLog, libpisock/slp.c: 2002-03-18 JP Rosevear * libpisock/slp.c (slp_rx): correct bit mask 2002-03-18 15:08 jpr * ChangeLog, libpisock/padp.c, libpisock/slp.c: 2002-03-18 JP Rosevear * libpisock/slp.c (slp_rx): adjust the check sum for loop back packets if it doesn't match in case its the tenth one * libpisock/padp.c (padp_rx): no need to kill the offset 2002-03-18 15:01 desrod * include/pi-source.h, libpisock/utils.c: Revert. 2002-03-18 14:54 desrod * ChangeLog, include/pi-source.h, libpisock/utils.c: [no log message] 2002-03-18 09:32 desrod * ChangeLog, src/pilot-addresses.c: Fixed missing options, getopt_long(), changed -c argument to -i. 2002-03-15 16:40 jpr * ChangeLog, pilot-link.m4.in: 2002-03-15 JP Rosevear m * pilot-link.m4.in: remove unneccessary checks, error on failure 2002-03-15 15:58 jpr * ChangeLog, src/pix/Makefile.am: 2002-03-15 JP Rosevear * src/pix/Makefile.am: install pix 2002-03-15 15:52 jpr * .cvsignore, ChangeLog, Makefile.am, configure.in, bindings/Makefile.am, bindings/Java/Jni.c, bindings/Java/Makefile.am, doc/.cvsignore, doc/Makefile.am, libpisock/Makefile.am, src/.cvsignore, src/Makefile.am, src/pix/.cvsignore, src/pix/Makefile.am, src/prc/.cvsignore, src/prc/Makefile.am, tests/Makefile.am: 2002-03-15 JP Rosevear * tests/Makefile.am (INCLUDES): fix dir for linking * src/prc/Makefile.am: dist and install the prc data * src/pix/Makefile.am: dist the pix * src/Makefile.am: compile apps * libpisock++/Makefile.am: rename to libpisock++, make shared lib and version * libpisock/Makefile.am: tidy * doc/Makefile.am: compile subdir * bindings/Makefile.am: use correct libdir * bindings/Java/Jni.c: s/defaultCategory/defaultCurrency/ * bindings/Makefile.am: reflect change of subdir from Perl5 to Perl * configure.in: fix AC_OUTPUT files, add version stuff for libpisock++ * Makefile.am: remove stuff to build apps 2002-03-15 14:29 desrod * getopt.h, parsedate.y: The last of the code-based files (text files are left) 2002-03-15 12:15 desrod * TODO: ./doc straggler 2002-03-15 12:14 desrod * README-Win32.txt, ietf2datebook.PL, pilot-undelete.PL, sync-plan.PL: Moving some docs into ./docs and some source into ./src 2002-03-15 12:06 desrod * addresses.c, ccexample.cc, debugsh.c, dlpsh.c, getopt.c, getopt1.c, getrom.c, getrom.prc, getrom2.prc, hinotes.c, iambicexample.cc, install-datebook.c, install-expenses.c, install-hinote.c, install-memo.c, install-netsync.c, install-todos.c, install-user.c, kittykiller.c, memos.c, money2qif.c, parsedate.c, pd-tty.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-debug.c, pilot-dedupe.c, pilot-file.c, pilot-mail.c, pilot-prc.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, validate.cc: Major directory and file restructuring. O V E R H A U L! 2002-03-07 16:09 jpr * ChangeLog, libpisock/inet.c, libpisock/unixserial.c: 2002-03-07 JP Rosevear * libsock/unixserial.c (s_write): obey the timeout for writes as well * libsock/inet.c (pi_inet_write): ditto 2002-03-07 15:27 jpr * ChangeLog, libpisock/connect.c: 2002-03-07 JP Rosevear * libsock/connect.c (pilot_connect): if the port is null and the PILOTPORT env var is null, try using /dev/pilot 2002-03-07 14:30 jpr * ChangeLog, read-expenses.c, bindings/Perl/Pilot.xs, include/pi-expense.h, libpisock/expense.c, src/pilot-read-expenses.c, src/read-expenses.c: 2002-03-07 JP Rosevear * tools/Perl5/Pilot.xs: adjust expense wrappers * read-expenses.c (main): print both font fields, the correct number of categories and the correct number of new pref bytes * include/pi-expense.h: adjust pref fields * libsock/expense.c (unpack_ExpensePref): its the default currency, not category, read the correct number of currencies and both font values, get the two unknown values (pack_ExpensePref): write the correct number of categories, showAllCategories is only one byte long, write 0xff for the two unknown values, write both font values 2002-03-01 09:13 desrod * ChangeLog, dlpsh.c, getrom.c, hinotes.c, install-expenses.c, install-hinote.c, install-memo.c, install-netsync.c, install-todos.c, install-user.c, memos.c, money2qif.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-debug.c, pilot-dedupe.c, pilot-file.c, pilot-mail.c, pilot-prc.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, include/pi-header.h, libpisock/pi-header.c, src/dlpsh.c, src/getrom.c, src/hinotes.c, src/install-expenses.c, src/install-hinote.c, src/install-memo.c, src/install-netsync.c, src/install-todos.c, src/install-user.c, src/memos.c, src/money2qif.c, src/pi-csd.c, src/pi-getram.c, src/pi-getrom.c, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-file.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-hinotes.c, src/pilot-install-expenses.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-netsync.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-mail.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-prc.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c: s/PalmHeader/print_splash/ && s/Help/print_help/ 2002-03-01 09:10 desrod * addresses.c, src/addresses.c: s/PalmHeader/print_splash/ && s/Help/print_help/ 2002-02-27 08:57 desrod * ChangeLog, Makefile.am, bindings/Makefile.am, bindings/Java/Makefile.am, libpisock/Makefile.am, tests/Makefile.am: Minor pokes to allow pilot-link to build outside $SRCDIR (John Marshall) 2002-02-27 00:19 desrod * ChangeLog, dlpsh.c, install-user.c, pi-nredir.c, pi-port.c, pilot-schlep.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, src/dlpsh.c, src/install-user.c, src/pi-nredir.c, src/pi-port.c, src/pilot-dlpsh.c, src/pilot-install-user.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c: pilot_connect() cleanup, getopt_long() conversion/cleanup, general cleaning. pi-port does not work at the moment, will fix later. 2002-02-25 09:01 desrod * ChangeLog, libpisock/connect.c: BSD errno.h fixes from Peter da Silva 2002-02-24 13:19 desrod * ChangeLog, configure.in, bindings/Perl/Makefile.PL.in: Incremented and fixed the versions in preparation for a release. libpisock, Perl and Python bindings fixed. Java was already corrected. Added a warning at the bottom of configure.in for those who install without reading docs. 2002-02-21 10:59 desrod * ChangeLog, libpisock/pi-header.c: Added build date and time to the header splash, helps track bugs more granularly 2002-02-21 10:18 desrod * pilot-xfer.c, src/pilot-xfer.c: Moved a type definition to where it belongs. 2002-02-21 09:23 desrod * ChangeLog, libpisock/pi-file.c: Removed "pretty-print" for now. 2002-02-21 00:15 desrod * ChangeLog, install-user.c, memos.c, money2qif.c, pilot-prc.c, pilot-xfer.c, src/install-user.c, src/memos.c, src/money2qif.c, src/pilot-install-user.c, src/pilot-memos.c, src/pilot-prc.c, src/pilot-xfer.c: Lots of cleanup here. Fixed the fallthrough cases, added --novsf hack to pilot-xfer to fix a JPilot issue, more stuff. 2002-02-20 20:40 desrod * ChangeLog, dlpsh.c, pilot-file.c, src/dlpsh.c, src/pilot-dlpsh.c, src/pilot-file.c: Fixing up the last of them, release time! (getopt conversions, aligning the --help and output options, cleanup) 2002-02-09 21:22 desrod * ChangeLog, memos.c, src/memos.c, src/pilot-memos.c: Removed -Q, -q, -D options.. changed -v from 'verbose' to 'version', flattened 2002-02-09 20:48 desrod * ChangeLog, memos.c, src/memos.c, src/pilot-memos.c: Flattened memos, updated PILOTPORT handling, flattened 2002-02-09 20:38 desrod * ChangeLog, install-hinote.c, src/install-hinote.c, src/pilot-install-hinote.c: PILOTPORT conversion of install-hinote, flattened 2002-02-09 20:18 desrod * ChangeLog, addresses.c, src/addresses.c: Cleaned up addresses a bit to handle the new PILOTPORT parsing, flattened it up a bit 2002-02-09 19:37 desrod * ChangeLog, bindings/Python/setup.py: Incremented version of Python binding to match core pilot-link version 2002-02-09 15:40 desrod * ChangeLog, addresses.c, src/addresses.c: Removed 'fancy' output from addresses (fstyle) 2002-02-09 09:55 desrod * ChangeLog, pilot-xfer.c, src/pilot-xfer.c: Reverted an optstring bug I introduced over the top of Judd's fix 2002-02-08 14:23 desrod * ChangeLog, dlpsh.c, src/dlpsh.c, src/pilot-dlpsh.c: Removed garbage string in 'ls' output 2002-02-08 14:14 desrod * ChangeLog, dlpsh.c, src/dlpsh.c, src/pilot-dlpsh.c: Missing string.h include 2002-02-08 14:09 jpr * ChangeLog, libpisock/inet.c, libpisock/socket.c: 2002-02-08 JP Rosevear * libsock/socket.c (ps_list_remove): update the prev_elem each iteration * libsock/inet.c (pi_inet_accept): set correct sd when we know it and don't recognize the socket twice 2002-02-08 12:50 desrod * ChangeLog, doc/README.debugging, doc/logging.txt: Renamed doc/logging.txt to doc/README.debugging 2002-02-08 12:49 judd * ChangeLog: Fixed bug of pilot-xfer -i not accepting multiple files as arguments. 2002-02-08 09:54 desrod * ChangeLog, pilot-xfer.c, src/pilot-xfer.c: Minor cleanups to pilot-xfer 2002-02-08 03:26 judd * pilot-xfer.c, src/pilot-xfer.c: pilot-xfer now accepts multiple files as arguments to -i 2002-02-05 11:13 jpr * ChangeLog, libpisock/dlp.c, libpisock/pi-file.c, libpisock/slp.c, libpisock/syspkt.c, libpisock/utils.c: 2002-02-05 JP Rosevear * libsock/dlp.c: include before for freebsd 4.4 * libsock/utils.c: ditto * libsock/syspkt.c: ditto * libsock/slp.c: ditto 2002-02-03 03:35 judd * libpisock/pi-file.c: fixed divide by zero error 2002-01-31 13:45 jpr * ChangeLog, include/pi-socket.h, libpisock/inet.c, libpisock/net.c, libpisock/padp.c, libpisock/serial.c: 2002-01-31 JP Rosevear * libsock/serial.c (pi_serial_setsockopt): these are device rather than socket level options, add timeout (pi_serial_getsockopt): ditto * libsock/padp.c (padp_tx): set device timeout for reading (padp_rx): ditto * libsock/net.c (net_rx): set device timeout * libsock/inet.c (pi_inet_getsockopt): implement timeout option (pi_inet_setsockopt): ditto * include/pi-socket.h: remove socket level and add device level 2002-01-31 12:35 jpr * ChangeLog, libpisock/connect.c: 2002-01-31 JP Rosevear * libsock/connect.c (pilot_connect): improve pi_bind error message 2002-01-31 12:05 jpr * ChangeLog, libpisock/serial.c: 2002-01-31 JP Rosevear * libsock/serial.c (pi_serial_device_dup): increment ref count properly (pi_serial_close): decrement ref count properly (pi_serial_accept): the timeout must be set before pi_socket_init because it might peek at the data for autodetection 2002-01-31 07:59 desrod * ChangeLog, dlpsh.c, src/dlpsh.c, src/pilot-dlpsh.c: dlpsh is segfaulting all over the place now, major problems in strtoke() are appearing now for no apparent reason 2002-01-30 17:15 jpr * ChangeLog, include/pi-cmp.h, libpisock/cmp.c, libpisock/pi-file.c: 2002-01-30 JP Rosevear * libsock/cmp.c (cmp_wakeup): use new version define * include/pi-cmp.h: tidy version defines * libsock/pi-file.c (pi_file_read_record): using logging functions 2002-01-30 00:35 desrod * libpisock/pi-file.c: Removed one final declaration of 'size' that was commented in 1.26 2002-01-30 00:26 desrod * ChangeLog, libpisock/pi-file.c: Fixed a problem in pi-file.c when 'size' was uninitialized 2002-01-29 23:16 desrod * ChangeLog, install-memo.c, src/install-memo.c, src/pilot-install-memo.c: Fixed an error with install-memo reporting erroneous argv[0] on filename 2002-01-29 16:29 desrod * ChangeLog, CodingGuidelines, Makefile.am, doc/CodingGuidelines: Moved CodingGuidelines to ./doc 2002-01-29 16:15 jpr * ChangeLog, doc/logging.txt: 2002-01-29 JP Rosevear * doc/logging.txt: Basic loggin how-to 2002-01-28 16:17 jpr * ChangeLog, libpisock/dlp.c: 2002-01-28 JP Rosevear * libsock/dlp.c: convert Trace and Expect to logging functions 2002-01-28 16:03 jpr * ChangeLog, libpisock/padp.c: 2002-01-28 JP Rosevear * libsock/padp.c: Use logging function 2002-01-28 12:05 jpr * ChangeLog, configure.in, libpisock/cmp.c, libpisock/padp.c, libpisock/serial.c, libpisock/slp.c, libpisock/unixserial.c: 2002-01-28 JP Rosevear * libsock/serial.c (pi_serial_accept): use the accept socket data when appropriate, set timeout value for initialization based on accept_to value * libsock/unixserial.c (s_read): set the errno for a timeout (s_poll): ditto * libsock/slp.c (slp_rx): check for read errors * libsock/padp.c (padp_rx): check for read errors (padp_tx): use LOG * libsock/cmp.c (cmp_init): set flags to 0x80 if rate is not 9600, rather than if rates don't match 2002-01-26 18:53 desrod * ChangeLog, libpisock/inet.c, libpisock/serial.c, libpisock/unixserial.c: Fixed a missing include problem ()for Redhat 6.x systems 2002-01-26 10:07 desrod * ChangeLog, pilot-debug.c, src/pilot-debug.c: We should be using , and not local 'extern int matherr();' in here 2002-01-26 09:43 desrod * ChangeLog, pilot-addresses.c, pilot-dedupe.c, pilot-mail.c, pilot-xfer.c, src/pilot-addresses.c, src/pilot-dedupe.c, src/pilot-mail.c, src/pilot-xfer.c: Fixed some lingering typos from the last update (thanks for spotting them Andreas) 2002-01-26 06:32 desrod * ChangeLog, addresses.c, dlpsh.c, hinotes.c, install-datebook.c, install-expenses.c, install-hinote.c, install-memo.c, install-netsync.c, install-todos.c, install-user.c, memos.c, money2qif.c, parsedate.c, pd-tty.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-debug.c, pilot-dedupe.c, pilot-file.c, pilot-mail.c, pilot-prc.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, libpisock/cmp.c, libpisock/datebook.c, libpisock/inet.c, libpisock/net.c, libpisock/os2serial.c, libpisock/padp.c, libpisock/pi-file.c, libpisock/slp.c, libpisock/sync.c, libpisock/syspkt.c, libpisock/unixserial.c, libpisock/utils.c, libpisock/winserial.c, libpisync/sync.c, src/addresses.c, src/dlpsh.c, src/hinotes.c, src/install-datebook.c, src/install-expenses.c, src/install-hinote.c, src/install-memo.c, src/install-netsync.c, src/install-todos.c, src/install-user.c, src/memos.c, src/money2qif.c, src/parsedate.c, src/pd-tty.c, src/pi-csd.c, src/pi-getram.c, src/pi-getrom.c, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-file.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-hinotes.c, src/pilot-install-datebook.c, src/pilot-install-expenses.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-netsync.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-mail.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-prc.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c: More annoying whitespace cleaning, fixing types, should match Coding Guidelines now 2002-01-26 04:53 desrod * ChangeLog, CodingGuidelines: First (ugly) draft of Coding Guidelines for pilot-link. burnout-- 2002-01-25 15:13 jpr * ChangeLog, configure.in: 002-01-25 JP Rosevear * configure.in: set use_python to false when appropriate, same for perl 2002-01-25 15:08 jpr * ChangeLog, configure.in: 2002-01-25 JP Rosevear * configure.in: set use_python to false when appropriate 2002-01-25 14:51 jpr * ChangeLog, configure.in: 2002-01-25 JP Rosevear * configure.in: dump python check to /dev/null 2002-01-25 14:35 jpr * ChangeLog, include/pi-iambicExpense.hxx: 2002-01-25 JP Rosevear * include/pi-iambicExpense.hxx: use "class" with friend declaration 2002-01-25 14:24 jpr * ChangeLog, include/Makefile.am: 2002-01-25 JP Rosevear * include/Makefile.am: make valid variables 2002-01-25 12:25 jpr * ChangeLog, include/Makefile.am, include/pi-debug.h, include/pi-serial.h, libpisock/pi-header.c, libpisock/serial.c, libpisock/socket.c, libpisock/unixserial.c, libpisock/utils.c: 2002-01-25 JP Rosevear * libsock/utils.c: include config.h * libsock/unixserial.c (s_close): only reset the port when all users are gone * libsock/socket.c (ps_list_append): add assertion (ps_list_prepend): ditto (ps_list_copy): copy a list (ps_list_free): free a list (but not its data members) (onexit): copy list before iterating over it * libsock/serial.c: remove unused proto (pi_serial_device_dup): copy tco struct, copy ref and increment it (pi_serial_close): decrement ref * libsock/pi-header.c: include config.h * include/pi-serial.h: add ref counter * include/pi-debug.h: always spew assert failures * include/Makefile.am (c_header_DATA): don't install pi-version.h.in 2002-01-25 08:42 desrod * libpisock/datebook.c: Fixed minor typo 2002-01-25 08:40 desrod * ChangeLog, libpisock/address.c, libpisock/appinfo.c, libpisock/datebook.c, libpisock/dlp.c, libpisock/expense.c, libpisock/hinote.c, libpisock/mail.c, libpisock/memo.c, libpisock/money.c, libpisock/os2serial.c, libpisock/pi-file.c, libpisock/socket.c, libpisock/sync.c, libpisock/todo.c, libpisock/unixserial.c, libpisock/utils.c, libpisync/sync.c: More type naming reversals, follows pilot-link CodingGUidelines guide being drafted 2002-01-25 08:20 desrod * ChangeLog, install-expenses.c, install-todos.c, pi-getram.c, pi-getrom.c, pilot-addresses.c, pilot-file.c, pilot-mail.c, pilot-prc.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, src/install-expenses.c, src/install-todos.c, src/pi-getram.c, src/pi-getrom.c, src/pilot-addresses.c, src/pilot-file.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-install-expenses.c, src/pilot-install-todos.c, src/pilot-mail.c, src/pilot-prc.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c: Type cleanups. s/idx/i/ # that was stupid of me 2002-01-24 16:30 jpr * ChangeLog, libpisock/debug.c, libpisock/utils.c: 2002-01-24 JP Rosevear * libsock/utils.c (dumpline): use type ALL for logging * libsock/debug.c (pi_log): don't bail if the type is all 2002-01-24 15:23 jpr * ChangeLog: Oops. 2002-01-24 15:17 jpr * ChangeLog, pilot-link.m4.in, libpisock/serial.c: 2002-01-24 JP Rosevear * pilot-link.m4.in: fix version configure check 2002-01-24 14:25 jpr * ChangeLog, libpisock/inet.c, libpisock/serial.c, libpisock/socket.c: 2002-01-24 JP Rosevear * libsock/socket.c (protocol_queue_destroy): increment the index rather than decrement (pi_close): check if the device close was strictly less than 0 * libsock/serial.c (pi_serial_protocol_dup): copy the free member (pi_serial_protocol_free): free the protocol (pi_serial_protocol): set the free member * libsock/inet.c (pi_inet_protocol_dup): copy the free member (pi_inet_protocol_free): free the protocol (pi_inet_protocol): set the free member 2002-01-24 04:51 desrod * ChangeLog, libpisock/connect.c: Report usable error on any incorrect port(s) specified, let getenv() fill out the rest 2002-01-24 04:43 desrod * ChangeLog, install-datebook.c, install-expenses.c, install-hinote.c, install-memo.c, install-netsync.c, money2qif.c, pi-getram.c, pi-getrom.c, pi-nredir.c, pilot-clip.c, pilot-dedupe.c, reminders.c, src/install-datebook.c, src/install-expenses.c, src/install-hinote.c, src/install-memo.c, src/install-netsync.c, src/money2qif.c, src/pi-getram.c, src/pi-getrom.c, src/pi-nredir.c, src/pilot-clip.c, src/pilot-dedupe.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-install-datebook.c, src/pilot-install-expenses.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-netsync.c, src/pilot-nredir.c, src/pilot-reminders.c, src/reminders.c: Cleaned up the perror() printfs, no double-colon, no tabs, libsock/connect.c is still not quite right 2002-01-24 04:18 desrod * ChangeLog, dlpsh.c, src/dlpsh.c, src/pilot-dlpsh.c: dlpsh.c: More bugs squashed, getopt_long'ified, added more useful -h options to each option, fixed a very ugly 'user -u' bug 2002-01-23 09:19 desrod * ChangeLog, libpisock/connect.c: Removed tabs, changed to spaces, breaks on weird termcaps 2002-01-23 09:16 desrod * ChangeLog, install-netsync.c, src/install-netsync.c, src/pilot-install-netsync.c: Added the ability to run install-netsync without host/ip/netmask arguments 2002-01-23 09:07 desrod * ChangeLog, install-user.c, src/install-user.c, src/pilot-install-user.c: install-user now runs without passing User and UserID, as before 2002-01-23 07:35 desrod * ChangeLog, TODO, dlpsh.c, install-datebook.c, doc/TODO, src/dlpsh.c, src/install-datebook.c, src/pilot-dlpsh.c, src/pilot-install-datebook.c: Fixed install-datebook, added pilot_connect() code, cleaned up dlpsh printf garbage text. 2002-01-22 20:13 desrod * configure.in: Just explanator text in configure.in, minor. 2002-01-22 20:09 desrod * ChangeLog, configure.in: Squashed a warning about cross-compiling in AC_TRY_RUN. Needed a third argument to satisfy all conditions. 2002-01-22 19:23 desrod * ChangeLog, bindings/Java/doConstants.c: Missing prototype in doConstants.c, minor. 2002-01-22 18:56 desrod * ChangeLog, bindings/Java/Jni.c: Fixed two missing includes in Jni.c 2002-01-22 17:51 jpr * ChangeLog, include/Makefile.am: 2002-01-22 JP Rosevear * include/Makefile.am (c_header_DATA): remove pi-sockaddr-win32.h 2002-01-22 14:48 jpr * ChangeLog, configure.in, include/pi-config-win32.h, include/pi-config.h, include/pi-sockaddr-win32.h: 2002-01-22 JP Rosevear * pilot-link.m4: remove header checks * configure.in: remove sa length check 2002-01-22 14:44 jpr * ChangeLog, acconfig.h, configure.in, debugsh.c, dlpsh.c, getrom.c, iambicexample.cc, install-datebook.c, install-expenses.c, install-hinote.c, install-memo.c, install-netsync.c, install-user.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-nredir.c, pilot-addresses.c, pilot-clip.c, pilot-debug.c, pilot-dedupe.c, pilot-mail.c, pilot-schlep.c, pilot-xfer.c, read-ical.c, include/Makefile.am, include/pi-address.hxx, include/pi-iambicExpense.hxx, include/pi-sockaddr.h, include/pi-source.h, libpisock/cmp.c, libpisock/dlp.c, libpisock/inet.c, libpisock/net.c, libpisock/padp.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/syspkt.c, libpisock/unixserial.c, libpisock/util.c, libpisock/utils.c, src/debugsh.c, src/dlpsh.c, src/getrom.c, src/iambicexample.cc, src/install-datebook.c, src/install-expenses.c, src/install-hinote.c, src/install-memo.c, src/install-netsync.c, src/install-user.c, src/pi-csd.c, src/pi-getram.c, src/pi-getrom.c, src/pi-nredir.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-debugsh.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-install-datebook.c, src/pilot-install-expenses.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-netsync.c, src/pilot-install-user.c, src/pilot-mail.c, src/pilot-nredir.c, src/pilot-read-ical.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-ical.c: 2002-01-22 JP Rosevear * include/pi-config.h: remove unused file * include/pi-source.h: no longer include pi-config.h * libsock/*.c: fix includes 2002-01-22 14:04 jpr * ChangeLog, libpisock/inet.c: 2002-01-22 JP Rosevear * libsock/inet.c (pi_inet_bind): INADDR_NONE is not defined on some platforms (pi_inet_connect): ditto 2002-01-22 14:02 jpr * ChangeLog, addresses.c, dlpsh.c, hinotes.c, install-hinote.c, install-netsync.c, install-todos.c, install-user.c, money2qif.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-dedupe.c, pilot-file.c, pilot-mail.c, pilot-prc.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, src/addresses.c, src/dlpsh.c, src/hinotes.c, src/install-hinote.c, src/install-netsync.c, src/install-todos.c, src/install-user.c, src/money2qif.c, src/pi-csd.c, src/pi-getram.c, src/pi-getrom.c, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-file.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-hinotes.c, src/pilot-install-hinote.c, src/pilot-install-netsync.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-mail.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-prc.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c: 2002-01-22 JP Rosevear * addresses.c (main): convert to getopt_long * *.c: remove blank default: clauses which screws up some non-gcc compilers 2002-01-18 17:54 desrod * Makefile.am: Fixed '.' being out of place 2002-01-18 17:51 desrod * Makefile.am: Put . in Makefile.am 2002-01-18 17:50 desrod * libpisock/inet.c: s/28/8 in editor macro assignment (emacs only) 2002-01-18 17:49 desrod * ChangeLog, debugsh.c, install-netsync.c, pi-getram.c, libpisock/cmp.c, libpisock/dlp.c, libpisock/inet.c, libpisock/pi-header.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/syspkt.c, src/debugsh.c, src/install-netsync.c, src/pi-getram.c, src/pilot-debugsh.c, src/pilot-getram.c, src/pilot-install-netsync.c: General warning cleanup in libsock/* and . Makefile.in: Make sure . is built first, then tools, editor macro placement 2002-01-18 17:28 jpr * ChangeLog, pilot-link.m4.in: 2002-01-18 JP Rosevear * pilot-link.m4.in: committ accidentally erased bit 2002-01-18 16:56 jpr * ChangeLog, configure.in: 2002-01-18 JP Rosevear * configure.in: fix java check 2002-01-18 16:50 jpr * ChangeLog, INSTALL, configure.in, pilot-link.m4, pilot-link.m4.in: 2002-01-18 JP Rosevear * pilot-link.m4.in: add version check * configure.in: output pilot-link.m4 2002-01-18 16:30 jpr * ChangeLog, configure.in, pilot-link.m4: 2002-01-18 JP Rosevear * pilot-link.m4: reduce number of checks * configure.in: reorg checks 2002-01-18 15:11 jpr * ChangeLog: [no log message] 2002-01-18 15:11 jpr * pi-nredir.c, src/pi-nredir.c, src/pilot-nredir.c: 2002-01-18 JP Rosevear * pi-nredir.c (main): don't write log info since the other end closed the connection 2002-01-18 12:28 jpr * money2qif.c, reminders.c, src/money2qif.c, src/pilot-reminders.c, src/reminders.c: 002-01-18 JP Rosevear * reminders.c (main): convert to getopt_long and tidy * money2qif.c (main): ditto 2002-01-18 11:48 jpr * install-netsync.c, pi-csd.c, libpisock/inet.c, src/install-netsync.c, src/pi-csd.c, src/pilot-csd.c, src/pilot-install-netsync.c: 2002-01-18 JP Rosevear * install-netsync.c (Help): tidy help message * libsock/inet.c (pi_inet_bind): accept net:any as an address and allow for port to be specified, ie net:any: 13333 * pi-csd.c (main): add getopt_long handling * dlpsh.c (main): add getopt_long handling 2002-01-18 11:05 jpr * .cvsignore, ChangeLog, dlpsh.c, src/dlpsh.c, src/pilot-dlpsh.c: 2002-01-18 JP Rosevear * dlpsh.c (main): add getopt_long handling 2002-01-18 10:56 jpr * ChangeLog, pilot-xfer.c, libpisock/inet.c, libpisock/net.c, src/pilot-xfer.c: 2002-01-18 JP Rosevear * pilot-xfer.c: remove dlp_OpenConduit calls because pilot_connect does that * libsock/net.c (net_tx_handshake): limit receive length to size of net packets * libsock/inet.c (pi_inet_accept): copy socket before accepting, init after 2002-01-16 21:49 desrod * ChangeLog, pi-csd.c, pi-port.c, pilot-addresses.c, pilot-mail.c, pilot-prc.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, src/pi-csd.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-csd.c, src/pilot-mail.c, src/pilot-port.c, src/pilot-prc.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c: More function relocation, nothing to see here, move along... 2002-01-16 21:40 desrod * ChangeLog, addresses.c, debugsh.c, dlpsh.c, hinotes.c, install-expenses.c, install-hinote.c, install-todos.c, memos.c, money2qif.c, src/addresses.c, src/debugsh.c, src/dlpsh.c, src/hinotes.c, src/install-expenses.c, src/install-hinote.c, src/install-todos.c, src/memos.c, src/money2qif.c, src/pilot-debugsh.c, src/pilot-dlpsh.c, src/pilot-hinotes.c, src/pilot-install-expenses.c, src/pilot-install-hinote.c, src/pilot-install-todos.c, src/pilot-memos.c: Just relocating some functions, main() to bottom, Help() up one 2002-01-16 21:27 jpr * ChangeLog, install-netsync.c, pi-nredir.c, pilot-xfer.c, src/install-netsync.c, src/pi-nredir.c, src/pilot-install-netsync.c, src/pilot-nredir.c, src/pilot-xfer.c: 2002-01-16 JP Rosevear * install-netsync.c: use -H to specify host * pi-nredir.c: ditto * pilot-xfer.c: switch to getopt_long and tidy 2002-01-16 21:19 desrod * ChangeLog, install-memo.c, install-user.c, memos.c, src/install-memo.c, src/install-user.c, src/memos.c, src/pilot-install-memo.c, src/pilot-install-user.c, src/pilot-memos.c: Minor cleanups, small type typo changed, preparing for merge 2002-01-16 21:14 desrod * ChangeLog, install-todos.c, src/install-todos.c, src/pilot-install-todos.c: General formatting changes in preparation for merging the two into one 2002-01-16 20:50 desrod * ChangeLog, libpisock/pi-file.c: More accidental deletions in vim. Gar. 2002-01-16 20:36 desrod * ChangeLog, libpisock/pi-file.c: Overzealous deletion buffers, put the LGPL banner splash back 2002-01-16 20:32 desrod * ChangeLog: Forgot one entry re: libsock/*.c 2002-01-16 20:29 desrod * ChangeLog, TODO, pilot-xfer.c, doc/TODO, libpisock/address.c, libpisock/appinfo.c, libpisock/cmp.c, libpisock/connect.c, libpisock/datebook.c, libpisock/dlp.c, libpisock/expense.c, libpisock/hinote.c, libpisock/inet.c, libpisock/mail.c, libpisock/md5.c, libpisock/memo.c, libpisock/money.c, libpisock/net.c, libpisock/os2serial.c, libpisock/padp.c, libpisock/pi-file.c, libpisock/pi-header.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/sync.c, libpisock/syspkt.c, libpisock/todo.c, libpisock/unixserial.c, libpisock/util.c, libpisock/utils.c, libpisock/winserial.c, libpisync/sync.c, src/pilot-xfer.c: Added a progress option to pi-file.c, cleaned up libsock/*.c layout, structures, types. 2002-01-16 13:47 jpr * ChangeLog, install-netsync.c, install-user.c, pilot-dedupe.c, pilot-file.c, src/install-netsync.c, src/install-user.c, src/pilot-dedupe.c, src/pilot-file.c, src/pilot-install-netsync.c, src/pilot-install-user.c: 2002-01-16 JP Rosevear * install-user.c (Help): remove bogus info (main): don't call dlp_OpenConduit * install-netsync.c: use -H insted of -o * pilot-dedupe.c: convert to getopt_long, tidy * pilot-file.c: convert to getopt_long 2002-01-16 07:24 jpr * ChangeLog, bindings/Makefile.am: 2002-01-16 JP Rosevear * tools/Makefile.am: fix cleaning rules 2002-01-16 07:14 jpr * ChangeLog, configure.in, bindings/Java/.cvsignore: 2002-01-16 JP Rosevear * configure.in: check for java stuff in the given path first 2002-01-16 07:06 desrod * ChangeLog: Misspelling. 2002-01-16 07:05 desrod * configure.in: Just a minor typo. 2002-01-16 07:04 jpr * bindings/Java/: .cvsignore, Makefile.am: Shush 2002-01-16 06:59 jpr * ChangeLog, bindings/Java/.cvsignore, bindings/Java/README, bindings/Java/doConstants.c, bindings/Java/test.java: 2002-01-16 JP Rosevear * tools/Java/test.java: forgotten files * tools/Java/doConstants.c: ditto * tools/Java/README: ditto 2002-01-16 06:56 jpr * ChangeLog, Makefile.am, configure.in, install-netsync.c, install-user.c, pi-getram.c, pi-getrom.c, pilot-clip.c, pilot-schlep.c, bindings/Makefile.am, bindings/Java/Jni.c, bindings/Java/Makefile.am, bindings/Java/README, bindings/Java/doConstants.c, bindings/Java/test.java, libpisock/connect.c, libpisock/socket.c, libpisock/unixserial.c, src/install-netsync.c, src/install-user.c, src/pi-getram.c, src/pi-getrom.c, src/pilot-clip.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-install-netsync.c, src/pilot-install-user.c, src/pilot-schlep.c, bindings/Python/setup.py: 2002-01-16 JP Rosevear * tools/Java: Doug G.'s Java stuff * tools/Makefile.am: python hack for compilation when builddir != srcdir, java enabling * configure.in: fix java checks * install-netsync.c: install netsync info * pilot-schlep.c: do getopt_long and tidy * pi-getrom.c: ditto * pi-getram.c: ditto * pilot-clip.c: ditto * install-user.c: ditto, and remove netsync stuff 2002-01-16 06:14 desrod * ChangeLog, addresses.c, configure.in, dlpsh.c, hinotes.c, install-expenses.c, install-hinote.c, install-todos.c, install-user.c, memos.c, money2qif.c, pi-csd.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-schlep.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, src/addresses.c, src/dlpsh.c, src/hinotes.c, src/install-expenses.c, src/install-hinote.c, src/install-todos.c, src/install-user.c, src/memos.c, src/money2qif.c, src/pi-csd.c, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-dlpsh.c, src/pilot-hinotes.c, src/pilot-install-expenses.c, src/pilot-install-hinote.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c: Removed the global dependancy. We should only be using a local getopt.h/getopt.c pair here for portability reasons. More to come... 2002-01-14 19:31 jpr * ChangeLog, Makefile.os2.in, os2configure.cmd: 2002-01-14 JP Rosevear * Remove no longer needed OS/2 stuff 2002-01-14 18:53 jpr * ChangeLog, debugsh.c, pi-csd.c, pilot-clip.c, include/Makefile.am, include/pi-source.h, libpisock/dlp.c, libpisock/net.c, libpisock/padp.c, libpisock/slp.c, libpisock/utils.c, src/debugsh.c, src/pi-csd.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-debugsh.c: 2002-01-14 JP Rosevear * libsock/dlp.c: reflect dumpdata changes * libsock/net.c (net_dump): ditto * libsock/padp.c (padp_dump): ditto * libsock/slp.c (slp_dump): ditto * pilot-clip.c (main): ditto * pi-csd.c (main): ditto * debugsh.c (read_pilot): ditto * include/pi-source.h: remove type param from dumpline and dumpdata * include/Makefile.am: dist new headers 2002-01-14 18:24 jpr * ChangeLog, pi-nredir.c, include/pi-source.h, libpisock/cmp.c, libpisock/inet.c, libpisock/net.c, libpisock/padp.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, src/pi-nredir.c, src/pilot-nredir.c: 2002-01-14 JP Rosevear * pi-nredir.c (main): connect properly with a net: address now * libsock/cmp.c: implement free method * libsock/net.c: ditto * libsock/padp.c: ditto * libsock/serial.c: ditto * libsock/inet.c: ditto * libsock/slp.c: ditto * libsock/socket.c (pi_close): properly free things (protocol_queue_destroy): free each protocol * include/pi-source.h: add free methods to the device and protocol 2002-01-13 20:05 desrod * ChangeLog: Oops! Forgot to commit the ChangeLog itself. 2002-01-12 16:33 desrod * include/: pi-address.hxx, pi-datebook.hxx, pi-memo.hxx, pi-todo.hxx: Include/*hxx: Fix a missing 'class' declaration which causes libcc to fail on gcc 3.x 2002-01-11 13:54 jpr * bindings/Perl/.cvsignore, bindings/Python/.cvsignore, tests/.cvsignore: Shush 2002-01-11 13:49 jpr * ChangeLog, Makefile.am, acconfig.h, configure.in, debugsh.c, install-expenses.c, install-memo.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-nredir.c, pilot-clip.c, pilot-debug.c, pilot-dedupe.c, pilot-xfer.c, bindings/Makefile.am, bindings/Perl/Pilot.xs, include/.cvsignore, include/Makefile.am, include/pi-cmp.h, include/pi-debug.h, include/pi-inet.h, include/pi-net.h, include/pi-padp.h, include/pi-serial.h, include/pi-slp.h, include/pi-socket.h, include/pi-source.h, libpisock/Makefile.am, libpisock/cmp.c, libpisock/connect.c, libpisock/debug.c, libpisock/dlp.c, libpisock/inet.c, libpisock/net.c, libpisock/padp.c, libpisock/pi-file.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/syspkt.c, libpisock/unixserial.c, libpisock/utils.c, src/debugsh.c, src/install-expenses.c, src/install-memo.c, src/pi-csd.c, src/pi-getram.c, src/pi-getrom.c, src/pi-nredir.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-debugsh.c, src/pilot-dedupe.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-install-expenses.c, src/pilot-install-memo.c, src/pilot-nredir.c, src/pilot-xfer.c: Merging from protocol-rewrite-branch 2002-01-11 13:26 jpr * ChangeLog, configure.in: 2002-01-11 JP Rosevear * configure.in: fix itcl typo 2002-01-11 11:34 jpr * ChangeLog, include/pi-cmp.h, include/pi-debug.h, include/pi-net.h, include/pi-padp.h, include/pi-serial.h, include/pi-slp.h, include/pi-socket.h, include/pi-source.h, libpisock/cmp.c, libpisock/inet.c, libpisock/net.c, libpisock/padp.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/unixserial.c: 2002-01-11 JP Rosevear * libsock/serial.c: handle buffer * libsock/inet.c: match new tx/rx protos and obey peek flag * libsock/unixserial.c: ditto * libsock/cmp.c: match new tx/rx protos and pass flags down the chain * libsock/slp.c: ditto * libsock/padp.c: ditto * libsock/net.c: ditto * include/pi-source.h: update protos, remove padp trace stuff * include/pi-socket.h: add PI_PF_DLP and PI_MSG_PEEK for autodetection * include/pi-cmp.h: update protos * include/pi-slp.h: ditto * include/pi-serial.h: ditto * include/pi-net.h: ditto * include/pi-debug.h: include config.h instead of pi-config.h 2002-01-10 13:05 jpr * include/pi-source.h, libpisock/dlp.c, libpisock/inet.c, libpisock/net.c, libpisock/padp.c, libpisock/serial.c, libpisock/socket.c: 2002-01-10 JP Rosevear * include/pi-source.h: add state defines * libsock/*.c: use them everywhere 2002-01-10 10:43 jpr * ChangeLog, debugsh.c, include/pi-inet.h, include/pi-serial.h, include/pi-socket.h, libpisock/inet.c, libpisock/serial.c, libpisock/socket.c, libpisock/unixserial.c, src/debugsh.c, src/pilot-debugsh.c: 2002-01-10 JP Rosevear * libsock/unixserial.c (s_open): use pi_socket_setsd and don't keep our own fd around * libsock/inet.c (pi_inet_connect): use pi_socket_setsd and don't keep our own fd around (pi_inet_bind): ditto * libsock/socket.c (pi_socket_setsd): makes the socket descriptor refer to the new descriptor passed in * include/pi-socket.h: add proto * include/pi-serial.h: remove fd member * include/pi-inet.h: remove fd member 2002-01-10 09:52 jpr * ChangeLog, include/Makefile.am, include/pi-source.h, libpisock/socket.c: 2002-01-10 JP Rosevear * libsock/socket.c (protocol_queue_build): add device protocol (pi_connect): call above after device is determined (pi_bind): ditto * include/Makefile.am (c_header_DATA): remove pi-inetserial.h * include/pi-source.h: remove unused tickle member 2002-01-10 05:15 desrod * configure.in: Fixed some of the checks, cleaned up the ouput, something broken in Itcl. 2002-01-09 16:17 jpr * ChangeLog, libpisock/inet.c: 2002-01-09 JP Rosevear * libsock/inet.c (pi_inet_accept): accept to the socket descriptor (pi_inet_write): write to the sd (pi_inet_read): read from the sd 2002-01-09 12:54 jpr * .cvsignore, ChangeLog, pi-getram.c, pi-nredir.c, include/.cvsignore, include/pi-inet.h, include/pi-inetserial.h, include/pi-net.h, include/pi-serial.h, include/pi-socket.h, libpisock/Makefile.am, libpisock/cmp.c, libpisock/inet.c, libpisock/net.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/unixserial.c, src/pi-getram.c, src/pi-nredir.c, src/pilot-getram.c, src/pilot-nredir.c: 2002-01-09 JP Rosevear * pi-getram.c: merge from head * pi-nredir.c: update for new net code * libsock/unixserial.c: improve logging messages * libsock/socket.c: build the proctocol queue during binding or connecting so we can first determine the device type * libsock/slp.c (slp_rx): kill warning * libsock/serial.c (pi_serial_device): choose impl based on type passed in (pi_serial_connect): switch over to cmp handshaking * libsock/net.c (net_rx): return the correct packet length (net_tx_handshake): implement server-client handshake * libsock/inet.c: convert to a generic device * libsock/cmp.c (cmp_tx_handshake): implement (cmp_wakeup): properly wakeup * libsock/Makefile.am: build inet.c again * include/pi-socket.h: rename PI_LEVEL_SOCKET to PI_LEVEL_DEV * include/pi-serial.h: update proto * include/pi-net.h: new proto * include/pi-inet.h: update to be a device 2002-01-08 14:39 jpr * ChangeLog, include/pi-cmp.h, include/pi-net.h, include/pi-padp.h, include/pi-serial.h, include/pi-slp.h, include/pi-socket.h, include/pi-source.h, libpisock/cmp.c, libpisock/net.c, libpisock/padp.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c: 2002-01-08 JP Rosevear * libsock/socket.c: re-org code (pi_version): get version from cmp or fake it for net * libsock/slp.c (slp_rx): make states match palm documentation and correct problem with maximal (1024 bytes) padp packets * libsock/serial.c (pi_serial_accept): do the handshaking via the cmp protocol and the command protocol queue * libsock/padp.c (padp_tx): use PI_PADP_MTU (padp_rx): ditto * libsock/net.c (net_rx): fix comment * include/pi-socket.h: add cmp options * include/pi-slp.h: define PI_SLP_MTU * include/pi-serial.h: make the rate a long * include/pi-padp.h: define PI_PADP_MTU * include/pi-cmp.h: remove old cmp struct and add cmp data, add protos and defines 2002-01-06 20:19 desrod * pilot-addresses.c, src/pilot-addresses.c: Temporary fix to allow this to build without errors. 2002-01-06 02:55 desrod * pilot-addresses.c, src/pilot-addresses.c: Minor fixes to pilot-addresses, major rework coming, new bugs found. 2002-01-06 02:05 jpr * ChangeLog, dlpsh.c, include/pi-net.h, include/pi-socket.h, include/pi-source.h, libpisock/debug.c, libpisock/net.c, libpisock/serial.c, libpisock/socket.c, src/dlpsh.c, src/pilot-dlpsh.c: 2002-01-06 JP Rosevear * libsock/net.c (net_getsockopt): allow type to be set (net_setsockopt): ditto (net_tx): use data type for packet * libsock/socket.c (pi_serial_onalarm): use log functions (pi_tickle): send proper tickle commands based on command type * libsock/serial.c: remove tickle stuff (pi_serial_connect): set socket command field (pi_serial_accept): ditto * libsock/debug.c (pi_log): flush the stream immediately * include/pi-source.h: rename init stuff to cmd, chuck accepted field * include/pi-socket.h: s/PI_INIT/PI_CMD/ and add net options enum * include/pi-net.h: add packet type defines and type field to data * dlpsh.c: merge from main line 2002-01-05 16:14 jpr * ChangeLog, acconfig.h, configure.in, pilot-xfer.c, include/pi-debug.h, libpisock/net.c, libpisock/pi-file.c, libpisock/socket.c, src/pilot-xfer.c: 2002-01-05 JP Rosevear * libsock/socket.c: look for API type * libsock/pi-file.c (pi_file_append_record): use LOG * libsock/net.c (net_rx): make reading a little more sane * include/pi-debug.h: add API type * configure.in: define DEBUG here when appropriate * acconfig.h: add DEBUG 2002-01-05 13:54 jpr * ChangeLog, libpisock/connect.c: 2002-01-05 JP Rosevear * libsock/connect.c (pilot_connect): switch back to _NET for testing 2002-01-05 13:50 jpr * ChangeLog, Makefile.am, acconfig.h, autogen.sh, configure.in, install-expenses.c, pilot-link.m4, bindings/Makefile.am, bindings/Perl/Makefile.PL.in, bindings/Perl/Pilot.pm, bindings/Perl/test.pl, bindings/Python/.cvsignore, bindings/Python/NEWS, bindings/Python/README.txt, bindings/Python/TODO, bindings/Python/pisock.py, bindings/Python/setup.py, include/pi-config.h, include/pi-config.h.in, include/pi-version.h, include/pi-version.h.in, libpisock/Makefile.am, src/install-expenses.c, src/pilot-install-expenses.c, bindings/Python/src/pisock.i, bindings/Python/src/pisock_wrap.c: 2002-01-05 JP Rosevear * Merge from the main line 2002-01-05 13:31 jpr * ChangeLog, configure.in: 2002-01-05 JP Rosevear * configure.in: use AC_PATH_PROGS rather than AC_PATH_PROG in the python check 2002-01-05 13:31 jpr * ChangeLog, include/pi-debug.h, libpisock/cmp.c, libpisock/connect.c, libpisock/serial.c, libpisock/slp.c, libpisock/unixserial.c: 2002-01-05 JP Rosevear * include/pi-debug.h: add CMP type * libsock/*.c: use new debugging commands 2002-01-05 13:07 desrod * include/: pi-address.h, pi-appinfo.h, pi-args.h, pi-config.h, pi-datebook.h, pi-dlp.h, pi-mail.h, pi-md5.h, pi-money.h, pi-slp.h, pi-sockaddr.h, pi-socket.h, pi-sync.h, pi-syspkt.h, pi-todo.h, pi-util.h: Fixed a whitespace problem in the headers that broke connections. Hrmph! 2002-01-05 12:29 desrod * pilot-xfer.c, src/pilot-xfer.c: Found a bug. Squish. 01-02-2002 version of pilot-xfer.c was bad. Rolled out those changes back to the 01-01-2002 version, added jpr's 'compare' fix. 2002-01-05 12:00 jpr * ChangeLog, configure.in, bindings/Makefile.am, bindings/Perl/Makefile.PL.in: 2002-01-05 JP Rosevear * tools/Perl5/Makefile.PL.in: look for library where its built * tools/Makefile.am: roll rules to build perl and python from here * configure.in: simplify python test 2002-01-04 01:17 jpr * .cvsignore, ChangeLog, Makefile.am, addresses.c, configure.in, dlpsh.c, hinotes.c, install-expenses.c, install-hinote.c, install-todos.c, install-user.c, memos.c, money2qif.c, pi-csd.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-schlep.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, src/addresses.c, src/dlpsh.c, src/hinotes.c, src/install-expenses.c, src/install-hinote.c, src/install-todos.c, src/install-user.c, src/memos.c, src/money2qif.c, src/pi-csd.c, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-dlpsh.c, src/pilot-hinotes.c, src/pilot-install-expenses.c, src/pilot-install-hinote.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c: 2002-01-04 JP Rosevear * *.c: fix getopt.h includes * Makefile.am: add LIBOBJS to LDADD lines * configure.in: check for getopt_long availability and compile in ours if not available 2002-01-03 21:22 jpr * ChangeLog, configure.in, memos.c, pi-csd.c, pilot-debug.c, pilot-link.m4, pilot-mail.c, pilot-xfer.c, read-todos.c, reminders.c, include/pi-config.h, include/pi-syspkt.h, libpisock/pi-file.c, src/memos.c, src/pi-csd.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-mail.c, src/pilot-memos.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-xfer.c, src/read-todos.c, src/reminders.c: 2002-01-03 JP Rosevear * configure.in: put termios cspeed check in a private section * pilot-link.m4: remove termios cspeed check * pilot-debug.c: mark many functions static * pilot-xfer.c (compare): make static * reminders.c: end file with new line * memos.c: ditto * pi-csd.c: ditto * pilot-mail.c: ditto * read-todos.c: ditto * libsock/pi-file.c: include time.h headers properly * include/pi-config.h: remove time.h related includes * include/pi-syspkt.h: add prototypes for publicly exposed symbols 2002-01-03 02:49 desrod * ChangeLog, include/pi-address.h, include/pi-appinfo.h, include/pi-args.h, include/pi-datebook.h, include/pi-dlp.h, include/pi-mail.h, include/pi-md5.h, include/pi-money.h, include/pi-slp.h, include/pi-sockaddr-win32.h, include/pi-sockaddr.h, include/pi-socket.h, include/pi-sync.h, include/pi-syspkt.h, include/pi-todo.h, include/pi-util.h: More whitespace/formatting changes. Fixed inconsistant commenting in libcc/* and added the new Python libpisock bindings to tools/Python (thanks Rob!) 2002-01-02 18:51 desrod * bindings/Python/: .cvsignore, NEWS, README.txt, TODO, pisock.py, setup.py, src/pisock.i, src/pisock_wrap.c: Updated the Python bindings to build against current libpisock and current versions of Python. Thanks to Rob Tillotson for the help. 2002-01-02 00:55 desrod * ChangeLog, configure.in: Fixed the version in configure.in to match 0.10.1-cvs, not 0.10.1cvs 2002-01-02 00:53 desrod * ChangeLog, install-expenses.c, pi-getram.c, pi-getrom.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-debug.c, pilot-dedupe.c, pilot-file.c, pilot-mail.c, pilot-prc.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, src/install-expenses.c, src/pi-getram.c, src/pi-getrom.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-debug.c, src/pilot-dedupe.c, src/pilot-file.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-install-expenses.c, src/pilot-mail.c, src/pilot-port.c, src/pilot-prc.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c: More code cleanups, function relocation, pilot_connect(). 2001-12-31 11:20 desrod * ChangeLog, Makefile.am, addresses.c, debugsh.c, hinotes.c, install-datebook.c, install-hinote.c, install-memo.c, install-todos.c, memos.c, money2qif.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-debug.c, pilot-dedupe.c, pilot-mail.c, pilot-schlep.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, src/addresses.c, src/debugsh.c, src/hinotes.c, src/install-datebook.c, src/install-hinote.c, src/install-memo.c, src/install-todos.c, src/memos.c, src/money2qif.c, src/pi-csd.c, src/pi-getram.c, src/pi-getrom.c, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-debugsh.c, src/pilot-dedupe.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-hinotes.c, src/pilot-install-datebook.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-todos.c, src/pilot-mail.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c: Updated the conduits so they will at least build. Most of this is getting tossed anyway when we merge with HEAD. Commented out dumpdata() calls for now, they aren't working. 2001-12-30 15:25 desrod * ChangeLog, Makefile.am, TODO, addresses.c, debugsh.c, dlpsh.c, getopt.c, getopt1.c, getrom.c, hinotes.c, install-datebook.c, install-expenses.c, install-hinote.c, install-memo.c, memos.c, money2qif.c, parsedate.c, pd-tty.c, pi-csd.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-mail.c, pilot-prc.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, doc/TODO, include/pi-address.h, include/pi-appinfo.h, include/pi-cmp.h, include/pi-config.h, include/pi-datebook.h, include/pi-dlp.h, include/pi-expense.h, include/pi-file.h, src/addresses.c, src/debugsh.c, src/dlpsh.c, src/getopt.c, src/getopt1.c, src/getrom.c, src/hinotes.c, src/install-datebook.c, src/install-expenses.c, src/install-hinote.c, src/install-memo.c, src/memos.c, src/money2qif.c, src/parsedate.c, src/pd-tty.c, src/pi-csd.c, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-csd.c, src/pilot-debugsh.c, src/pilot-dlpsh.c, src/pilot-hinotes.c, src/pilot-install-datebook.c, src/pilot-install-expenses.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-mail.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-prc.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c, bindings/Perl/Makefile.PL.in, bindings/Perl/Pilot.pm, bindings/Perl/test.pl, include/pi-hinote.h, include/pi-iambicExpense.h, include/pi-inet.h, include/pi-inetserial.h, include/pi-mail.h, include/pi-md5.h, include/pi-memo.h, include/pi-money.h, include/pi-padp.h, include/pi-serial.h, include/pi-slp.h, include/pi-sockaddr-win32.h, include/pi-sockaddr.h, include/pi-socket.h, include/pi-source.h, include/pi-sync.h, include/pi-syspkt.h, include/pi-todo.h, libpisock/address.c, libpisock/appinfo.c, libpisock/cmp.c, libpisock/pi-header.c, libpisock/serial.c, libpisock/util.c, libpisock/utils.c, libpisock/winserial.c: Lots of changes, winding up for the 0.10.1 release. Code relocation, reformatting changes from GNU to Berkeley, added install-expenses.c, etc. HUGE commit. 2001-12-29 18:44 jpr * ChangeLog, libpisock/Makefile.am: 2001-12-29 JP Rosevear * libsock/Makefile.am: Include iconv cflags and libs where appropriate 2001-12-29 17:54 jpr * ChangeLog, libpisock/dlp.c, libpisock/pi-header.c, libpisock/socket.c, libpisock/winserial.c: 2001-12-29 JP Rosevear * libsock/pi-header.c (PalmHeader): remove unused var * libsock/winserial.c (win_changebaud): remove non ansii comments * libsock/dlp.c (dlp_strerror): ditto * libsock/socket.c (alarm): ditto 2001-12-29 17:27 jpr * ChangeLog, include/.cvsignore, include/pi-version.h.in: 2001-12-29 JP Rosevear * include/pi-version.h.in: add new line to end of file 2001-12-29 14:39 jpr * ChangeLog, configure.in, include/Makefile.am, include/pi-version.h, include/pi-version.h.in, libpisock/Makefile.am: 2001-12-29 JP Rosevear * configure.in: vars for the module and library versions, subst the version stuff into the version header * libsock/Makefile.am: use vars for the library versioning * include/pi-version.h.in: subst in the version info * include/Makefile.am (c_header_DATA): include pi-version.h.in 2001-12-24 09:22 desrod * libpisock/padp.c: Testing fix as found in the Debian archives http://bugs.debian.org/120459 2001-12-23 18:20 desrod * include/pi-version.h: Just changed the version to match HEAD, with tag. 0.10.1-prb 2001-12-23 09:00 desrod * ChangeLog, dlpsh.c, install-user.c, libpisock/connect.c, src/dlpsh.c, src/install-user.c, src/pilot-dlpsh.c, src/pilot-install-user.c: Sometimes we go too far in one direction, and realize... DOH! Reverted. 2001-12-23 06:04 desrod * dlpsh.c, install-user.c, src/dlpsh.c, src/install-user.c, src/pilot-dlpsh.c, src/pilot-install-user.c, ChangeLog, getopt.h, include/pi-dlp.h, libpisock/connect.c, src/getopt.h: Filling &User, &Sys, &Net pointers in libsock/connect.c now, cleaner. Updated getopt.h to the latest portable version. 2001-12-19 09:16 desrod * ChangeLog, money2qif.c, pi-nredir.c, read-ical.c, src/money2qif.c, src/pi-nredir.c, src/pilot-nredir.c, src/pilot-read-ical.c, src/read-ical.c: A few bugs from the last commit fixed. Bleh. 2001-12-19 07:45 desrod * ChangeLog, dlpsh.c, src/dlpsh.c, src/pilot-dlpsh.c: Fixed a minor segfault problem in user_fn related to strncpy() with *optarg. 2001-12-19 06:45 desrod * ChangeLog, money2qif.c, pi-nredir.c, pi-port.c, pilot-schlep.c, read-ical.c, read-todos.c, reminders.c, src/money2qif.c, src/pi-nredir.c, src/pi-port.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/read-ical.c, src/read-todos.c, src/reminders.c: Lots of movement in the code. 'Berkeley' style indenting implemented, changed the names of some types to be more 'human', as this codebase grows some more "hair", it should be easier, not harder to maintain!! 2001-12-18 19:02 desrod * read-ical.c, src/pilot-read-ical.c, src/read-ical.c: Removed some debug prints to identify an 'ical' problem. 2001-12-18 19:01 desrod * ChangeLog, read-ical.c, src/pilot-read-ical.c, src/read-ical.c: Reversed some changes from a 12/12 commit, need to clean up main() and pare it down a bit.. too large. 2001-12-15 07:50 desrod * libpisock/connect.c: Just fixing a mistake from November 19th re: testing the return of sd. 2001-12-12 04:07 desrod * ChangeLog, addresses.c, dlpsh.c, hinotes.c, install-todos.c, install-user.c, pi-port.c, pilot-schlep.c, read-ical.c, read-todos.c, reminders.c, src/addresses.c, src/dlpsh.c, src/hinotes.c, src/install-todos.c, src/install-user.c, src/pi-port.c, src/pilot-dlpsh.c, src/pilot-hinotes.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-port.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/read-ical.c, src/read-todos.c, src/reminders.c: Winding down to the final 0.10.1 release, more cleanups, relocation of code. 2001-12-11 06:10 desrod * pilot-schlep.c, src/pilot-schlep.c: Oh yeah, comments, I forgot to add those silly things. 2001-12-11 06:05 desrod * ChangeLog, install-todos.c, pilot-schlep.c, src/install-todos.c, src/pilot-install-todos.c, src/pilot-schlep.c: Updates for getopt(), main() fixes, pilot_connect(), and general vacuuming. Still needs some more "polish" in areas, read-todos/install-todos are not yet siblings, pilot-schlep needs to stop using redirection. 2001-12-10 23:24 desrod * libpisock/connect.c: Stupid move on my part, s/printf/fprintf/, can't have the strings dumping into redirected files, now can we? Let's us do ./foo > bar.txt without much breakage 2001-12-08 21:00 desrod * ChangeLog, install-user.c, src/install-user.c, src/pilot-install-user.c: install-user: More of the same. Cleaned up the $PILOTPORT parsing goop, moved things around, and made the -h and lack of any options make logical sense. Changed some of the options around a bit too, -n for netmask, -o for hostname (can't recycle -h on that one) 2001-12-08 18:51 jpr * ChangeLog, autogen.sh, configure.in: 2001-12-08 JP Rosevear * autogen.sh: remove some useless aclocal checks * configure.in: put the pilot link checks in directly 2001-12-08 01:34 desrod * ChangeLog, addresses.c, src/addresses.c: Updated addresses.c for new pilot_connect() style, added Help(), cleaned up arguments, and added an additional output "style" for the records with a -f. 2001-12-06 15:30 desrod * configure.in: Rolled back to 1.38, the later changes that were made to parse out the perl 5.x version would have only worked on 5.6.x and later, not previous 5.x versions. Need to clean this up later on, not important now, but will be.. 2001-12-06 15:11 desrod * ChangeLog, configure.in: Silly me, typing too fast when I save the file. 2001-12-06 15:10 desrod * ChangeLog, configure.in: Updated configure.in to report the canonical version number instead of the internal working version number for perl 5.x versions (5.006001 vs. 5.6.1) 2001-12-06 14:27 jpr * ChangeLog, configure.in: 2001-12-06 JP Rosevear * configure.in (msg_perl): fix perl check to allow for all 5.x versions 2001-12-06 14:19 desrod * include/pi-version.h, libpisock/connect.c, libpisock/padp.c: Clarified the verbage for the 'Weird packet' errors, changed connect.c to return the right sd, and incremented the version in pi-version.h 2001-12-06 12:44 desrod * ChangeLog, dlpsh.c, src/dlpsh.c, src/pilot-dlpsh.c: Fixed a cvs merge problem, hand-merged changes in. Major dlpsh reworking, moved things around, cleaned up some minor things s/U./User./ and fixed a small error in the config.h include statement. 2001-12-06 02:59 jpr * ChangeLog, dlpsh.c, getrom.c, pilot-xfer.c, include/pi-debug.h, include/pi-net.h, include/pi-padp.h, include/pi-slp.h, include/pi-source.h, libpisock/Makefile.am, libpisock/debug.c, libpisock/dlp.c, libpisock/net.c, libpisock/padp.c, libpisock/slp.c, libpisock/socket.c, libpisock/utils.c, src/dlpsh.c, src/getrom.c, src/pilot-dlpsh.c, src/pilot-xfer.c: 2001-12-06 JP Rosevear * libsock/utils.c (dumpline): take debug type (dumpdata): ditto * libsock/net.c: convert to new logging functions * libsock/padp.c: ditto * libsock/slp.c: ditto * libsock/dlp.c: start converting over to new logging functions * libsock/Makefile.am (INCLUDES): compile new files * include/pi-source.h: no longer need the serial trace info, modify protos * include/pi-slp.h: new protos * include/pi-padp.h: new protos, tidy * include/pi-net.h: new protos * libsock/socket.c: let env vars set the debugging types, level and log files * libsock/debug.c (pi_debug_get_types): get the debugging type flags (pi_debug_set_types): set same (pi_debug_get_level): get debug level (pi_debug_set_level): set same (pi_debug_set_file): set the file to write debug output to (pi_log): log debugging info * include/pi-debug.h: debugging functionality 2001-12-05 04:25 jpr * ChangeLog, configure.in: 2001-12-05 JP Rosevear * configure.in: check for a few more readline functions 2001-12-05 04:21 jpr * ChangeLog, Makefile.am, acconfig.h, configure.in, dlpsh.c, pd-tty.c, src/dlpsh.c, src/pd-tty.c, src/pilot-dlpsh.c: 2001-12-05 JP Rosevear * pd-tty.c: use new defines for compiling read line support * dlpsh.c: ditto * configure.in: improved readline checking, no just checks for appropriate functions, basic ones and extra ones * acconfig.h: new defines * Makefile.am: conditionally compile tcl/tk dependant apps, include readline cflags and libs 2001-12-02 10:57 desrod * libpisock/: serial.c, socket.c: Better comments on serial.c's pi_socket_tickle() struct, and monkeyed around with the ps.mac stuff in socket.c, we need that working. 2001-12-01 14:10 desrod * libpisock/: connect.c, net.c, serial.c: Updated test.c a bit to handle the new connect() stuff, fixed SysInfo. 2001-12-01 12:06 jpr * ChangeLog, include/pi-cmp.h, include/pi-net.h, include/pi-socket.h, include/pi-source.h, libpisock/Makefile.am, libpisock/cmp.c, libpisock/net.c, libpisock/serial.c, libpisock/socket.c: 2001-12-01 JP Rosevear * libsock/test.c (main): default to using PI_PF_NET protocol * libsock/socket.c (pi_socket): set up a separate initialization protocol * libsock/serial.c (pi_serial_accept): use various types of handshaking depending on the init value is set to * libsock/cmp.c (cmp_dump): additional info * libsock/Makefile.am: compile new file * libsock/net.c: Move the net sync type protocol in to its own file and make it a pi protocol 2001-11-29 13:38 jpr * ChangeLog, include/pi-padp.h, include/pi-serial.h, include/pi-slp.h, include/pi-socket.h, include/pi-source.h, libpisock/Makefile.am, libpisock/cmp.c, libpisock/connect.c, libpisock/dlp.c, libpisock/padp.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/syspkt.c, libpisock/unixserial.c: 2001-11-29 JP Rosevear * First cut of the new protocol queue rewrite 2001-11-23 11:39 jpr * .cvsignore, ChangeLog, autogen.sh, include/.cvsignore: 2001-11-23 JP Rosevear * autogen.sh: handle ACLOCAL_FLAGS properly 2001-11-23 11:28 jpr * ChangeLog, Makefile.am, autogen.sh, configure.in, pilot-link.m4, include/pi-config.h, include/pi-config.h.in, include/pi-sockaddr-win32.h, include/pi-sockaddr.h, include/pi-sockaddr.h.in: 2001-11-23 JP Rosevear * include/pi-sockaddr-win32.h: ditto * include/pi-sockaddr.h: ditto * include/pi-config.h: conditionally include config.h * autogen.sh: include the local dir in the aclocal flags * Makefile.am: install the pilot-link.m4 file * pilot-link.m4: give an AC_PILOT_LINK function to do all the checks for the pi-config and pi-sockaddr headers * configure.in: use AC_PILOT_LINK macro instead of all the individual checks 2001-11-19 12:58 jpr * ChangeLog, aclocal.m4, configure.in, include/pi-sockaddr.h.in, include/pi-util.h, libpisock/address.c, libpisock/appinfo.c, libpisock/datebook.c, libpisock/expense.c, libpisock/hinote.c, libpisock/mail.c, libpisock/memo.c, libpisock/money.c, libpisock/todo.c, tests/Makefile.in: 2001-11-19 JP Rosevear * aclocal.m4: remove autogenerated file * tests/Makefile.in: ditto * libsock/*.c: clean up includes, remove uneccessary pi-source.h includes * include/pi-util.h: remove pi-config.h include * include/pi-sockaddr.h.in: sub in SA_LEN_FIELD * configure.in: remove next hack because libtool should handle it, add back maximum compiler warnings when possible, ac_output pi-sockaddr.h 2001-11-19 07:13 desrod * ChangeLog, pilot-xfer.c, libpisock/connect.c, src/pilot-xfer.c: Minor fixes before I hit the airport. Hit it with the virtual Kirby this time! 2001-11-19 06:51 desrod * ChangeLog, aclocal.m4, dlpsh.c, install-user.c, parsedate.c, pilot-xfer.c, src/dlpsh.c, src/install-user.c, src/parsedate.c, src/pilot-dlpsh.c, src/pilot-install-user.c, src/pilot-xfer.c, include/pi-version.h, libpisock/connect.c, libpisock/pi-header.c, tests/Makefile.in: A bunch of updates on this one, mostly in the userspace stuff, getopt, decremented pi-version, added a timer, moved around some things, gutted a bunch of things out. Fun fun fun! 2001-11-17 13:18 jpr * ChangeLog, bindings/Makefile.am: 2001-11-17 JP Rosevear * tools/Makefile.am (EXTRA_DIST): add the language binding dirs 2001-11-17 02:01 jpr * ChangeLog, include/i18n.h, include/pi-source.h: 2001-11-17 JP Rosevear * include/pi-source.h: remove i18n.h inclusion * include/i18n.h: kill 2001-11-17 01:43 jpr * .cvsignore, ChangeLog, acconfig.h: 2001-11-17 JP Rosevear * acconfig.h: re-add file 2001-11-17 01:34 jpr * ChangeLog, configure.in: 2001-11-17 JP Rosevear * configure.in: Make version same as before 2001-11-17 01:28 jpr * ChangeLog, Makefile.am, Makefile.in, configure, bindings/Makefile.am, libpisock/Makefile.am: 2001-11-17 JP Rosevear * Remove dead files * Makefile.am: build install-user again * tools/Makefile.am (SUBDIRS): don't build any subdirs right now * libsock/Makefile.am: make sure connect.c is a source 2001-11-17 01:02 jpr * .cvsignore, AUTHORS, ChangeLog, Makefile.am, Makefile.in, NEWS, aclocal.m4, autogen.sh, configure, configure.in, bindings/.cvsignore, bindings/Makefile.am, doc/man/.cvsignore, doc/man/Makefile.am, include/.cvsignore, include/Makefile.am, libpisock/.cvsignore, libpisock/Makefile.am, libpisock/sync.c, libpisync/sync.c, tests/.cvsignore, tests/Makefile.am, tests/Makefile.in: 2001-11-17 JP Rosevear * Convert to automake 2001-11-06 01:53 desrod * ChangeLog, Makefile.in, dlpsh.c, install-user.c, memos.c, pilot-file.c, src/dlpsh.c, src/install-user.c, src/memos.c, src/pilot-dlpsh.c, src/pilot-file.c, src/pilot-install-user.c, src/pilot-memos.c: Lots of changes here, mainly to install-user.c as a testing platform for the new argument stuff going in, added NetLanSync writes, still playing around with program flow. Not satisfied yet with it. 2001-11-05 19:13 desrod * ChangeLog, Makefile.in, install-user.c, pilot-xfer.c, libpisock/connect.c, libpisock/dlp.c, libpisock/padp.c, libpisock/pi-file.c, src/install-user.c, src/pilot-install-user.c, src/pilot-xfer.c: Beginning the public migration to getopt_long() in all of the binaries which are passed arguments. Also cleaning out the redundant code, moving into external objects. 2001-11-03 20:12 desrod * ChangeLog, Makefile.os2, pi-getrom.c, pilot-xfer.c, src/pi-getrom.c, src/pilot-getrom.c, src/pilot-xfer.c: Makefile.os2 should not be in the cvs as a real file. It is created dynamically. Blecch. 2001-10-31 13:12 desrod * ChangeLog, Makefile.os2, pi-getram.c, pi-getrom.c, src/pi-getram.c, src/pi-getrom.c, src/pilot-getram.c, src/pilot-getrom.c: Updated pi-getr?m.c to handle newer ROM images (Kyocera, etc.) and added a percentage counter of completion for each output file. Also changed the file names output and added bugfixVersion to pi-getram.c. Lots of small fixes here. 2001-10-26 10:52 jpr * ChangeLog, libpisock/sync.c, libpisock/util.c, libpisync/sync.c: 2001-10-26 JP Rosevear * libsock/util.c (convert_ToPilotChar): plug leak (convert_FromPilotChar): ditto * libsock/sync.c (sync_MergeToPilot_fast): free all of the pilot record (sync_MergeToPilot_slow): ditto 2001-10-17 18:33 jpr * ChangeLog, Makefile.os2, libpisock/sync.c, libpisync/sync.c: 2001-10-17 JP Rosevear * libsock/sync.c (sync_record): If the record was created and deleted between syncs (without being archived) ignore it 2001-10-03 03:07 desrod * ChangeLog: Updated missed ChangeLog entry from 09-24 2001-09-24 16:50 desrod * pilot-addresses.c, src/pilot-addresses.c: Several people have reported this, it's fixed now. The original offending line was still in the code, commented out, but made it's way into production. Small fixes coming in the coming weeks. 2001-07-21 17:38 desrod * ChangeLog, Makefile.os2.in, TODO, addresses.c, debugsh.c, dlpsh.c, hinotes.c, install-datebook.c, install-memo.c, install-todos.c, install-user.c, memos.c, money2qif.c, pi-csd.c, pi-nredir.c, pilot-addresses.c, pilot-dedupe.c, pilot-file.c, doc/TODO, src/addresses.c, src/debugsh.c, src/dlpsh.c, src/hinotes.c, src/install-datebook.c, src/install-memo.c, src/install-todos.c, src/install-user.c, src/memos.c, src/money2qif.c, src/pi-csd.c, src/pi-nredir.c, src/pilot-addresses.c, src/pilot-csd.c, src/pilot-debugsh.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-file.c, src/pilot-hinotes.c, src/pilot-install-datebook.c, src/pilot-install-memo.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-memos.c, src/pilot-nredir.c, pilot-prc.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-todos.c, reminders.c, libpisock/dlp.c, libpisock/winserial.c, src/pilot-prc.c, src/pilot-read-expenses.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-expenses.c, src/read-todos.c, src/reminders.c: Two new patches from Bill Janssen and Oliver Schmidt added. Also cleaned up the declarations, vacuumed up some of the other dust. Added a missing Makefile.os2.in, incremented patch version. 2001-07-21 13:08 desrod * include/pi-version.h: Changed the patch tag to denote that this is a CVS version. There are people running around with 0.9.6 calling it released. 2001-07-12 18:25 desrod * ChangeLog, include/i18n.h: Oops, forgot include/i18n.h. Fixed. 2001-07-12 16:02 desrod * .cvsignore, ChangeLog, Makefile.in, TODO, doc/TODO, aclocal.m4, autogen.sh, configure, configure.in, dlpsh.c, memos.c, parsedate.c, parsedate.y, src/dlpsh.c, src/memos.c, src/parsedate.c, src/parsedate.y, src/pilot-dlpsh.c, src/pilot-memos.c, pilot-debug.c, pilot-xfer.c, src/pilot-debug.c, src/pilot-xfer.c, include/.cvsignore, include/pi-config.h.in, include/pi-sockaddr.h.in, include/pi-source.h, include/pi-version.h, libpisock/.cvsignore, bindings/Perl/Pilot.xs: Lots of post 0.9.5 fixes, moving towards 0.9.6 cleanliness. Added readline() support, removed unreachable pilot-xfer options, changed the format of TODO, fixed some Perl5 layout bugs, lots more. Check the ChangeLog for the latest changes. 2001-06-19 01:50 desrod * ChangeLog, Makefile.in, libpisock/padp.c, libpisock/syspkt.c: Two fixes from Carl Jacobsen, and a few from me. RELEASE TIME!!! 2001-06-13 15:58 jpr * .cvsignore, bindings/.cvsignore: Shush 2001-06-06 16:00 jpr * ChangeLog, libpisock/unixserial.c: 2001-06-06 Peter Williams * libsock/unixserial.c (s_write): Only free() skb after we access skb->len, not before it. 2001-06-06 04:19 desrod * ChangeLog: Updated ChangeLog to reflect recent GPL vs. LGPL reverts 2001-06-06 04:16 desrod * COPYING.LIB, parsedate.c, src/parsedate.c, include/pi-dlp.h, include/pi-sync.h, include/pi-util.h, libpisock/address.c, libpisock/appinfo.c, libpisock/cmp.c, libpisock/datebook.c, libpisock/dlp.c, libpisock/expense.c, libpisock/hinote.c, libpisock/inet.c, libpisock/mail.c, libpisock/memo.c, libpisock/money.c, libpisock/os2serial.c, libpisock/padp.c, libpisock/pi-file.c, libpisock/pi-header.c, libpisock/serial.c, libpisock/slp.c, bindings/Java/doConstants.c, libpisock/socket.c, libpisock/sync.c, libpisock/syspkt.c, libpisock/todo.c, libpisock/unixserial.c, libpisock/util.c, libpisock/utils.c, libpisock/winserial.c, libpisync/sync.c, bindings/Perl/Makefile.PL.in, bindings/Perl/Pilot.pm, bindings/Perl/Pilot.xs: "Move along, nothing to see here..." Seriously, I made a late-night error back in October of 2000 when I was adding the GPL/LGPL headers to a bunch of files in the source, and ended up adding the wrong headers to several. I reverted them back and put the proper LGPL headers in where the libpisock bindings were used and required (in ./libsock and Java/Perl5 directories). Sorry about that, it's all better now. Note: The license for the pisock library, the C++ libary, and the Perl, Python, Tcl, and Java bindings have been covered under the LGPL since August 23, 1998. 2001-05-28 18:02 desrod * ChangeLog, bindings/Perl/Pilot.xs: Fixed the problems in line-continuation in Pilot.xs, tabbing oddness 2001-05-28 07:12 desrod * TODO, doc/TODO: Uhm, I forgot what I changed. Updated the TODO. 2001-05-25 21:49 desrod * ChangeLog, Makefile.in, dlpsh.c, parsedate.c, src/dlpsh.c, src/parsedate.c, src/pilot-dlpsh.c, parsedate.y, reminders.c, src/parsedate.y, src/pilot-reminders.c, src/reminders.c, libpisock/appinfo.c: reminders.c ANSI C cleanup, dlpsh fixes and additions. Minor. 2001-05-25 05:22 desrod * ChangeLog, include/md5.h, include/pi-md5.h, bindings/README, bindings/Perl/README, bindings/Perl/dump.pl, libpisock/md5.c: * include/md5.h: Renamed md5.h to pi-md5.h to be more in line with the current include/* naming scheme. * tools/Perl5/README: cleaned up the README to make it more current and less threatening * tools/Perl5/test.pl, tools/Perl5/dump.pl: chmod 0755 * tools/Perl5/dump.pl: Fixed shebang to be a bit more portable (recommended by the perl newsgroups and the Camel book) 2001-05-25 05:04 desrod * ChangeLog, iambicexample.cc, install-hinote.c, pilot-addresses.c, include/pi-iambicExpense.h, include/pi-version.h, libpisock/address.c, libpisock/cmp.c, libpisock/datebook.c, libpisock/dlp.c, src/iambicexample.cc, src/install-hinote.c, src/pilot-addresses.c, src/pilot-install-hinote.c, bindings/Perl/Pilot.xs, libpisock/memo.c, libpisock/os2serial.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/sync.c, libpisock/syspkt.c, libpisock/todo.c, libpisock/unixserial.c, libpisock/util.c, libpisock/utils.c, libpisock/winserial.c, libpisync/sync.c: * tools/Perl5/Pilot.xs: Fixed a typo in 'creatDate' (Hadmut Danisch) * install-hinote.c: Fixed to include detection of notes > 28k (David A. Desrosiers) * iambicexample.cc: Poked around and added the banner, removed static file declaration path (still static for now, need to install AllTime and test it out) * More documentation fixes, rolled back out of gtk-doc for now, until we can agree on a portable format to represent these docs in (kudos to jpr for the work and the idea) (David A. Desrosiers) * Closed 5 bugs listed at Sourceforge (David A. Desrosiers) 2001-05-24 02:08 desrod * pilot-addresses.c, src/pilot-addresses.c: What the heck was that burp in pilot-addresses.c? Major breakage on file imports to AddressDB. Fixed and removed. 2001-05-23 17:12 jpr * ChangeLog, libpisock/address.c, libpisock/cmp.c, libpisock/datebook.c, libpisock/socket.c, libpisock/util.c: * libsock/datebook.c: ditto * libsock/address.c: ditto * libsock/util.c: ditto * libsock/inetserial.c: ditto 2001-05-23 16:29 jpr * ChangeLog, libpisock/os2serial.c, libpisock/serial.c, libpisock/slp.c, libpisock/unixserial.c, libpisock/winserial.c: 2001-05-23 JP Rosevear * libsock/sync.c: Document all public and private functions (the public ones in much more detail * libsock/dlp.c: Ditto * libsock/unixserial.c: ditto * libsock/winserial.c: ditto (so_changebaud): make static * libsock/os2serial.c: ditto * libsock/serial.c: ditto * libsock/slp.c: ditto 2001-05-23 15:52 jpr * ChangeLog, libpisock/dlp.c, libpisock/sync.c, libpisync/sync.c: 2001-05-23 JP Rosevear * libsock/sync.c: Document all public functions * libsock/dlp.c: Ditto 2001-05-22 11:38 desrod * Makefile.in: Oops, forgot there were two Makefile.in's... one for OS/2, and one for Unix. Fixed the Unix one now. 2001-05-22 08:20 desrod * ChangeLog, Makefile.in, Makefile.os2, pilot-xfer.c, src/pilot-xfer.c, include/md5.h, libpisock/md5.c, libpisock/padp.c, libpisock/serial.c, libpisock/slp.c, libpisock/winserial.c: * Makefile.in/Makefile.os2: Fixed the "double-header" install problem with the Makefile in the install stanza. Fixed the install-strip option, removed it, and pulled it into the install stanza, put in the proper order. It was backwards before. Added pilot-prc back in. Not sure how it got dropped out. (David A. Desrosiers) * libsock/md5.c: Implemented md5.c and md5.h for the new password authentication scheme. (David A. Desrosiers) * include/md5.h: Same as above, legacy-free algorithm used here. (David A. Desrosiers) * dlpsh.c: Fixed the visual layout of 'df' (David A. Desrosiers) * pilot-prc: Minor fixes to get it to compile cleanly (missing protos, etc.) (David A. Desrosiers) * libsock/winserial.c,libsock/serial.c: Error handling fixes on Win32 (Oliver Schmidt) * pilot-xfer.c: Possible fix for 'time' on Next Openstep, commented out, need to test. (Juergen Sell) 2001-05-21 02:58 desrod * Makefile.in: Oops, how'd foo.c and foo2.c get in that Makefile. Fixed. 2001-05-21 02:55 desrod * ChangeLog, Makefile.in, Makefile.os2, addresses.c, debugsh.c, dlpsh.c, getrom.c, install-memo.c, install-user.c, memos.c, pd-tty.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-debug.c, pilot-dedupe.c, pilot-file.c, pilot-mail.c, pilot-prc.c, pilot-schlep.c, pilot-xfer.c, read-ical.c, reminders.c, libpisock/address.c, libpisock/appinfo.c, libpisock/cmp.c, libpisock/datebook.c, libpisock/dlp.c, libpisock/expense.c, libpisock/hinote.c, libpisock/inet.c, libpisock/mail.c, libpisock/memo.c, libpisock/money.c, libpisock/os2serial.c, libpisock/padp.c, libpisock/pi-file.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/sync.c, libpisock/syspkt.c, libpisock/todo.c, libpisock/unixserial.c, libpisock/util.c, libpisock/utils.c, libpisock/winserial.c, libpisync/sync.c, src/addresses.c, src/debugsh.c, src/dlpsh.c, src/getrom.c, src/install-memo.c, src/install-user.c, src/memos.c, src/pd-tty.c, src/pi-csd.c, src/pi-getram.c, src/pi-getrom.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-debugsh.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-file.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-install-memo.c, src/pilot-install-user.c, src/pilot-mail.c, src/pilot-memos.c, src/pilot-port.c, src/pilot-prc.c, src/pilot-read-ical.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-ical.c, src/reminders.c: Beginning to document every function in the whole codebase, more small cleanups. 2001-05-15 17:55 desrod * ChangeLog, pilot-addresses.c, src/pilot-addresses.c: [no log message] 2001-05-14 02:48 desrod * ChangeLog, Makefile.in, addresses.c, debugsh.c, dlpsh.c, getopt.c, getopt1.c, getrom.c, hinotes.c, install-datebook.c, install-hinote.c, install-memo.c, install-todos.c, install-user.c, kittykiller.c, memos.c, money2qif.c, parsedate.c, pd-tty.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-debug.c, src/addresses.c, src/debugsh.c, src/dlpsh.c, src/getopt.c, src/getopt1.c, src/getrom.c, src/hinotes.c, src/install-datebook.c, src/install-hinote.c, src/install-memo.c, src/install-todos.c, src/install-user.c, src/kittykiller.c, src/memos.c, src/money2qif.c, src/parsedate.c, src/pd-tty.c, src/pi-csd.c, src/pi-getram.c, src/pi-getrom.c, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-debugsh.c, src/pilot-dlpsh.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-hinotes.c, src/pilot-install-datebook.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-port.c, pilot-dedupe.c, pilot-file.c, pilot-mail.c, pilot-prc.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, include/pi-address.h, include/pi-appinfo.h, include/pi-cmp.h, include/pi-config.h.in, include/pi-datebook.h, include/pi-dlp.h, include/pi-dlp.hxx, include/pi-expense.h, include/pi-file.h, include/pi-hinote.h, include/pi-iambicExpense.h, include/pi-inet.h, include/pi-inetserial.h, include/pi-macros.h, include/pi-mail.h, include/pi-memo.h, include/pi-money.h, include/pi-padp.h, include/pi-serial.h, include/pi-slp.h, include/pi-sockaddr-win32.h, include/pi-socket.h, include/pi-source.h, include/pi-sync.h, include/pi-syspkt.h, include/pi-todo.h, include/pi-util.h, include/pi-version.h, libpisock/address.c, libpisock/appinfo.c, libpisock/cmp.c, libpisock/datebook.c, libpisock/dlp.c, libpisock/expense.c, libpisock/hinote.c, libpisock/inet.c, libpisock/mail.c, libpisock/memo.c, libpisock/money.c, libpisock/os2serial.c, libpisock/padp.c, libpisock/pi-file.c, libpisock/pi-header.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/sync.c, libpisock/syspkt.c, libpisock/todo.c, libpisync/sync.c, src/pilot-dedupe.c, src/pilot-file.c, src/pilot-mail.c, src/pilot-prc.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c, libpisock/unixserial.c, libpisock/util.c, libpisock/utils.c, libpisock/winserial.c: memos.c fix (Tamito KAJIYAMA), huge reformatting changes (hint: do not diff the codebase =), Makefile.in (John Marshall) 2001-05-09 04:18 desrod * ChangeLog, Makefile.os2, ccexample.cc, src/ccexample.cc, dlpsh.c, pi-getrom.c, pilot-schlep.c, src/dlpsh.c, src/pi-getrom.c, src/pilot-dlpsh.c, src/pilot-getrom.c, src/pilot-schlep.c, doc/man/pilot-addresses.1, doc/man/pilot-link.7: Various fixes and minor tweaks in 0.9.5-final readiness 2001-04-30 03:15 desrod * ChangeLog, Makefile.in, addresses.c, debugsh.c, dlpsh.c, getopt.c, getopt1.c, getrom.c, hinotes.c, install-datebook.c, install-hinote.c, install-memo.c, install-todos.c, install-user.c, kittykiller.c, memos.c, money2qif.c, parsedate.c, pd-tty.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-dedupe.c, pilot-file.c, pilot-mail.c, pilot-prc.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, src/addresses.c, src/debugsh.c, src/dlpsh.c, src/getopt.c, src/getopt1.c, src/getrom.c, src/hinotes.c, src/install-datebook.c, src/install-hinote.c, src/install-memo.c, src/install-todos.c, src/install-user.c, src/kittykiller.c, src/memos.c, src/money2qif.c, src/parsedate.c, src/pd-tty.c, src/pi-csd.c, src/pi-getram.c, src/pi-getrom.c, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-debugsh.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-file.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-hinotes.c, src/pilot-install-datebook.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-mail.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-prc.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c, include/pi-version.h, libpisock/address.c, libpisock/appinfo.c, libpisock/cmp.c, libpisock/datebook.c, libpisock/dlp.c, libpisock/expense.c, libpisock/hinote.c, libpisock/inet.c, libpisock/mail.c, libpisock/memo.c, libpisock/money.c, libpisock/os2serial.c, libpisock/padp.c, libpisock/pi-file.c, libpisock/pi-header.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/sync.c, libpisock/syspkt.c, libpisock/todo.c, libpisock/unixserial.c, libpisock/util.c, libpisock/utils.c, libpisock/winserial.c, libpisync/sync.c: Preparing for a 0.9.5 final release, check the ChangeLog for details 2001-03-30 19:34 jpr * ChangeLog: 2001-03-30 JP Rosevear * libsock/Makefile.in: version should be 4.0.0 because the old sync interface was removed and the new one added 2001-03-30 19:26 jpr * ChangeLog, libpisock/sync.c, libpisync/sync.c: 2001-03-30 JP Rosevear * libsock/sync.c (sync_MergeFromPilot_fast): Free the record if it wasn't added to the queue not vice versa (sync_MergeFromPilot_slow): ditto 2001-03-14 15:34 jpr * ChangeLog: 2001-03-14 JP Rosevear * libsock/Makefile.in: set the .so version to 4:0:1 as per libtool rules 2001-03-12 23:06 jpr * ChangeLog, configure: 2001-03-12 JP Rosevear * scripts/tarball.c (main): fixes to make it work again, what a horrible hack 2001-03-12 22:41 jpr * ChangeLog, Makefile.in, include/pi-sync.h, libpisock/sync.c, libpisync/sync.c: 2001-03-12 JP Rosevear * libsock/sync.c (open_db): handle the secret flag (sync_CopyToPilot): use open_db (sync_CopyFromPilot): ditto (sync_MergeFromPilot): ditto (sync_MergeToPilot): ditto (sync_Synchronize): ditto * scripts/tarball.c: name the tarball properly * Makefile.in: make make dist a little better * include/pi-sync.h: add secret field * Makefile.in: remove old dist tarball and reflect new name 2001-03-04 20:16 desrod * ChangeLog, Makefile.in, configure.in, install-user.c, doc/man/pilot-addresses.1, src/install-user.c, src/pilot-install-user.c: Added man/pilot-addresses.1, tools/empty.in, applied John Marshall's fix for broken directory/Makefile creation. Must fix this when we autoconfiscate the whole tree properly. Rolling some more getopt() fixes into all binaries slowly. 2001-03-01 08:11 desrod * ChangeLog, pilot-file.c, pilot-prc.c, pilot-xfer.c, include/pi-dlp.h, include/pi-file.h, libpisock/dlp.c, libpisock/pi-file.c, src/pilot-file.c, src/pilot-prc.c, src/pilot-xfer.c, bindings/Java/doConstants.c, bindings/Perl/Pilot.pm, bindings/Perl/Pilot.xs: Added John Marshalls patch. It was a patch against 0.9.0, so I had to hand-stitch the patch in, but it was successful. Some of the fixes were already in the 0.9.5 codebase. Addition of CopyProtect and Stream interfaces, general housecleaning of the code, and some realignment. 2001-02-28 06:19 desrod * ChangeLog: Updated ChangeLog. 2001-02-28 06:15 desrod * pilot-debug.c, pilot-xfer.c, doc/man/dlpsh.1, doc/man/ietf2datebook.1, doc/man/install-datebook.1, doc/man/install-hinote.1, doc/man/install-memo.1, doc/man/install-user.1, src/pilot-debug.c, src/pilot-xfer.c, doc/man/pilot-link.7, doc/man/pilot-xfer.1, doc/man/read-ical.1: Minor edits to layout and formatting on the manpages, some udpates to the verbage on the manpages, added some addition explanation to memos and other binary descriptions in man/pilot-link.7. Added Tamito's fixes to pilot-xfer.c and tools/Python/pdapilot.py. Also added some small fixes from Carl Jacobsen. Nothing functional in this commit, only cosmetic. 2001-02-25 19:56 desrod * ChangeLog, install-user.c, memos.c, pilot-addresses.c, pilot-xfer.c, sync-plan.PL, libpisock/dlp.c, src/install-user.c, src/memos.c, src/pilot-addresses.c, src/pilot-install-user.c, src/pilot-memos.c, src/pilot-sync-plan.pl, src/pilot-xfer.c, src/sync-plan.PL, doc/man/install-memo.1, doc/man/pilot-xfer.1: Various fixes for the PILOTPORT detection, port naming conventions, sync-plan authentication, a few manpage updates, and some small buglets here and there. Credits to go Bob Wittig, Mark Peletier. 2001-02-19 17:41 desrod * ChangeLog, aclocal.m4, configure, dlpsh.c, pilot-debug.c, sync-plan.PL, include/pi-version.h, src/dlpsh.c, src/pilot-debug.c, src/pilot-dlpsh.c, src/pilot-sync-plan.pl, src/sync-plan.PL: 2001-02-17 David A. Desrosiers * aclocal.m4: Fixed the BSD nm test (again). How many times do we have to keep fixing this?! sync-plan.PL: s/Pilot/Palm where required. No breakage. dlpsh.c: Fixed the double "EXITING" error. Prettied up the 'mem' function and added kbytes. Removed the 'exit' option. Changed the layout of 'help'. Fixed some of the formatting. Lots more to do to this binary. 2001-01-28 23:54 desrod * ChangeLog, configure: Updated ChangeLog 2001-01-28 23:46 desrod * Makefile.in, configure, configure.in, include/pi-version.h: How did -FOO get back in there. Be gone. 2001-01-23 17:03 jpr * ChangeLog, Makefile.in, autogen.sh: 2001-01-23 JP Rosevear * Makefile.in: Add a dist target * autogen.sh: add for packaging systems 2001-01-23 01:12 jpr * ChangeLog, Makefile.in: 2001-01-23 JP Rosevear * libsock/Makefile.in: update depends * Makefile.in: Don't specifically include the header object file, its already in the library and breaks --disable-static flag, update depends 2001-01-16 19:07 jpr * ChangeLog, include/pi-sync.h, libpisock/sync.c, libpisync/sync.c: 2001-01-16 JP Rosevear * libsock/sync.c (sync_CopyPilotRecord): copies a pilot record (sync_CopyDesktopRecord): copies a desktop record (add_record_queue): add a pilot side operation to the queue (free_record_queue): free a queu of operations (delete_both): fix incorrect error check (sync_record): Instead of actually doing pilot mods, add an op to the queue (sync_MergeFromPilot_process): Process the items in the queue (sync_MergeFromPilot_fast): go back to processing the records as they come in and processing the queue at the end (sync_MergeFromPilot_slow): ditto (sync_MergeToPilot_fast): process queue at the end (sync_MergeToPilot_slow): ditto * include/pi-sync.h: Add pilot and desktop record copy protos 2001-01-12 11:55 jpr * ChangeLog, include/pi-sockaddr.h.in: oops 2001-01-12 11:52 jpr * ChangeLog: 2001-01-12 JP Rosevear * include/pi-sockaddr.h: Up the device name limit to 255 2001-01-12 10:40 jpr * ChangeLog, libpisock/dlp.c: 2001-01-12 JP Rosevear * libsock/dlp.c (dlp_ReadSortBlock): Expect 2 bytes, fixes bug pointed out by Matthias Hessler 2001-01-11 01:16 jpr * ChangeLog, read-ical.c, src/pilot-read-ical.c, src/read-ical.c: 2001-01-11 JP Rosevear * read-ical.c (main): use ii instead of i to index repeat days in datebook struct, fixes bug pointed out by Matthias Hessler 2001-01-05 19:17 jpr * ChangeLog, libpisock/datebook.c, libpisock/sync.c, libpisync/sync.c: 2001-01-05 JP Rosevear * libsock/datebook.c (pack_AppointmentAppInfo): Fix bug pointed out by Matthias Hessler where i rather than len was being checked * libsock/sync.c (sync_MergeFromPilot_slow): Build a list of pilot records before iterating because its not valid to edit in place during the index loop 2000-12-21 16:52 jpr * ChangeLog, include/pi-sync.h, libpisock/sync.c, libpisync/sync.c: 2000-12-21 JP Rosevear * include/pi-sync.h: new prototypes * libsock/sync.c (sync_FreePilotRecord): util function for pilot records (sync_FreeDesktopRecord): ditto for desktop records (free_pilot_record_list): free the linked list (sync_record): Correct sync logic errors (sync_MergeFromPilot_fast): Build a list of the pilot records before iterating because its not valid to edit in place during the get mod record loop 2000-12-19 16:22 jpr * ChangeLog, libpisock/util.c: 2000-12-19 JP Rosevear * libsock/util.c (convert_FromPilotChar): Fix implementation (convert_ToPilotChar): ditto 2000-12-19 12:51 jpr * ChangeLog, configure, configure.in, include/pi-config.h.in, include/pi-util.h, libpisock/util.c: 2000-12-19 JP Rosevear * include/pi-config.h.in: List HAVE_ICONV * configure.in: Check for an iconv implementation to do charset conversion * libsock/util.c (convert_ToPilotChar): Convert to pilot character set (only does CP1252 devices right now) (convert_FromPilotChar): Code to convert from pilot character set * include/pi-util.h: New routines to convert to pilot character set 2000-12-08 17:36 jpr * ChangeLog, libpisock/sync.c, libpisync/sync.c: 2000-12-08 JP Rosevear * libsock/sync.c (sync_record): When pilot record is archived and changed and the desktop record is changed and the changes are not identical, make sure the pilot record to be archived gets a new pilot id so it is not overwritten by store_record_on_pilot 2000-12-07 JP Rosevear * libsock/sync.c (sync_record): When the pilot record is archived the desktop record is deleted, make sure to archive the record. 2000-12-07 14:09 jpr * ChangeLog, libpisock/sync.c, libpisync/sync.c: 2000-12-07 JP Rosevear * libsock/sync.c (sync_record): When the pilot record is changed and archived and the desktop record is changed and the changes are not identical, keep the pilot record - don't delete it. 2000-11-29 15:27 jpr * ChangeLog: oops 2000-11-29 15:22 jpr * libpisock/sync.c, libpisync/sync.c: 2000-11-29 JP Rosevear * libsock/sync.c: Add error checking for all callbacks and dlp calls. Add writable checks so the merge to pilot and merge from pilot only affect the pilot and desktop records respectively. 2000-11-28 15:41 jpr * ChangeLog, doc/syncabs.sgml: 2000-11-28 JP Rosevear * doc/syncabs.sgml: Update design docs 2000-11-28 14:55 jpr * ChangeLog, include/pi-sync.h, libpisock/sync.c, libpisync/sync.c: 2000-11-28 JP Rosevear * libsock/sync.c (store_record_on_pilot): the prepare callback now provides the pilot record structure to be filled out, free prepare is no longer used - this is because the pilot record struct can never be extended properly and this reduces the work done. Rename from store_record_on_palm. * include/pi-sync.h: Remove free prepare callback and update prepare callback 2000-11-09 21:41 desrod * ChangeLog, Makefile.in: pixdir fix. My bad. 2000-10-31 14:22 jpr * ChangeLog, include/pi-sync.h, libpisock/sync.c, libpisync/sync.c: 2000-10-31 JP Rosevear * libsock/sync.c (sync_record): use ArchiveRecord to set/unset records "archiveness" and use SetStatusCleared to avoid double syncing records. * include/pi-sync.h: Remove AddArchive and DeleteArchive, add SetStatusCleared and ArchiveRecord. 2000-10-30 18:09 desrod * ChangeLog: Just a ChangeLog conflict merge and update. 2000-10-30 12:34 jpr * ChangeLog, include/pi-sync.h, libpisock/sync.c, libpisync/sync.c: 2000-10-30 JP Rosevear * include/pi-sync.h: Replace AddArchiveRecord and DeleteArchivedRecord callbacks with the set archive status callback. * libsock/sync.c (store_record_on_palm): Do some proper result checking for errors. (sync_record): Use new set archive status callback which makes the semantics such that the implementor can choose several implementations and preserve continuity. Replaces AddArchiveRecord and DeleteArchiveRecord. 2000-10-29 19:09 desrod * Makefile.in, dlpsh.c, install-datebook.c, bindings/Perl/Makefile.PL.in, bindings/Perl/Pilot.xs, src/dlpsh.c, src/install-datebook.c, src/pilot-dlpsh.c, src/pilot-install-datebook.c: Perl5 error output fix (wrong text displayed) Makefile.in updates for new paths (../../include, tools relo) 2000-10-28 17:27 jpr * ChangeLog, Makefile.in: 2000-10-28 * Makefile.in: install pix dir properly 2000-10-28 16:34 jpr * tests/.cvsignore: oops 2000-10-28 16:33 jpr * .cvsignore, ChangeLog: 2000-10-28 * tests/.cvsignore: shush * libcc/.cvsignore: ditto 2000-10-28 16:30 jpr * ChangeLog, Makefile.in, include/.cvsignore, bindings/Java/.cvsignore, bindings/Perl/.cvsignore, bindings/Python/.cvsignore, bindings/Tcl/.cvsignore: 2000-10-28 * Makefile.in: Re-run make depend to generate correct dependencies * include/.cvsignore: shush * tools/Java/.cvsignore: ditto * tools/Tcl/.cvsignore: ditto * tools/Python/.cvsignore: ditto * tools/Perl5/.cvsignore: ditto 2000-10-28 15:47 jpr * ChangeLog, libpisock/sync.c, libpisync/sync.c: 2000-10-28 * libsock/sync.c (sync_MergeToPilot_slow): Manually set the id of the record (sync_MergeToPilot_fast): ditto 2000-10-27 20:23 jpr * ChangeLog, Makefile.in, configure, configure.in, configure.scan, ietf2datebook.PL, pd-tty.c, pilot-debug.c, pilot-xfer.c, src/ietf2datebook.PL, src/pd-tty.c, src/pilot-debug.c, src/pilot-ietf2datebook.pl, src/pilot-xfer.c, doc/syncabs.sgml, include/pi-version.h, libpisock/pi-header.c, bindings/README, bindings/Java/README, bindings/Java/doConstants.c, bindings/Java/test.java, bindings/Perl/MANIFEST, bindings/Perl/Makefile.PL.in, bindings/Perl/Pilot.pm, bindings/Perl/Pilot.xs, bindings/Perl/README, bindings/Perl/dump.pl, bindings/Perl/test.pl, bindings/Perl/typemap, bindings/Tcl/Makefile.in, bindings/Tcl/README, bindings/Tcl/license.terms, bindings/Tcl/pitcl.c, bindings/Tcl/tclAppInit.c, bindings/Tcl/test.tcl, bindings/Tcl/tkAppInit.c, src/pix/b1.gif, src/pix/b2.gif, src/pix/b3.gif, src/pix/b4.gif, src/pix/b5.gif, src/pix/b6.gif, src/pix/b7.gif, src/pix/case.gif, src/pix/case.xbm, src/pix/casemask.xbm: Resurrect 0.9.5pre4 2000-10-27 19:13 jpr * .cvsignore, include/pi-header.h, libpisock/.cvsignore, libpisock/pi-header.c: Add new files from update 2000-10-27 19:09 jpr * ChangeLog, Makefile.in, Makefile.os2, README, TODO, addresses.c, ccexample.cc, configure, debugsh.c, dlpsh.c, getopt.c, getopt1.c, getrom.c, hinotes.c, iambicexample.cc, doc/TODO, src/addresses.c, src/ccexample.cc, src/debugsh.c, src/dlpsh.c, src/getopt.c, src/getopt1.c, src/getrom.c, src/hinotes.c, src/iambicexample.cc, src/pilot-debugsh.c, src/pilot-dlpsh.c, src/pilot-hinotes.c, ietf2datebook.PL, install-datebook.c, install-hinote.c, install-memo.c, install-todos.c, install-user.c, kittykiller.c, memos.c, money2qif.c, parsedate.c, parsedate.y, pd-tty.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-debug.c, pilot-dedupe.c, pilot-file.c, pilot-mail.c, pilot-prc.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, validate.cc, src/ietf2datebook.PL, src/install-datebook.c, src/install-hinote.c, src/install-memo.c, src/install-todos.c, src/install-user.c, src/kittykiller.c, src/memos.c, src/money2qif.c, src/parsedate.c, src/parsedate.y, src/pd-tty.c, src/pi-csd.c, src/pi-getram.c, src/pi-getrom.c, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-dedupe.c, src/pilot-file.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-ietf2datebook.pl, src/pilot-install-datebook.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-mail.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-prc.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c, src/validate.cc, include/pi-address.h, include/pi-appinfo.h, include/pi-cmp.h, include/pi-datebook.h, include/pi-dlp.h, include/pi-expense.h, include/pi-file.h, include/pi-hinote.h, include/pi-iambicExpense.h, include/pi-inet.h, include/pi-inetserial.h, include/pi-macros.h, include/pi-mail.h, include/pi-memo.h, include/pi-money.h, include/pi-padp.h, include/pi-serial.h, include/pi-slp.h, include/pi-sockaddr-win32.h, include/pi-socket.h, include/pi-source.h, include/pi-sync.h, include/pi-syspkt.h, include/pi-todo.h, include/pi-version.h, libpisock/address.c, libpisock/appinfo.c, libpisock/cmp.c, libpisock/datebook.c, libpisock/dlp.c, libpisock/expense.c, libpisock/hinote.c, libpisock/inet.c, libpisock/mail.c, libpisock/memo.c, libpisock/money.c, libpisock/os2serial.c, libpisock/padp.c, libpisock/pi-file.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/sync.c, libpisock/syspkt.c, libpisock/todo.c, libpisock/unixserial.c, libpisock/utils.c, libpisock/winserial.c, libpisync/sync.c, doc/man/pilot-link.7, doc/man/pilot-xfer.1, doc/man/read-ical.1, tests/packers.c: Bring pre3 back from the dead 2000-10-11 23:39 jpr * ChangeLog, libpisock/sync.c, libpisync/sync.c: 2000-10-11 JP Rosevear * libsock/sync.c (sync_record): Use ReplaceRecord callback. There can be a subtle difference between add/delete and replace. (sync_MergeToPilot_slow): Calculate flags for records during a slow sync (sync_MergeFromPilot_slow): ditto * include/pi-sync.h: Add ReplaceRecord callback 2000-10-11 15:54 jpr * ChangeLog, include/pi-sync.h, libpisock/sync.c, libpisync/sync.c: 2000-10-11 JP Rosevear * libsock/sync.c (sync_record): Use ReplaceRecord callback. There can be a subtle difference between add/delete and replace. 2000-10-11 03:28 jpr * ChangeLog, include/pi-sync.h, libpisock/sync.c, libpisync/sync.c: 2000-10-11 JP Rosevear * libsock/sync.c: Unconditionally close the database after use. The slow/fast flag is now passed back via the Pre callback (sync_record): Reflect the fact that the dirty and deleted pilot record flags are not mutually exclusive. (store_record_on_palm): When storing, 0 the flags. 2000-10-10 JP Rosevear * libsock/sync.c (sync_MergeToPilot_slow): Only try and obtain a pilot record if there record id set. 2000-10-09 23:46 jpr * ChangeLog, libpisock/sync.c, libpisync/sync.c: 2000-10-08 JP Rosevear * libsock/sync.c (sync_MergeToPilot_fast): Only try and obtain a pilot record if there record id set. 2000-10-08 17:56 desrod * addresses.c, configure, src/addresses.c, debugsh.c, dlpsh.c, getrom.c, hinotes.c, install-datebook.c, install-hinote.c, install-memo.c, install-todos.c, install-user.c, kittykiller.c, memos.c, money2qif.c, parsedate.c, pd-tty.c, pi-csd.c, pi-getram.c, pi-getrom.c, src/debugsh.c, src/dlpsh.c, src/getrom.c, src/hinotes.c, src/install-datebook.c, src/install-hinote.c, src/install-memo.c, src/install-todos.c, src/install-user.c, src/kittykiller.c, src/memos.c, src/money2qif.c, src/parsedate.c, src/pd-tty.c, src/pi-csd.c, src/pi-getram.c, src/pi-getrom.c, src/pilot-csd.c, src/pilot-debugsh.c, src/pilot-dlpsh.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-hinotes.c, src/pilot-install-datebook.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-memos.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-debug.c, pilot-dedupe.c, pilot-file.c, pilot-mail.c, pilot-prc.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, sync-plan.PL, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-debug.c, src/pilot-dedupe.c, src/pilot-file.c, src/pilot-mail.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-prc.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-sync-plan.pl, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c, src/sync-plan.PL: 1. Added a 'mem' option to dlpsh. I will eventually add a 'password' function, version (OS version), and some other tweaks. I've put up some detailed information on how to extract this password from the Palm on the pilot-link site on gnu-designs.com when I get a free moment. 2. I nuked the Palm regex I did in pre1. Basically pre1 was a s/PilotRecord/PalmRecord/g (and others), and this release I reversed that action. Too many things would have been adversely affected for this to be practical at the onset. If we feel that having 'Pilot' in the name doesn't violate what Palm has legally stated about using the name Pilot, then it should stay. If we feel that there could be some legal issues, we would need to rename most of the code and package name itself, i.e. BAD! 3. Since there was a possible issue about the copyright status of the code in sync.c, jpr and myself have completely gutted it and did a ground-up rewrite of the code. In libsock/sync.c we've implemented the following interfaces: (sync_Synchronize): Do a full blown sync (sync_MergeToRemote): Sync desktop records to pilot. (sync_MergeToRemote_slow): Implement slow sync of above (sync_MergeToRemote_fast): Implement fast sync of above (sync_MergeFromRemote): Sync pilot records to desktop (sync_MergeFromRemote_slow): Implement slow sync of above (sync_MergeFromRemote_fast): Implement fast sync of above (sync_CopyFromRemote): Copy pilot records to desktop (sync_CopyToRemote): Copy desktop records to pilot (sync_record): Sync a desktop and pilot record (store_record_on_palm): Utility routine Also, include/pi-sync.h was rewritten to implement a generic sync algorithm include/pi-macros.h now has included for struct tm include/pi-dlp.h has now exposed the DLP_BUF_SIZE macro 4. All appropriate FSF headers have been plopped into the files where appropriate. All originating authorship and copyrights were retained in the files, and where there was no definitive author, I've replaced it with 'Copyright (c) 1997-2000, The pilot-link team'. This should make it very clear which files are not proprietary (as was the previous sync.c implementation) 5. include/pi-header.h has been nuked, and replaced with a cleaner pi-header.c function, which exposes PalmHeader(). 6. The beginnings of the longopt() conversion is in the code as well, so we can mash out the "ASCII art" that John mentioned. The "Palm Splash" will only show up on a --version call, not when using --help. 7. A bad BSD nm test in ./configure was nuked and replaced with a much cleaner working version of the test. 8. Two quick tweaks to Perl5/Makefile.PL and Makefile.PL.in to allow it to cleanly build on perl-5.005 and later versions w.r.t. prototypes and namespace. 9. include/pi-sync.h: Some renaming, add pre and post sync callback struct members. 10. libsock/sync.c: (close_db): Don't just close the db, clean it up and reset the sync flags. 2000-10-08 17:45 desrod * include/pi-dlp.h, include/pi-header.h, include/pi-sync.h, libpisock/address.c, libpisock/appinfo.c, libpisock/cmp.c, libpisock/datebook.c, libpisock/dlp.c, libpisock/expense.c, libpisock/hinote.c, libpisock/inet.c, libpisock/mail.c, libpisock/memo.c, libpisock/money.c, libpisock/os2serial.c, libpisock/padp.c, libpisock/pi-file.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/sync.c, libpisock/syspkt.c, libpisock/todo.c, libpisock/unixserial.c, libpisock/utils.c, libpisock/winserial.c, libpisync/sync.c: 1. Added a 'mem' option to dlpsh. I will eventually add a 'password' function, version (OS version), and some other tweaks. I've put up some detailed information on how to extract this password from the Palm on the pilot-link site on gnu-designs.com when I get a free moment. 2. I nuked the Palm regex I did in pre1. Basically pre1 was a s/PilotRecord/PalmRecord/g (and others), and this release I reversed that action. Too many things would have been adversely affected for this to be practical at the onset. If we feel that having 'Pilot' in the name doesn't violate what Palm has legally stated about using the name Pilot, then it should stay. If we feel that there could be some legal issues, we would need to rename most of the code and package name itself, i.e. BAD! 3. Since there was a possible issue about the copyright status of the code in sync.c, jpr and myself have completely gutted it and did a ground-up rewrite of the code. In libsock/sync.c we've implemented the following interfaces: (sync_Synchronize): Do a full blown sync (sync_MergeToRemote): Sync desktop records to pilot. (sync_MergeToRemote_slow): Implement slow sync of above (sync_MergeToRemote_fast): Implement fast sync of above (sync_MergeFromRemote): Sync pilot records to desktop (sync_MergeFromRemote_slow): Implement slow sync of above (sync_MergeFromRemote_fast): Implement fast sync of above (sync_CopyFromRemote): Copy pilot records to desktop (sync_CopyToRemote): Copy desktop records to pilot (sync_record): Sync a desktop and pilot record (store_record_on_palm): Utility routine Also, include/pi-sync.h was rewritten to implement a generic sync algorithm include/pi-macros.h now has included for struct tm include/pi-dlp.h has now exposed the DLP_BUF_SIZE macro 4. All appropriate FSF headers have been plopped into the files where appropriate. All originating authorship and copyrights were retained in the files, and where there was no definitive author, I've replaced it with 'Copyright (c) 1997-2000, The pilot-link team'. This should make it very clear which files are not proprietary (as was the previous sync.c implementation) 5. include/pi-header.h has been nuked, and replaced with a cleaner pi-header.c function, which exposes PalmHeader(). 6. The beginnings of the longopt() conversion is in the code as well, so we can mash out the "ASCII art" that John mentioned. The "Palm Splash" will only show up on a --version call, not when using --help. 7. A bad BSD nm test in ./configure was nuked and replaced with a much cleaner working version of the test. 8. Two quick tweaks to Perl5/Makefile.PL and Makefile.PL.in to allow it to cleanly build on perl-5.005 and later versions w.r.t. prototypes and namespace. 9. include/pi-sync.h: Some renaming, add pre and post sync callback struct members. 10. libsock/sync.c: (close_db): Don't just close the db, clean it up and reset the sync flags. 2000-10-08 05:58 jpr * .cvsignore, ChangeLog, libpisock/.cvsignore: 2000-10-08 JP Rosevear * .cvsignore, libsock/.cvsignore: Shush 2000-10-08 05:48 jpr * ChangeLog, include/pi-sync.h, libpisock/sync.c, libpisync/sync.c: 2000-10-08 JP Rosevear * include/pi-sync.h: Reorder SetPilotID args * libsock/sync.c (sync_CopyFromPilot): Break out of loop if returned record is null (we're done) (sync_CopyToPilot): ditto (store_record_on_palm): Reorder SetPilotID args 2000-10-08 01:59 jpr * ChangeLog, libpisock/sync.c, libpisync/sync.c: 2000-10-08 JP Rosevear * libsock/sync.c (sync_CopyToPilot): Pass the sync handler to close_db like we're supposed to (sync_CopyFromPilot): ditto (sync_MergeFromPilot): ditto (sync_MergeToPilot): ditto (sync_CopyFromPilot): Make sure the pre call occurs before the for each call 2000-10-08 01:24 jpr * ChangeLog, libpisock/sync.c, libpisync/sync.c: 2000-10-08 JP Rosevear * libsock/sync.c (sync_MergeFromPilot_slow): Only free the match if one was actually found (sync_MergeFromPilot_fast): ditto (sync_MergeToPilot_fast): Break out of the loop if the returned record is null (we're done) (sync_MergeToPilot_slow): ditto 2000-10-06 23:22 jpr * ChangeLog, include/pi-sync.h, libpisock/sync.c, libpisync/sync.c: 2000-10-06 JP Rosevear * include/pi-sync.h: Some renaming, add pre and post sync callback struct members. * libsock/sync.c: Some renaming. Add pre and post sync callbacks. (close_db): Don't just close the db, clean it up and reset the sync flags. 2000-10-04 21:56 jpr * ChangeLog, addresses.c, dlpsh.c, hinotes.c, install-datebook.c, install-hinote.c, install-memo.c, install-todos.c, install-user.c, memos.c, money2qif.c, pilot-addresses.c, pilot-dedupe.c, pilot-mail.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, src/addresses.c, src/dlpsh.c, src/hinotes.c, src/install-datebook.c, src/install-hinote.c, src/install-memo.c, src/install-todos.c, src/install-user.c, src/memos.c, src/money2qif.c, src/pilot-addresses.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-hinotes.c, src/pilot-install-datebook.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-mail.c, src/pilot-memos.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c, include/pi-dlp.h, include/pi-dlp.hxx, include/pi-sync.h, libpisock/dlp.c, libpisock/sync.c, libpisync/sync.c: 2000-10-04 JP Rosevear * s/PalmRecord/PilotRecord/ * s/PalmUser/PilotUser/ 2000-10-04 21:35 jpr * .cvsignore, AUTHORS, ChangeLog, Makefile.am, Makefile.in, NEWS, acconfig.h, aclocal.m4, addresses.c, autogen.sh, ccexample.cc, configure, configure.in, debugsh.c, dlpsh.c, getopt.c, src/addresses.c, src/ccexample.cc, src/debugsh.c, src/dlpsh.c, src/getopt.c, src/pilot-debugsh.c, src/pilot-dlpsh.c, getopt.h, getopt1.c, getrom.c, getrom.prc, getrom2.prc, hinotes.c, iambicexample.cc, ietf2datebook.PL, install-datebook.c, install-hinote.c, install-memo.c, install-todos.c, install-user.c, kittykiller.c, memos.c, money2qif.c, parsedate.c, parsedate.y, pd-tty.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-debug.c, src/getopt.h, src/getopt1.c, src/getrom.c, src/hinotes.c, src/iambicexample.cc, src/ietf2datebook.PL, src/install-datebook.c, src/install-hinote.c, src/install-memo.c, src/install-todos.c, src/install-user.c, src/kittykiller.c, src/memos.c, src/money2qif.c, src/parsedate.c, src/parsedate.y, src/pd-tty.c, src/pi-csd.c, src/pi-getram.c, src/pi-getrom.c, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-hinotes.c, src/pilot-ietf2datebook.pl, src/pilot-install-datebook.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-port.c, src/prc/getrom.prc, src/prc/getrom2.prc, pilot-dedupe.c, pilot-file.c, pilot-mail.c, pilot-prc.c, pilot-schlep.c, pilot-undelete.PL, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, validate.cc, src/pilot-dedupe.c, src/pilot-file.c, src/pilot-mail.c, src/pilot-prc.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-undelete.PL, src/pilot-undelete.pl, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c, src/validate.cc, include/pi-address.h, include/pi-address.hxx, include/pi-appinfo.h, include/pi-appinfo.hxx, include/pi-args.h, include/pi-cmp.h, include/pi-config-win32.h, include/pi-config.h.in, include/pi-datebook.h, include/pi-datebook.hxx, include/pi-dlp.h, include/pi-dlp.hxx, include/pi-expense.h, include/pi-file.h, include/pi-header.h, include/pi-hinote.h, include/pi-iambicExpense.h, include/pi-iambicExpense.hxx, include/pi-inet.h, include/pi-inetserial.h, include/pi-macros.h, include/pi-mail.h, include/pi-memo.h, include/pi-memo.hxx, include/pi-money.h, include/pi-padp.h, include/pi-serial.h, include/pi-slp.h, include/pi-sockaddr-win32.h, include/pi-sockaddr.h.in, include/pi-socket.h, include/pi-source.h, include/pi-sync.h, include/pi-syspkt.h, include/pi-todo.h, include/pi-todo.hxx, include/pi-version.h, libpisock/.cvsignore, libpisock/Makefile.am, libpisock/dlp.c, libpisock/sync.c, libpisync/sync.c, doc/man/.cvsignore, doc/man/Makefile.am, bindings/.cvsignore, bindings/Makefile.am, tests/.cvsignore, tests/Makefile.am, tests/Makefile.in: Revert previous auto* foo. The way headers are done in pilot-link seems broken and I can't fix it with out breaking the API, which is not a good thing atm. 2000-10-04 00:01 jpr * ChangeLog, libpisock/dlp.c, libpisock/sync.c, libpisync/sync.c: 2000-10-04 JP Rosevear * libsock/sync.c: s/PalmRecord/PilotRecord * libsock/pi-sync.h: ditto 2000-10-03 20:27 jpr * ChangeLog, bindings/.cvsignore, bindings/Makefile.am: 2000-10-03 JP Rosevear * tools/Makefile.am: Build c++ programs if possible * tools/parsedate.c: Remove generated file * tools/.cvsignore: shush 2000-10-03 14:49 jpr * ChangeLog, acconfig.h, doc/man/.cvsignore, bindings/.cvsignore, bindings/Makefile.am, tests/.cvsignore, tests/Makefile.am: 2000-10-03 JP Rosevear * Add missing files 2000-10-03 14:38 jpr * .cvsignore, AUTHORS, ChangeLog, Makefile.am, Makefile.in, NEWS, aclocal.m4, addresses.c, autogen.sh, ccexample.cc, configure, configure.in, debugsh.c, dlpsh.c, getopt.c, src/addresses.c, src/ccexample.cc, src/debugsh.c, src/dlpsh.c, src/getopt.c, src/pilot-debugsh.c, src/pilot-dlpsh.c, getopt.h, getopt1.c, getrom.c, getrom.prc, getrom2.prc, hinotes.c, iambicexample.cc, ietf2datebook.PL, install-datebook.c, install-hinote.c, install-memo.c, install-todos.c, install-user.c, kittykiller.c, memos.c, money2qif.c, parsedate.c, parsedate.y, pd-tty.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-debug.c, pilot-dedupe.c, src/getopt.h, src/getopt1.c, src/getrom.c, src/hinotes.c, src/iambicexample.cc, src/ietf2datebook.PL, src/install-datebook.c, src/install-hinote.c, src/install-memo.c, src/install-todos.c, src/install-user.c, src/kittykiller.c, src/memos.c, src/money2qif.c, src/parsedate.c, src/parsedate.y, src/pd-tty.c, src/pi-csd.c, src/pi-getram.c, src/pi-getrom.c, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-dedupe.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-hinotes.c, src/pilot-ietf2datebook.pl, src/pilot-install-datebook.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-port.c, src/prc/getrom.prc, src/prc/getrom2.prc, pilot-file.c, pilot-mail.c, pilot-prc.c, pilot-schlep.c, pilot-undelete.PL, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, validate.cc, src/pilot-file.c, src/pilot-mail.c, src/pilot-prc.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-undelete.PL, src/pilot-undelete.pl, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c, src/validate.cc, include/pi-address.h, include/pi-address.hxx, include/pi-appinfo.h, include/pi-appinfo.hxx, include/pi-args.h, include/pi-cmp.h, include/pi-config-win32.h, include/pi-config.h.in, include/pi-datebook.h, include/pi-datebook.hxx, include/pi-dlp.h, include/pi-dlp.hxx, include/pi-expense.h, include/pi-file.h, include/pi-header.h, include/pi-hinote.h, include/pi-iambicExpense.h, include/pi-iambicExpense.hxx, include/pi-inet.h, include/pi-inetserial.h, include/pi-macros.h, include/pi-mail.h, include/pi-memo.h, include/pi-memo.hxx, include/pi-money.h, include/pi-padp.h, include/pi-serial.h, include/pi-slp.h, include/pi-sockaddr-win32.h, include/pi-sockaddr.h.in, include/pi-socket.h, include/pi-source.h, include/pi-sync.h, include/pi-syspkt.h, include/pi-todo.h, include/pi-todo.hxx, include/pi-version.h, libpisock/.cvsignore, libpisock/Makefile.am, doc/man/Makefile.am, bindings/.cvsignore, tests/Makefile.in: 2000-10-03 JP Rosevear * Reorganize files and do the automake thing. include/*.h goes to libsock/ include/*.hxx goes to libcc/ top level source files go to tools Still need to auto* foo the 4 language binding dirs 2000-10-02 12:38 jpr * ChangeLog, include/pi-dlp.h, include/pi-macros.h, include/pi-sync.h, libpisock/sync.c, libpisync/sync.c: 2000-09-28 JP Rosevear * libsock/sync.c (sync_Synchronize): Do a full blown sync (sync_MergeToRemote): Sync desktop records to pilot. (sync_MergeToRemote_slow): Implement slow sync of above (sync_MergeToRemote_fast): Implement fast sync of above (sync_MergeFromRemote): Sync pilot records to desktop (sync_MergeFromRemote_slow): Implement slow sync of above (sync_MergeFromRemote_fast): Implement fast sync of above (sync_CopyFromRemote): Copy pilot records to desktop (sync_CopyToRemote): Copy desktop records to pilot (sync_record): Sync a desktop and pilot record (store_record_on_palm): Utility routine (archive_and_delete): ditto (delete_both): ditto (sync_NewDesktopRecord): Allocate new desktop record (sync_NewPalmRecord): Allocation new palm record * include/pi-sync.h: Rewrite of header for generic sync algorithm * include/pi-macros.h: Include for struct tm * include/pi-dlp.h: Make the DLP_BUF_SIZE macro available 2000-09-05 00:12 desrod * libpisock/unixserial.c: A '0' is legal to return on Linux from the tty layer write. This affects the USB Visor (for old versions of the Linux USB driver) and some of the usb-serial converters on Linux. 2000-09-04 21:25 desrod * Makefile.in, Makefile.os2, README, addresses.c, debugsh.c, dlpsh.c, getrom.c, hinotes.c, iambicexample.cc, install-datebook.c, install-hinote.c, install-memo.c, install-todos.c, install-user.c, memos.c, money2qif.c, pi-csd.c, pi-getram.c, pi-getrom.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-debug.c, pilot-dedupe.c, pilot-file.c, pilot-mail.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, sync-plan.PL, validate.cc, src/addresses.c, src/debugsh.c, src/dlpsh.c, src/getrom.c, src/hinotes.c, src/iambicexample.cc, src/install-datebook.c, src/install-hinote.c, src/install-memo.c, src/install-todos.c, src/install-user.c, src/memos.c, src/money2qif.c, src/pi-csd.c, src/pi-getram.c, src/pi-getrom.c, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-debugsh.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-file.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-hinotes.c, src/pilot-install-datebook.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-mail.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-sync-plan.pl, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c, src/sync-plan.PL, src/validate.cc, include/pi-appinfo.h, include/pi-dlp.h, include/pi-dlp.hxx, include/pi-header.h, tests/packers.c: More source tweaks, tried to clean up places where argv[1] was, instead of char *port; Added some more cleanliness to pi_bind in the programs which didn't have it. Still much more to go, at least without breaking much of the code anyway 2000-09-03 23:06 desrod * Makefile.in, Makefile.os2, addresses.c, ccexample.cc, debugsh.c, dlpsh.c, getopt.c, getopt1.c, getrom.c, hinotes.c, ietf2datebook.PL, install-datebook.c, install-hinote.c, install-memo.c, install-todos.c, install-user.c, kittykiller.c, memos.c, money2qif.c, parsedate.c, parsedate.y, pd-tty.c, pi-csd.c, src/addresses.c, src/ccexample.cc, src/debugsh.c, src/dlpsh.c, src/getopt.c, src/getopt1.c, src/getrom.c, src/hinotes.c, src/ietf2datebook.PL, src/install-datebook.c, src/install-hinote.c, src/install-memo.c, src/install-todos.c, src/install-user.c, src/kittykiller.c, src/memos.c, src/money2qif.c, src/parsedate.c, src/parsedate.y, src/pd-tty.c, src/pi-csd.c, src/pilot-csd.c, src/pilot-debugsh.c, src/pilot-dlpsh.c, src/pilot-hinotes.c, src/pilot-ietf2datebook.pl, src/pilot-install-datebook.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-memos.c, pi-getram.c, pi-getrom.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-debug.c, pilot-dedupe.c, pilot-file.c, pilot-mail.c, pilot-prc.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, include/pi-dlp.h, include/pi-dlp.hxx, include/pi-header.h, include/pi-memo.hxx, include/pi-sockaddr.h.in, include/pi-version.h, libpisock/address.c, libpisock/appinfo.c, libpisock/cmp.c, libpisock/datebook.c, libpisock/dlp.c, libpisock/expense.c, libpisock/hinote.c, libpisock/inet.c, libpisock/mail.c, libpisock/memo.c, libpisock/money.c, libpisock/os2serial.c, libpisock/padp.c, libpisock/pi-file.c, libpisock/serial.c, libpisock/slp.c, libpisock/sync.c, libpisock/syspkt.c, libpisock/todo.c, libpisock/unixserial.c, libpisock/utils.c, libpisock/winserial.c, libpisync/sync.c, src/pi-getram.c, src/pi-getrom.c, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-debug.c, src/pilot-dedupe.c, src/pilot-file.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-mail.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-prc.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c, doc/man/pilot-link.7, doc/man/pilot-xfer.1, doc/man/read-ical.1: A ton of changes in this release. Below is a small list: Here's a short list of what I've done (by no means complete) 1. I changed PilotUser to PalmUser in all relevant places. This had no direct affect on the code, but I'm doing this so that future plugins will function in a more "generic" way, not bound to "Pilot" devices specifically. Though this does not affect pilot-link, the authors of code which uses that must now put an #ifndef in their code when testing for versions of pilot-link (0.9.3 will use PilotUser, versions > 0.9.3 will now use PalmUser. 2. Added proper error trapping in pi_bind for all programs which used it, so incorrect port settings can be trapped, and the user notified. In some cases, you would just get "Error: pi_bind", which is not that descriptive. Fixed. 3. Added the ability to sync PQA files from PalmVII and PalmVIIx units. There were other things in the patch Tom sent me which I tried to integrate, but a -U option was conflicting with another option, so I had to rename (the other) option to -I. I do not have a PalmVIIx, only a PalmVII, so if someone has a VIIx, please test this and get back to me. 4. Added a "-a " option to archive (move) deleted files (during a "-s" sync command) to the specified directory, rather than just deleting them. 5. Added the Graffiti Shortcuts fix to pi-file.c and pilot-xfer.c 6. Added a -F option to toggle the Backup code between backing up the RAM databases, and the ones in ROM. With the advent of FlashbuilderIII and now FlashPro, user apps may be hiding in the Flash ROM of a Palm III/IIIx/V. When the "rom" databases are being backed up, the code skips over any which have a creator that is composed entirely of lowercase letters and/or "_". This should keep the standard built-in apps from needlessly getting backed up (since Palm has claimed this entire class of creator ids for themselves). 7. Also added a corresponding -O option which is sort of the opposite of -F -- it backs up ONLY the Flash (or ROM) databases which have creator ids composed entirely of lowercase letters and/or "_". (My use for this was to be able to run prc2pilrc on various of the PalmOS databases to see exactly how their forms were laid out. 8. Added a -q option which avoids printing out all the "Skipping..." messages. This way, if you only have a few databases that need to be synced, the output won't scroll off the screen, and it will be easier to see what has actually been done. 9. Added a -c option which falls partway between -q and the previous behavior: for each database examined, "[ ## ]" (where ## is a monotonically increasing index number) is printed at the beginning of the line, with a "\r" but no "\n". The effect of this is to make evident that the backup code is skipping past lots of databases that don't need backing up. 10. Changed the default behavior to no longer back up the database named "Unsaved Preferences". Apparently, Palm asked the creator of BackupBuddy to make this change in his code, as restoring this database can cause trouble version 3.1 of PalmOS. 11. Added a -I option to revert to the original behavior of considering the "Unsaved Preferences" database for backup. This was originally a -U option, but the -U(pdate) option made more sense there. I named this one -I for -I(llegal) databases. *shrug* I couldn't think of a better one at the time. =) 12. Changed the "Backup done." message to say either "RAM backup done.", "Flash backup done.", or "OS backup done", as appropriate. 13. Modified dlp_ptohdate() to return a date outside of the Pilot's valid range of dates when fed a date with a zero year field. This zero year field seems to mean "never", or "no date". 14. Added BSD/NetBSD to the list of systems for which the sleeping_beauty define gets set. 15. Added a "-f file" option, to read memos from a MemoDB.pdb file that is already on-disk, rather than syncing them from the Palm. Stole the idea, and most of the code, from read-todos. 16. Added a -Q option, which prevents write_memo_in_directory from printing its "Opening file ..." messages. 17. Fixed (admittedly with a hack) the pi_accept timeout errors by ignoring the 10th packet. Once we start to gut this code, this will be fixed in a proper fashion. For this release, it would have affected too much other reliant code, so I implemented the hack instead. 18. Increased the PATH_MAX for the device name in libsock/libsockaddr.h.in to [255]. This needs to be more portable, but for the meantime, this will get everyone by. 19. Added a -D, -T, and -t option to pilot-addresses. You can now output the file with headers intact. There's a small buglet here I'm tracking down, but it works in very basic manner, and I didn't break the previous working code, so consider this transitory. 20. Added pi-header.h to the files which could use it. This adds a bit of similarity (visually) to the application, as well as outputs the proper binary being used, and it's version number. Now all the binaries when run look the same. 21. Cleaned up the "Help()" and "Usage()" functions to output visually similar results. Some of the binaries had options which were not in the output of --help. I am going to continue adding longopt[] to the remaining code in place of getopt, for those which require it. There's also a lingering issue with the name of the port being 'device' in some places, 'argv[0]' in others, 'addr.pi_device' in some places, and 'port' still in others. Should clean that up and make a call to pi-device or some such. 22. Removed all of the relvant entries to "Pilot" in the code and replaced them with "Palm" where appropriate, as well as nuked the references to "US Robotics" from the man pages, source code, and other ancillary files. 23. Added the 'null date' fix to install-datebook to allow proper dating of units which exceed Palm threshholds or those which have no date. 24. Added a fix for databases > 255, so you can sync 256 or more databases to your Palm, without crashing. 2000-09-03 22:12 desrod * build.logfile: Removed an errant build.logfile I left there by accident, whoops 2000-08-30 21:59 desrod * libpisock/address.c, libpisock/appinfo.c, libpisock/cmp.c, libpisock/datebook.c, libpisock/dlp.c, libpisock/expense.c, libpisock/hinote.c, libpisock/inet.c, libpisock/mail.c, libpisock/memo.c, libpisock/money.c, libpisock/os2serial.c, libpisock/padp.c, libpisock/pi-file.c, libpisock/slp.c, libpisock/sync.c, libpisock/syspkt.c, libpisock/todo.c, libpisock/utils.c, libpisock/winserial.c, libpisync/sync.c: Added missing money.c, whoops, sorry guys! =) 2000-07-30 20:51 desrod * build.logfile, ietf2datebook.PL, install-user.c, parsedate.c, parsedate.y, pi-csd.c, pilot-debug.c, src/ietf2datebook.PL, src/install-user.c, src/parsedate.c, src/parsedate.y, src/pi-csd.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-ietf2datebook.pl, src/pilot-install-user.c, include/pi-config.h.in, libpisock/dlp.c, libpisock/slp.c: This is the debug output patched version and also includes the rolled in slp patch which will stop those pi_accept timeout errors. 2000-07-30 20:18 desrod * ChangeLog, Makefile.in, Makefile.os2, README-Win32.txt, configure, configure.in, ietf2datebook.PL, install-hinote.c, kittykiller.c, pilot-xfer.c, doc/README-Win32.txt, src/ietf2datebook.PL, src/install-hinote.c, src/kittykiller.c, src/pilot-ietf2datebook.pl, src/pilot-install-hinote.c, src/pilot-xfer.c, include/pi-appinfo.hxx, include/pi-config-win32.h, include/pi-datebook.hxx, include/pi-dlp.hxx, include/pi-macros.h, include/pi-sockaddr-win32.h, include/pi-socket.h, include/pi-source.h, include/pi-version.h, libpisock/cmp.c, libpisock/dlp.c, libpisock/inet.c, libpisock/os2serial.c, libpisock/padp.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/syspkt.c, libpisock/unixserial.c, libpisock/utils.c, libpisock/winserial.c: May 10, 1999 Tilo Christ 0.9.3 Fixed Win32 support. Applied patch by John Franks to inet.c Apr 26, 1999 Kenneth Albanowski 0.9.3 Upgrade configure to use autoconf 2.13. Installed the rest of Tilo's patches. 2000-07-30 20:17 desrod * ChangeLog, configure, configure.in, ietf2datebook.PL, src/ietf2datebook.PL, src/pilot-ietf2datebook.pl, pilot-dedupe.c, src/pilot-dedupe.c, include/pi-socket.h, include/pi-source.h, include/pi-version.h, libpisock/hinote.c, libpisock/serial.c, libpisock/socket.c, doc/man/pilot-link.7: Apr 4, 1999 Kenneth Albanowski 0.9.2 Please note a significant (but minor) change: the license for the hinote code in the pisock library has been changed to LGPL. In the previous release (0.9.1), it was GPL, which would prevent the library from being used in an LGPL manner. If you wish to use the pisock library with the LGPL license, please base your work on 0.9.2. Rewrote pilot-dedupe in a more sensible manner. (New version could have some bugs.) Added Tilo's changes to support "high" baud rates with PILOTRATE environment variable. Say "PILOTRATE=H115200" to specify a high rate. PILOTHIGHRATE variable is now ignored. Added Tilo's pi_setmaxspeed() function, and added initial pi_getsockopt() support to retrieve current speed. Changed Python detection to support 1.5.1 installation. 2000-07-30 20:16 desrod * ChangeLog, Makefile.in, Makefile.os2, getopt.c, hinotes.c, ietf2datebook.PL, install-datebook.c, install-hinote.c, install-memo.c, pi-csd.c, pi-getrom.c, read-ical.c, read-todos.c, sync-plan.PL, src/getopt.c, src/hinotes.c, src/ietf2datebook.PL, src/install-datebook.c, src/install-hinote.c, src/install-memo.c, src/pi-csd.c, src/pi-getrom.c, src/pilot-csd.c, src/pilot-getrom.c, src/pilot-hinotes.c, src/pilot-ietf2datebook.pl, src/pilot-install-datebook.c, src/pilot-install-hinote.c, src/pilot-install-memo.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-sync-plan.pl, src/read-ical.c, src/read-todos.c, src/sync-plan.PL, include/pi-address.hxx, include/pi-hinote.h, include/pi-source.h, include/pi-version.h, libpisock/dlp.c, libpisock/hinote.c, libpisock/inet.c, libpisock/pi-file.c, libpisock/serial.c, doc/man/install-hinote.1: Jan 14, 1999 Kenneth Albanowski 0.9.1 Hi-Notes support (in 'hinotes' and 'install-hinote', courtesy of Bill Goodman, and Michael Bravo.) Install-memo improvements. read-ical improvements (?) regarding secret records and alarms. Fixed pi-getrom's decoding of ROM version. (3.0 units should now download complete ROM image.) Installation of databases fixed to allow uploading of databases with zero-length resources. Direct support for "high" (nominally unsupported) baud rates via PILOTHIGHRATE environment variable. 2000-07-30 20:15 desrod * COPYING.LIB, ChangeLog, Makefile.in, Makefile.os2, README, ietf2datebook.PL, pi-getram.c, pi-getrom.c, read-todos.c, src/ietf2datebook.PL, src/pi-getram.c, src/pi-getrom.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-ietf2datebook.pl, src/pilot-read-todos.c, src/read-todos.c, include/pi-version.h, libpisock/address.c, libpisock/appinfo.c, libpisock/cmp.c, libpisock/datebook.c, libpisock/dlp.c, libpisock/expense.c, libpisock/inet.c, libpisock/mail.c, libpisock/memo.c, libpisock/os2serial.c, libpisock/padp.c, libpisock/pi-file.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/syspkt.c, libpisock/todo.c, libpisock/unixserial.c, libpisock/utils.c: Aug 23, 1998 Kenneth Albanowski 0.9.0 Please note a significant change: the license for the pisock library, the C++ libary, and the Perl, Python, Tcl, and Java bindings has been changed from the GPL (GNU Public License) to the LGPL (Library GNU Public License). For more information, please see the files COPYING.LIB, and COPYING. If you have any reason to disagree with this change, please contact me as soon as possible. I have attempted to verify with all affected parties that this change is acceptable. This license change applies starting with release 0.9.0 of pilot-link. This change is not retroactive, and previous releases (0.8.13, and before) are still available, with all parts under the GPL. In other news: pi-getrom fixed to get 2 Meg of ROM on a 3.0 device (by working around a bug in PalmOS 3.0.) read-todos modified to work with both a ToDoDB.pdb file (as downloaded from the device), as well as the database on the device. Tcl binding changed to remove "Pilot" from name. (I'm only changing Tcl at the moment, because nothing could possibly be relying on it.) 2000-07-30 20:13 desrod * ChangeLog, Makefile, Makefile.in, Makefile.os2, README, config.cache, config.log, config.status, ietf2datebook.PL, libtool, memos.c, money2qif.c, pi-port.c, pilot-addresses.c, pilot-debug.c, pilot-mail.c, pilot-xfer.c, reminders.c, sync-plan.PL, src/ietf2datebook.PL, src/memos.c, src/money2qif.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-debug.c, src/pilot-ietf2datebook.pl, src/pilot-mail.c, src/pilot-memos.c, src/pilot-port.c, src/pilot-reminders.c, src/pilot-sync-plan.pl, src/pilot-xfer.c, src/reminders.c, src/sync-plan.PL, include/pi-address.hxx, include/pi-appinfo.hxx, include/pi-config.h, include/pi-datebook.hxx, include/pi-dlp.hxx, include/pi-iambicExpense.hxx, include/pi-memo.hxx, include/pi-money.h, include/pi-sockaddr.h, include/pi-todo.hxx, include/pi-version.h, libpisock/pi-file.c, libpisock/socket.c, doc/man/README, doc/man/pilot-link.7, doc/man/pilot-xfer.1, tests/Makefile: May 11, 1998 Kenneth Albanowski 0.8.13 This version is an unchanged re-release of 0.8.12, which was not released properly. (0.8.12 archives actually contain 0.8.11, mea culpa.) 2000-07-30 20:10 desrod * Makefile, config.cache, config.log, config.status, ietf2datebook.PL, libtool, src/ietf2datebook.PL, src/pilot-ietf2datebook.pl, include/pi-config.h, include/pi-sockaddr.h, tests/Makefile: May 7, 1998 Kenneth Albanowski 0.8.12 Not much work has gone into pilot-link since the previous release, the main changes being several patches that have been applied: David Warren's fix for reminds.c. Dag Nygren's tickles for sync-plan. Russell Nelson's patches for pilot-mail. Bodo Bellut's patch for pi-file to better catch errors. Jay Sekora's improved memos and pilot-addresses. Rik Harris's patch to get pi-port working. Fixed libsock/socket.c to not crash on unbound/unconnected socket. Added Rui Oliveira's MoneyManager code. Removed Java bin build directory stuff, it was broken. Also, I've decided that getopt() was a complete loss where pilot-xfer is concerned, so it now has manual argument processing. I rather expect the new code is buggy, too, but at least it will be the same bugs for everyone. Lastly, I've added the latest release of libtool, 1.2. This should fix some problems, but might well cause others. Let me know, of course. 2000-07-30 20:08 desrod * ChangeLog, README, ietf2datebook.PL, install-memo.c, os2configure.cmd, pi-nredir.c, pilot-xfer.c, src/ietf2datebook.PL, src/install-memo.c, src/pi-nredir.c, src/pilot-ietf2datebook.pl, src/pilot-install-memo.c, src/pilot-nredir.c, src/pilot-xfer.c, include/pi-version.h, libpisock/os2serial.c, libpisock/utils.c: Feb 27, 1998 Kenneth Albanowski 0.8.11 Sorry, no time for detail: - Java build changed, to store executables in separate directory - Minor patch to Perl binding - Major patch to Python binding - A few OS/2 improvements Note: I've seen an apparent problem with glibc2's getopt, but this is not confirmed. 2000-07-30 20:07 desrod * ChangeLog, ietf2datebook.PL, pilot-xfer.c, src/ietf2datebook.PL, src/pilot-ietf2datebook.pl, src/pilot-xfer.c, include/pi-version.h, libpisock/address.c: Dec 20, 1997 Kenneth Albanowski 0.8.10 Library changes: - Bug affecting address book sorting corrected Utility changes: - pilot-xfer mistake corrected (-b acted like -u). 2000-07-30 20:06 desrod * ChangeLog, Makefile.in, Makefile.os2, configure, configure.in, getopt.c, getopt.h, getopt1.c, ietf2datebook.PL, install-memo.c, memos.c, pilot-xfer.c, src/getopt.c, src/getopt.h, src/getopt1.c, src/ietf2datebook.PL, src/install-memo.c, src/memos.c, src/pilot-ietf2datebook.pl, src/pilot-install-memo.c, src/pilot-memos.c, src/pilot-xfer.c, include/pi-version.h, libpisock/dlp.c: Dec 14, 1997 Kenenth Albanowski 0.8.9 Configuration changed: - added Python configuration patches by Bill Janssen . Library changes: - Modified emulation of DLP NextRecInCat function. Utility changes: - added GNU (glibc2) getopt, changed pilot-xfer to use long options. - install-memos getopt tweak - added patches by Jay Sekora to improve memos - added Ian Goldberg's sensible name escape patches for pilot-xfer (so that a database with a slash or equals in the name is translated to something safe.) - added slightly modified patches by Simon Burge so that pilot-xfer does not have to back up the entire Pilot each time. (added sync and update modes). 2000-07-30 20:05 desrod * ChangeLog, Makefile.in, Makefile.os2, configure, configure.in, ietf2datebook.PL, install-memo.c, pi-nredir.c, pilot-debug.c, src/ietf2datebook.PL, src/install-memo.c, src/pi-nredir.c, src/pilot-debug.c, src/pilot-ietf2datebook.pl, src/pilot-install-memo.c, src/pilot-nredir.c, include/pi-config.h.in, include/pi-sockaddr.h.in, include/pi-socket.h, include/pi-version.h, libpisock/padp.c, libpisock/utils.c: Dec 7, 1997 Kenneth Albanowski 0.8.8 Configuration changes: - add sa_len member to pi_sockaddr, to match OS - include compatability code for putenv Library changes: - Modified PADP code to better cope with the timeout response of PalmOS 2.0. (The result is _not_ faster response, but less confusion.) Utility changes: - pilot-debug has minimal feature support - install-memo has several new options, provided by Paul Traina . 2000-07-30 20:04 desrod * ChangeLog, Makefile.in, Makefile.os2, aclocal.m4, configure, configure.in, ietf2datebook.PL, pi-nredir.c, src/ietf2datebook.PL, src/pi-nredir.c, src/pilot-ietf2datebook.pl, src/pilot-nredir.c, include/pi-config.h.in, include/pi-socket.h, tests/Makefile.in, tests/Makefile.os2: Oct 7, 1997 Kenneth Albanowski 0.8.7 Configuration changes: - install .hxx headers - use $(MAKE) instead of make - added latest libtool-1.0c Utility changes: - pi-nredir deals with missing putenv or setenv Perl 5 binding changes: - quote "index". - change usages of errno as a member to errnop - fix some leaking newRV()'s. 2000-07-30 20:03 desrod * ChangeLog, Makefile.in, Makefile.os2, README, addresses.c, debugsh.c, dlpsh.c, getrom.c, ietf2datebook.PL, install-memo.c, install-todos.c, memos.c, pi-getram.c, pi-getrom.c, pi-nredir.c, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-dedupe.c, pilot-mail.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, src/addresses.c, src/debugsh.c, src/dlpsh.c, src/getrom.c, src/ietf2datebook.PL, src/install-memo.c, src/install-todos.c, src/memos.c, src/pi-getram.c, src/pi-getrom.c, src/pi-nredir.c, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-debugsh.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-getram.c, src/pilot-getrom.c, src/pilot-ietf2datebook.pl, src/pilot-install-memo.c, src/pilot-install-todos.c, src/pilot-mail.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-port.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c, include/pi-config.h.in, include/pi-socket.h, libpisock/datebook.c, libpisock/expense.c, libpisock/pi-file.c, libpisock/socket.c: Sep 14, 1997 Kenneth Albanowski 0.8.6 Configuration changes: - skip sys/select.h if it is not available Utility changes: - added pi-getram utility to fetch RAM image. (Use -c switch if fetching for Copilot). - added holey files to pi-getrom All: - corrected miscellaneous C warnings Documentation changes: - added program list to README 2000-07-30 20:02 desrod * ChangeLog, Makefile.in, Makefile.os2, ietf2datebook.PL, pilot-debug.c, sync-plan.PL, src/ietf2datebook.PL, src/pilot-debug.c, src/pilot-ietf2datebook.pl, src/pilot-sync-plan.pl, src/sync-plan.PL, include/pi-socket.h: Sep 6, 1997 Kenneth Albanowski 0.8.5 Configuration changes: - added patch for libtool 1.0b to prevent extraneous 'n's. Utility changes: - pilot-debug adjusted for release version of Tcl 8.0. - sync-plan massively updated to support syncing multiple plan database against a single Pilot, support for more then one Pilot, working repetitions, general bug fixes, etc. Perl 5 binding changes: - Several bug fixes by Bharat. 2000-07-30 20:01 desrod * ChangeLog, Makefile.in, Makefile.os2, README, TODO, aclocal.m4, configure, configure.in, ietf2datebook.PL, sync-memodir.c, sync-plan.PL, test-acceptor.c, test-connector.c, doc/TODO, src/ietf2datebook.PL, src/pilot-ietf2datebook.pl, src/pilot-sync-plan.pl, src/sync-plan.PL, include/pi-socket.h: Aug 31, 1997 Kenneth Albanowski 0.8.4 Configuration changes: - libtool 1.0b included (which means you can say './libtool gdb pilot-mail') - 'dubious' directory added Utility changes: - Added sync-plan module to do complete Pilot<->Plan synchronization. Perl 5 binding changes: - Several bug fixes by Bharat. 2000-07-30 20:00 desrod * ChangeLog, ietf2datebook.PL, src/ietf2datebook.PL, src/pilot-ietf2datebook.pl, include/pi-socket.h: Aug 24, 1997 Kenneth Albanowski 0.8.3 Perl 5 binding changes: - Default attributes of new records. - Generic typedef for all pilot-link char* casts. - Added SvOK and SvTYPE checks to all (?) SvRV extactions. - Rewrote unpacking technique to deal with failed unpackings (due to deleted records.) - Rewrote packing technique to deal with deleted records (produce empty result). - alarm->units returns text, not numbes. - Fixed shadowing variable in getNextModRecord. 2000-07-30 19:59 desrod * ChangeLog, ietf2datebook.PL, pi-csd.c, read-ical.c, src/ietf2datebook.PL, src/pi-csd.c, src/pilot-csd.c, src/pilot-ietf2datebook.pl, src/pilot-read-ical.c, src/read-ical.c, include/pi-socket.h, libpisock/dlp.c: Aug 17, 1997 Kenneth Albanowski 0.8.2 Utility changes: - read-ical: still more oops. - pi-csd: scrap ifr_netmask. 2000-07-30 19:57 desrod * ChangeLog, Makefile.in, Makefile.os2, configure, configure.in, ietf2datebook.PL, install-datebook.c, pi-csd.c, pi-nredir.c, pilot-mail.c, pilot-undelete.PL, pilot-undelete.pl, pilot-xfer.c, read-expenses.c, read-ical.c, reminders.c, src/ietf2datebook.PL, src/install-datebook.c, src/pi-csd.c, src/pi-nredir.c, src/pilot-csd.c, src/pilot-ietf2datebook.pl, src/pilot-install-datebook.c, src/pilot-mail.c, src/pilot-nredir.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-reminders.c, src/pilot-undelete.PL, src/pilot-undelete.pl, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/reminders.c, include/pi-datebook.h, include/pi-dlp.h, include/pi-expense.h, include/pi-mail.h, include/pi-socket.h, libpisock/datebook.c, libpisock/expense.c, libpisock/inet.c, libpisock/mail.c, libpisock/memo.c, libpisock/pi-file.c, libpisock/utils.c, doc/man/ietf2datebook.1, doc/man/install-datebook.1, tests/packers.c: Aug 9, 1997 Kenneth Albanowski 0.8.1 Configuration changes: - A few tweaks for Java and OS/2. Pisocket library changes: - For datebook packer code: repeatOn split into repeatDay and repeatDays. - Fixed pi-file crash on records larger then 64K. (Note that the Pilot itself cannot deal with records larger then 64K!) - pi-csd now tries to cope better with missing ifr_netmask. - pi-nredir: setenv scrapped. - pilot-mail: Added x-mailer header, and avoid preprending dashes to signature if it already has them. - pilot-xfer: tried to fix optind. Again. - read-ical: oops. Utility changes: - Added installdatebook and ietf2datebook, both provided by Tero Kivinen Java binding changes: - Now compiles with JDK 1.1. - All standard Pilot databases support with complete packer/unpacker support. - File access added. - All enumeration record values changed over to enumeration objects. - All bit-fields replaced with individual items. Perl 5 binding changes: - All enumeration record values changed over to text values. - Support for mail preferences added. - Expense database supported. - All bit-fields replaced with individual items. - Open command accepts text mode ("rxws") as well as numeric. Python binding changes: - All enumeration record values changed over to text values. 2000-07-30 19:54 desrod * ChangeLog, Makefile.in, Makefile.os2, TODO, addresses.c, configure, configure.in, dlpsh.c, install-memo.c, install-todos.c, install-user.c, memos.c, pd-tty.c, pi-csd.c, pi-getrom.c, pi-nredir.c, pilot-addresses.c, pilot-debug.c, pilot-file.c, pilot-mail.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, validate.cc, doc/TODO, src/addresses.c, src/dlpsh.c, src/install-memo.c, src/install-todos.c, src/install-user.c, src/memos.c, src/pd-tty.c, src/pi-csd.c, src/pi-getrom.c, src/pi-nredir.c, src/pilot-addresses.c, src/pilot-csd.c, src/pilot-debug.c, src/pilot-dlpsh.c, src/pilot-file.c, src/pilot-getrom.c, src/pilot-install-memo.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-mail.c, src/pilot-memos.c, src/pilot-nredir.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c, src/validate.cc, include/pi-address.h, include/pi-appinfo.h, include/pi-appinfo.hxx, include/pi-config.h.in, include/pi-datebook.h, include/pi-dlp.h, include/pi-expense.h, include/pi-iambicExpense.h, include/pi-mail.h, include/pi-memo.h, include/pi-socket.h, include/pi-source.h, include/pi-todo.h, libpisock/address.c, libpisock/appinfo.c, libpisock/datebook.c, libpisock/dlp.c, libpisock/expense.c, libpisock/mail.c, libpisock/memo.c, libpisock/pi-file.c, libpisock/todo.c, libpisock/utils.c, tests/Makefile.in, tests/Makefile.os2, tests/packers.c: Aug 4, 1997 Kenneth Albanowski 0.8.0 Configuration changes: - Added dependancy checking to utilties. - Touched up OS/2 configuration slightly. - Added detection of uname and other SunOS (or was it Solaris?) foibles. Pisocket library changes: - Changes to nearly all structure definitions, though these are mostly just changes to the names of members. The names have been changed to follow a common naming scheme ("thisIsAMethod", "ramSize", etc.), to remove chopped words, and to let the interpreter bindings use the same member names as the C code. The new names are frozen (I hope) and will not change again. - Category information has been broken out of the appInfo structures into a separate structure, since it was producing needless duplicated code. - All of the database record packing code had been tuned and tested, and now pay attention to their arguments. In particular, both the packers and unpackers return how many bytes were used (or zero if the buffer wasn't long enough), and the packer will return the desired buffer length if it is passed a buffer address of zero. These changes allow programs to let the packer calculate how much buffer space should be allocated. - Version number of shared library bumped up to indicate incompatible changes. Test code changes: - Added test code to check all packers and unpackers for proper operation. Utility changes: - Added pi-getrom program to fetch a Pilot's ROM through RPC calls. Be careful, this program _could_ cause your Pilot to lock up, so back up first. But I'd love to hear about any problems. - pi-csd tries to get the host name via uname if gethostname isn't available. - Added backlight support to remote UI in pilot-debug. - Added Ian G.'s pilot-debug patches to support pasting text into the remote UI. - All utilities modified to match changes to pisocket library. Java binding changes: - Dlp exceptions now contain (through hard effort) the Dlp error value - Use slightly less deprecated Date interface (bleagh!) - Structures modified to match new definitions. - Added resetNext & callApplication methods. - Adapted packers to new structures -- broke off categories into a subclass of AppBlock. - Added support for all standard databases except Expense. - Changed toString mechanism to allow superclasses to build up description. - Added newRecord, newResource, newAppBlock, newSortBlock and newPref methods. - Java structures and methods are freezing if not frozen. Perl 5 binding changes: - Structures modified to match new definitions. - Perl structures and methods are freezing if not frozen. - Renamed methods to match Java binding ("likeThis", "ramSize", "getRecord", etc.) Python binding changes: - Structures modified to match new definitions. - Python structures and methods are freezing if not frozen. - Renamed methods to match Java binding. 2000-07-30 19:51 desrod * ChangeLog, Makefile.in, Makefile.os2, configure, configure.in, pi-csd.c, pi-nredir.c, read-ical.c, src/pi-csd.c, src/pi-nredir.c, src/pilot-csd.c, src/pilot-nredir.c, src/pilot-read-ical.c, src/read-ical.c, include/pi-config.h.in, include/pi-socket.h, libpisock/inet.c, libpisock/serial.c, libpisock/socket.c: Jul 26, 1997 Kenneth Albanowski 0.7.6 Configuration changes: - No more complaints if the Java Development Kit isn't installed. - sockaddr.sa_len member is detected (for pi-csd) Pisocket library changes: - Support for Palm's TCP/IP NetSync(tm) has been added. To use this, give a program like pilot-xfer a port of '.' (a single period). You will also need to run (perhaps in the background) pi-csd, with its settings configured to match the PC NetSync(tm) settings on your PalmPilot(tm). - Leak of laddr/raddr members fixed. Utility changes: - Added pi-csd program to allow network synchronization. This program must be running for your computer to accept NetSync(tm) connections from a PalmPilot(tm). You must of course also run whatever utility or synchronization program you want the PalmPilot(tm) to connect to. - Added pi-nredir to allow a normal (or network, for that matter) connection to be redirected over the network to pilot-link or the PalmPilot(tm) Desktop. - Read-ical patches by Ian G. applied, allowing use of a default port, and a method of hiding the text of datebook entries. Java binding changes: - Todo application supported. - You can now open a database using an instance of Pdapilot.Database instead of a database name. 2000-07-30 19:49 desrod * ChangeLog, Makefile.in, Makefile.os2, configure, configure.in, pilot-mail.c, pilot-undelete.pl, pilot-xfer.c, read-ical.c, src/pilot-mail.c, src/pilot-read-ical.c, src/pilot-xfer.c, src/read-ical.c, include/pi-config.h.in, include/pi-mail.h, include/pi-socket.h, libpisock/dlp.c, libpisock/mail.c: Jul 22, 1997 Kenneth Albanowski 0.7.5 Configuration changes: - Uninstalled binaries should better cope with symlinks or moving their directory. - The Java Development Kit is automatically detected. Build changes: - Man pages probably can be installed now - Added Mike Jarabek's latest OS/2 patches, which should allow a shared libpisock dll to be built and used. Pisoket library changes: - Mail preferences renamed from "MailPrefs" to "MailPref1". - Corrected bug in retrieving NetSync info if fields were empty. Utility changes: - Modified pilot-undelete slightly to match new Perl5 module. - Added pilot-xfer patches (slightly modified) by Christopher Chan-Nui . These allow default port via PILOTPORT, and multiple files/db's with a command. Java binding changes: - New! All of the libpisock functionality is accessible from the Java interpreter. The only missing parts are RPC, CallApplication, and the packers other then Memo. Perl 5 binding changes: - Completely revised record storage mechanism uses objects to describe records, resources, appblocks, sortblocks, and prefs. All current code using the Perl5 module will need to be rewritten, though the changes will probably be minimal. The upshot of this change is that record packing/unpacking is now automated. Python binding changes: - Preferences may be retrieved from an open DB. 2000-07-30 19:47 desrod * ChangeLog, Makefile.in, Makefile.os2, TODO, aclocal.m4, configure, configure.in, pd-tty.c, pilot-mail.c, doc/TODO, src/pd-tty.c, src/pilot-mail.c, include/pi-inet.h, include/pi-inetserial.h, include/pi-macros.h, include/pi-mail.h, include/pi-serial.h, include/pi-socket.h, include/pi-source.h, libpisock/os2serial.c, libpisock/serial.c, libpisock/socket.c, libpisock/utils.c: Jul 13, 1997 Kenneth Albanowski 0.7.4 Configuration changes: - Integrated libtool 1.0 (thanks, Gord!) - Automatic detection of GNU readline 2.0 and 2.1 (or later). - libtool removed entirely from C++ section - Itcl automatically detected, and tcl/tk from an itcl installation will be detected. Itcl is not currently used, however. - Adjusted to (re)support OS/2 compilation. - Revised OS/2 makefiles by Mike Jarabek. Pisocket library changes: - Fixed up a few headers to use PI_ARGS. - Added compareTm function to compare tm's. Utilities: - pilot-debug can now automatically utilise GNU readline 2.0 or 2.1 for decent line-editing support, and in theory anything past 2.1 should work as well. - pilot-mail includes patches by Diego Zamboni to support reading of MH mail folders. (Note: this code does not support file or folder locking, or non-contiguous message numbers.) Perl 5 binding changes: - various dlp constants are now exported by PDA::Pilot. - CompareTm function exportable which takes two tm style listrefs and returns <0, 0, or >0. - Fixed nasty bugs on packing appointments with alarms (alarm wouldn't trigger properly), and on appointments without descriptions (Datebook would crash). - Modified typemap so module will not fail on earlier versions of Perl. Python binding changes: - SetRecord now takes an optional second argument. If a non-zero integer, the record will not be packed, and only the "raw" attribute will be used. Tcl binding changes: - Large chunks rewritten to increase functionality. - Small, subtle, incomprehensible, and potentially bug-ridden chunks rewritten to make channel code compatible with versions of Tcl prior to 8.0. - "make test" should work. - GetRecord and SetRecord commands supported, with packer support. - Only memo records currently have packer support. Databases without defined packers cannot be read. 2000-07-30 19:45 desrod * ChangeLog, Makefile.in, Makefile.os2, README, configure, configure.in, pilot-debug.c, pilot-undelete, pilot-undelete.pl, src/pilot-debug.c, include/pi-socket.h, include/pi-source.h, libpisock/dlp.c, libpisock/syspkt.c: Jul 6, 1997 Kenneth Albanowski 0.7.3 Heavily modifed Python binding to use OO approach to record manipulation and packing. Read the README and test.py files in the Python directory for more information. Added 'struct sockaddr;' reference to pi-socket.h to allow use by code that has not pulled in the full set of socket headers. Added to configure the --with-cpp and --with-perl5 options to allow choice (or avoidance, via '--without') of the C++ compiler and Perl 5 interpreter, respectively. ('onfigure --help' for list.) Once library is built, interpreter bindings may be built via 'make Perl5', 'make Tcl', or 'make Python'. Changed configure interpreter selection to try to choose newer interpreter versions over older ones. Removed shared library generation from C++ library (it has too much of a chance of breaking.) Reversed -I directives in Makefiles so that current headers come before installed headers. 2000-07-30 19:39 desrod * ChangeLog, Makefile.in, Makefile.os2, aclocal.m4, configure, configure.in, parsedate.c, parsedate.y, src/parsedate.c, src/parsedate.y, pilot-mail.c, sync-memodir.c, src/pilot-mail.c, include/pi-socket.h, libpisock/serial.c, libpisock/unixserial.c: Jun 29, 1997 Kenneth Albanowski 0.7.2 Complete reimplemenation of library production, using version 0.9h of Gordon Matzigkeit's libtool package. Added Tcl, Tk, & Python auto-detection to configure script (use 'configure --help' to see what options can be modified.) Rewrote Python compilation to use standard dynamic compilation technique. Rewrote Tcl compilation to use libtool and to generate binaries. Added David Warren's patch to add serial delays for SGI. 2000-07-30 19:24 desrod * ChangeLog, Makefile.in, Makefile.os2, install-user.c, parsedate.c, parsedate.y, pilot-file.c, pilot-xfer.c, read-ical.c, sync-memodir.c, src/install-user.c, src/parsedate.c, src/parsedate.y, src/pilot-file.c, src/pilot-install-user.c, src/pilot-read-ical.c, src/pilot-xfer.c, src/read-ical.c, include/pi-dlp.h, include/pi-file.h, include/pi-socket.h, libpisock/dlp.c, libpisock/padp.c, libpisock/pi-file.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/unixserial.c: Jun 22, 1997 Kenneth Albanowski 0.7.1 Added Ian's patches to install man-pages, and dump records in pilot-file. Added Andreas Wrede's patch to sync-ical. Added Tero Kivinen's patch to add RecordID to read-ical. Modified PI_AF_* constants to reduce likelyhood of conflicting with AF_INET constant. Added a new UNIX serial pause after baud rate negotation even if the rate didn't change. This prevents a dropped packet. Tuned serial pauses before and after baud rate change. I am now losing no packets at all. OS/2 code may need to be adjusted in a similar manner. Added pi_file_merge routine and -m switch to pilot-xfer. This merges record from a file into an existing database, which is especially useful for Dinkypad. Note that this could potentially damage some third-party application databases. 2000-07-30 19:23 hacker * .gdb_history: Jun 14, 1997 Kenneth Albanowski 0.7.0 Substantial modification to socket implementation. The serial and socket layers now have significantly more separation and modularity, with the goal of allowing clean serial implementations, across both architectures (os2, amiga, unix, etc.) and interfaces (direct serial, networked serial redirector, etc.). A higher layer will allow for connections that do not use the serial interface and protocols at all, though this is not utilized in this version. All pi_ functions that deal with addresses now use sockaddr struct * params instead of pi_sockaddr. Any C programs using pilot-link directly will need to be modified. The parameter is still a pi_sockaddr, but it must be cast to (struct sockaddr*), as with the genuine socket functions. The pi_port element has been removed from the pi_sockaddr structure. Any C code constructing these structures will have to be modified. All included programs and language bindings have been modified as described above. SLP, PADP, and syspackets recoded slightly to better deal with xid generation. The OS/2 and UNIX serial code was stripped out of serial.c, and placed into os2serial.c and unixserial.c. If you wish to port the serial layer, please do so in a new file (amigaserial.c, etc.) Added '-2' switch to getrom, which should retrieve the entire ROM if a PalmPilot and getrom2.prc are used. Getrom2.prc included from the latest version of CoPilot (I hope Greg doesn't mind.) 2000-07-30 19:23 desrod * ChangeLog, Makefile.in, Makefile.os2, addresses.c, debugsh.c, dlpsh.c, getrom.c, getrom2.prc, install-memo.c, install-todos.c, install-user.c, memos.c, parsedate.c, parsedate.y, pi-port.c, pilot-addresses.c, pilot-clip.c, pilot-debug.c, pilot-dedupe.c, pilot-mail.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, sync-memodir.c, test-acceptor.c, test-connector.c, src/addresses.c, src/debugsh.c, src/dlpsh.c, src/getrom.c, src/install-memo.c, src/install-todos.c, src/install-user.c, src/memos.c, src/parsedate.c, src/parsedate.y, src/pi-port.c, src/pilot-addresses.c, src/pilot-clip.c, src/pilot-debug.c, src/pilot-debugsh.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-install-memo.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-mail.c, src/pilot-memos.c, src/pilot-port.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c, src/prc/getrom2.prc, include/pi-config.h.in, include/pi-inet.h, include/pi-inetserial.h, include/pi-net.h, include/pi-serial.h, include/pi-socket.h, include/pi-source.h, include/pi-syspkt.h, libpisock/cmp.c, libpisock/net.c, libpisock/os2serial.c, libpisock/padp.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/syspkt.c, libpisock/unixserial.c: Jun 14, 1997 Kenneth Albanowski 0.7.0 Substantial modification to socket implementation. The serial and socket layers now have significantly more separation and modularity, with the goal of allowing clean serial implementations, across both architectures (os2, amiga, unix, etc.) and interfaces (direct serial, networked serial redirector, etc.). A higher layer will allow for connections that do not use the serial interface and protocols at all, though this is not utilized in this version. All pi_ functions that deal with addresses now use sockaddr struct * params instead of pi_sockaddr. Any C programs using pilot-link directly will need to be modified. The parameter is still a pi_sockaddr, but it must be cast to (struct sockaddr*), as with the genuine socket functions. The pi_port element has been removed from the pi_sockaddr structure. Any C code constructing these structures will have to be modified. All included programs and language bindings have been modified as described above. SLP, PADP, and syspackets recoded slightly to better deal with xid generation. The OS/2 and UNIX serial code was stripped out of serial.c, and placed into os2serial.c and unixserial.c. If you wish to port the serial layer, please do so in a new file (amigaserial.c, etc.) Added '-2' switch to getrom, which should retrieve the entire ROM if a PalmPilot and getrom2.prc are used. Getrom2.prc included from the latest version of CoPilot (I hope Greg doesn't mind.) 2000-07-30 19:21 hacker * .gdb_history: Jun 8, 1997 Kenneth Albanowski 0.6.6 Added highly experimental networked connections. The concept is to run pi-port on a machine with a serial port, and have the real pilot utilities connect to this server via TCP/IP. The current code is supposed to work, but unfortunately is broken at the moment. Added experimental Tcl 8.0b1 binding. Modified Perl5 binding slightly, towards eventual goal of automatic app-specific record packing and unpacking. Modified Python test code slightly to demonstrate changing the Pilot's display during HotSync. Added CreateDB to Perl5 binding. pilot-debug patched to compile under Tcl8.0b1. pilot-xfer now properly fails if it cannot find a database to fetch. Fixed odd-data length problem in RPC code so pilot-clip can now successfully set the clipboard. 2000-07-30 19:21 desrod * ChangeLog, Makefile.in, Makefile.os2, getrom.c, parsedate.c, parsedate.y, pi-port.c, pilot-clip.c, pilot-debug.c, pilot-xfer.c, src/getrom.c, src/parsedate.c, src/parsedate.y, src/pi-port.c, src/pilot-clip.c, src/pilot-debug.c, src/pilot-port.c, src/pilot-xfer.c, include/pi-net.h, include/pi-serial.h, include/pi-source.h, libpisock/cmp.c, libpisock/dlp.c, libpisock/net.c, libpisock/padp.c, libpisock/pi-file.c, libpisock/serial.c, libpisock/socket.c, libpisock/syspkt.c: Jun 8, 1997 Kenneth Albanowski 0.6.6 Added highly experimental networked connections. The concept is to run pi-port on a machine with a serial port, and have the real pilot utilities connect to this server via TCP/IP. The current code is supposed to work, but unfortunately is broken at the moment. Added experimental Tcl 8.0b1 binding. Modified Perl5 binding slightly, towards eventual goal of automatic app-specific record packing and unpacking. Modified Python test code slightly to demonstrate changing the Pilot's display during HotSync. Added CreateDB to Perl5 binding. pilot-debug patched to compile under Tcl8.0b1. pilot-xfer now properly fails if it cannot find a database to fetch. Fixed odd-data length problem in RPC code so pilot-clip can now successfully set the clipboard. 2000-07-30 19:20 desrod * ChangeLog, Makefile.os2, parsedate.c, parsedate.y, src/parsedate.c, src/parsedate.y, include/pi-macros.h, include/pi-serial.h, include/pi-socket.h: Jun 1, 1997 Kenneth Albanowski 0.6.5 Patches for OS/2 supplied by Mike Jarabek . 2000-07-30 19:20 desrod * ChangeLog, Makefile.in, Makefile.os2, dlpsh.c, parsedate.c, parsedate.y, pilot-mail.c, src/dlpsh.c, src/parsedate.c, src/parsedate.y, src/pilot-dlpsh.c, src/pilot-mail.c, include/pi-macros.h, include/pi-socket.h, include/pi-source.h, libpisock/dlp.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/utils.c: May 25, 1997 Kenneth Albanowski 0.6.4 Added pi_watchdog function to automatically tickle sockets. Modified dlpsh to use watchdog. Added get_s/set_s macros to manipulate signed Pilot values. The old routines are now officially unsigned. Modified get/set float routines to use signed macros. Added scripts/struct.pl, a first attempt at a portable structure preprocessor. Modified libsock/dlp.c to use struct.pl for ReadStorageInfo. 2000-07-30 19:18 desrod * ChangeLog, parsedate.c, parsedate.y, validate.cc, src/parsedate.c, src/parsedate.y, src/validate.cc, include/pi-datebook.hxx, include/pi-iambicExpense.hxx, libpisock/dlp.c, libpisock/serial.c: May 18, 1997 Kenneth Albanowski 0.6.3 Serial code uses PILOTPORT environment variable if a port isn't specified (but note that the included utilities do not yet make use of this.) Perl 5 module now supports GetAppPref and SetAppPref functions (only the former is tested.) Removed 'bool' from Perl 5 code. Python SetAppPref function modified to match Perl calling sequence. Added RPC calls to Python interface (check out test.py). Revised various DLP functions to check for overlarge input buffers. New C++ code revision. 2000-07-30 19:18 desrod * ChangeLog, Makefile.in, Makefile.os2, ccexample.cc, configure, configure.in, getrom.c, iambicexample.cc, parsedate.c, parsedate.y, pd-tty.c, pilot-clip.c, pilot-debug.c, pilot-mail.c, pilot-undelete, validate.cc, src/ccexample.cc, src/getrom.c, src/iambicexample.cc, src/parsedate.c, src/parsedate.y, src/pd-tty.c, src/pilot-clip.c, src/pilot-debug.c, src/pilot-mail.c, src/validate.cc, include/pi-address.h, include/pi-address.hxx, include/pi-appinfo.h, include/pi-appinfo.hxx, include/pi-args.h, include/pi-cmp.h, include/pi-datebook.h, include/pi-datebook.hxx, include/pi-dlp.h, include/pi-expense.h, include/pi-file.h, include/pi-iambicExpense.h, include/pi-iambicExpense.hxx, include/pi-macros.h, include/pi-mail.h, include/pi-memo.h, include/pi-memo.hxx, include/pi-padp.h, include/pi-serial.h, include/pi-slp.h, include/pi-socket.h, include/pi-source.h, include/pi-syspkt.h, include/pi-todo.h, include/pi-todo.hxx, libpisock/socket.c, libpisock/utils.c: May 11, 1997 Kenneth Albanowski 0.6.2 Added pilot-undelete utility to un-archive records. Needs Perl 5. Added pilot-clip to retrieve (can not yet set) the pilot's clipboard. Repaired Python SetRecord and SetResource, which were broken. Added Unpack, Pack, PackAppBlock & UnpackAppBlock methods to Python DLP object. (These automatically route to MemoUnpack, TodoUnpack, etc.) Removed all bool, true, & false from C++ code. If Perl 5 is around, use the flags it calculated for dynamically loadable code to render the libraries position independant. (Experimental/hack.) Perl and Python examples now prompt for serial port. 2000-07-30 19:16 desrod * ChangeLog, Makefile.in, Makefile.os2, addresses.c, ccexample.cc, config.uue, configure, src/addresses.c, src/ccexample.cc, configure.in, debugsh.c, dlpsh.c, getrom.c, install-memo.c, install-todos.c, install-user.c, memos.c, parsedate.c, parsedate.y, pilot-addresses.c, pilot-debug.c, pilot-dedupe.c, pilot-mail.c, pilot-prc.c, pilot-schlep.c, pilot-xfer.c, read-expenses.c, read-ical.c, read-todos.c, reminders.c, sync-memodir.c, test-acceptor.c, test-connector.c, src/debugsh.c, src/dlpsh.c, src/getrom.c, src/install-memo.c, src/install-todos.c, src/install-user.c, src/memos.c, src/parsedate.c, src/parsedate.y, src/pilot-addresses.c, src/pilot-debug.c, src/pilot-debugsh.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-install-memo.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-mail.c, src/pilot-memos.c, src/pilot-prc.c, src/pilot-read-expenses.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-schlep.c, src/pilot-xfer.c, src/read-expenses.c, src/read-ical.c, src/read-todos.c, src/reminders.c, include/pi-address.h, include/pi-appinfo.h, include/pi-config.h.in, include/pi-datebook.h, include/pi-dlp.h, include/pi-file.h, include/pi-macros.h, include/pi-memo.h, include/pi-socket.h, include/pi-source.h, include/pi-todo.h, libpisock/address.c, libpisock/datebook.c, libpisock/dlp.c, libpisock/memo.c, libpisock/pi-file.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/syspkt.c, libpisock/utils.c: Mar 4, 1997 Kenneth Albanowski 0.6.1 Perl5 support nearly complete. Documentation less so. Python support nearly complete. Documentation less so. Scott's C++ and uchar_t cleanup. DLP ResetDBIndex now resets emulated category iterator. Fixed lib/serial variable definition. Really. Fixed long-standing bug in terminating card manufacturer's name. Fixed socket code leaking file descriptors and double closing. Modified socket code to return separate fd from pi_accept(). Added suffixes and .cc definition to makefiles. Applied Mark Eichin's configure and makefile portability patches. Applied David Warren's makefile and socket portability patches. 2000-07-30 19:13 desrod * ChangeLog, Makefile.in, Makefile.os2, README, ccexample.cc, configure, configure.in, parsedate.c, parsedate.y, pd-tty.c, pilot-debug.c, pilot-mail.c, pilot-xfer.c, read-expenses.c, validate.cc, src/ccexample.cc, src/parsedate.c, src/parsedate.y, src/pd-tty.c, src/pilot-debug.c, src/pilot-mail.c, src/pilot-read-expenses.c, src/pilot-xfer.c, src/read-expenses.c, src/validate.cc, include/pi-address.h, include/pi-appinfo.h, include/pi-config.h.in, include/pi-datebook.h, include/pi-expense.h, include/pi-macros.h, include/pi-memo.h, include/pi-todo.h, libpisock/address.c, libpisock/cmp.c, libpisock/datebook.c, libpisock/dlp.c, libpisock/expense.c, libpisock/mail.c, libpisock/memo.c, libpisock/padp.c, libpisock/pi-file.c, libpisock/serial.c, libpisock/slp.c, libpisock/socket.c, libpisock/sync.c, libpisock/syspkt.c, libpisock/todo.c, libpisock/utils.c, libpisync/sync.c: Apr 28, 1997 Kenneth Albanowski 0.6.0 Primary feature: optional C++ support. If you have a C++ compiler, you'll get new code, and a new library. Added Scott Grosch's C++ code, and completely mucked up autoconf getting it to understand optional C++ code. Paul Traina's patches for pilot-mail's use of getopt. Fixed simple variable definition problem affecting SGTYY in serial.c Fixed lib/Makefile trailing slash and object duplication. Added pd-tty.c to break out tty/async display code from pilot-debug. Added GNU readline 2.0 support to pilot-debug (see Makefile). Added complete Pilot Expense application DB support. Added read-expenses program to document expenses reading. Modified lib/pi-file so it will not even attempt to install deleted records (even if the DB contains them) on an old Pilot, but will retrieve them if possible. 2000-07-30 19:02 desrod * ChangeLog, Makefile.in, Makefile.os2, README, config.uue, configure, configure.in, parsedate.c, parsedate.y, pilot-mail.c, src/parsedate.c, src/parsedate.y, src/pilot-mail.c, include/pi-address.h, include/pi-cmp.h, include/pi-config.h.in, include/pi-datebook.h, include/pi-dlp.h, include/pi-expense.h, include/pi-file.h, include/pi-macros.h, include/pi-mail.h, include/pi-memo.h, include/pi-padp.h, include/pi-serial.h, include/pi-slp.h, include/pi-socket.h, include/pi-source.h, include/pi-sync.h, include/pi-syspkt.h, include/pi-todo.h: Apr 20, 1997 Kenneth Albanowski 0.5.7 Adaption for NeXTStep and Solaris configuration problems. - Always use three arguments to fcntl. - Use bmove for memmove even if memcopy is present. 2000-07-30 19:02 desrod * ChangeLog, Makefile.in, Makefile.os2, README, configure, configure.in, install-user.c, parsedate.c, parsedate.y, pilot-addresses.c, pilot-debug.c, pilot-dedupe.c, pilot-mail.c, src/install-user.c, src/parsedate.c, src/parsedate.y, src/pilot-addresses.c, src/pilot-debug.c, src/pilot-dedupe.c, src/pilot-install-user.c, src/pilot-mail.c, include/pi-dlp.h, include/pi-mail.h, include/pi-padp.h, include/pi-source.h, include/pi-syspkt.h: Apr 13, 1997 Kenneth Albanowski 0.5.6 New pilot-mail excutable to directly support transmission and reception of internet mail through the Pilot Mail application present on newer Pilots. (Requires POP3 for reception and/or sendmail for transmission.) Fixed nasty bug in "long" DLP argument recognition. Please do not use 0.5.5. PalmOS 2.0 DLP functions DeleteCategory, ReadNextModifiedInCategory, ReadNextRecInCategory, ReadFeature, ReadAppPreference and WriteAppPreference are now emulated for 1.0 Pilots, and may be freely used where you like, regardless of OS version. (Untested) PalmOS 2.0 DLP functions repaired. (None would have worked in 0.5.5) Removed extraneous category parameter from dlp_ReadNext*Category functions. Added DLP function dlp_RPC, which allows invoking arbitrary system traps during HotSync. Fixed pilot-debug mirroring to display entire updated rectangle. Fixed uncaught decoding problem in unpack_ToDoAppInfo. DLP trace is now compiled in by default, but only activated if the PILOTDLP environment variable exists. 2000-07-30 19:00 desrod * ChangeLog, Makefile.in, Makefile.os2, README, configure, configure.in, debugsh.c, dlpsh.c, getrom.c, install-user.c, pilot-debug.c, pilot-dedupe.c, pilot-schlep.c, pilot-xfer.c, sync-memodir.c, src/debugsh.c, src/dlpsh.c, src/getrom.c, src/install-user.c, src/pilot-debug.c, src/pilot-debugsh.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-install-user.c, src/pilot-schlep.c, src/pilot-xfer.c, include/pi-cmp.h, include/pi-config.h.in, include/pi-dlp.h, include/pi-expense.h, include/pi-mail.h, include/pi-socket.h, include/pi-source.h: Apr 4, 1997 Kenneth Albanowski 0.5.5 Added Ron Nicholson's patch for user-id setting in install-user. Added Jason S Kohles's patch for excluding databases in pilot-xfer. Added pilot-schlep utility that allows you to carry a single UNIX file on your Pilot. Pilot-debug now can receive, display, enable, and disable screen updates. (Type "mirror", then show the Remote UI window, and play with the Pilot.) Modified socket code to provide real descriptors from pi_socket that last through the bind, so they are directly selectable. Serial trace is now compiled in by default, but only activated if the PILOTLOG environment variable exists. (PILOTLOGFILE sets name.) Fixed baud-rate over 9600 "problem". (Mea culpa, I had commented out a call for testing purposes. My apologies.) Fixed rbuf leak in lib/pi-file.c. (Thanks to Scott Grosch for noticing.) With the gracious help of Palm, the following PalmOS 2.0 features are supported (though not yet tested): Updated CMP logic to match 2.0 versioning (extended CMP still to-do). Updated DLP decoding to decode long args (buffering and encoding rewrite to-do). Added v2.0 ReadFeature, DeleteCategory, ReadNextRecInCategory, ReadNextModifiedRecInCategory, ReadAppPreference and WriteAppPreference DLP functions. (emulation for 1.0 Pilots to-do). Added v2.0 ReadNetSyncInfo and WriteNetSyncInfo functions (no 1.0 emulation possible.) Added v2.0 extension for CallApplication DLP function. (still works on 1.0) 2000-07-30 18:59 desrod * ChangeLog, Makefile.in, Makefile.os2, README, config.guess, config.sub, configure, configure.in, install-sh, pilot-addresses.c, pilot-debug.c, src/pilot-addresses.c, src/pilot-debug.c, include/pi-cmp.h, include/pi-socket.h, include/pi-source.h, include/pi-syspkt.h: Mar 22, 1997 Kenneth Albanowski 0.5.4 Added installation (and uninstallation) support to Makefile. Extensively reorganized pilot-debug startup, added Tcl event loop from plus-patch, and removed Tk dependancy -- pilot-debug is now usable with or without Tk! That means debugsh is officially deprecated, unless there is a significant outcry for a Tcl-less debugger. Modified syspkt RPC code to properly support byte values and pointers. Added initial support for Personal PalmPilot -- but beware the possibility of uncaught incompatibilities. Updated debugging routines in syspkt to more closely match Palm documentation -- note that this breaks my original gdb patch. 2000-07-30 18:58 desrod * ChangeLog, pilot-debug.c, src/pilot-debug.c, include/pi-syspkt.h: Mar 9, 1997 Kenneth Albanowski 0.5.3 To help gdb, expanded syspkt support. Started reorganization of pilot-debug. 2000-07-30 18:57 desrod * ChangeLog, Makefile.in, Makefile.os2, README, debugsh.c, pilot-addresses.c, pilot-debug.c, pilot-xfer.c, sync-memodir.c, src/debugsh.c, src/pilot-addresses.c, src/pilot-debug.c, src/pilot-debugsh.c, src/pilot-xfer.c, include/pi-macros.h, include/pi-serial.h, include/pi-source.h, include/pi-syspkt.h: Mar 2, 1997 Kenneth Albanowski 0.5.2 Added Pilot-debug executable -- you'll need to modify Makefile to compile it, read README for further instructions. Removed Linux DTR & RTS code, as per Ted Ts'o's request. Added Matthew Schnee's latest OS/2 patches. Changed default connection rate to 9600 from 19200. (For some reason 19200 now doesn't seem to be working on my machine. I have no idea where the problem lies, hardware or software.) Modified lib/serial code (both UNIX and OS/2 sections) to use timeouts specified in tenth seconds, allowing finer grained timeouts. This is specifically used in the syspkt code to respond faster to RPC failures. Modified lib/syspkt.c and include/pi-syspkt.h extensively to support pilot-debug. This includes new packet transmission routines and more modular RPC code. Added hack fix for deletion problem in pilot-addresses. 2000-07-30 18:55 desrod * ChangeLog, Makefile.in, Makefile.os2, configure, configure.in, debugsh.c, getrom.c, getrom.prc, install-memo.c, memos.c, pilot-addresses.c, pilot-dedupe.c, pilot-xfer.c, read-ical.c, sync-memodir.c, src/debugsh.c, src/getrom.c, src/install-memo.c, src/memos.c, src/pilot-addresses.c, src/pilot-debugsh.c, src/pilot-dedupe.c, src/pilot-install-memo.c, src/pilot-memos.c, src/pilot-read-ical.c, src/pilot-xfer.c, src/read-ical.c, src/prc/getrom.prc, include/pi-dlp.h, include/pi-macros.h, include/pi-source.h, include/pi-sync.h: Feb 23, 1997 Kenneth Albanowski 0.5.1 Added getrom executable, and included getrom.prc from CoPilot distribution with Greg Hewgill's permission. Completed data pack & unpack support for all Pilot applications. Modified headers and code (particularly dlp) to use new recordid_t typedef for record IDs. This should prevent one source of sign problems. Modified dlp headers and code to pass all buffers as void*'s instead of unsigned char *'s. Added experimental Perl5 linkage. To use, change to Perl5/PDAPilot directory, run erl Makefile.PL ; make test, and stand back. Most bits are currently missing and some bits don't work. 2000-07-30 18:54 desrod * ChangeLog, Makefile.in, Makefile.os2, README, addresses.c, configure, configure.in, debugsh.c, dlpsh.c, install-memo.c, install-todos.c, install-user.c, memos.c, pilot-addresses.c, pilot-dedupe.c, pilot-file.c, pilot-xfer.c, read-ical.c, read-todos.c, reminders.c, sync-memodir.c, test-acceptor.c, test-connector.c, src/addresses.c, src/debugsh.c, src/dlpsh.c, src/install-memo.c, src/install-todos.c, src/install-user.c, src/memos.c, src/pilot-addresses.c, src/pilot-debugsh.c, src/pilot-dedupe.c, src/pilot-dlpsh.c, src/pilot-file.c, src/pilot-install-memo.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-memos.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/pilot-xfer.c, src/read-ical.c, src/read-todos.c, src/reminders.c, include/address.h, include/cmp.h, include/datebook.h, include/dlp.h, include/memo.h, include/padp.h, include/pi-address.h, include/pi-cmp.h, include/pi-datebook.h, include/pi-dlp.h, include/pi-file.h, include/pi-macros.h, include/pi-memo.h, include/pi-padp.h, include/pi-serial.h, include/pi-slp.h, include/pi-socket.h, include/pi-source.h, include/pi-sync.h, include/pi-syspkt.h, include/pi-todo.h, include/slp.h, include/sync.h, include/syspkt.h, include/todo.h, doc/man/pilot-xfer.1: Feb 5, 1997 Kenneth Albanowski 0.5.0 Rearranged header files so they should be cleaner to externally use. Added pilot-dedupe program, which will automatically remove duplicate records from any Pilot database. (Use with caution on databases for third-party applications. It is safe to use on all of the standard databases.) Added useful serial trace. If SERIAL_TRACE is defined during compilation, then a complete trace of all serial activity (in and out) will be appended to PiDebug.log in the current directory. If you are getting low level failures of the software, please try generating one of these logs and mailing it to me (kjahds@kjahds.com) so I can attempt to find the problem. Made a few slight changes in various programs and headers to reduce miscasts. Removed -Wall flag for CC compiler. 2000-07-30 18:51 desrod * ChangeLog, Makefile.in, Makefile.os2, README, addresses.c, config.guess, config.sub, configure, configure.in, dlpsh.c, install-memo.c, install-sh, pilot-addresses.c, pilot-xfer.c, src/addresses.c, src/dlpsh.c, src/install-memo.c, src/pilot-addresses.c, src/pilot-dlpsh.c, src/pilot-install-memo.c, src/pilot-xfer.c, include/address.h, include/pi-config.h.in, include/pi-socket.h: Jan 18, 1997 Kenneth Albanowski 0.4.3 Modified configure support for NeXT and OS/2. Added pilot-addresses program, a program designed to translate between a comma-separated-value format and the Pilot address book. In theory the format is compatible with the Palm Desktop import/export format. An "a" switch (Advanced/Augment) is available to output more data in a Desktop incompatible format. This software may be buggy! Always back up the DatebookDB database before installing records! Modified pilot-xfer to sort databases during Restore to put applications after their data, and larger records after smaller ones. Modified pilot-xfer to clear lastsyncpc value so that a fast sync will not be done with possibly missing sync flags on newly installed DBs. Added lib/address.c & addresses.c patches to simplify phone label storage. Added -c switch to install-memo.c Added stub README. 2000-07-30 18:49 desrod * ChangeLog, dlpsh.c, pilot-file.c, src/dlpsh.c, src/pilot-dlpsh.c, src/pilot-file.c, include/datebook.h, include/pi-file.h, include/pi-serial.h, include/sync.h: Jan 9, 1997 Kenneth Albanowski 0.4.2 Applied Pace's rm_fn patch, and pi-file patch for freads and attrs. My patch to return correct DLP errors. Probably some other stuff that I've forgotton. 2000-07-30 18:48 desrod * ChangeLog, Makefile.in, Makefile.os2, configure, configure.in, install-user.c, pilot-xfer.c, read-ical.c, src/install-user.c, src/pilot-install-user.c, src/pilot-read-ical.c, src/pilot-xfer.c, src/read-ical.c, include/dlp.h, include/pi-socket.h, include/syspkt.h: Dec 30, 1996 Kenneth Albanowski 0.4.1 Got sync-ical functional. It's very messy, but parts of it do actually work. Added new trace code to lib/dlp. Enable with -DDLP_TRACE in makefile. Added remaining DLP functions. All but RPC are now implemented (and I have not been able to deduce how to invoke RPC under DLP, so it will stay unimplemented until somebody comes up with more information.) Pace's patch for dlp_ReadRecordIDList. Added patch to pi-file to successfully store zero-length records. _Also_ added patch to stop ignore records on database retrieval that are archived or deleted. The reason is that without going to the RPC layer, there is no way to store records with those attributes. Mucked about with getopt in pilot-xfer, hopefully for the better. Added uname detection to configure so that IRIX gets proper warning flag. -- sync code still in limbo, undoubtedly not helped by holiday season. Patience is a virtue. 2000-07-30 18:46 hacker * .lclintrc: Dec 22, 1996 Kenneth Albanowski 0.4.0 Removed {install,retrieve}-{pdb,prc} packages, replaced with pilot-xfer, which also includes general backup and listing functions. Integrated Pace Willisson's pi-file code, replacing prc.c & pdb.c. (This new code, along with pilot-xfer, is intended to be production quality, and should be used as the basis for all attempts to manipulate Pilot files, as well as the stock mechanism for backing up a Pilot via Unix.) Added Pace's pdump, modified and renamed to pilot-file, which is used for dumping and exploring .pdb and .prc files. Wrote and tested sync.c abstract synchronization layer. All but category synchronization and the detail of when to use which sync type is implemented. Fleshed out sync-memodir program which can now successfully synchronize a Pilot with a "memo directory", a directory containing text files. (sync-ical is still useless stub) Integrated Bill Sommerfeld's patches for read-ical, padp, and syspkt. -- Removed sync code based on Palm algorithms, pending approval from Palm/USR. What remains is sufficient to overwrite one side with another, and to serve as a framework if people who have not seen Palm code want to implement their own algorithms. Quoting from lib/sync.c: * Revised revision: all sections of code directly derived (albeit in a * paraphased manner) from code in the Palm Conduit SDK, _which are not * blatently obvious and irreducible_ have been temporarily removed until * word is obtained from Palm that the code may be publically released. * * The issue that needs to be resolved is whether Palm Computing Inc. will * allow the public distribution of source code derived from source code in * their Pilot PC Conduit SDK. The licensing information that I recieved * with the PC and Mac SDKs is not sufficient to resolve this question. * * In keeping with the sprit of the EU practice for reverse engineering, the * interface that I have designed to plug into the Palm algorithms has been * retained. 2000-07-30 18:46 desrod * ChangeLog, Makefile.in, Makefile.os2, configure, configure.in, dlpsh.c, install-pdb.c, install-prc.c, pilot-file.c, pilot-xfer.c, read-ical.c, retrieve-pdb.c, retrieve-prc.c, sync-memodir.c, src/dlpsh.c, src/pilot-dlpsh.c, src/pilot-file.c, src/pilot-read-ical.c, src/pilot-xfer.c, src/read-ical.c, include/dlp.h, include/pdb.h, include/pi-config.h.in, include/pi-file.h, include/pi-socket.h, include/prc.h, include/sync.h, doc/man/pilot-xfer.1: Dec 22, 1996 Kenneth Albanowski 0.4.0 Removed {install,retrieve}-{pdb,prc} packages, replaced with pilot-xfer, which also includes general backup and listing functions. Integrated Pace Willisson's pi-file code, replacing prc.c & pdb.c. (This new code, along with pilot-xfer, is intended to be production quality, and should be used as the basis for all attempts to manipulate Pilot files, as well as the stock mechanism for backing up a Pilot via Unix.) Added Pace's pdump, modified and renamed to pilot-file, which is used for dumping and exploring .pdb and .prc files. Wrote and tested sync.c abstract synchronization layer. All but category synchronization and the detail of when to use which sync type is implemented. Fleshed out sync-memodir program which can now successfully synchronize a Pilot with a "memo directory", a directory containing text files. (sync-ical is still useless stub) Integrated Bill Sommerfeld's patches for read-ical, padp, and syspkt. -- Removed sync code based on Palm algorithms, pending approval from Palm/USR. What remains is sufficient to overwrite one side with another, and to serve as a framework if people who have not seen Palm code want to implement their own algorithms. Quoting from lib/sync.c: * Revised revision: all sections of code directly derived (albeit in a * paraphased manner) from code in the Palm Conduit SDK, _which are not * blatently obvious and irreducible_ have been temporarily removed until * word is obtained from Palm that the code may be publically released. * * The issue that needs to be resolved is whether Palm Computing Inc. will * allow the public distribution of source code derived from source code in * their Pilot PC Conduit SDK. The licensing information that I recieved * with the PC and Mac SDKs is not sufficient to resolve this question. * * In keeping with the sprit of the EU practice for reverse engineering, the * interface that I have designed to plug into the Palm algorithms has been * retained. 2000-07-30 18:43 desrod * ChangeLog, Makefile, Makefile.in, Makefile.os2, addresses.c, configure, configure.in, debugsh.c, dlpsh.c, install-memo.c, install-pdb.c, install-prc.c, install-todos.c, install-user.c, memos.c, read-ical.c, read-todos.c, reminders.c, retrieve-pdb.c, retrieve-prc.c, test-acceptor.c, test-connector.c, src/addresses.c, src/debugsh.c, src/dlpsh.c, src/install-memo.c, src/install-todos.c, src/install-user.c, src/memos.c, src/pilot-debugsh.c, src/pilot-dlpsh.c, src/pilot-install-memo.c, src/pilot-install-todos.c, src/pilot-install-user.c, src/pilot-memos.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/read-ical.c, src/read-todos.c, src/reminders.c, include/cmp.h, include/padp.h, include/pi-config.h.in, include/pi-serial.h, include/pi-socket.h, include/slp.h, include/sync.h, include/syspkt.h: Dec 1, 1996 Kenneth Albanowski 0.3.2 Converted package to use autoconf for configuration. Cleaned up package so -Wall is clean. Added sync-ical stub. It does not do anything useful yet. 2000-07-30 18:42 desrod * ChangeLog, Makefile, dlpsh.c, install-pdb.c, install-prc.c, install-todos.c, read-ical.c, read-todos.c, reminders.c, retrieve-pdb.c, retrieve-prc.c, todos.c, src/dlpsh.c, src/install-todos.c, src/pilot-dlpsh.c, src/pilot-install-todos.c, src/pilot-read-ical.c, src/pilot-read-todos.c, src/pilot-reminders.c, src/read-ical.c, src/read-todos.c, src/reminders.c, include/cmp.h, include/dlp.h, include/padp.h, include/pdb.h, include/pi-serial.h, include/pi-socket.h, include/prc.h, doc/man/read-ical.1: Nov 25, 1996 Kenneth Albanowski 0.3.1 Integrated Ulrich Hertlein's SunOS patches (in slightly changed form). Integrated Matthew Schnee's final OS/2 patches (in slightly changed form). Added install-pdb, retrieve-prc, and retrieve-pdb. Added read-ical, which converts the Pilot's datebook and todo list into an Ical 2.x calendar. Renamed todos to read-todos to avoid conflict with common utility. Added Robert A. Kaplan's install-todos (slightly modified and renamed.) Got rid of CBAUD and memmove, defined ENOMSG if not present. Fixed PADP bug where unexpected packet in padp_rx would cause infinite loop. 2000-07-30 18:41 desrod * ChangeLog, Makefile, addresses.c, memos.c, todos.c, src/addresses.c, src/memos.c, src/pilot-memos.c, include/address.h, include/datebook.h, include/dlp.h, include/memo.h, include/padp.h, include/pi-serial.h, include/pi-socket.h, include/sync.h, include/todo.h: Nov 12, 1996 Kenneth Albanowski 0.3.0 Integrated David Morgan's mktime and indefinite todo patch Integrated my patches - AppInfo block support for all Pilot applications - new "addresses" end user program - new "todos" end user program Rewrote PADP to match USR specs Rewrote xid generation as part of PADP rewrite, and made it always an unsigned character Added stub lib/sync.c Added dependencies in lib/Makefile 2000-07-30 18:39 desrod * ChangeLog, Makefile, debugsh.c, install-prc.c, memos.c, reminders.c, test-debug.c, src/debugsh.c, src/memos.c, src/pilot-debugsh.c, src/pilot-memos.c, src/pilot-reminders.c, src/reminders.c, include/address.h, include/datebook.h, include/dlp.h, include/memo.h, include/pi-socket.h, include/syspkt.h, include/todo.h: Nov 1, 1996 D. Jeff Dionne 0.2.4 Integrated 5 patches from Kenneth Albanowski - RPC - new "debugsh" program that talks to Pilot over RPC - cleanup of "system packets" - new "memo" end user program - new "remind" end user program Limit the generated value of xid in padp_tx to 0x7f, hopfully will fix the problems with long running syncs. DJD. accept() now blocks insted of listen(). DJD. padp will now re-assemble fragments. DJD. install-prc now updates the Pilot display as it goes along. DJD. 2000-07-30 18:38 desrod * ChangeLog, Makefile, dlpsh.c, install-memo.c, install-prc.c, install-user.c, test-acceptor.c, test-connector.c, test-debug.c, src/dlpsh.c, src/install-memo.c, src/install-user.c, src/pilot-dlpsh.c, src/pilot-install-memo.c, src/pilot-install-user.c, include/dlp.h, include/padp.h, include/pi-serial.h, include/pi-socket.h, include/syspkt.h, doc/man/dlpsh.1, doc/man/install-memo.1: Oct 24, 1996 D. Jeff Dionne 0.2.3 Integrated patches for "system packets" from Kenneth Albanowski - new program, test-debug Integrated patches for OS2 support (mostly serial.c) f/ Matthew Schnee Integrated patches for SGI from David S. Warren Integrated patches from Damien P. Neil - new program, dlpsh - fixed bug in padp.c for Pilot re-transmit - install-memo now writes userid for compatibilty with Windows. - check return values from socket calls. - Swapped the slp_rx and pi_socket_flush in pi_socket_read() - Wrote a man page for install-memo and dlpsh 2000-07-30 18:37 desrod * ChangeLog, Makefile, install-memo.c, install-prc.c, install-user.c, test-acceptor.c, test-connector.c, src/install-memo.c, src/install-user.c, src/pilot-install-memo.c, src/pilot-install-user.c, include/cmp.h, include/dlp.h, include/prc.h: Oct 19, 1996 D. Jeff Dionne 0.2.2 Integrated a patch from Kenneth Albanowski - More DLP code. - Socket fixes. - prcread complete re-write using DLP. - test server and client using ptys 2000-07-30 18:36 desrod * ChangeLog, DB-sync.c, Makefile, all-sync.c, cmp.c, cmp.h, dlp.c, dlp.h, install-memo.c, install-prc.c, install-user.c, padp.c, padp.h, pi-socket.h, prc.h, prcread.c, serial.c, slp.c, slp.h, socket.c, test_c.c, test_s.c, utils.c, src/install-memo.c, src/install-user.c, src/pilot-install-memo.c, src/pilot-install-user.c, include/cmp.h, include/dlp.h, include/padp.h, include/pi-socket.h, include/prc.h, include/slp.h, doc/man/install-memo.1, doc/man/install-user.1: Oct 16, 1996 D. Jeff Dionne 0.2.1 moved the parts of libpisock.a to a seperate directory moved the include files to a seperate directory creates a few simple man pages, in a seperate directory install-memo installs all files on the command line. install-user new program, reads or sets Pilot user name Attempted to reconstruct history for this ChangeLog. All previous ChangeLog entries are approximate, and short. 2000-07-30 18:33 desrod * COPYING, Makefile, cmp.c, cmp.h, dlp.c, dlp.h, install-memo.c, install-prc.c, pi-socket.h, serial.c, socket.c, test_c.c, test_s.c, src/install-memo.c, src/pilot-install-memo.c: Oct 15, 1996 D. Jeff Dionne 0.2.0 Integrated 2 patches for DLP from Kenneth Albanowski Integrated 1 patch for CMP from Kenneth Albanowski Integrated 1 patch for install-memo from Brian Added install-memo from Damien Neil Included COPYING license file from FSF 2000-07-30 18:32 desrod * DB-sync.c, Makefile, all-sync.c, install-prc.c, main.c, padp.c, pi-socket.h, prc.h, prcread.c, serial.c, slp.c, socket.c, test_s.c: Oct 8, 1996 D. Jeff Dionne 0.1.0 First functional release. 2000-07-30 18:31 desrod * DB-sync.c, Makefile, address-db.c, all-sync.c, datebook-db.c, foo.log, memo-db.c, test_s.c: Updated the sources to 0.0.2, incuded tagged branch. 2000-07-30 18:28 desrod * Makefile, address-db.c, datebook-db.c, foo.log, main.c, memo-db.c, padp.c, padp.h, pi-socket.h, serial.c, slp.c, slp.h, socket.c, test_c.c, test_s.c, utils.c: Initial import of 0.0.1 sources into tagged branches 2000-07-30 18:28 desrod * Makefile, address-db.c, datebook-db.c, foo.log, main.c, memo-db.c, padp.c, padp.h, pi-socket.h, serial.c, slp.c, slp.h, socket.c, test_c.c, test_s.c, utils.c: Initial revision pilot-link-0.12.5-dfsg/tests/0000755000175000017500000000000011333433324016241 5ustar rousseaurousseaupilot-link-0.12.5-dfsg/tests/contactsdb-test.c0000644000175000017500000001621411206407420021507 0ustar rousseaurousseau/* * contactsdb-test.c: Playing around with palmOne's ContactsDB-PAdd * * Written by T. Joseph Carter * * This program is released to the public domain where allowed by law. Some * countries (eg, the United States) lack legal provision for releasing * Copyright claims. In such jurisdictions you are licensed to use, modify, * and distribute this program as you see fit. This program is released * WITHOUT ANY WARRANTY, including the implied warranties of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. * * These terms do NOT apply to libpisock, which is covered by the GNU Library * General Public License. Please see the GNU LGPL for details. */ #include #include #include #ifdef HAVE_STDINT_H #include #endif #include #include #include #include "popt.h" #include "pi-socket.h" #include "pi-dlp.h" #include "pi-header.h" #include "pi-appinfo.h" #include "pi-contact.h" #undef PRINT_USELESS_INFO #undef SAVE_PICTURES #define hi(x) (((x) >> 4) & 0x0f) #define lo(x) ((x) & 0x0f) char *contacts_fields[] = { "Last name", "First name", "Company", "Title", "Phone 1", "Phone 2", "Phone 3", "Phone 4", "Phone 5", "Phone 6", "Phone 7", "Messaging 1", "Messaging 2", "Website", "Custom 1", "Custom 2", "Custom 3", "Custom 4", "Custom 5", "Custom 6", "Custom 7", "Custom 8", "Custom 9", "Address 1", "City", "State", "Zip", "Country", "Address 2", "City", "State", "Zip", "Country", "Address 3", "City", "State", "Zip", "Country", "Note" }; char *contacts_phones[] = { "Phone (Work)", "Phone (Home)", "Phone (Fax)", "Phone (Other)", "Email", "Phone (Main)", "Phone (Pager)", "Phone (Mobile)" }; char *contacts_ims[] = { "IM", "AIM", "MSN IM", "Yahoo IM", "ICQ" }; char *contacts_addrs[] = { "Addr (Work)", "Addr (Home)", "Addr (Other)" }; /* This is ugly, but it works */ void hexprint (unsigned char *data, size_t len, size_t ofs, int ascii) { int i, j; int line; line = ofs; i = 0; while (i < len) { printf (" %08X:", line); for (j = 0; j < 16; j++, i++) { if (i < len) printf (" %02X", data[i]); else printf (" "); if (j == 7) printf (" "); } if (ascii) { printf (" |"); i -= 16; for (j = 0; j < 16; j++, i++) { if (i < len) { if (isprint(data[i])) printf ("%c", data[i]); else printf ("."); } else printf (" "); } printf ("|\n"); } else printf ("\n"); line += 16; } } int print_appblock (int sd, int db, struct ContactAppInfo *cai) { int i; size_t j; pi_buffer_t *appblock = pi_buffer_new(0xffff); if (dlp_ReadAppBlock(sd, db, 0, -1, appblock) <= 0) goto error; if (unpack_ContactAppInfo (cai, appblock) < 0) goto error; pi_buffer_free (appblock); printf ("Categories:\n"); for (i = 0; i < 16; i++) { if (strlen(cai->category.name[i]) > 0) printf (" Category %i: %s\n", cai->category.ID[i], cai->category.name[i]); } printf (" Last Unique ID: %i\n", cai->category.lastUniqueID); printf ("\nCustom labels"); for (i = 0; i < cai->numCustoms; i++) { if (i%4 == 0) printf ("\n "); printf ("%02i:%-16s ", i, cai->customLabels[i]); } if (i%4 != 0) printf ("\n"); /* Fair enough for a test to print opaque data.. */ if (cai->internal != NULL) { printf ("\nInternal data (opaque)\n"); hexprint ((unsigned char *)cai->internal, sizeof(cai->internal), 0, 0); } printf ("\nField labels"); i = 0; for (j = 0; j < cai->num_labels; j++) { if (i%4 == 0) printf ("\n "); printf ("%02i:%-16s ", i++, cai->labels[j]); } if (i%4 != 0) printf ("\n"); printf ("\nCountry: %i\n", cai->country); printf ("Sorting: %s\n\n", cai->sortByCompany ? "By company" : "By name"); return 0; error: pi_buffer_free(appblock); return -1; } void print_records (int sd, int db, struct ContactAppInfo *cai) { char *l; struct Contact c; int i, idx, attr, category; recordid_t recid; pi_buffer_t *buf; buf = pi_buffer_new (0xffff); for (idx = 0; /**/; idx++) { if (dlp_ReadRecordByIndex (sd, db, idx, buf, &recid, &attr, &category) < 0) break; printf ("\nRecord 0x%04x\n", (unsigned int)recid); printf (" Category : %i\n", category); printf (" Attributes : %c%c%c%c%c\n", attr & dlpRecAttrDeleted ? 'X' : '-', attr & dlpRecAttrArchived ? 'A' : '-', attr & dlpRecAttrSecret ? 'S' : '-', attr & dlpRecAttrBusy ? 'B' : '-', attr & dlpRecAttrDirty ? 'd' : '-'); printf (" Length : %zu\n", buf->used); if (buf->used == 0) /* Empty records are legal */ continue; if (unpack_Contact (&c, buf, cai->type) < 0) { printf (" [Broken record]\n"); continue; } #if PRINT_USELESS_INFO printf (" Phone labels: { %i, %i, %i, %i, %i, %i, %i }" " (showing [%i])\n", c.phoneLabel[0], c.phoneLabel[1], c.phoneLabel[2], c.phoneLabel[3], c.phoneLabel[4], c.phoneLabel[5], c.phoneLabel[6], c.showPhone); printf (" Address labels: { %i, %i, %i }\n", c.addressLabel[0], c.addressLabel[1], c.addressLabel[2]); printf (" IM labels: { %i, %i }\n", c.IMLabel[0], c.IMLabel[1]); #endif /* PRINT_USELESS_INFO */ for (i = 0; i < NUM_CONTACT_ENTRIES; i++) { if (c.entry[i] != NULL) { /* Special cases are annoying.. */ if (i > 3 && i < 11) l = contacts_phones[c.phoneLabel[i - 4]]; else if (i == 11 || i == 12) l = contacts_ims[c.IMLabel[i - 11]]; else if (i == 23) l = contacts_addrs[c.addressLabel[0]]; else if (i == 28) l = contacts_addrs[c.addressLabel[1]]; else if (i == 33) l = contacts_addrs[c.addressLabel[2]]; else l = contacts_fields[i]; printf (" %-15s: %s\n", l, c.entry[i]); } } if (c.birthdayFlag) { printf (" Birthday : %i-%02i-%02i", c.birthday.tm_year + 1900, c.birthday.tm_mon + 1, c.birthday.tm_mday); if (c.reminder) printf (" (%i day reminder)", c.advance); puts (""); } if (c.picture != NULL) { #ifdef SAVE_PICTURES char fname[25]; FILE *f; snprintf (fname, 24, "rec-%lu.jpeg", (uint32_t)recid); printf (" Picture : %s\n", fname); f = fopen (fname, "wb"); if (f) { fwrite (c.picture->data, c.picture->length, 1, f); fclose (f); } #else printf (" Picture : JPEG (%zu bytes)\n", c.picture->length); #endif /* SAVE_PICTURES */ } free_Contact (&c); } pi_buffer_free (buf); return; } int main (const int argc, const char **argv) { int sd = -1; int db; struct ContactAppInfo cai; if (argc != 2) { fprintf (stderr, "Usage: contactsdb-test \n"); return 1; } sd = pilot_connect (argv[1]); if (sd < 0) goto error; if (dlp_OpenConduit (sd) < 0) goto error; if (dlp_OpenDB(sd, 0, dlpOpenRead, "ContactsDB-PAdd", &db) < 0) { fprintf (stderr, "Unable to open Contacts database\n"); goto error; } if (print_appblock (sd, db, &cai) < 0) { fprintf (stderr, "Failed read/print appblock\n"); goto error; } else { print_records (sd, db, &cai); } free_ContactAppInfo (&cai); dlp_CloseDB(sd, db); dlp_EndOfSync (sd, 0); pi_close (sd); error: if (sd != -1) pi_close (sd); return 1; } pilot-link-0.12.5-dfsg/tests/Makefile.in0000644000175000017500000005532511333433244020321 0ustar rousseaurousseau# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ target_triplet = @target@ noinst_PROGRAMS = calendardb-test$(EXEEXT) locationdb-test$(EXEEXT) \ contactsdb-test$(EXEEXT) dlp-test$(EXEEXT) \ versamail-test$(EXEEXT) vfs-test$(EXEEXT) check_PROGRAMS = packers$(EXEEXT) TESTS = packers$(EXEEXT) subdir = tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/bluez.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/tcl.m4 \ $(top_srcdir)/m4/threads.m4 \ $(top_srcdir)/m4/vl_lib_readline.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/include/pi-md5.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_calendardb_test_OBJECTS = calendardb-test.$(OBJEXT) calendardb_test_OBJECTS = $(am_calendardb_test_OBJECTS) calendardb_test_DEPENDENCIES = $(top_builddir)/libpisock/libpisock.la am_contactsdb_test_OBJECTS = contactsdb-test.$(OBJEXT) contactsdb_test_OBJECTS = $(am_contactsdb_test_OBJECTS) contactsdb_test_DEPENDENCIES = $(top_builddir)/libpisock/libpisock.la am_dlp_test_OBJECTS = dlp-test.$(OBJEXT) dlp_test_OBJECTS = $(am_dlp_test_OBJECTS) dlp_test_DEPENDENCIES = $(top_builddir)/libpisock/libpisock.la am_locationdb_test_OBJECTS = locationdb-test.$(OBJEXT) locationdb_test_OBJECTS = $(am_locationdb_test_OBJECTS) locationdb_test_DEPENDENCIES = $(top_builddir)/libpisock/libpisock.la am_packers_OBJECTS = packers.$(OBJEXT) packers_OBJECTS = $(am_packers_OBJECTS) packers_DEPENDENCIES = $(top_builddir)/libpisock/libpisock.la am_versamail_test_OBJECTS = versamail-test.$(OBJEXT) versamail_test_OBJECTS = $(am_versamail_test_OBJECTS) versamail_test_DEPENDENCIES = $(top_builddir)/libpisock/libpisock.la am_vfs_test_OBJECTS = vfs-test.$(OBJEXT) vfs_test_OBJECTS = $(am_vfs_test_OBJECTS) vfs_test_DEPENDENCIES = $(top_builddir)/libpisock/libpisock.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(calendardb_test_SOURCES) $(contactsdb_test_SOURCES) \ $(dlp_test_SOURCES) $(locationdb_test_SOURCES) \ $(packers_SOURCES) $(versamail_test_SOURCES) \ $(vfs_test_SOURCES) DIST_SOURCES = $(calendardb_test_SOURCES) $(contactsdb_test_SOURCES) \ $(dlp_test_SOURCES) $(locationdb_test_SOURCES) \ $(packers_SOURCES) $(versamail_test_SOURCES) \ $(vfs_test_SOURCES) ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLUEZ_CFLAGS = @BLUEZ_CFLAGS@ BLUEZ_LIBS = @BLUEZ_LIBS@ CAT_ENTRY_END = @CAT_ENTRY_END@ CAT_ENTRY_START = @CAT_ENTRY_START@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOCBOOK_ROOT = @DOCBOOK_ROOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CFLAGS = @ICONV_CFLAGS@ ICONV_LIBS = @ICONV_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVA = @JAVA@ JAVABASE = @JAVABASE@ JAVAC = @JAVAC@ JAVA_VERSION = @JAVA_VERSION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PIC_LIBS = @PIC_LIBS@ PILOT_LINK_MAJOR = @PILOT_LINK_MAJOR@ PILOT_LINK_MINOR = @PILOT_LINK_MINOR@ PILOT_LINK_PATCH = @PILOT_LINK_PATCH@ PILOT_LINK_VERS = @PILOT_LINK_VERS@ PISOCK_AGE = @PISOCK_AGE@ PISOCK_CURRENT = @PISOCK_CURRENT@ PISOCK_REVISION = @PISOCK_REVISION@ PISYNC_AGE = @PISYNC_AGE@ PISYNC_CURRENT = @PISYNC_CURRENT@ PISYNC_REVISION = @PISYNC_REVISION@ PKG_CONFIG = @PKG_CONFIG@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ POPT_INCLUDES = @POPT_INCLUDES@ POPT_LIBS = @POPT_LIBS@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_H = @PYTHON_H@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RL_LIBS = @RL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ XML_CATALOG = @XML_CATALOG@ XSLTPROC = @XSLTPROC@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ builddir = @builddir@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ usb_libs = @usb_libs@ INCLUDES = \ -I../include \ -I$(top_srcdir)/include \ $(POPT_INCLUDES) calendardb_test_SOURCES = \ calendardb-test.c calendardb_test_LDADD = \ $(top_builddir)/libpisock/libpisock.la locationdb_test_SOURCES = \ locationdb-test.c locationdb_test_LDADD = \ $(top_builddir)/libpisock/libpisock.la contactsdb_test_SOURCES = \ contactsdb-test.c contactsdb_test_LDADD = \ $(top_builddir)/libpisock/libpisock.la dlp_test_SOURCES = \ dlp-test.c dlp_test_LDADD = \ $(top_builddir)/libpisock/libpisock.la vfs_test_SOURCES = \ vfs-test.c vfs_test_LDADD = \ $(top_builddir)/libpisock/libpisock.la versamail_test_SOURCES = \ versamail-test.c versamail_test_LDADD = \ $(top_builddir)/libpisock/libpisock.la packers_SOURCES = \ packers.c packers_LDADD = \ $(top_builddir)/libpisock/libpisock.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/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 $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list calendardb-test$(EXEEXT): $(calendardb_test_OBJECTS) $(calendardb_test_DEPENDENCIES) @rm -f calendardb-test$(EXEEXT) $(LINK) $(calendardb_test_OBJECTS) $(calendardb_test_LDADD) $(LIBS) contactsdb-test$(EXEEXT): $(contactsdb_test_OBJECTS) $(contactsdb_test_DEPENDENCIES) @rm -f contactsdb-test$(EXEEXT) $(LINK) $(contactsdb_test_OBJECTS) $(contactsdb_test_LDADD) $(LIBS) dlp-test$(EXEEXT): $(dlp_test_OBJECTS) $(dlp_test_DEPENDENCIES) @rm -f dlp-test$(EXEEXT) $(LINK) $(dlp_test_OBJECTS) $(dlp_test_LDADD) $(LIBS) locationdb-test$(EXEEXT): $(locationdb_test_OBJECTS) $(locationdb_test_DEPENDENCIES) @rm -f locationdb-test$(EXEEXT) $(LINK) $(locationdb_test_OBJECTS) $(locationdb_test_LDADD) $(LIBS) packers$(EXEEXT): $(packers_OBJECTS) $(packers_DEPENDENCIES) @rm -f packers$(EXEEXT) $(LINK) $(packers_OBJECTS) $(packers_LDADD) $(LIBS) versamail-test$(EXEEXT): $(versamail_test_OBJECTS) $(versamail_test_DEPENDENCIES) @rm -f versamail-test$(EXEEXT) $(LINK) $(versamail_test_OBJECTS) $(versamail_test_LDADD) $(LIBS) vfs-test$(EXEEXT): $(vfs_test_OBJECTS) $(vfs_test_DEPENDENCIES) @rm -f vfs-test$(EXEEXT) $(LINK) $(vfs_test_OBJECTS) $(vfs_test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/calendardb-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contactsdb-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dlp-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/locationdb-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/packers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/versamail-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs-test.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ echo "$$grn$$dashes"; \ else \ echo "$$red$$dashes"; \ fi; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes$$std"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) installdirs: 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-checkPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-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: pilot-link-0.12.5-dfsg/tests/dlp-test.c0000644000175000017500000005360610474335350020160 0ustar rousseaurousseau/* * dlp-test.c: DLP Regression Test * * (c) 2002, JP Rosevear. * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * * * This regression test calls every DLP function except the following: * dlp_CallApplication * dlp_ResetSystem * dlp_ProcessRPC */ #include #include "pi-debug.h" #include "pi-source.h" #include "pi-dlp.h" /* Prototypes */ int pilot_connect(char *port); /* For various protocol versions, set to 0 to not test those versions */ #define DLP_1_1 1 #define DLP_1_2 1 /* Logging defines */ #define CHECK_RESULT(func) \ if (result < 0) { \ LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST " #func " failed (%d)\n", result)); \ goto error; \ } /* Utility defines */ #define pi_mktag(c1,c2,c3,c4) (((c1)<<24)|((c2)<<16)|((c3)<<8)|(c4)) #define CREATOR pi_mktag('T', 'e', 's', 't') #define DATA pi_mktag('D', 'A', 'T', 'A') #define INFO pi_mktag('I', 'N', 'F', 'O') int main (int argc, char **argv) { int sd; int result; struct SysInfo s; struct PilotUser u1, u2; struct NetSyncInfo n1, n2; struct CardInfo c; struct DBInfo dbi; struct DBSizeInfo dbsi; unsigned long romVersion; time_t t1, t2; int handle; unsigned char pref1[256], pref2[256]; unsigned char ablock1[256]; unsigned char sblock1[256]; unsigned char ires1[256]; unsigned char dres1[256]; unsigned char record1[256], record2[256], record3[256]; recordid_t rid1, rid2, rid3, rlist[4]; int index, id_, count; unsigned long type; int cardno; int i; pi_buffer_t *record4, *dres2, *ires2, *appblock; record4 = pi_buffer_new (sizeof(record1)); ires2 = pi_buffer_new (sizeof (ires1)); dres2 = pi_buffer_new (sizeof (dres1)); appblock = pi_buffer_new(256); sd = pilot_connect (argv[1]); t1 = time (NULL); LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "DLPTEST Starting at %s", ctime (&t1))); /********************************************************************* * * Test: Open Conduit * * Direct Testing Functions: * dlp_OpenConduit * * Indirect Testing Functions: * None * *********************************************************************/ result = dlp_OpenConduit (sd); CHECK_RESULT(dlp_OpenConduit); /********************************************************************* * * Test: System Information * * Direct Testing Functions: * dlp_ReadSysInfo * * Indirect Testing Functions: * None * *********************************************************************/ result = dlp_ReadSysInfo (sd, &s); CHECK_RESULT(dlp_ReadSysInfo); /********************************************************************* * * Test: User Info * * Direct Testing Functions: * dlp_WriteUserInfo * dlp_ReadUserInfo * * Indirect Testing Functions: * None * *********************************************************************/ memset (&u1, '\0', sizeof (struct PilotUser)); memset (&u2, '\0', sizeof (struct PilotUser)); u1.passwordLength = 0; strcpy (u1.username, "Test User"); strcpy (u1.password, ""); u1.userID = 500; u1.viewerID = 5000; u1.lastSyncPC = 111111; u1.successfulSyncDate = time(NULL); u1.lastSyncDate = time(NULL) + 100; result = dlp_WriteUserInfo (sd, &u1); CHECK_RESULT(dlp_WriteUserInfo); result = dlp_ReadUserInfo (sd, &u2); CHECK_RESULT(dlp_ReadUserInfo); if (memcmp(&u1, &u2, sizeof(struct PilotUser) != 0)) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST User info mismatch\n")); goto error; } /********************************************************************* * * Test: Feature * * Direct Testing Functions: * dlp_ReadFeature * * Indirect Testing Functions: * None * *********************************************************************/ romVersion = 0; result = dlp_ReadFeature(sd, makelong("psys"), 1, &romVersion); CHECK_RESULT(dlp_ReadFeature); if (romVersion != s.romVersion) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Rom Version mismatch\n")); goto error; } /********************************************************************* * * Test: Net Sync Info * * Direct Testing Functions: * dlp_WriteNetSyncInfo * dlp_ReadNetSyncInfo * * Indirect Testing Functions: * None * *********************************************************************/ #if DLP_1_1 memset (&n1, '\0', sizeof (struct NetSyncInfo)); memset (&n2, '\0', sizeof (struct NetSyncInfo)); n1.lanSync = 0; strcpy (n1.hostName, "localhost"); strcpy (n1.hostAddress, "192.168.1.1"); strcpy (n1.hostSubnetMask, "255.255.255.0"); result = dlp_WriteNetSyncInfo (sd, &n1); CHECK_RESULT(dlp_WriteNetSyncInfo); result = dlp_ReadNetSyncInfo (sd, &n2); CHECK_RESULT(dlp_ReadNetSyncInfo); if (memcmp(&n1, &n2, sizeof(struct NetSyncInfo) != 0)) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Net sync info mismatch\n")); goto error; } #endif /********************************************************************* * * Test: Time * * Direct Testing Functions: * dlp_SetSysDateTime * dlp_GetSysDateTime * * Indirect Testing Functions: * None * *********************************************************************/ t1 = time(NULL); dlp_SetSysDateTime (sd, t1); CHECK_RESULT(dlp_SetSysDateTime); dlp_GetSysDateTime (sd, &t2); CHECK_RESULT(dlp_GetSysDateTime); if (t2 > t1 + 1) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST System Time Mismatch\n")); goto error; } /********************************************************************* * * Test: Storage Information * * Direct Testing Functions: * dlp_ReadStorageInfo * * Indirect Testing Functions: * None * *********************************************************************/ c.more = 1; for (i = 0; c.more != 0; i++) { result = dlp_ReadStorageInfo (sd, i, &c); CHECK_RESULT(dlp_ReadStorageInfo); } /********************************************************************* * * Test: Database List * * Direct Testing Functions: * dlp_ReadDBList * * Indirect Testing Functions: * None * *********************************************************************/ dbi.more = 1; for (i = 0; dbi.more != 0; i++) { result = dlp_ReadDBList (sd, 0, dlpDBListRAM | dlpDBListROM, i, record4); CHECK_RESULT(dlp_ReadDBList); memcpy(&dbi, record4->data, sizeof(struct DBInfo)); } /********************************************************************* * * Test: Existing Database * * Direct Testing Functions: * dlp_OpenDB * dlp_CloseDB * * Indirect Testing Functions: * None * *********************************************************************/ result = dlp_OpenDB (sd, 0, dlpOpenReadWrite, "ToDoDB", &handle); CHECK_RESULT(dlp_OpenDB); result = dlp_CloseDB (sd, handle); CHECK_RESULT(dlp_CloseDB); /********************************************************************* * * Test: New Database * * Direct Testing Functions: * dlp_CreateDB * dlp_CloseDB * dlp_DeleteDB * * Indirect Testing Functions: * None * *********************************************************************/ result = dlp_CreateDB (sd, CREATOR, DATA, 0, dlpDBFlagResource, 1, "TestResource", &handle); CHECK_RESULT(dlp_CreateDB); result = dlp_CloseDB (sd, handle); CHECK_RESULT(dlp_CloseDB); result = dlp_DeleteDB (sd, 0, "TestResource"); CHECK_RESULT(dlp_DeleteDB); /********************************************************************* * * Test: Database Info and Searching * * Direct Testing Functions: * dlp_SetDBInfo * dlp_FindDBByName * dlp_FindDBByOpenHandle * dlp_FindDBByTypeCreator * * Indirect Testing Functions: * dlp_CreateDB * dlp_OpenDB * dlp_ReadDBList * dlp_CloseDB * dlp_DeleteDB * *********************************************************************/ #if DLP_1_2 result = dlp_CreateDB (sd, CREATOR, DATA, 0, 0, 1, "TestRecord", &handle); CHECK_RESULT(dlp_CreateDB); result = dlp_SetDBInfo (sd, handle, dlpDBFlagBackup, dlpDBFlagCopyPrevention, 0, 0, 0, 0, 0, 0); CHECK_RESULT(dlp_SetDBInfo); result = dlp_CloseDB (sd, handle); CHECK_RESULT(dlp_CloseDB); result = dlp_OpenDB (sd, 0, dlpOpenReadWrite, "TestRecord", &handle); CHECK_RESULT(dlp_OpenDB); result = dlp_FindDBByOpenHandle (sd, handle, &cardno, NULL, &dbi, &dbsi); CHECK_RESULT(dlp_FindDBByOpenHandle); if (strcmp (dbi.name, "TestRecord") || !(dbi.flags & dlpDBFlagBackup)) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Database info mismatch with openhandle\n")); goto error; } result = dlp_CloseDB (sd, handle); CHECK_RESULT(dlp_CloseDB); result = dlp_FindDBByName (sd, 0, "TestRecord", NULL, NULL, &dbi, &dbsi); CHECK_RESULT(dlp_FindDBByName); if (strcmp (dbi.name, "TestRecord") || !(dbi.flags & dlpDBFlagBackup)) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Database info mismatch with name\n")); goto error; } result = dlp_FindDBByTypeCreator (sd, DATA, CREATOR, 1, 0, &cardno, NULL, NULL, &dbi, &dbsi); CHECK_RESULT(dlp_FindDBByName); if (strcmp (dbi.name, "TestRecord") || !(dbi.flags & dlpDBFlagBackup)) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Database info mismatch with type/creator\n")); goto error; } result = dlp_DeleteDB (sd, 0, "TestRecord"); CHECK_RESULT(dlp_DeleteDB); #endif /********************************************************************* * * Test: App Preference * * Direct Testing Functions: * dlp_WriteAppPreference * dlp_ReadAppPreference * * Indirect Testing Functions: * None * *********************************************************************/ memset (pref1, '\0', sizeof (pref1)); memset (pref2, '\0', sizeof (pref2)); pref1[9] = 'T'; pref2[10] = 'T'; result = dlp_WriteAppPreference (sd, CREATOR, 0, 1, 1, pref1, sizeof(pref1)); CHECK_RESULT(dlp_WriteAppPrefence); result = dlp_ReadAppPreference (sd, CREATOR, 0, 1, sizeof(pref2), pref2, NULL, NULL); CHECK_RESULT(dlp_ReadAppPreference); if (memcmp(&pref1, &pref2, sizeof(pref1) != 0)) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Preference mismatch\n")); goto error; } /********************************************************************* * * Test: Record * * Direct Testing Functions: * dlp_WriteAppBlock * dlp_ReadAppBlock * dlp_WriteSortBlock * dlp_ReadSortBlock * dlp_WriteRecord * dlp_ReadOpenDBInfo * dlp_ReadRecordById * dlp_ReadRecordByIndex * dlp_ReadNextModifiedRec * dlp_ReadNextRecInCategory * dlp_ReadNextModifiedRecInCategory * dlp_MoveCategory * dlp_DeleteRecord * dlp_DeleteCategory * dlp_ResetDBIndex * * Indirect Testing Functions: * dlp_CreateDB * dlp_CloseDB * dlp_DeleteDB * *********************************************************************/ memset (ablock1, '\0', sizeof (ablock1)); memset (sblock1, '\0', sizeof (sblock1)); memset (record1, '\0', sizeof (record1)); memset (record2, '\0', sizeof (record2)); memset (record3, '\0', sizeof (record3)); ablock1[3] = 'T'; sblock1[17] = 'T'; record1[32] = 'T'; record2[33] = 'T'; record3[34] = 'T'; result = dlp_CreateDB (sd, CREATOR, DATA, 0, 0, 1, "TestRecord", &handle); CHECK_RESULT(dlp_CreateDB); /* Write and read back an app block */ result = dlp_WriteAppBlock (sd, handle, ablock1, sizeof(ablock1)); CHECK_RESULT(dlp_WriteAppBlock); result = dlp_ReadAppBlock (sd, handle, 0, sizeof(ablock1), appblock); CHECK_RESULT(dlp_ReadAppBlock); if (result != sizeof(ablock1) || memcmp(ablock1, appblock->data, sizeof(ablock1) != 0)) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST App block mismatch\n")); goto error; } /* Write and read back a sort block */ result = dlp_WriteSortBlock (sd, handle, sblock1, sizeof(sblock1)); CHECK_RESULT(dlp_WriteSortBlock); result = dlp_ReadSortBlock (sd, handle, 0, sizeof(sblock1), appblock); CHECK_RESULT(dlp_ReadSortBlock); if (result != sizeof(sblock1) || memcmp(sblock1, appblock->data, sizeof(sblock1) != 0)) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST App block mismatch\n")); goto error; } /* Write some records out */ result = dlp_WriteRecord (sd, handle, 0, 0, 1, record1, sizeof(record1), &rid1); CHECK_RESULT(dlp_WriteRecord); result = dlp_WriteRecord (sd, handle, dlpRecAttrDirty, 0, 2, record2, sizeof(record2), &rid2); CHECK_RESULT(dlp_WriteRecord); result = dlp_WriteRecord (sd, handle, 0, 0, 3, record3, sizeof(record3), &rid3); CHECK_RESULT(dlp_WriteRecord); /* Get the db info */ result = dlp_ReadOpenDBInfo (sd, handle, &count); CHECK_RESULT(dlp_ReadOpenDBInfo); if (count != 3) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Read wrong open database info\n")); goto error; } /* Get the id list */ result = dlp_ReadRecordIDList (sd, handle, 0, 0, 4, rlist, &count); CHECK_RESULT(dlp_ReadRecordIDList); if (count != 3) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Read wrong record id list length\n")); goto error; } for (i = 0; i < 3; i++) { if (rlist[i] != rid1 && rlist[i] != rid2 && rlist[i] != rid3) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Read wrong record id\n")); goto error; } } /* Try reading the records in various ways */ result = dlp_ReadRecordById (sd, handle, rid1, record4, &index, NULL, NULL); CHECK_RESULT(dlp_ReadRecordById); if (memcmp(record1, record4->data, sizeof(record1) != 0)) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Record by Id mismatch\n")); goto error; } result = dlp_ReadRecordByIndex (sd, handle, index, record4, NULL, NULL, NULL); CHECK_RESULT(dlp_ReadRecordByIndex); if (memcmp(record1, record4->data, sizeof(record1) != 0)) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Record by index mismatch\n")); goto error; } result = dlp_ReadNextModifiedRec (sd, handle, record4, NULL, NULL, NULL, NULL); CHECK_RESULT(dlp_ReadNextModifiedRec); if (memcmp(record2, record4->data, sizeof(record2) != 0)) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Next modified record mismatch\n")); goto error; } /* Reset because of the above next modified record call */ result = dlp_ResetDBIndex (sd, handle); CHECK_RESULT(dlp_ResetDBIndex) /* This is a DLP 1.1 call, but pilot-link has a 1.0 implementation */ result = dlp_ReadNextRecInCategory (sd, handle, 3, record4, NULL, NULL, NULL); CHECK_RESULT(dlp_ReadNextRecInCategory) if (memcmp(record3, record4->data, sizeof(record3) != 0)) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST dlp_ReadNextRecInCategory mismatch\n")); goto error; } /* Reset because of the above next record in category call */ result = dlp_ResetDBIndex (sd, handle); CHECK_RESULT(dlp_ResetDBIndex) /* This is a DLP 1.1 call, but pilot-link has a 1.0 implementation */ result = dlp_ReadNextModifiedRecInCategory (sd, handle, 2, record4, NULL, NULL, NULL); CHECK_RESULT(dlp_ReadNextModifiedRecInCategory) if (memcmp(record2, record4->data, sizeof(record2) != 0)) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST dlp_ReadNextModifiedRecInCategory mismatch\n")); goto error; } /* Reset because of the above next modified record in category call */ result = dlp_ResetDBIndex (sd, handle); CHECK_RESULT(dlp_ResetDBIndex) /* Move a category and try to read the record back in */ result = dlp_MoveCategory (sd, handle, 1, 4); CHECK_RESULT(dlp_MoveCategory) result = dlp_ReadNextRecInCategory (sd, handle, 4, record4, NULL, NULL, NULL); CHECK_RESULT(dlp_ReadNextRecInCategory) if (memcmp(record1, record4->data, sizeof(record1) != 0)) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST dlp_ReadNextRecInCategory mismatch\n")); goto error; } /* Delete records in various ways */ result = dlp_DeleteRecord (sd, handle, 0, rid1); CHECK_RESULT(dlp_DeleteRecord ); result = dlp_ReadRecordById (sd, handle, rid1, record4, NULL, NULL, NULL); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Deleted record could still be read\n")); goto error; } result = dlp_DeleteCategory (sd, handle, 3); CHECK_RESULT(dlp_DeleteCategory); result = dlp_ReadRecordById (sd, handle, rid3, record4, NULL, NULL, NULL); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Deleted category could still be read\n")); goto error; } result = dlp_DeleteRecord (sd, handle, 1, 0); CHECK_RESULT(dlp_DeleteRecord ); result = dlp_ReadRecordById (sd, handle, rid2, record4, NULL, NULL, NULL); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Deleted all record could still be read\n")); goto error; } result = dlp_CloseDB (sd, handle); CHECK_RESULT(dlp_CloseDB); result = dlp_DeleteDB (sd, 0, "TestRecord"); CHECK_RESULT(dlp_DeleteDB); /********************************************************************* * * Test: Resource * * Direct Testing Functions: * dlp_WriteResource * dlp_ReadResourceByType * dlp_ReadResourceByIndex * dlp_DeleteResource * * Indirect Testing Functions: * dlp_CreateDB * dlp_CloseDB * dlp_DeleteDB * *********************************************************************/ memset (ires1, '\0', sizeof (ires1)); memset (dres1, '\0', sizeof (dres1)); ires1[3] = 'T'; dres1[4] = 'T'; result = dlp_CreateDB (sd, CREATOR, DATA, 0, dlpDBFlagResource, 1, "TestResource", &handle); CHECK_RESULT(dlp_CreateDB); /* Write out some resources */ result = dlp_WriteResource (sd, handle, INFO, 1, ires1, sizeof(ires1)); CHECK_RESULT(dlp_WriteResource); result = dlp_WriteResource (sd, handle, DATA, 0, dres1, sizeof(dres1)); CHECK_RESULT(dlp_WriteResource); /* Read in the resources by various methods */ result = dlp_ReadResourceByType (sd, handle, INFO, 1, ires2, &index); CHECK_RESULT(dlp_ReadResourceByType) if (memcmp(ires1, ires2->data, sizeof(ires1) != 0)) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Resource by type mismatch\n")); goto error; } result = dlp_ReadResourceByIndex (sd, handle, index, ires2, &type, &id_); CHECK_RESULT(dlp_ReadResourceByIndex) if (memcmp(ires1, ires2->data, sizeof(ires1) != 0)) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Resource by index mismatch\n")); goto error; } if (type != INFO) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Resource by index return type mismatch\n")); goto error; } if (id_ != 1) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Resource by index return id mismatch\n")); goto error; } /* Delete resources by the various methods */ result = dlp_DeleteResource (sd, handle, 0, INFO, 1); CHECK_RESULT(dlp_DeleteResource ) result = dlp_ReadResourceByType (sd, handle, INFO, 1, ires2, &index); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Deleted resource could still be read\n")); goto error; } result = dlp_DeleteResource (sd, handle, 1, INFO, 1); CHECK_RESULT(dlp_DeleteResource ) result = dlp_ReadResourceByType (sd, handle, DATA, 0, dres2, &index); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Deleted all resource could still be read\n")); goto error; } result = dlp_CloseDB (sd, handle); CHECK_RESULT(dlp_CloseDB) result = dlp_DeleteDB (sd, 0, "TestResource"); CHECK_RESULT(dlp_DeleteDB) /********************************************************************* * * Test: Database Cleanup * * Direct Testing Functions: * dlp_CleanUpDatabase * dlp_ResetSyncFlags * * Indirect Testing Functions: * dlp_CreateDB * dlp_WriteRecord * dlp_CloseDB * dlp_DeleteDB * *********************************************************************/ result = dlp_CreateDB (sd, CREATOR, DATA, 0, 0, 1, "TestRecord", &handle); CHECK_RESULT(dlp_CreateDB); /* Create dummy records */ result = dlp_WriteRecord (sd, handle, dlpRecAttrDeleted, 0, 0, record1, sizeof(record1), &rid1); CHECK_RESULT(dlp_WriteRecord); result = dlp_WriteRecord (sd, handle, dlpRecAttrDirty, 0, 0, record2, sizeof(record2), &rid2); CHECK_RESULT(dlp_WriteRecord); /* Call the test functions */ result = dlp_CleanUpDatabase (sd, handle); CHECK_RESULT(dlp_CleanUpDatabase); result = dlp_ResetSyncFlags (sd, handle); CHECK_RESULT(dlp_ResetSyncFlags); result = dlp_CloseDB (sd, handle); CHECK_RESULT(dlp_CloseDB); /* Confirm the test functions worked */ result = dlp_OpenDB (sd, 0, dlpOpenReadWrite, "TestRecord", &handle); CHECK_RESULT(dlp_OpenDB); result = dlp_ReadRecordById (sd, handle, rid1, record4, NULL, NULL, NULL); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Cleaned up record could still be read\n")); goto error; } result = dlp_ReadNextModifiedRec (sd, handle, record4, NULL, NULL, NULL, NULL); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "DLPTEST Modified recorded could still be read\n")); goto error; } result = dlp_CloseDB (sd, handle); CHECK_RESULT(dlp_CloseDB); result = dlp_DeleteDB (sd, 0, "TestRecord"); CHECK_RESULT(dlp_DeleteDB); /********************************************************************* * * Test: Sync Log * * Direct Testing Functions: * dlp_AddSyncLogEntry * * Indirect Testing Functions: * None * *********************************************************************/ result = dlp_AddSyncLogEntry (sd, "dlp-test added sync log entry"); CHECK_RESULT(dlp_AddSyncLogEntry); /********************************************************************* * * Test: End Sync * * Direct Testing Functions: * dlp_EndOfSync * * Indirect Testing Functions: * None * *********************************************************************/ result = dlp_EndOfSync (sd, dlpEndCodeNormal); CHECK_RESULT(dlp_EndOfSync); t1 = time (NULL); LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "DLPTEST Ending at %s", ctime (&t1))); error: pi_close (sd); pi_buffer_free (record4); pi_buffer_free (ires2); pi_buffer_free (dres2); pi_buffer_free(appblock); return 0; } pilot-link-0.12.5-dfsg/tests/calendardb-test.c0000644000175000017500000002015511333421636021447 0ustar rousseaurousseau/* * $Id: calendardb-test.c,v 1.3 2010-01-17 00:37:35 judd Exp $ * * calendardb-test.c: Test code for calendar database * (c) 2008, Jon Schewe * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #include "pi-source.h" #include "pi-file.h" #include "pi-macros.h" #include "pi-calendar.h" /*********************************************************************** * * Function: dump * * Summary: Dump data as requested by other functions * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void dump(void *buf, int n) { int ch, i, j; if(NULL == buf) { printf("Null buf\n"); return; } for (i = 0; i < n; i += 16) { printf("%04x: ", i); for (j = 0; j < 16; j++) { if (i + j < n) printf("%02x ", ((unsigned char *) buf)[i + j]); else printf(" "); } printf(" "); for (j = 0; j < 16 && i + j < n; j++) { ch = ((unsigned char *) buf)[i + j] & 0x7f; if (ch < ' ' || ch >= 0x7f) putchar('.'); else putchar(ch); } printf("\n"); } } /** * Test parsing database. */ void parse(pi_file_t *pf) { void *app_info; size_t app_info_size; int i; CalendarAppInfo_t cab; int result; int nentries; unsigned char *buf; int attrs, cat; size_t size; recordid_t uid; CalendarEvent_t appt; int entnum; pi_buffer_t *pi_buf; pi_buffer_t *test; char timeString[256]; pi_file_get_app_info(pf, &app_info, &app_info_size); if (app_info == NULL) { fprintf(stderr, "Unable to get app info\n"); return; } printf("Size of appinfo block: %d\n", (int)app_info_size); // dump the appinfo dump(app_info, app_info_size); pi_buf = pi_buffer_new(0); pi_buf->data = app_info; pi_buf->used = app_info_size; pi_buf->allocated = app_info_size; result = unpack_CalendarAppInfo(&cab, pi_buf); printf("unpack_CalendarAppInfo returned %d\n", result); pi_buf->data=NULL; pi_buf->used = 0; pi_buf->allocated = 0; result = pack_CalendarAppInfo(&cab, pi_buf); printf("pack_CalendarAppInfo returned %d\n", result); // dump the appinfo dump(pi_buf->data, pi_buf->used); pi_buffer_free(pi_buf); /* print out the standard app info stuff and see if it's right */ /* not really useful for Calendar, all names are custom for(i=0; i<16; ++i) { printf("renamed[%d] = %d\n", i, cab.category.renamed[i]); } */ for(i=0; i<16; ++i) { printf("Category %d is %s\n", i, cab.category.name[i]); } printf("Start of week is %d\n", cab.startOfWeek); printf("Internal:\n"); dump(cab.internal, 18); pi_file_get_entries(pf, &nentries); printf("Number of entries: %d\n", nentries); for (entnum = 0; entnum < nentries; entnum++) { if (pi_file_read_record(pf, entnum, (void **) &buf, &size, &attrs, &cat, &uid) < 0) { printf("Error reading record number %d\n", entnum); return; } /* Skip deleted records */ if ((attrs & dlpRecAttrDeleted) || (attrs & dlpRecAttrArchived)) { continue; } printf("original record %d:\n", entnum); dump(buf, size); pi_buf = pi_buffer_new(size); pi_buffer_append(pi_buf, buf, size); result = unpack_CalendarEvent(&appt, pi_buf, calendar_v1); if(-1 == result) { printf("Error unpacking record %d!\n", entnum); } printf("\tdescription: %s\n", appt.description); if(NULL != appt.location) { printf("\tLocation: %s\n", appt.location); } printf("\tis event: %d\n", appt.event); result = strftime(timeString, 256, "%F %T %z", &(appt.begin)); if(0 == result) { printf("Error begin time to string!"); } else { printf("\tBegin: %s\n", timeString); } result = strftime(timeString, 256, "%F %T %z", &(appt.end)); if(0 == result) { printf("Error end time to string!"); } else { printf("\tEnd: %s\n", timeString); } printf("\tnote: %s\n", appt.note); if(NULL != appt.tz) { printf("\tTimezone name: %s\n", appt.tz->name); printf("\t\tOffset from GMT: %d minutes\n", appt.tz->offset); printf("\t\tDST observed: %d\n", appt.tz->dstObserved); printf("\t\tDST start:\n"); printf("\t\t\tdayOfWeek: %d\n", appt.tz->dstStart.dayOfWeek); printf("\t\t\tweekOfMonth: %d\n", appt.tz->dstStart.weekOfMonth); printf("\t\t\tmonth: %d\n", appt.tz->dstStart.month); printf("\t\tDST end:\n"); printf("\t\t\tdayOfWeek: %d\n", appt.tz->dstEnd.dayOfWeek); printf("\t\t\tweekOfMonth: %d\n", appt.tz->dstEnd.weekOfMonth); printf("\t\t\tmonth: %d\n", appt.tz->dstEnd.month); } /* now try and pack the record and see if we get the same data */ test = pi_buffer_new(0); result = pack_CalendarEvent(&appt, test, calendar_v1); if(result == -1) { printf("Error packing record %d!\n", entnum); } else { printf("packed record\n"); dump(test->data, test->used); if(pi_buf->used != test->used) { int i; printf("Error: Different record sizes unpack: %ld pack: %ld last byte unpack: 0x%02X pack: 0x%02X\n", pi_buf->used, test->used, pi_buf->data[pi_buf->used-1], test->data[test->used-1]); for(i=0; iused; ++i) { if(pi_buf->data[i] != test->data[i]) { printf("Error: Byte %d is different unpack: 0x%02X pack: 0x%02X\n", i, pi_buf->data[i], test->data[i]); } } } } /*printf("event: %d\n", appt.event);*/ /* if (appt.untimed() == false) { cout << "Begin Time: " << asctime(appt. beginTime()); cout << "End Time: " << asctime(appt.endTime()); } else { cout << "Untimed event" << endl; } if (appt.hasAlarm()) { cout << "The alarm is set to go off " << appt. advance() << " "; switch (appt.advanceUnits()) { case appointment_t::minutes: cout << "minutes"; break; case appointment_t::hours: cout << "hours"; break; case appointment_t::days: cout << "days"; default: cout << "(internal error)"; } cout << " before the event" << endl; } else cout << "There is not an alarm set for this event" << endl; if (appt.repeatType() != appointment_t::none) prettyPrintRepeat(&appt); else cout << "Event does not repeat" << endl; if ((timePtr = appt.exceptions())) { size = appt.numExceptions(); cout << "I seem to have " << size << " exceptions:" << endl; for (int i = 0; i < size; i++) cout << "\t" << asctime(&timePtr[i]); } cout << "Description: " << appt.description() << endl; if (appt.note()) { cout << "Note: " << appt.note() << endl; } cout << endl; */ pi_buffer_free(pi_buf); free_CalendarEvent(&appt); } } int main(int argc, char **argv) { pi_file_t *pf; struct DBInfo info; if (argc != 2) { fprintf(stderr, "Usage: %s [.pdb file]\n", *argv); return 1; } if ((pf = pi_file_open(*(argv + 1))) == NULL) { perror("pi_file_open"); return 1; } pi_file_get_info(pf, &info); parse(pf); pi_file_close(pf); return 0; } pilot-link-0.12.5-dfsg/tests/Makefile.am0000644000175000017500000000174011206417506020302 0ustar rousseaurousseauINCLUDES = \ -I../include \ -I$(top_srcdir)/include \ $(POPT_INCLUDES) noinst_PROGRAMS = \ calendardb-test \ locationdb-test \ contactsdb-test \ dlp-test \ versamail-test \ vfs-test calendardb_test_SOURCES = \ calendardb-test.c calendardb_test_LDADD = \ $(top_builddir)/libpisock/libpisock.la locationdb_test_SOURCES = \ locationdb-test.c locationdb_test_LDADD = \ $(top_builddir)/libpisock/libpisock.la contactsdb_test_SOURCES = \ contactsdb-test.c contactsdb_test_LDADD = \ $(top_builddir)/libpisock/libpisock.la dlp_test_SOURCES = \ dlp-test.c dlp_test_LDADD = \ $(top_builddir)/libpisock/libpisock.la vfs_test_SOURCES = \ vfs-test.c vfs_test_LDADD = \ $(top_builddir)/libpisock/libpisock.la versamail_test_SOURCES = \ versamail-test.c versamail_test_LDADD = \ $(top_builddir)/libpisock/libpisock.la check_PROGRAMS = \ packers packers_SOURCES = \ packers.c packers_LDADD = \ $(top_builddir)/libpisock/libpisock.la TESTS = packers pilot-link-0.12.5-dfsg/tests/locationdb-test.c0000644000175000017500000001131211150204036021467 0ustar rousseaurousseau/* * $Id: locationdb-test.c,v 1.1 2009/02/22 08:09:02 nicholas Exp $ * * calendardb-test.c: Test parsing the PalmOne timezone databases * loclLDefLocationDB and loclCusLocationDB. * (c) 2008, Jon Schewe * * This library 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 of the License, or (at * your option) any later version. * * This 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 Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include /* #ifdef HAVE_STDINT_H #include #endif */ #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #include "pi-source.h" #include "pi-file.h" #include "pi-macros.h" #include "pi-location.h" /*********************************************************************** * * Function: dump * * Summary: Dump data as requested by other functions * * Parameters: None * * Returns: Nothing * ***********************************************************************/ static void dump(void *buf, int n) { int ch, i, j; for (i = 0; i < n; i += 16) { printf("%04x: ", i); for (j = 0; j < 16; j++) { if (i + j < n) printf("%02x ", ((unsigned char *) buf)[i + j]); else printf(" "); } printf(" "); for (j = 0; j < 16 && i + j < n; j++) { ch = ((unsigned char *) buf)[i + j] & 0x7f; if (ch < ' ' || ch >= 0x7f) putchar('.'); else putchar(ch); } printf("\n"); } } /** * Test parsing database. */ void parse(pi_file_t *pf) { int result; int nentries; char *buf; int attrs, cat; size_t size; recordid_t uid; Location_t loc; int entnum; pi_buffer_t *pi_buf; pi_buffer_t *test; pi_file_get_entries(pf, &nentries); printf("Number of entries: %d\n", nentries); for (entnum = 0; entnum < nentries; entnum++) { if (pi_file_read_record(pf, entnum, (void **) &buf, &size, &attrs, &cat, &uid) < 0) { printf("Error reading record number %d\n", entnum); return; } /* Skip deleted records */ if ((attrs & dlpRecAttrDeleted) || (attrs & dlpRecAttrArchived)) { continue; } printf("original record %d\n", entnum); dump(buf, size); pi_buf = pi_buffer_new(size); pi_buffer_append(pi_buf, buf, size); result = unpack_Location(&loc, pi_buf); if(result == -1) { printf("Error unpacking record %d!\n", entnum); } else { printf("Timezone name: %s\n", loc.tz.name); printf("\tOffset from GMT: %d minutes\n", loc.tz.offset); printf("\tDST observed: %d\n", loc.tz.dstObserved); printf("\tNote is: %s\n", loc.note); printf("\tlat: %d degrees %d minutes\n", loc.latitude.degrees, loc.latitude.minutes); printf("\tlon: %d degrees %d minutes\n", loc.longitude.degrees, loc.longitude.minutes); } /* now try and pack the record and see if we get the same data */ test = pi_buffer_new(0); result = pack_Location(&loc, test); if(result == -1) { printf("Error packing record %d!\n", entnum); } else { printf("packed record\n"); dump(test->data, test->used); if(pi_buf->used != test->used) { int i; printf("Error: Different record sizes unpack: %d pack: %d last byte unpack: 0x%02X pack: 0x%02X\n", pi_buf->used, test->used, pi_buf->data[pi_buf->used-1], test->data[test->used-1]); for(i=0; iused; ++i) { if(pi_buf->data[i] != test->data[i]) { printf("Error: Byte %d is different unpack: 0x%02X pack: 0x%02X\n", i, pi_buf->data[i], test->data[i]); } } } } pi_buffer_free(test); pi_buffer_free(pi_buf); free_Location(&loc); } } int main(int argc, char **argv) { pi_file_t *pf; struct DBInfo info; if (argc != 2) { fprintf(stderr, "Usage: %s [.pdb file]\n", *argv); return 1; } if ((pf = pi_file_open(*(argv + 1))) == NULL) { perror("pi_file_open"); return 1; } pi_file_get_info(pf, &info); parse(pf); pi_file_close(pf); return 0; } pilot-link-0.12.5-dfsg/tests/vfs-test.c0000644000175000017500000003527710561576532020211 0ustar rousseaurousseau/* * vfs-test.c: VFS Regression Test * * (c) 2002, JP Rosevear. * (c) 2004, Florent Pillet * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA * * * This regression test calls every DLP function except the following: * dlp_CallApplication * dlp_ResetSystem * dlp_ProcessRPC */ #include #include #include #include #include "pi-debug.h" #include "pi-socket.h" #include "pi-dlp.h" #include "pi-error.h" #include "pi-source.h" #include "pi-header.h" /* For various protocol versions, set to 0 to not test those versions */ #define DLP_1_1 1 #define DLP_1_2 1 #define DLP_1_3 1 /* Logging defines */ #define CHECK_RESULT(func) \ if (result < 0) { \ LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "VFSTEST " #func " failed (%d, last palmos error: 0x%04x)\n", result, pi_palmos_error(sd))); \ if (result == PI_ERR_SOCK_DISCONNECTED) \ goto error; \ } #define TEST_VFS_DIR "/vfs-test" #define TEST_VFS_FILE "/vfs-test/test.dat" #define TEST_VFS_FILE2 "/vfs-test/test2.dat" #define TEST_VFS_FILE2_SHORT "test2.dat" #define BIG_FILE_SIZE (2 * 1024 * 1024) /* test vfs read/write with 1Mb data */ int main (int argc, char **argv) { int i, j, sd, result, refs[200], ref_length, len, numStrings; char *strings; FileRef fileRef; unsigned long fileAttrs; unsigned char *buf1; time_t t1, t2; char name[255], oldName[255]; unsigned long flags; sd = pilot_connect (argv[1]); if (sd < 0) return 1; t1 = time (NULL); LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "VFSTEST Starting at %s", ctime (&t1))); /********************************************************************* * * Test: Expansion * * Direct Testing Functions: * dlp_ExpSlotEnumerate * dlp_ExpCardPresent * dlp_ExpCardInfo * * Indirect Testing Functions: * None * *********************************************************************/ #if DLP_1_3 ref_length = sizeof (refs) / sizeof (refs[0]); result = dlp_ExpSlotEnumerate (sd, &ref_length, refs); CHECK_RESULT(dlp_ExpSlotEnumerate); for (i = 0; i < ref_length; i++) { result = dlp_ExpCardPresent (sd, refs[i]); if (result == PI_ERR_DLP_PALMOS) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "* dlp_ExpCardPresent: card not present in slot %d, PalmOS err 0x%04x\n", i, pi_palmos_error(sd))); } else { CHECK_RESULT(dlp_ExpCardPresent); if (result >= 0) { strings = NULL; result = dlp_ExpCardInfo (sd, refs[i], &flags, &numStrings, &strings); CHECK_RESULT(dlp_ExpCardInfo); LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Expansion card {%d}: " "capabilities = 0x%08lx, numStrings = %d\n", refs[i], flags, numStrings)); if (strings) { char *p = strings; for (j = 0; j < numStrings; j++) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "\tstring[%d] = '%s'\n", j, p)); p += strlen (p) + 1; } free (strings); } } } } #endif /********************************************************************* * * Test: VFS Volumes, files and directories * * Direct Testing Functions: * dlp_VFSDirCreate * dlp_VFSDirEntryEnumerate * dlp_VFSFileClose * dlp_VFSFileCreate * dlp_VFSFileDelete * dlp_VFSFileEOF * dlp_VFSFileGetAttributes * dlp_VFSFileGetDate * dlp_VFSFileOpen * dlp_VFSFileRead * dlp_VFSFileRename * dlp_VFSFileResize * dlp_VFSFileSeek * dlp_VFSFileSetAttributes * dlp_VFSFileSetDate * dlp_VFSFileSize * dlp_VFSFileTell * dlp_VFSFileWrite * dlp_VFSGetDefaultDir * dlp_VFSVolumeEnumerate * dlp_VFSVolumeGetLabel * dlp_VFSVolumeInfo * dlp_VFSVolumeSetLabel * dlp_VFSVolumeSize * * Indirect Testing Functions: * None * *********************************************************************/ #if DLP_1_3 ref_length = sizeof (refs) / sizeof (refs[0]); result = dlp_VFSVolumeEnumerate (sd, &ref_length, refs); CHECK_RESULT(dlp_VFSVolumeEnumerate); for (i = 0; i < ref_length; i++) { struct VFSInfo vfs; long used, total; LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "\nTESTING VOLUME %d/%d {ref=%d}\n\n", i+1, ref_length, refs[i])); result = dlp_VFSVolumeInfo (sd, refs[i], &vfs); CHECK_RESULT(dlp_VFSVolumeInfo); if (result >= 0) { name[0] = 0; if (vfs.attributes & 0x00000004) strcpy (name, "hidden "); if (vfs.attributes & 0x00000002) strcat (name, "read-only "); if (vfs.attributes & 0x00000001) strcat (name, "slot-based"); LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Volume attributes:\n\tattributes: %s\n", name)); LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "\tfsType: '%4.4s'\n\tfsCreator: '%4.4s'\n\tmountClass: '%4.4s'\n", &vfs.fsType, &vfs.fsCreator, &vfs.mountClass)); LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "\tslotLibRefNum: %d\n\tslotRefNum: %d\n\tmediaType: '%4.4s'\n\n", vfs.slotLibRefNum, vfs.slotRefNum, &vfs.mediaType)); } result = dlp_VFSVolumeSize (sd, refs[i], &used, &total); CHECK_RESULT(dlp_VFSVolumeSize); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* volume used: %ld / %ld bytes\n", used, total)); } /* volume label test */ len = sizeof (name); result = dlp_VFSVolumeGetLabel (sd, refs[i], &len, name); CHECK_RESULT(dlp_VFSVolumeGetLabel); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* volume label: '%s'\n", name)); } strcpy (oldName, name); result = dlp_VFSVolumeSetLabel (sd, refs[i], "Test"); CHECK_RESULT(dlp_VFSVolumeSetLabel); if (result >= 0) { len = sizeof (name); result = dlp_VFSVolumeGetLabel (sd, refs[i], &len, name); CHECK_RESULT(dlp_VFSVolumeGetLabel); if (result >= 0) { if (strcmp("Test", name)) { LOG((PI_DBG_USER, PI_DBG_LVL_ERR, "* ERROR: Label change mismatch\n")); } else { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Label change successful\n")); } } result = dlp_VFSVolumeSetLabel (sd, refs[i], oldName); CHECK_RESULT(dlp_VFSVolumeSetLabel); } /* directory listing test */ len = sizeof (name); result = dlp_VFSGetDefaultDir (sd, refs[i], ".prc", name, &len); CHECK_RESULT(dlp_VFSGetDefaultDir); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Listing directory contents at '%s'\n", name)); result = dlp_VFSFileOpen (sd, refs[i], name, 0x0007 /* vfsModeReadWrite */, &fileRef); CHECK_RESULT(dlp_VFSFileOpen); if (result >= 0) { unsigned long dirIterator = vfsIteratorStart; do { struct VFSDirInfo dirItems[16]; int dirCount; memset (dirItems, 0, sizeof(dirItems)); dirCount = 16; result = dlp_VFSDirEntryEnumerate (sd, fileRef, &dirIterator, &dirCount, dirItems); CHECK_RESULT(dlp_VFSDirEntryEnumerate); if (result >= 0) { for (j = 0; j < dirCount; j++) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "\t'%s' attrs = 0x%08lx\n", dirItems[j].name, dirItems[j].attr)); } } } while (dirIterator != vfsIteratorStop && result >= 0); result = dlp_VFSFileClose (sd, fileRef); CHECK_RESULT(dlp_VFSFileClose); LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Closed directory %s\n", name)); } } /* directory creation test */ result = dlp_VFSDirCreate (sd, refs[i], "/vfs-test"); CHECK_RESULT(dlp_VFSDirCreate); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Created directory %s\n", TEST_VFS_DIR)); /* file access tests */ result = dlp_VFSFileCreate (sd, refs[i], TEST_VFS_FILE); CHECK_RESULT(dlp_VFSFileCreate); LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Created file %s\n", TEST_VFS_FILE)); result = dlp_VFSFileOpen (sd, refs[i], TEST_VFS_FILE, 0x0007 /* read-write */, &fileRef); CHECK_RESULT(dlp_VFSFileOpen); if (result >= 0) { pi_buffer_t *fileBuf = pi_buffer_new (BIG_FILE_SIZE); LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Opened file %s\n", TEST_VFS_FILE)); strcpy (name, "a test string written to a file\n"); result = dlp_VFSFileWrite (sd, fileRef, (unsigned char *)name, strlen (name)); CHECK_RESULT(dlp_VFSFileWrite); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Wrote small string to file %s\n", TEST_VFS_FILE)); result = dlp_VFSFileTell (sd, fileRef, &j); CHECK_RESULT(dlp_VFSFileTell); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Current seek position: %d\n", j)); } result = dlp_VFSFileSeek (sd, fileRef, vfsOriginBeginning, 0); CHECK_RESULT(dlp_VFSFileSeek); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Seeked to beginning of file\n", j)); } result = dlp_VFSFileRead (sd, fileRef, fileBuf, strlen(name)); CHECK_RESULT(dlp_VFSFileRead); if (fileBuf->used != strlen (name)) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* ERROR: File read: read %d instead of the expected %d\n", len, strlen (name))); } else if (memcmp (name, fileBuf->data, fileBuf->used)) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* ERROR: File read: read data mismatch\n", fileBuf->used, strlen (name))); pi_dumpdata (name, fileBuf->used); pi_dumpdata (fileBuf->data, fileBuf->used); } else { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* File read: successfully read the data back\n")); } } /* huge file write/read test - allocate a big buffer, don't clean it (keep the garbage), write it to the file and read it back them compare */ LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Please wait, writing %ld bytes of data to the file...\n", (long)BIG_FILE_SIZE)); buf1 = (unsigned char *)malloc (BIG_FILE_SIZE); if (buf1) { result = dlp_VFSFileWrite (sd, fileRef, buf1, BIG_FILE_SIZE); CHECK_RESULT(dlp_VFSFileWrite); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Successful, now reading it back...\n")); result = dlp_VFSFileSeek (sd, fileRef, vfsOriginCurrent, -BIG_FILE_SIZE); CHECK_RESULT(dlp_VFSFileSeek); result = dlp_VFSFileRead (sd, fileRef, fileBuf, BIG_FILE_SIZE); CHECK_RESULT(dlp_VFSFileRead); if (result >= 0) { if (fileBuf->used != BIG_FILE_SIZE || memcmp (buf1, fileBuf->data, BIG_FILE_SIZE)) LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* ERROR, data differs!\n")); else LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Successful, all bytes are the same...\n")); } } } if (buf1) free (buf1); pi_buffer_free (fileBuf); result = dlp_VFSFileEOF (sd, fileRef); if (pi_palmos_error(sd) == 0x2A07) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* File EOF: YES\n")); } else if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* File EOF: NO\n")); } else { CHECK_RESULT(dlp_VFSFileEOF); } result = dlp_VFSFileSize (sd, fileRef, &len); CHECK_RESULT(dlp_VFSFileSize); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* File size: %d bytes\n", len)); } result = dlp_VFSFileGetAttributes (sd, fileRef, &fileAttrs); CHECK_RESULT(dlp_VFSFileGetAttributes); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* File attributes: 0x%08lx\n", fileAttrs)); } fileAttrs |= 0x00000001L; result = dlp_VFSFileSetAttributes (sd, fileRef, fileAttrs); CHECK_RESULT(dlp_VFSFileSetAttributes); result = dlp_VFSFileGetAttributes (sd, fileRef, &fileAttrs); CHECK_RESULT(dlp_VFSFileGetAttributes); if (fileAttrs & 0x00000001L) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Successfully set read-only bit on file attributes\n")); } fileAttrs &= ~0x00000001L; result = dlp_VFSFileSetAttributes (sd, fileRef, fileAttrs); CHECK_RESULT(dlp_VFSFileSetAttributes); result = dlp_VFSFileResize (sd, fileRef, 1024); CHECK_RESULT(dlp_VFSFileResize); result = dlp_VFSFileSize (sd, fileRef, &len); CHECK_RESULT(dlp_VFSFileGetSize); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* File size after resize: %d\n", len)); } result = dlp_VFSFileGetDate (sd, fileRef, vfsFileDateCreated, &t1); CHECK_RESULT(dlp_VFSFileGetDate); if (result >= 0) { ctime_r (&t1, name); LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Date created: %s", name)); } result = dlp_VFSFileGetDate (sd, fileRef, vfsFileDateModified, &t2); CHECK_RESULT(dlp_VFSFileGetDate); if (result >= 0) { ctime_r (&t2, name); LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Date modified: %s", name)); } result = dlp_VFSFileGetDate (sd, fileRef, vfsFileDateAccessed, &t2); CHECK_RESULT(dlp_VFSFileGetDate); if (result >= 0) { ctime_r (&t2, name); LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Date accessed: %s", name)); } t1 -= 3600 * 24; result = dlp_VFSFileSetDate (sd, fileRef, vfsFileDateCreated, t1); CHECK_RESULT(dlp_VFSFileSetDate); if (result >= 0) { result = dlp_VFSFileGetDate (sd, fileRef, vfsFileDateCreated, &t2); CHECK_RESULT(dlp_VFSFileGetDate); if (result >= 0) { if (t1 == t2) LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* dlp_VFSFileSetDate successful\n")); else LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* BUG: dlp_VFSFileSetDate FAILED\n")); } } result = dlp_VFSFileClose (sd, fileRef); CHECK_RESULT(dlp_VFSFileClose); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Closed file %s\n", TEST_VFS_FILE)); } } result = dlp_VFSFileRename (sd, refs[i], TEST_VFS_FILE, TEST_VFS_FILE2_SHORT); CHECK_RESULT(dlp_VFSFileRename); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Renamed file %s to %s\n", TEST_VFS_FILE, TEST_VFS_FILE2_SHORT)); } result = dlp_VFSFileDelete (sd, refs[i], TEST_VFS_FILE2); CHECK_RESULT(dlp_VFSFileDelete); if (result >= 0) { LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Deleted file %s\n", TEST_VFS_FILE2)); } } result = dlp_VFSFileDelete (sd, refs[i], "/vfs-test"); CHECK_RESULT(dlp_VFSFileDelete); LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "* Deleted directory /vfs-test\n")); } #endif /********************************************************************* * * Test: VFS Import/Export Databases * * Direct Testing Functions: * dlp_VFSImportDatabaseFromFile * dlp_VFSExportDatabaseFromFile * * Indirect Testing Functions: * None * *********************************************************************/ t1 = time (NULL); LOG((PI_DBG_USER, PI_DBG_LVL_INFO, "VFSTEST Ending at %s", ctime (&t1))); error: pi_close (sd); return 0; } pilot-link-0.12.5-dfsg/tests/versamail-test.c0000644000175000017500000001242210231742372021350 0ustar rousseaurousseau#include #include #include #include #include "pi-file.h" #include "pi-versamail.h" size_t palm_strftime(char *s, size_t max, const char *fmt, const struct tm *tm); void hex_dump(unsigned char *buf, int size) { char text[18]; int i; bzero(text, 17); for (i = 0; i < size; i++) { printf("%02x ", buf[i]); text[i % 16] = (isprint(buf[i]) ? buf[i] : '.'); if ((i + 1) % 16 == 0) { printf("%s\n", text); bzero(text, 17); } } printf("\n"); } int print_cat_info(struct CategoryAppInfo *ai) { int i; printf("Category Info Start\n"); printf("renamed="); for (i = 0; i < 16; i++) { printf("%d", ai->renamed[i]); } printf("\n"); for (i = 0; i < 16; i++) { printf("Index %02d ID %03d %s\n", i, ai->ID[i], ai->name[i]); } printf("lastUniqueID = %d\n", ai->lastUniqueID); printf("Category Info End\n"); return 0; } int print_versamail_app_info(int db, void *record, int size) { struct VersaMailAppInfo ai; printf("Category app info\n"); //undo //hex_dump(record, size);//undo unpack_VersaMailAppInfo(&ai, record, size); print_cat_info(&(ai.category)); return 0; } void print_versamail_record(void *record, int size, int attr, int idx) { struct VersaMail mail; char datestr[255]; unpack_VersaMail(&mail, record, size); printf("----\n"); printf("version: %lu\n", mail.imapuid); palm_strftime(datestr, 254, "%c", &(mail.date)); //printf("date: %s\n", datestr); //printf("category: %d\n", mail.category); //printf("account: %d\n", mail.accountNo); printf("unknown1: %d\n", mail.unknown1); printf("unknown2: %d\n", mail.unknown2); printf("reserved1: %d\n", mail.reserved1); printf("reserved2: %d\n", mail.reserved2); printf("download: %d\n", mail.download); printf("mark: %d\n", mail.mark); printf("read: %d\n", mail.read); printf("body: %s\n", mail.body); //printf("to: %s\n", mail.to); //printf("from: %s\n", mail.from); //printf("cc: %s\n", mail.cc); //printf("bcc: %s\n", mail.bcc); printf("subject: %s\n", mail.subject); //printf("dateString: %s\n", mail.dateString); //printf("replyTo: %s\n", mail.replyTo); free_VersaMail(&mail); } void validate_versamail_packer(void *record, int size, int attr, int idx) { struct VersaMail mail; char *buffer; int len; int i; unpack_VersaMail(&mail, record, size); len = pack_VersaMail(&mail, NULL, 0); buffer = malloc(len); pack_VersaMail(&mail, buffer, len); /* printf("-------------\n"); */ if (size - len != 0) { printf ("on-disk size is %d, pack asked for %d to repack, wrong by %d.\n", size, len, size - len); } printf("subject: %s\n", mail.subject); printf(" attachment count: %d\n", mail.attachmentCount); if (0) { printf("uid: %d\n", (int) mail.imapuid); printf("size: %d\n", mail.msgSize); printf("unknown1: %d\n", mail.unknown1); printf("unknown2: %d\n", mail.unknown2); printf("reserved1: %d\n", mail.reserved1); printf("reserved2: %d\n", mail.reserved2); printf("download: %d\n", mail.download); printf("mark: %d\n", mail.mark); /* printf("body: %s\n", mail.body); printf("dateString: %s\n", mail.dateString); printf("replyTo: %s\n", mail.replyTo); */ } if (0) { if (mail.unknown3length > 0) { for (i = 0; i < mail.unknown3length; i++) { printf ("unknown attachment system Byte %3d: 0x%10x | %c | %6d\n", i, ((char *) mail.unknown3)[i], (isprint(((char *) mail.unknown3)[i]) ? ((char *) mail.unknown3)[i] : '.'), ((char *) mail.unknown3)[i]); } } } for (i = 0; i < ((size) > (len) ? (size) : (len)); i++) { if ((i < len) && (i < size)) { if (!((char *) record)[i] == buffer[i]) { printf ("WRONG Byte %3d: 0x%10x (%c) vs. 0x%10x (%c)\n", i, ((char *) record)[i], (isprint(((char *) record)[i]) ? ((char *) record)[i] : '.'), buffer[i], (isprint(buffer[i]) ? buffer[i] : '.')); } else { if (0) { printf (" OK Byte %3d: 0x%10x (%c) vs. 0x%10x (%c)\n", i, ((char *) record)[i], (isprint(((char *) record)[i]) ? ((char *) record)[i] : '.'), buffer[i], (isprint(buffer[i]) ? buffer[i] : '.')); } } } else if (i < len) { printf ("WRONG Byte %3d: ----------- vs. 0x%10x (%c)\n", i, buffer[i], (isprint(buffer[i]) ? buffer[i] : '.')); } else if (i < size) { printf ("WRONG Byte %3d: 0x%10x (%c) vs. -----------\n", i + 1, ((char *) record)[i], (isprint(((char *) record)[i]) ? ((char *) record)[i] : '.')); } } free(buffer); free_VersaMail(&mail); } int main(int argc, char *argv[]) { struct pi_file *pi_fp; char *DBname; int r; int idx; size_t size; int attr; int cat; recordid_t uid; void *record; DBname = "MultiMail Messages.pdb"; pi_fp = pi_file_open(DBname); if (pi_fp == 0) { printf("Unable to open '%s'!\n", DBname); return -1; } pi_file_get_app_info PI_ARGS((pi_fp, &record, &size)); print_versamail_app_info(r, record, size); printf("----------\n"); for (idx = 0;; idx++) { r = pi_file_read_record(pi_fp, idx, &record, &size, &attr, &cat, &uid); if (r < 0) break; //print_versamail_record(record, size, attr, idx); validate_versamail_packer(record, size, attr, idx); } pi_file_close(pi_fp); return 0; } pilot-link-0.12.5-dfsg/tests/packers.c0000644000175000017500000016356410254316364020061 0ustar rousseaurousseau/* packers.c: Test packing functions * * Copyright (c) 1997, Kenneth Albanowski * * This is free software, licensed under the GNU Public License V2. * See the file COPYING for details. */ #include #include #include #include "pi-source.h" #include "pi-socket.h" #include "pi-memo.h" #include "pi-address.h" #include "pi-datebook.h" #include "pi-todo.h" #include "pi-dlp.h" #include "pi-expense.h" #include "pi-mail.h" unsigned char seed; char *target; int targetlen; void reset_block(char *buffer, int len) { unsigned int i; for (i = 0; i < len; i++) buffer[i] = (i + seed) & 0xff; } int check_block(int test, const char *buffer, int len, int start, int count, const char *name) { unsigned int i; int fore = 0, aft = 0; for (i = 0; i < start; i++) if (buffer[i] != (char) ((i + seed) & 0xff)) { fore = start - i; break; } for (i = start + count; i < len; i++) if (buffer[i] != (char) ((i + seed) & 0xff)) { aft = i - start; break; } if (fore || aft) { printf("%d: %s scribbled ", test, name); if (fore) printf("%d byte(s) before", fore); if (fore && aft) printf(", and "); if (aft) printf("%d byte(s) after", aft); printf(" the allocated buffer.\n"); return 1; } return 0; } char MemoAppBlock[17 * 16 + 10] = "\ \x00\x00\x55\x6e\x66\x69\x6c\x65\x64\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x42\x75\x73\x69\x6e\x65\x73\x73\x00\x00\x00\x00\x00\x00\ \x00\x00\x50\x65\x72\x73\x6f\x6e\x61\x6c\x00\x00\x00\x00\x00\x00\ \x00\x00\x54\x65\x63\x68\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x54\x65\x73\x74\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x42\x6f\x6f\x6b\x73\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x53\x74\x6f\x72\x79\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x01\x02\x10\x11\x12\x13\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x13\x00\x00\x00\x00\x00\x01\x00"; char MemoRecord[3 * 16 + 7] = "\ \x61\x61\x4d\x61\x6b\x65\x66\x69\x6c\x65\x0a\x52\x45\x41\x44\x4d\ \x45\x0a\x6c\x69\x63\x65\x6e\x73\x65\x2e\x74\x65\x72\x6d\x73\x0a\ \x70\x69\x6c\x6f\x74\x6c\x69\x6e\x6b\x2e\x63\x0a\x74\x65\x73\x74\ \x2e\x74\x63\x6c\x2a\x0a\x00"; int test_memo() { struct MemoAppInfo mai; struct Memo m; pi_buffer_t *RecordBuffer; int l; int errors = 0; /* Unpacker should return count of bytes used */ l = unpack_MemoAppInfo(&mai, MemoAppBlock, sizeof(MemoAppBlock) + 10); if (l != sizeof(MemoAppBlock)) { errors++; printf ("1: unpack_MemoAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(MemoAppBlock)); } /* Unpacker should return count of bytes used */ l = unpack_MemoAppInfo(&mai, MemoAppBlock, sizeof(MemoAppBlock) + 1); if (l != sizeof(MemoAppBlock)) { errors++; printf ("2: unpack_MemoAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(MemoAppBlock)); } /* Unpacker should return failure if the block is too small to contain data */ l = unpack_MemoAppInfo(&mai, MemoAppBlock, sizeof(MemoAppBlock) - 10); if (l != 0) { errors++; printf ("3: unpack_MemoAppInfo returned incorrect length (got %d, expected %d)\n", l, 0); } /* Unpacker should return failure if the block is too small to contain data */ /* Note: -1 isn't used, because four bytes _can_ be subtracted, to account for the new data in OS 2.0 */ l = unpack_MemoAppInfo(&mai, MemoAppBlock, sizeof(MemoAppBlock) - 5); if (l != 0) { errors++; printf ("4: unpack_MemoAppInfo returned incorrect length (got %d, expected %d)\n", l, 0); } /* Unpacker should return count of bytes used */ l = unpack_MemoAppInfo(&mai, MemoAppBlock, sizeof(MemoAppBlock)); if (l != sizeof(MemoAppBlock)) { errors++; printf ("5: unpack_MemoAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(MemoAppBlock)); } if ( (mai.sortByAlpha == 0) || strcmp(mai.category.name[0], "Unfiled") || strcmp(mai.category.name[1], "Business") || strcmp(mai.category.name[2], "Personal") || strcmp(mai.category.name[3], "Tech") || strcmp(mai.category.name[4], "Test") || strcmp(mai.category.name[5], "Books") || strcmp(mai.category.name[6], "Story") || strcmp(mai.category.name[7], "") || strcmp(mai.category.name[8], "") || strcmp(mai.category.name[9], "") || strcmp(mai.category.name[10], "") || strcmp(mai.category.name[11], "") || strcmp(mai.category.name[12], "") || strcmp(mai.category.name[13], "") || strcmp(mai.category.name[14], "") || strcmp(mai.category.name[15], "") || mai.category.renamed[0] || mai.category.renamed[1] || mai.category.renamed[2] || mai.category.renamed[3] || mai.category.renamed[4] || mai.category.renamed[5] || mai.category.renamed[6] || mai.category.renamed[7] || mai.category.renamed[8] || mai.category.renamed[9] || mai.category.renamed[10] || mai.category.renamed[11] || mai.category.renamed[12] || mai.category.renamed[13] || mai.category.renamed[14] || mai.category.renamed[15] || (mai.category.ID[0] != 0) || (mai.category.ID[1] != 1) || (mai.category.ID[2] != 2) || (mai.category.ID[3] != 16) || (mai.category.ID[4] != 17) || (mai.category.ID[5] != 18) || (mai.category.ID[6] != 19) || (mai.category.ID[7] != 0) || (mai.category.ID[8] != 0) || (mai.category.ID[9] != 0) || (mai.category.ID[10] != 0) || (mai.category.ID[11] != 0) || (mai.category.ID[12] != 0) || (mai.category.ID[13] != 0) || (mai.category.ID[14] != 0) || (mai.category.ID[15] != 0) || (mai.category.lastUniqueID != 19) || 0) { errors++; printf("6: unpack_MemoAppInfo generated incorrect information\n"); } /* Packer should return necessary block length when no buffer is given */ l = pack_MemoAppInfo(&mai, 0, 0); if (l != sizeof(MemoAppBlock)) { errors++; printf ("7: pack_MemoAppInfo returned incorrect allocation length (got %d, expected %d)\n", l, sizeof(MemoAppBlock)); } reset_block(target, 8192); /* Packer should not pack when the block length is too small */ l = pack_MemoAppInfo(&mai, target + 128, 1); if (l != 0) { errors++; printf("8: pack_MemoAppInfo packed into too small buffer (got %d)\n", l); } /* Packer should not scribble on memory */ if (check_block(9, target, 8192, 128, 1, "pack_MemoAppInfo")) errors++; reset_block(target, 8192); /* Packer should return length of data written */ l = pack_MemoAppInfo(&mai, target + 128, 8192 - 256); if (l != sizeof(MemoAppBlock)) { errors++; printf ("10: pack_MemoAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(MemoAppBlock)); } /* Packer should not scribble on memory */ if (check_block(11, target, 8192, 128, l, "pack_MemoAppInfo")) errors++; if (memcmp(target + 128, MemoAppBlock, sizeof(MemoAppBlock))) { errors++; printf ("12: pack_MemoAppInfo generated incorrect information. Got:\n"); pi_dumpdata(target + 128, l); printf(" expected:\n"); pi_dumpdata(MemoAppBlock, sizeof(MemoAppBlock)); } RecordBuffer = pi_buffer_new(sizeof(MemoRecord)); memcpy(RecordBuffer->data, MemoRecord, RecordBuffer->allocated); RecordBuffer->used=sizeof(MemoRecord); unpack_Memo(&m, RecordBuffer, memo_v1); pi_buffer_free(RecordBuffer); if ( (m.text == 0) || strcmp(m.text, "aaMakefile\x0aREADME\x0alicense.terms\x0apilotlink.c\x0atest.tcl*\x0a")) { errors++; printf("13: unpack_Memo generated incorrect information\n"); } RecordBuffer = pi_buffer_new(0); if (pack_Memo(&m, RecordBuffer, memo_v1) != 0) { errors++; printf("14: pack_Memo returned failure\n"); } if (RecordBuffer->used != sizeof(MemoRecord)) { errors++; printf ("15: pack_MemoRecord returned incorrect allocation length (got %d, expected %d)\n", RecordBuffer->used, sizeof(MemoRecord)); } if (memcmp(RecordBuffer->data, MemoRecord, sizeof(MemoRecord))) { errors++; printf("16: pack_Memo generated incorrect information. Got:\n"); pi_dumpdata(target + 128, l); printf(" expected:\n"); pi_dumpdata(MemoRecord, sizeof(MemoRecord)); } pi_buffer_free(RecordBuffer); printf("Memo packers test completed with %d error(s).\n", errors); return errors; } char AddressAppBlock[39 * 16 + 14] = "\ \x00\x10\x55\x6e\x66\x69\x6c\x65\x64\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x42\x75\x73\x69\x6e\x65\x73\x73\x00\x00\x00\x00\x00\x00\ \x00\x00\x50\x65\x72\x73\x6f\x6e\x61\x6c\x00\x00\x00\x00\x00\x00\ \x00\x00\x51\x75\x69\x63\x6b\x4c\x69\x73\x74\x00\x00\x00\x00\x00\ \x00\x00\x46\x6f\x6f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x01\x02\x03\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x11\x00\x00\x00\x00\x00\x0e\x00\x4c\x61\x73\x74\x20\x6e\ \x61\x6d\x65\x00\x00\x00\x00\x00\x00\x00\x46\x69\x72\x73\x74\x20\ \x6e\x61\x6d\x65\x00\x00\x00\x00\x00\x00\x43\x6f\x6d\x70\x61\x6e\ \x79\x00\x00\x00\x00\x00\x00\x00\x00\x00\x57\x6f\x72\x6b\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x48\x6f\x6d\x65\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x46\x61\x78\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4f\x74\x68\x65\x72\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x45\x2d\x6d\x61\x69\x6c\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x41\x64\x64\x72\x65\x73\ \x73\x00\x00\x00\x00\x00\x00\x00\x00\x00\x43\x69\x74\x79\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x53\x74\x61\x74\x65\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5a\x69\x70\x20\x43\x6f\ \x64\x65\x00\x00\x00\x00\x00\x00\x00\x00\x43\x6f\x75\x6e\x74\x72\ \x79\x00\x00\x00\x00\x00\x00\x00\x00\x00\x54\x69\x74\x6c\x65\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x43\x75\x73\x74\x6f\x6d\ \x20\x31\x00\x00\x00\x00\x00\x00\x00\x00\x43\x75\x73\x74\x6f\x6d\ \x20\x32\x00\x00\x00\x00\x00\x00\x00\x00\x43\x75\x73\x74\x6f\x6d\ \x20\x33\x00\x00\x00\x00\x00\x00\x00\x00\x43\x75\x73\x74\x6f\x6d\ \x20\x34\x00\x00\x00\x00\x00\x00\x00\x00\x4e\x6f\x74\x65\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4d\x61\x69\x6e\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x50\x61\x67\x65\x72\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4d\x6f\x62\x69\x6c\x65\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00"; char AddressRecord[2 * 16 + 12] = "\ \x00\x14\x32\x10\x00\x04\x41\x03\x00\x53\x68\x61\x77\x00\x42\x65\ \x72\x6e\x61\x72\x64\x00\x4e\x6f\x6e\x65\x20\x6b\x6e\x6f\x77\x6e\ \x00\x43\x31\x00\x41\x20\x6e\x6f\x74\x65\x2e\x00"; int test_address() { struct AddressAppInfo mai; struct Address m; pi_buffer_t *RecordBuffer; int l; int errors = 0; /* Unpacker should return count of bytes used */ l = unpack_AddressAppInfo(&mai, AddressAppBlock, sizeof(AddressAppBlock) + 10); if (l != sizeof(AddressAppBlock)) { errors++; printf ("1: unpack_AddressAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(AddressAppBlock)); } /* Unpacker should return count of bytes used */ l = unpack_AddressAppInfo(&mai, AddressAppBlock, sizeof(AddressAppBlock) + 1); if (l != sizeof(AddressAppBlock)) { errors++; printf ("2: unpack_AddressAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(AddressAppBlock)); } /* Unpacker should return failure if the block is too small to contain data */ l = unpack_AddressAppInfo(&mai, AddressAppBlock, sizeof(AddressAppBlock) - 10); if (l != 0) { errors++; printf ("3: unpack_AddressAppInfo returned incorrect length (got %d, expected %d)\n", l, 0); } /* Unpacker should return failure if the block is too small to contain data */ l = unpack_AddressAppInfo(&mai, AddressAppBlock, sizeof(AddressAppBlock) - 1); if (l != 0) { errors++; printf ("4: unpack_AddressAppInfo returned incorrect length (got %d, expected %d)\n", l, 0); } /* Unpacker should return count of bytes used */ l = unpack_AddressAppInfo(&mai, AddressAppBlock, sizeof(AddressAppBlock)); if (l != sizeof(AddressAppBlock)) { errors++; printf ("5: unpack_AddressAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(AddressAppBlock)); } if (strcmp(mai.category.name[0], "Unfiled") || strcmp(mai.category.name[1], "Business") || strcmp(mai.category.name[2], "Personal") || strcmp(mai.category.name[3], "QuickList") || strcmp(mai.category.name[4], "Foo") || strcmp(mai.category.name[5], "") || strcmp(mai.category.name[6], "") || strcmp(mai.category.name[7], "") || strcmp(mai.category.name[8], "") || strcmp(mai.category.name[9], "") || strcmp(mai.category.name[10], "") || strcmp(mai.category.name[11], "") || strcmp(mai.category.name[12], "") || strcmp(mai.category.name[13], "") || strcmp(mai.category.name[14], "") || strcmp(mai.category.name[15], "") || mai.category.renamed[0] || mai.category.renamed[1] || mai.category.renamed[2] || mai.category.renamed[3] || (!mai.category.renamed[4]) || mai.category.renamed[5] || mai.category.renamed[6] || mai.category.renamed[7] || mai.category.renamed[8] || mai.category.renamed[9] || mai.category.renamed[10] || mai.category.renamed[11] || mai.category.renamed[12] || mai.category.renamed[13] || mai.category.renamed[14] || mai.category.renamed[15] || (mai.category.ID[0] != 0) || (mai.category.ID[1] != 1) || (mai.category.ID[2] != 2) || (mai.category.ID[3] != 3) || (mai.category.ID[4] != 17) || (mai.category.ID[5] != 0) || (mai.category.ID[6] != 0) || (mai.category.ID[7] != 0) || (mai.category.ID[8] != 0) || (mai.category.ID[9] != 0) || (mai.category.ID[10] != 0) || (mai.category.ID[11] != 0) || (mai.category.ID[12] != 0) || (mai.category.ID[13] != 0) || (mai.category.ID[14] != 0) || (mai.category.ID[15] != 0) || (mai.category.lastUniqueID != 17) || 0) { errors++; printf("6: unpack_AddressAppInfo generated incorrect information\n"); } /* Packer should return necessary block length when no buffer is given */ l = pack_AddressAppInfo(&mai, 0, 0); if (l != sizeof(AddressAppBlock)) { errors++; printf ("7: pack_AddressAppInfo returned incorrect allocation length (got %d, expected %d)\n", l, sizeof(AddressAppBlock)); } reset_block(target, 8192); /* Packer should not pack when the block length is too small */ l = pack_AddressAppInfo(&mai, target + 128, 1); if (l != 0) { errors++; printf ("8: pack_AddressAppInfo packed into too small buffer (got %d)\n", l); } /* Packer should not scribble on memory */ if (check_block(9, target, 8192, 128, 1, "pack_AddressAppInfo")) errors++; reset_block(target, 8192); /* Packer should return length of data written */ l = pack_AddressAppInfo(&mai, target + 128, 8192 - 256); if (l != sizeof(AddressAppBlock)) { errors++; printf ("10: pack_AddressAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(AddressAppBlock)); } /* Packer should not scribble on memory */ if (check_block(11, target, 8192, 128, l, "pack_AddressAppInfo")) errors++; if (memcmp(target + 128, AddressAppBlock, sizeof(AddressAppBlock))) { errors++; printf ("12: pack_AddressAppInfo generated incorrect information. Got:\n"); pi_dumpdata(target + 128, l); printf(" expected:\n"); pi_dumpdata(AddressAppBlock, sizeof(AddressAppBlock)); } /* Unpacker should return count of bytes used */ RecordBuffer = pi_buffer_new(sizeof(AddressRecord)); memcpy(RecordBuffer->data, AddressRecord, RecordBuffer->allocated); RecordBuffer->used=sizeof(AddressRecord); unpack_Address(&m, RecordBuffer, address_v1); pi_buffer_free(RecordBuffer); if ( (m.phoneLabel[0] != 0) || (m.phoneLabel[1] != 1) || (m.phoneLabel[2] != 2) || (m.phoneLabel[3] != 3) || (m.phoneLabel[4] != 4) || strcmp(m.entry[0], "Shaw") || strcmp(m.entry[1], "Bernard") || m.entry[2] || m.entry[3] || strcmp(m.entry[8], "None known") || strcmp(m.entry[14], "C1") || (m.showPhone != 1) || 0) { errors++; printf("13: unpack_Address generated incorrect information\n"); } RecordBuffer = pi_buffer_new(0); if (pack_Address(&m, RecordBuffer, address_v1) != 0) { errors++; printf("14: pack_Address returned failure\n"); } if (RecordBuffer->used != sizeof(AddressRecord)) { errors++; printf ("15: pack_Address returned incorrect length (got %d, expected %d)\n", RecordBuffer->used, sizeof(AddressRecord)); } if (memcmp(RecordBuffer->data, AddressRecord, sizeof(AddressRecord))) { errors++; printf("16: pack_Address generated incorrect information. Got:\n"); pi_dumpdata(RecordBuffer->data, l); printf(" expected:\n"); pi_dumpdata(AddressRecord, sizeof(AddressRecord)); } pi_buffer_free(RecordBuffer); printf("Address packers test completed with %d error(s).\n", errors); return errors; } char AppointmentAppBlock[17 * 16 + 8] = "\ \x00\x00\x55\x6e\x66\x69\x6c\x65\x64\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00"; /* Note: Bytes seven and seventeen ares undefined by the Pilot code, and thus have a floating value. This sample record has been altered to make theses bytes zero, to match what our packing code generates. */ char AppointmentRecord[2 * 16 + 3] = "\ \x09\x00\x0d\x28\xbb\x02\x7c\x00\x1d\x02\x02\x00\xbd\x24\x02\x55\ \x00\x00\x00\x01\xbb\x0c\x47\x65\x6f\x72\x67\x65\x00\x4e\x6f\x74\ \x65\x21\x00"; int test_appointment() { struct AppointmentAppInfo mai; struct Appointment m; pi_buffer_t *RecordBuffer; int l; int errors = 0; /* Unpacker should return count of bytes used */ l = unpack_AppointmentAppInfo(&mai, AppointmentAppBlock, sizeof(AppointmentAppBlock) + 10); if (l != sizeof(AppointmentAppBlock)) { errors++; printf ("1: unpack_AppointmentAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(AppointmentAppBlock)); } /* Unpacker should return count of bytes used */ l = unpack_AppointmentAppInfo(&mai, AppointmentAppBlock, sizeof(AppointmentAppBlock) + 1); if (l != sizeof(AppointmentAppBlock)) { errors++; printf ("2: unpack_AppointmentAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(AppointmentAppBlock)); } /* Unpacker should return failure if the block is too small to contain data */ l = unpack_AppointmentAppInfo(&mai, AppointmentAppBlock, sizeof(AppointmentAppBlock) - 10); if (l != 0) { errors++; printf ("3: unpack_AppointmentAppInfo returned incorrect length (got %d, expected %d)\n", l, 0); } /* Unpacker should return failure if the block is too small to contain data */ l = unpack_AppointmentAppInfo(&mai, AppointmentAppBlock, sizeof(AppointmentAppBlock) - 1); if (l != 0) { errors++; printf ("4: unpack_AppointmentAppInfo returned incorrect length (got %d, expected %d)\n", l, 0); } /* Unpacker should return count of bytes used */ l = unpack_AppointmentAppInfo(&mai, AppointmentAppBlock, sizeof(AppointmentAppBlock)); if (l != sizeof(AppointmentAppBlock)) { errors++; printf ("5: unpack_AppointmentAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(AppointmentAppBlock)); } if ( /* strcmp(mai.category.name[0],"Unfiled") || strcmp(mai.category.name[1],"Business") || strcmp(mai.category.name[2],"Personal") || strcmp(mai.category.name[3],"QuickList") || strcmp(mai.category.name[4],"Foo") || strcmp(mai.category.name[5],"") || strcmp(mai.category.name[6],"") || strcmp(mai.category.name[7],"") || strcmp(mai.category.name[8],"") || strcmp(mai.category.name[9],"") || strcmp(mai.category.name[10],"") || strcmp(mai.category.name[11],"") || strcmp(mai.category.name[12],"") || strcmp(mai.category.name[13],"") || strcmp(mai.category.name[14],"") || strcmp(mai.category.name[15],"") || mai.category.renamed[0] || mai.category.renamed[1] || mai.category.renamed[2] || mai.category.renamed[3] || (!mai.category.renamed[4]) || mai.category.renamed[5] || mai.category.renamed[6] || mai.category.renamed[7] || mai.category.renamed[8] || mai.category.renamed[9] || mai.category.renamed[10] || mai.category.renamed[11] || mai.category.renamed[12] || mai.category.renamed[13] || mai.category.renamed[14] || mai.category.renamed[15] || (mai.category.ID[0] != 0) || (mai.category.ID[1] != 1) || (mai.category.ID[2] != 2) || (mai.category.ID[3] != 3) || (mai.category.ID[4] != 17) || (mai.category.ID[5] != 0) || (mai.category.ID[6] != 0) || (mai.category.ID[7] != 0) || (mai.category.ID[8] != 0) || (mai.category.ID[9] != 0) || (mai.category.ID[10] != 0) || (mai.category.ID[11] != 0) || (mai.category.ID[12] != 0) || (mai.category.ID[13] != 0) || (mai.category.ID[14] != 0) || (mai.category.ID[15] != 0) || (mai.category.lastUniqueID != 17) ||*/ 0) { errors++; printf ("6: unpack_AppointmentAppInfo generated incorrect information\n"); } /* Packer should return necessary block length when no buffer is given */ l = pack_AppointmentAppInfo(&mai, 0, 0); if (l != sizeof(AppointmentAppBlock)) { errors++; printf ("7: pack_AppointmentAppInfo returned incorrect allocation length (got %d, expected %d)\n", l, sizeof(AppointmentAppBlock)); } reset_block(target, 8192); /* Packer should not pack when the block length is too small */ l = pack_AppointmentAppInfo(&mai, target + 128, 1); if (l != 0) { errors++; printf ("8: pack_AppointmentAppInfo packed into too small buffer (got %d)\n", l); } /* Packer should not scribble on memory */ if (check_block(9, target, 8192, 128, 1, "pack_AppointmentAppInfo")) errors++; reset_block(target, 8192); /* Packer should return length of data written */ l = pack_AppointmentAppInfo(&mai, target + 128, 8192 - 256); if (l != sizeof(AppointmentAppBlock)) { errors++; printf ("10: pack_AppointmentAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(AppointmentAppBlock)); } /* Packer should not scribble on memory */ if (check_block(11, target, 8192, 128, l, "pack_AppointmentAppInfo")) errors++; if (memcmp (target + 128, AppointmentAppBlock, sizeof(AppointmentAppBlock))) { errors++; printf ("12: pack_AppointmentAppInfo generated incorrect information. Got:\n"); pi_dumpdata(target + 128, l); printf(" expected:\n"); pi_dumpdata(AppointmentAppBlock, sizeof(AppointmentAppBlock)); } RecordBuffer = pi_buffer_new(sizeof(AppointmentRecord)); memcpy(RecordBuffer->data, AppointmentRecord, RecordBuffer->allocated); RecordBuffer->used=sizeof(AppointmentRecord); unpack_Appointment(&m, RecordBuffer, datebook_v1); pi_buffer_free(RecordBuffer); if ( /* (m.phonelabel[0] != 0) || (m.phonelabel[1] != 1) || (m.phonelabel[2] != 2) || (m.phonelabel[3] != 3) || (m.phonelabel[4] != 4) || strcmp(m.entry[0],"Shaw") || strcmp(m.entry[1],"Bernard") || m.entry[2] || m.entry[3] || strcmp(m.entry[8],"None known") || strcmp(m.entry[14],"C1") || (m.whichphone != 1) ||*/ 0) { errors++; printf("13: unpack_Appointment generated incorrect information\n"); } RecordBuffer = pi_buffer_new(0); if (pack_Appointment(&m, RecordBuffer, datebook_v1) != 0) { errors++; printf("14: pack_Appointment returned failure\n"); } if (RecordBuffer->used != sizeof(AppointmentRecord)) { errors++; printf ("15: pack_Appointment returned incorrect length (got %d, expected %d)\n", RecordBuffer->used, sizeof(AppointmentRecord)); } if (memcmp(RecordBuffer->data, AppointmentRecord, sizeof(AppointmentRecord))) { errors++; printf ("16: pack_Appointment generated incorrect information. Got:\n"); pi_dumpdata(RecordBuffer->data, l); printf(" expected:\n"); pi_dumpdata(AppointmentRecord, sizeof(AppointmentRecord)); } printf("Appointment packers test completed with %d error(s).\n", errors); return errors; } char ToDoAppBlock[17 * 16 + 10] = "\ \x00\x08\x55\x6e\x66\x69\x6c\x65\x64\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x42\x75\x73\x69\x6e\x65\x73\x73\x00\x00\x00\x00\x00\x00\ \x00\x00\x50\x65\x72\x73\x6f\x6e\x61\x6c\x00\x00\x00\x00\x00\x00\ \x00\x00\x46\x6f\x6f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x01\x02\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x11\x00\x00\x00\xff\xff\x01\x00"; char ToDoRecord[1 * 16 + 1] = "\ \xbb\x09\x05\x54\x6f\x64\x6f\x33\x00\x41\x20\x6e\x6f\x74\x65\x2e\ \x00"; int test_todo() { struct ToDoAppInfo mai; struct ToDo m; pi_buffer_t *RecordBuffer; int l; int errors = 0; /* Unpacker should return count of bytes used */ l = unpack_ToDoAppInfo(&mai, ToDoAppBlock, sizeof(ToDoAppBlock) + 10); if (l != sizeof(ToDoAppBlock)) { errors++; printf ("1: unpack_ToDoAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(ToDoAppBlock)); } /* Unpacker should return count of bytes used */ l = unpack_ToDoAppInfo(&mai, ToDoAppBlock, sizeof(ToDoAppBlock) + 1); if (l != sizeof(ToDoAppBlock)) { errors++; printf ("2: unpack_ToDoAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(ToDoAppBlock)); } /* Unpacker should return failure if the block is too small to contain data */ l = unpack_ToDoAppInfo(&mai, ToDoAppBlock, sizeof(ToDoAppBlock) - 10); if (l != 0) { errors++; printf ("3: unpack_ToDoAppInfo returned incorrect length (got %d, expected %d)\n", l, 0); } /* Unpacker should return failure if the block is too small to contain data */ l = unpack_ToDoAppInfo(&mai, ToDoAppBlock, sizeof(ToDoAppBlock) - 1); if (l != 0) { errors++; printf ("4: unpack_ToDoAppInfo returned incorrect length (got %d, expected %d)\n", l, 0); } /* Unpacker should return count of bytes used */ l = unpack_ToDoAppInfo(&mai, ToDoAppBlock, sizeof(ToDoAppBlock)); if (l != sizeof(ToDoAppBlock)) { errors++; printf ("5: unpack_ToDoAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(ToDoAppBlock)); } if ( /* strcmp(mai.category.name[0],"Unfiled") || strcmp(mai.category.name[1],"Business") || strcmp(mai.category.name[2],"Personal") || strcmp(mai.category.name[3],"QuickList") || strcmp(mai.category.name[4],"Foo") || strcmp(mai.category.name[5],"") || strcmp(mai.category.name[6],"") || strcmp(mai.category.name[7],"") || strcmp(mai.category.name[8],"") || strcmp(mai.category.name[9],"") || strcmp(mai.category.name[10],"") || strcmp(mai.category.name[11],"") || strcmp(mai.category.name[12],"") || strcmp(mai.category.name[13],"") || strcmp(mai.category.name[14],"") || strcmp(mai.category.name[15],"") || mai.category.renamed[0] || mai.category.renamed[1] || mai.category.renamed[2] || mai.category.renamed[3] || (!mai.category.renamed[4]) || mai.category.renamed[5] || mai.category.renamed[6] || mai.category.renamed[7] || mai.category.renamed[8] || mai.category.renamed[9] || mai.category.renamed[10] || mai.category.renamed[11] || mai.category.renamed[12] || mai.category.renamed[13] || mai.category.renamed[14] || mai.category.renamed[15] || (mai.category.ID[0] != 0) || (mai.category.ID[1] != 1) || (mai.category.ID[2] != 2) || (mai.category.ID[3] != 3) || (mai.category.ID[4] != 17) || (mai.category.ID[5] != 0) || (mai.category.ID[6] != 0) || (mai.category.ID[7] != 0) || (mai.category.ID[8] != 0) || (mai.category.ID[9] != 0) || (mai.category.ID[10] != 0) || (mai.category.ID[11] != 0) || (mai.category.ID[12] != 0) || (mai.category.ID[13] != 0) || (mai.category.ID[14] != 0) || (mai.category.ID[15] != 0) || (mai.category.lastUniqueID != 17) ||*/ 0) { errors++; printf("6: unpack_ToDoAppInfo generated incorrect information\n"); } /* Packer should return necessary block length when no buffer is given */ l = pack_ToDoAppInfo(&mai, 0, 0); if (l != sizeof(ToDoAppBlock)) { errors++; printf ("7: pack_ToDoAppInfo returned incorrect allocation length (got %d, expected %d)\n", l, sizeof(ToDoAppBlock)); } reset_block(target, 8192); /* Packer should not pack when the block length is too small */ l = pack_ToDoAppInfo(&mai, target + 128, 1); if (l != 0) { errors++; printf("8: pack_ToDoAppInfo packed into too small buffer (got %d)\n", l); } /* Packer should not scribble on memory */ if (check_block(9, target, 8192, 128, 1, "pack_ToDoAppInfo")) errors++; reset_block(target, 8192); /* Packer should return length of data written */ l = pack_ToDoAppInfo(&mai, target + 128, 8192 - 256); if (l != sizeof(ToDoAppBlock)) { errors++; printf ("10: pack_ToDoAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(ToDoAppBlock)); } /* Packer should not scribble on memory */ if (check_block(11, target, 8192, 128, l, "pack_ToDoAppInfo")) errors++; if (memcmp(target + 128, ToDoAppBlock, sizeof(ToDoAppBlock))) { errors++; printf ("12: pack_ToDoAppInfo generated incorrect information. Got:\n"); pi_dumpdata(target + 128, l); printf(" expected:\n"); pi_dumpdata(ToDoAppBlock, sizeof(ToDoAppBlock)); } /* Unpacker should return count of bytes used */ RecordBuffer = pi_buffer_new(sizeof(ToDoRecord)); memcpy(RecordBuffer->data, ToDoRecord, RecordBuffer->allocated); RecordBuffer->used=sizeof(ToDoRecord); unpack_ToDo(&m, RecordBuffer, todo_v1); pi_buffer_free(RecordBuffer); if ( /* (m.phonelabel[0] != 0) || (m.phonelabel[1] != 1) || (m.phonelabel[2] != 2) || (m.phonelabel[3] != 3) || (m.phonelabel[4] != 4) || strcmp(m.entry[0],"Shaw") || strcmp(m.entry[1],"Bernard") || m.entry[2] || m.entry[3] || strcmp(m.entry[8],"None known") || strcmp(m.entry[14],"C1") || (m.whichphone != 1) ||*/ 0) { errors++; printf("13: unpack_ToDo generated incorrect information\n"); } reset_block(target, 8192); RecordBuffer = pi_buffer_new(0); if (pack_ToDo(&m, RecordBuffer, todo_v1) != 0) { errors++; printf("14: pack_ToDo returned failure\n"); } if (RecordBuffer->used != sizeof(ToDoRecord)) { errors++; printf ("15: pack_ToDo returned incorrect length (got %d, expected %d)\n", l, sizeof(ToDoRecord)); } if (memcmp(RecordBuffer->data, ToDoRecord, sizeof(ToDoRecord))) { errors++; printf("16: pack_ToDo generated incorrect information. Got:\n"); pi_dumpdata(RecordBuffer->data, l); printf(" expected:\n"); pi_dumpdata(ToDoRecord, sizeof(ToDoRecord)); } pi_buffer_free(RecordBuffer); printf("ToDo packers test completed with %d error(s).\n", errors); return errors; } char ExpenseAppBlock[24 * 16 + 8] = "\ \x00\x00\x55\x6e\x66\x69\x6c\x65\x64\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x4e\x65\x77\x20\x59\x6f\x72\x6b\x00\x00\x00\x00\x00\x00\ \x00\x00\x50\x61\x72\x69\x73\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x45\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x01\x02\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00"; /* Byte five is floating */ char ExpenseRecord[1 * 16 + 14] = "\ \xbb\x2a\x09\x01\x08\x00\x32\x39\x2e\x37\x32\x00\x55\x00\x43\x00\ \x41\x74\x74\x00\x54\x68\x65\x20\x6e\x6f\x74\x65\x2e\x00"; int test_expense() { struct ExpenseAppInfo mai; struct Expense m; int l; int errors = 0; /* Unpacker should return count of bytes used */ l = unpack_ExpenseAppInfo(&mai, ExpenseAppBlock, sizeof(ExpenseAppBlock) + 10); if (l != sizeof(ExpenseAppBlock)) { errors++; printf ("1: unpack_ExpenseAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(ExpenseAppBlock)); } /* Unpacker should return count of bytes used */ l = unpack_ExpenseAppInfo(&mai, ExpenseAppBlock, sizeof(ExpenseAppBlock) + 1); if (l != sizeof(ExpenseAppBlock)) { errors++; printf ("2: unpack_ExpenseAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(ExpenseAppBlock)); } /* Unpacker should return failure if the block is too small to contain data */ /*l = unpack_ExpenseAppInfo(&mai, ExpenseAppBlock, sizeof(ExpenseAppBlock)-10); if (l != 0) { errors++; printf("x: unpack_ExpenseAppInfo returned incorrect length (got %d, expected %d)\n", l, 0); } */ /* Unpacker should return count of bytes used */ l = unpack_ExpenseAppInfo(&mai, ExpenseAppBlock, sizeof(ExpenseAppBlock)); if (l != sizeof(ExpenseAppBlock)) { errors++; printf ("3: unpack_ExpenseAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(ExpenseAppBlock)); } if ( /* strcmp(mai.category.name[0],"Unfiled") || strcmp(mai.category.name[1],"Business") || strcmp(mai.category.name[2],"Personal") || strcmp(mai.category.name[3],"QuickList") || strcmp(mai.category.name[4],"Foo") || strcmp(mai.category.name[5],"") || strcmp(mai.category.name[6],"") || strcmp(mai.category.name[7],"") || strcmp(mai.category.name[8],"") || strcmp(mai.category.name[9],"") || strcmp(mai.category.name[10],"") || strcmp(mai.category.name[11],"") || strcmp(mai.category.name[12],"") || strcmp(mai.category.name[13],"") || strcmp(mai.category.name[14],"") || strcmp(mai.category.name[15],"") || mai.category.renamed[0] || mai.category.renamed[1] || mai.category.renamed[2] || mai.category.renamed[3] || (!mai.category.renamed[4]) || mai.category.renamed[5] || mai.category.renamed[6] || mai.category.renamed[7] || mai.category.renamed[8] || mai.category.renamed[9] || mai.category.renamed[10] || mai.category.renamed[11] || mai.category.renamed[12] || mai.category.renamed[13] || mai.category.renamed[14] || mai.category.renamed[15] || (mai.category.ID[0] != 0) || (mai.category.ID[1] != 1) || (mai.category.ID[2] != 2) || (mai.category.ID[3] != 3) || (mai.category.ID[4] != 17) || (mai.category.ID[5] != 0) || (mai.category.ID[6] != 0) || (mai.category.ID[7] != 0) || (mai.category.ID[8] != 0) || (mai.category.ID[9] != 0) || (mai.category.ID[10] != 0) || (mai.category.ID[11] != 0) || (mai.category.ID[12] != 0) || (mai.category.ID[13] != 0) || (mai.category.ID[14] != 0) || (mai.category.ID[15] != 0) || (mai.category.lastUniqueID != 17) ||*/ 0) { errors++; printf("4: unpack_ExpenseAppInfo generated incorrect information\n"); } /* Packer should return necessary block length when no buffer is given */ l = pack_ExpenseAppInfo(&mai, 0, 0); if (l != sizeof(ExpenseAppBlock)) { errors++; printf ("5: pack_ExpenseAppInfo returned incorrect allocation length (got %d, expected %d)\n", l, sizeof(ExpenseAppBlock)); } reset_block(target, 8192); /* Packer should not pack when the block length is too small */ l = pack_ExpenseAppInfo(&mai, target + 128, 1); if (l != 0) { errors++; printf ("6: pack_ExpenseAppInfo packed into too small buffer (got %d)\n", l); } /* Packer should not scribble on memory */ if (check_block(7, target, 8192, 128, 1, "pack_ExpenseAppInfo")) errors++; reset_block(target, 8192); /* Packer should return length of data written */ l = pack_ExpenseAppInfo(&mai, target + 128, 8192 - 256); if (l != sizeof(ExpenseAppBlock)) { errors++; printf ("8: pack_ExpenseAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(ExpenseAppBlock)); } /* Packer should not scribble on memory */ if (check_block(9, target, 8192, 128, l, "pack_ExpenseAppInfo")) errors++; if (memcmp(target + 128, ExpenseAppBlock, sizeof(ExpenseAppBlock))) { errors++; printf ("10: pack_ExpenseAppInfo generated incorrect information. Got:\n"); pi_dumpdata(target + 128, l); printf(" expected:\n"); pi_dumpdata(ExpenseAppBlock, sizeof(ExpenseAppBlock)); } /* Unpacker should return count of bytes used */ l = unpack_Expense(&m, ExpenseRecord, sizeof(ExpenseRecord) + 10); if (l != sizeof(ExpenseRecord)) { errors++; printf ("11: unpack_Expense returned incorrect length (got %d, expected %d)\n", l, sizeof(ExpenseRecord)); } if ( /* (m.phonelabel[0] != 0) || (m.phonelabel[1] != 1) || (m.phonelabel[2] != 2) || (m.phonelabel[3] != 3) || (m.phonelabel[4] != 4) || strcmp(m.entry[0],"Shaw") || strcmp(m.entry[1],"Bernard") || m.entry[2] || m.entry[3] || strcmp(m.entry[8],"None known") || strcmp(m.entry[14],"C1") || (m.whichphone != 1) ||*/ 0) { errors++; printf("12: unpack_Expense generated incorrect information\n"); } /* Packer should return necessary block length when no buffer is given */ l = pack_Expense(&m, 0, 0); if (l != sizeof(ExpenseRecord)) { errors++; printf ("13: pack_Expense returned incorrect allocation length (got %d, expected %d)\n", l, sizeof(ExpenseRecord)); } reset_block(target, 8192); /* Packer should not pack when the block length is too small */ l = pack_Expense(&m, target + 128, 1); if (l != 0) { errors++; printf("14: pack_Expense packed into too small buffer (got %d)\n", l); } /* Packer should not scribble on memory */ if (check_block(15, target, 8192, 128, 1, "pack_Expense")) errors++; reset_block(target, 8192); /* Packer should return length of data written */ l = pack_Expense(&m, target + 128, 8192 - 256); if (l != sizeof(ExpenseRecord)) { errors++; printf ("16: pack_Expense returned incorrect length (got %d, expected %d)\n", l, sizeof(ExpenseRecord)); } /* Packer should not scribble on memory */ if (check_block(17, target, 8192, 128, l, "pack_Expense")) errors++; if (memcmp(target + 128, ExpenseRecord, sizeof(ExpenseRecord))) { errors++; printf("18: pack_Expense generated incorrect information. Got:\n"); pi_dumpdata(target + 128, l); printf(" expected:\n"); pi_dumpdata(ExpenseRecord, sizeof(ExpenseRecord)); } printf("Expense packers test completed with %d error(s).\n", errors); return errors; } char MailAppBlock[18 * 16 + 1] = "\ \x00\x1f\x49\x6e\x62\x6f\x78\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x4f\x75\x74\x62\x6f\x78\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x44\x65\x6c\x65\x74\x65\x64\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x46\x69\x6c\x65\x64\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x44\x72\x61\x66\x74\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\ \x0e\x0f\x0f\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x01\x20\ \x00"; char MailRecord[1 * 16 + 2] = "\ \x00\x00\x00\x00\x78\x00\x43\x00\x00\x61\x00\x62\x00\x00\x00\x00\ \x44\x00"; /*\x27"; This byte seems to be spurious */ char MailSigPreference[3] = "\ \x61\x62\x00"; char MailSyncPreference[13] = "\ \x02\x01\x00\x00\x17\x70\x61\x74\x00\x6c\x64\x00\x00"; int test_mail() { struct MailAppInfo mai; struct Mail m; struct MailSyncPref s1; struct MailSignaturePref s2; int l; int errors = 0; /* Unpacker should return count of bytes used */ l = unpack_MailAppInfo(&mai, MailAppBlock, sizeof(MailAppBlock) + 10); if (l != sizeof(MailAppBlock)) { errors++; printf ("1: unpack_MailAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(MailAppBlock)); } /* Unpacker should return count of bytes used */ l = unpack_MailAppInfo(&mai, MailAppBlock, sizeof(MailAppBlock) + 1); if (l != sizeof(MailAppBlock)) { errors++; printf ("2: unpack_MailAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(MailAppBlock)); } /* Unpacker should return failure if the block is too small to contain data */ /*l = unpack_MailAppInfo(&mai, MailAppBlock, sizeof(MailAppBlock)-10); if (l != 0) { errors++; printf("2: unpack_MailAppInfo returned incorrect length (got %d, expected %d)\n", l, 0); } */ /* Unpacker should return count of bytes used */ l = unpack_MailAppInfo(&mai, MailAppBlock, sizeof(MailAppBlock)); if (l != sizeof(MailAppBlock)) { errors++; printf ("3: unpack_MailAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(MailAppBlock)); } if ( /* strcmp(mai.category.name[0],"Unfiled") || strcmp(mai.category.name[1],"Business") || strcmp(mai.category.name[2],"Personal") || strcmp(mai.category.name[3],"QuickList") || strcmp(mai.category.name[4],"Foo") || strcmp(mai.category.name[5],"") || strcmp(mai.category.name[6],"") || strcmp(mai.category.name[7],"") || strcmp(mai.category.name[8],"") || strcmp(mai.category.name[9],"") || strcmp(mai.category.name[10],"") || strcmp(mai.category.name[11],"") || strcmp(mai.category.name[12],"") || strcmp(mai.category.name[13],"") || strcmp(mai.category.name[14],"") || strcmp(mai.category.name[15],"") || mai.category.renamed[0] || mai.category.renamed[1] || mai.category.renamed[2] || mai.category.renamed[3] || (!mai.category.renamed[4]) || mai.category.renamed[5] || mai.category.renamed[6] || mai.category.renamed[7] || mai.category.renamed[8] || mai.category.renamed[9] || mai.category.renamed[10] || mai.category.renamed[11] || mai.category.renamed[12] || mai.category.renamed[13] || mai.category.renamed[14] || mai.category.renamed[15] || (mai.category.ID[0] != 0) || (mai.category.ID[1] != 1) || (mai.category.ID[2] != 2) || (mai.category.ID[3] != 3) || (mai.category.ID[4] != 17) || (mai.category.ID[5] != 0) || (mai.category.ID[6] != 0) || (mai.category.ID[7] != 0) || (mai.category.ID[8] != 0) || (mai.category.ID[9] != 0) || (mai.category.ID[10] != 0) || (mai.category.ID[11] != 0) || (mai.category.ID[12] != 0) || (mai.category.ID[13] != 0) || (mai.category.ID[14] != 0) || (mai.category.ID[15] != 0) || (mai.category.lastUniqueID != 17) ||*/ 0) { errors++; printf("4: unpack_MailAppInfo generated incorrect information\n"); } /* Packer should return necessary block length when no buffer is given */ l = pack_MailAppInfo(&mai, 0, 0); if (l != sizeof(MailAppBlock)) { errors++; printf ("5: pack_MailAppInfo returned incorrect allocation length (got %d, expected %d)\n", l, sizeof(MailAppBlock)); } reset_block(target, 8192); /* Packer should not pack when the block length is too small */ l = pack_MailAppInfo(&mai, target + 128, 1); if (l != 0) { errors++; printf("6: pack_MailAppInfo packed into too small buffer (got %d)\n", l); } /* Packer should not scribble on memory */ if (check_block(7, target, 8192, 128, 1, "pack_MailAppInfo")) errors++; reset_block(target, 8192); /* Packer should return length of data written */ l = pack_MailAppInfo(&mai, target + 128, 8192 - 256); if (l != sizeof(MailAppBlock)) { errors++; printf ("8: pack_MailAppInfo returned incorrect length (got %d, expected %d)\n", l, sizeof(MailAppBlock)); } /* Packer should not scribble on memory */ if (check_block(9, target, 8192, 128, l, "pack_MailAppInfo")) errors++; if (memcmp(target + 128, MailAppBlock, sizeof(MailAppBlock))) { errors++; printf ("10: pack_MailAppInfo generated incorrect information. Got:\n"); pi_dumpdata(target + 128, l); printf(" expected:\n"); pi_dumpdata(MailAppBlock, sizeof(MailAppBlock)); } /* Unpacker should return count of bytes used */ l = unpack_Mail(&m, MailRecord, sizeof(MailRecord) + 10); if (l != sizeof(MailRecord)) { errors++; printf ("11: unpack_Mail returned incorrect length (got %d, expected %d)\n", l, sizeof(MailRecord)); } if ( /* (m.phonelabel[0] != 0) || (m.phonelabel[1] != 1) || (m.phonelabel[2] != 2) || (m.phonelabel[3] != 3) || (m.phonelabel[4] != 4) || strcmp(m.entry[0],"Shaw") || strcmp(m.entry[1],"Bernard") || m.entry[2] || m.entry[3] || strcmp(m.entry[8],"None known") || strcmp(m.entry[14],"C1") || (m.whichphone != 1) ||*/ 0) { errors++; printf("12: unpack_Mail generated incorrect information\n"); } /* Packer should return necessary block length when no buffer is given */ l = pack_Mail(&m, 0, 0); if (l != sizeof(MailRecord)) { errors++; printf ("13: pack_Mail returned incorrect allocation length (got %d, expected %d)\n", l, sizeof(MailRecord)); } reset_block(target, 8192); /* Packer should not pack when the block length is too small */ l = pack_Mail(&m, target + 128, 1); if (l != 0) { errors++; printf("14: pack_Mail packed into too small buffer (got %d)\n", l); } /* Packer should not scribble on memory */ if (check_block(15, target, 8192, 128, 1, "pack_Mail")) errors++; reset_block(target, 8192); /* Packer should return length of data written */ l = pack_Mail(&m, target + 128, 8192 - 256); if (l != sizeof(MailRecord)) { errors++; printf ("16: pack_Mail returned incorrect length (got %d, expected %d)\n", l, sizeof(MailRecord)); } /* Packer should not scribble on memory */ if (check_block(17, target, 8192, 128, l, "pack_Mail")) errors++; if (memcmp(target + 128, MailRecord, sizeof(MailRecord))) { errors++; printf("18: pack_Mail generated incorrect information. Got:\n"); pi_dumpdata(target + 128, l); printf(" expected:\n"); pi_dumpdata(MailRecord, sizeof(MailRecord)); } /* Unpacker should return count of bytes used */ l = unpack_MailSyncPref(&s1, MailSyncPreference, sizeof(MailSyncPreference) + 10); if (l != sizeof(MailSyncPreference)) { errors++; printf ("19: unpack_MailSyncPref returned incorrect length (got %d, expected %d)\n", l, sizeof(MailSyncPreference)); } /* Unpacker should return count of bytes used */ l = unpack_MailSyncPref(&s1, MailSyncPreference, sizeof(MailSyncPreference) + 1); if (l != sizeof(MailSyncPreference)) { errors++; printf ("20: unpack_MailSyncPref returned incorrect length (got %d, expected %d)\n", l, sizeof(MailSyncPreference)); } /* Unpacker should return count of bytes used */ l = unpack_MailSyncPref(&s1, MailSyncPreference, sizeof(MailSyncPreference)); if (l != sizeof(MailSyncPreference)) { errors++; printf ("21: unpack_MailSyncPref returned incorrect length (got %d, expected %d)\n", l, sizeof(MailSyncPreference)); } if ( /* (m.phonelabel[0] != 0) || (m.phonelabel[1] != 1) || (m.phonelabel[2] != 2) || (m.phonelabel[3] != 3) || (m.phonelabel[4] != 4) || strcmp(m.entry[0],"Shaw") || strcmp(m.entry[1],"Bernard") || m.entry[2] || m.entry[3] || strcmp(m.entry[8],"None known") || strcmp(m.entry[14],"C1") || (m.whichphone != 1) ||*/ 0) { errors++; printf("22: unpack_MailSyncPref generated incorrect information\n"); } /* Packer should return necessary block length when no buffer is given */ l = pack_MailSyncPref(&s1, 0, 0); if (l != sizeof(MailSyncPreference)) { errors++; printf ("23: pack_MailSyncPref returned incorrect allocation length (got %d, expected %d)\n", l, sizeof(MailSyncPreference)); } reset_block(target, 8192); /* Packer should not pack when the block length is too small */ l = pack_MailSyncPref(&s1, target + 128, 1); if (l != 0) { errors++; printf ("24: pack_MailSyncPref packed into too small buffer (got %d)\n", l); } /* Packer should not scribble on memory */ if (check_block(25, target, 8192, 128, 1, "pack_MailSyncPref")) errors++; reset_block(target, 8192); /* Packer should return length of data written */ l = pack_MailSyncPref(&s1, target + 128, 8192 - 256); if (l != sizeof(MailSyncPreference)) { errors++; printf ("26: pack_MailSyncPref returned incorrect length (got %d, expected %d)\n", l, sizeof(MailSyncPreference)); } /* Packer should not scribble on memory */ if (check_block(27, target, 8192, 128, l, "pack_Mail")) errors++; if (memcmp (target + 128, MailSyncPreference, sizeof(MailSyncPreference))) { errors++; printf ("28: pack_MailSyncPref generated incorrect information. Got:\n"); pi_dumpdata(target + 128, l); printf(" expected:\n"); pi_dumpdata(MailSyncPreference, sizeof(MailSyncPreference)); } /* Unpacker should return count of bytes used */ l = unpack_MailSignaturePref(&s2, MailSigPreference, sizeof(MailSigPreference) + 10); if (l != sizeof(MailSigPreference)) { errors++; printf ("29: unpack_MailSigPref returned incorrect length (got %d, expected %d)\n", l, sizeof(MailSyncPreference)); } /* Unpacker should return count of bytes used */ l = unpack_MailSignaturePref(&s2, MailSigPreference, sizeof(MailSigPreference) + 1); if (l != sizeof(MailSigPreference)) { errors++; printf ("30: unpack_MailSigPref returned incorrect length (got %d, expected %d)\n", l, sizeof(MailSyncPreference)); } /* Unpacker should return count of bytes used */ l = unpack_MailSignaturePref(&s2, MailSigPreference, sizeof(MailSigPreference)); if (l != sizeof(MailSigPreference)) { errors++; printf ("31: unpack_MailSigPref returned incorrect length (got %d, expected %d)\n", l, sizeof(MailSyncPreference)); } if ( /* (m.phonelabel[0] != 0) || (m.phonelabel[1] != 1) || (m.phonelabel[2] != 2) || (m.phonelabel[3] != 3) || (m.phonelabel[4] != 4) || strcmp(m.entry[0],"Shaw") || strcmp(m.entry[1],"Bernard") || m.entry[2] || m.entry[3] || strcmp(m.entry[8],"None known") || strcmp(m.entry[14],"C1") || (m.whichphone != 1) ||*/ 0) { errors++; printf("32: unpack_MailSyncPref generated incorrect information\n"); } /* Packer should return necessary block length when no buffer is given */ l = pack_MailSignaturePref(&s2, 0, 0); if (l != sizeof(MailSigPreference)) { errors++; printf ("33: pack_MailSignaturePref returned incorrect allocation length (got %d, expected %d)\n", l, sizeof(MailSigPreference)); } reset_block(target, 8192); /* Packer should not pack when the block length is too small */ l = pack_MailSignaturePref(&s2, target + 128, 1); if (l != 0) { errors++; printf ("34: pack_MailSignaturePref packed into too small buffer (got %d)\n", l); } /* Packer should not scribble on memory */ if (check_block(35, target, 8192, 128, 1, "pack_MailSyncPref")) errors++; reset_block(target, 8192); /* Packer should return length of data written */ l = pack_MailSignaturePref(&s2, target + 128, 8192 - 256); if (l != sizeof(MailSigPreference)) { errors++; printf ("36: pack_MailSignaturePref returned incorrect length (got %d, expected %d)\n", l, sizeof(MailSigPreference)); } /* Packer should not scribble on memory */ if (check_block(37, target, 8192, 128, l, "pack_Mail")) errors++; if (memcmp(target + 128, MailSigPreference, sizeof(MailSigPreference))) { errors++; printf ("38: pack_MailSignaturePref generated incorrect information. Got:\n"); pi_dumpdata(target + 128, l); printf(" expected:\n"); pi_dumpdata(MailSigPreference, sizeof(MailSigPreference)); } printf("Mail packers test completed with %d error(s).\n", errors); return errors; } int main(int argc, char *argv[]) { seed = time(0) & 0xff; /* Make scribble checker use a random check value */ target = malloc(8192); targetlen = 8192; test_memo(); test_address(); test_appointment(); test_todo(); test_expense(); test_mail(); return 0; } pilot-link-0.12.5-dfsg/AUTHORS0000644000175000017500000000000007375376530016155 0ustar rousseaurousseau