2000-01-22 Andrew Arensburger Version 1.0.0 released. * src/conduit.c: Commented out some trace statements that shouldn't be printed every time. Clarified comment on status codes. * src/Makefile.in: Fixed install flags to strip binaries. * doc/pdb.texi: Added @dircategory and @direntry, for BSD port. * doc/conduits.texi: Added the reference section. Fixed some style points. Added @dircategory and @direntry, for BSD port. * doc/Makefile.in: Fixed the install flags. Duh. Took `libpalm' out of the default install, since it needs to be reorganized. Install the other info files by default. Version 0.5.7 released. Bug fix: categories weren't downloaded properly. * src/coldsync.c: Bug fix: don't run Dump conduits if we're doing a backup or restore (or, more generally, don't run them unless we're doing a sync). * libpdb/pdb.c: pdb_DownloadRecords() now correctly adds the category to downloaded records. * configure.in: Updated version. * src/handledb.c: Changed handledb() to just call run_GenericConduit() for now, until Sync conduits are implemented. * src/conduit.h: Took out old-API conduit stuff. * src/conduit.c: Took out a boatload of old-API conduit stuff. * src/GenericConduit.cc: Added notes on syncing AppInfo block. Updated invocations of new_Record(). * libpdb/pdb.c: new_Record() now takes a `category' attribute, and combines it with the `attributes' argument. This makes other parts of the code easier to write. * libpdb/Makefile.in: Commented out the actual install actions: it's too early to install the libraries just yet. * libpconn/Makefile.in: Commented out the actual install actions: it's too early to install the libraries just yet. * include/pconn/Makefile.in: Commented out the actual install actions: it's too early to install the .h files just yet. * include/pdb.h: Added 'category' argument to new_Record(), for "convenience" (it's a PITA to combine the flags and attribute, but it's also sometimes a PITA to separate them). * include/Makefile.in: Commented out the actual install actions: it's too early to install the .h files just yet. * doc/Makefile.in: Added INFODIR, preparatory to actually installing the documentation. Fixed install flags: don't automatically add the "-c". Added "conduits.texi", documentation on conduits. First, failed attempt at including HTML documentation in the distribution. * doc/conduits.texi (added): Documentation on conduits. * configure.in: Added test for 'texi2html', preparatory to generating HTML documentation. * src/Makefile.in: Fixed install flags: don't automatically add the "-c". 2000-01-19 Andrew Arensburger * src/config.c: get_config() now sets host ID. Finally took out load_config(). * src/conduit.h: Changed declarations for run_*_conduits() functions. * src/coldsync.c: Fixed run_Fetch_conduits() call. * src/GenericConduit.cc: Made some trace statements more specific. * doc/coldsync.8: "-p " is now listed as optional. Clarified explanation of the "-d" flags. Added "conduit" directives in .coldsyncrc . Rewrote section on syncing. * configure.in: Incremented version number. * TODO: Added, removed some stuff. * README: Redid the format of the OS-specific notes (again). * src/conduit.c: Added definition for WCOREDUMP, for AIX. Added run_conduits(), to hold the shared functionality of the run_*_conduit() functions. run_Fetch_conduits() now functional; run_Dump_conduits() uses run_conduits(). Sends "InputDB" and "OutputDB" header fields to conduit. 2000-01-13 Andrew Arensburger Version 0.5.5 released. * src/conduit.c: New conduit API. run_Dump_conduits() now works. Use the STD*_FILENO macros for clarity. Made signal stuff more portable. Replaced 'conduit_is_running' with a special value of 'conduit_pid', so that things are more atomic. Use execvp() instead of execve() to spawn conduits, so that they inherit environment. Send header lines to conduit: "Daemon", "Version", "InputDB", "OutputDB". Now use file handles instead of file descriptors to talk to conduit. Use fork() to spawn conduit instead of vfork(), since there's too much stuff going on for vfork() to work. Child's stdout is now line-buffered. Lots of smallish stuff in cond_sendline(). Added cond_sendheader(), for convenience. Added cond_readline(). Added cond_readstatus(). * src/config.c: In get_config(), get max # file descriptors. This can be useful in conduits. Set conduit flags to 0 in new_conduit_block(). * src/conduit.h: Defined max size of the lines sent back and forth between ColdSync and conduits; make sure they're sane. * src/coldsync.h: Added flags to conduit block. They're not used yet, though. Added 'sys_maxfds', the max # of file descriptors you can have. * src/coldsync.c: Removed the separate check for , since it appears to be a standard part of libintl. Updated the "-h" help message to conform to reality. * src/parser.y: Added "default" and "final" options for conduits. These aren't used yet, though. * src/lexer.l: Added placeholders for "final" and "default" options for conduits. These haven't been implemented yet. * src/handledb.c: Print out a message saying which database it's syncing. * config.h.in: Added macro for signal()'s return type. Added HAVE_SYSCONF. Added magic cpp lines to make things compile cleanly under OSF1/DU/Tru64. * configure.in: I18n support (such as it is) can now be turned off with "configure --without-i18n". The documentation-related tests now print a warning message if 'makeinfo', 'texi2dvi', 'dvips' couldn't be found, just so it's obvious that they weren't found. Added checks for and sysconf(). * README: Added version-specific notes, since I haven't been testing each version with each OS. * Makefile.in: Fixed the 'id' target so that the ID file gets rebuilt every time you "make id". * src/GenericConduit.cc: Changed sync logic yet again: "AddressBook" doesn't set the "deleted" flag for archived records. Grrr... 1999-12-05 Andrew Arensburger * src/conduit.c: First draft of functions that implement working conduits, preparatory to changing their API to use FILE *s instead of file descriptors. Added spawn_conduit(), cond_sendline(), sigchld_handler(). Added static global variables for child process state; this may prove to be a mistake. Use execve() for spawning conduits. This is probably a mistake. 1999-12-02 Andrew Arensburger * src/lexer.l: Hack to make lexer.l compile cleanly under Solaris. * src/GenericConduit.cc: Handle the case where a record was added and deleted since the last sync. * libpdb/pdb.c: Fixed a 0-byte allocation bug in new_Record(). 1999-12-01 Andrew Arensburger * src/Makefile.in, libpdb/Makefile.in, libpconn/Makefile.in, include/pconn/Makefile.in, include/Makefile.in: Split distribution stuff into "dist" and "dist-core", so that snapshots don't have to include extra fluff. Rearranged the order of cpp flags, so that a) user-specified flags can override those in the Makefile, and b) when compiling a new version, it #includes the .h files in the source tree, not those already installed. * doc/Makefile.in: Split distribution stuff into "dist" and "dist-core", so that snapshots don't have to include extra fluff (PostScript and .info files). * Makefile.in: Split distribution stuff into "dist" and "dist-core", so that snapshots don't have to include extra fluff. * src/coldsync.c: #include , for I18N packages other than GNU's. * src/parser.y: Fixed a double-free bug. 1999-11-28 Andrew Arensburger * libpdb/pdb.c: Fixed bug in pdb_DownloadRecords(): DlpReadRecordIDList() doesn't return more than 500 record IDs at once, which can cause problems for large databases. Need to call it repeatedly to make sure all of the IDs get read. Bug reported by Paul Rolland. * libpconn/dlp_cmd.c: Documented limitation in DlpReadRecordIDList(), that it doesn't retrieve more than 500 record IDs at once. * src/Makefile.in: Tidied up the 'depend' target. * libpdb/Makefile.in, libpconn/Makefile.in: Made 'make depend' work again. 1999-11-27 Andrew Arensburger Version 0.5.4 released * src/parser.y, src/lexer.l: Added I18N. * src/handledb.c: Got rid of some unused #includes. * src/config.c: Minor cleaning. * src/log.c, src/install.c: In error messages, took function name out of the string to be translated, to make things easier on translators. * src/coldsync.c: main() cleans up better after itself when something fails. In error messages, took function name out of the string to be translated, to make things easier on translators. * src/backup.c: Added logging during backup. * src/restore.c: Added logging during restores. * src/archive.c: Added I18N. Got rid of an unused #include. * src/GenericConduit.cc: Minor cleaning. * libpdb/pdb.c: Added I18N. Made error messages a tad more standard, for the benefit of translators. * libpconn/palm_errno.c: List the error codes next to their respective messages. * libpconn/dlp_cmd.c: Added I18N. Fixed most of the potential buffer overflows. * libpconn/slp.c, libpconn/padp.c, libpconn/dlp.c, libpconn/PConnection.c: Added I18N. * include/pconn/dlp_cmd.h: Added DLPARGLEN_CallApplication_* constants. * include/Makefile.in: Fixed the "entering directory `foo'", "leaving directory `foo'" messages. * HACKING: Added some notes on I18N. 1999-11-20 Andrew Arensburger * README: Minor disclaimer about compatibility. Added I18N. * src/config.c: Took out a bunch of obsolete stuff. Added sanity checks in get_config. Simplified getuid() call in load_palm_config(). * src/conduit.h: Removed unload_conduit() prototype. * src/conduit.c: Minor cleaning. Took out some of the old conduit API stuff that's obviously never going to be used. * src/coldsync.h: Fixed Connect() prototype. Removed obsolete parse_args(), load_config(). Added add_to_log(). * libpdb/pdb.c: Fixed pdb_Read: file offsets are supposed to be unsigned. Took out bogus arguments in calls to DlpWriteAppBlock() and DlpWriteSortBlock(). get_file_length() now returns unsigned value, like it says. Minor tidying: explicit 0Ls in a few places. 1999-11-19 Andrew Arensburger * configure.in: Added -I${prefix}/include to default CPPFLAGS. Added check for libintl, for i18n. * config.h.in: Added stuff for i18n. 1999-11-12 Andrew Arensburger * src/parser.y: Mark's patch: can't assign NULL to an enum. Duh. Added lint support in Makefiles * src/GenericConduit.cc: Took out the add_to_log() prototype, since it's now in "coldsync.h". * include/pconn/dlp_cmd.h, libpconn/dlp_cmd.c: Took out some unused arguments. * configure.in: Bumped up version number. * libpdb/Makefile.in, libpconn/Makefile.in: Added a variable for the library name. * Makefile.in: Fixed snapshot tarball name. * doc/libpalm.texi: Took out all the function prototypes. 1999-11-11 Andrew Arensburger * src/install.c: Add to the Palm's log when installing a file. Fixed a case where an error didn't get cleaned up properly. * doc/coldsync.8: Added section on configuration file. Rewrote the section on conduits for clarity; now talks about the new conduit API. Minor cleaning. Removed a bunch of old crap. Added ~/.palm/backup/Attic to list of files. 1999-11-10 Andrew Arensburger * src/GenericConduit.cc: FastSync now uploads dirty local records and otherwise deals correctly with the local database. * libpconn/dlp_cmd.c: Fixed a bug that clobbered the username on the Palm. * include/pconn/dlp_cmd.h: Fixed a bunch of bad memory references found by Purify. * src/parser.y: Set cur_listen to NULL when we're done with it. This way, it doesn't get free()d prematurely and we avoid all sorts of nastiness. * src/lexer.l: Explicitly terminate strings. * src/coldsync.c: Added "parse" to the list of debugging facilities. Initialize some 'uinfo' fields in UpdateUserInfo, to make Purify happy. * src/Makefile.in: Added stub for Purify, mainly to remind me how to do it. * Makefile.in: ${DISTFILES} now includes README. D'oh! Snapshot tarball now includes version number as well as date. 1999-11-09 Andrew Arensburger * configure.in: Incremented version number. * src/coldsync.c: Got rid of the 'user_fullname' global variable. * src/Makefile.in: Got rid of some obsolete comments and the experimental 'parse' target. * src/parser.y: Use new_{listen,conduit}_block(). Free cur_listen and cur_conduit at the end, if necessary. * src/config.c: Got rid of user_fullname global variable. * src/coldsync.h: Made 'userinfo' globally visible. Added declarations for new_conduit_block() and free_conduit_block(). * src/backup.c: Make sure backup file name is terminated. * src/archive.c: Use the precomputed 'archivedir' for constructing archive file names, instead of finding $HOME manually. Changed some buffers's sizes to MAXPATHLEN+1 instead of MAXPATHLEN, to simplify the code. * src/config.c: The permissions for new directories are 0700, non-negotiable. If you want something else, there's 'chmod'. Added new_conduit_block(), free_conduit_block(). * libpconn/dlp_cmd.c: Fixed some potential buffer overflows. 1999-11-08 Andrew Arensburger * src/config.c: Added cpp symbol PALMDEV for built-in default Palm device. Moved get_config up in the file. Added -S, -F -R command-line flags, removed -u. Bug fix: used to dump core if ~/.coldsyncrc didn't exist. Fixed a misleading trace statement, made another more explicit. * src/coldsync.c: Consolidated parse_args and load_config() into get_config(). Cleaned up a bit. * doc/coldsync.8: Describe default device. * libpconn/PConnection.c: Minor tweaking at end of connection. * src/parser.y: Changed raw fprintf(stderr...) statements to use PARSE_TRACE. * src/parser.h: Added PARSE_TRACE. 1999-11-04 Andrew Arensburger * src/coldsync.c: Massive reorganization on two fronts: the conduit API has completely changed, and support for config files. This code is in flux, so it's a mess. Got rid of the debugging flags struct, since it didn't really work after the two libraries seceded from the rest of the code base. parse_args() and load_config() have now been merged into get_config(). Some global options no longer exist because of this. 'struct config' is now more generic, and should allow coldsync to listen on multiple ports. For now, this is still rather ad hoc, though. parse_args() was moved to "config.c" before being commented out. Added stub code to run Fetch and Dump conduits before and after the main sync, respectively. Added clearer trace statements, since it's not always easy to tell whether coldsync has terminated normally, or has dumped core. * src/coldsync.h: Moved a bunch of stuff into here out of "conduit.h", for a wider audience, and to simplify some of the code. Got rid of the old debugging structure. Added variables 'sync_trace' and 'misc_trace'. Now trace statements work again. Added 'struct userinfo', for information about the Palm's owner. Moved 'listen_block' and 'conduit_block' into here, since they're used throughout the code, not just in the parser. Added 'struct config' to hold the current configuration (ports to listen on, lists of conduits, and so forth). Lots of tentative stuff involving config files and conduits. This code is a mess right now. In 'struct cmd_opts', took out a bunch of members that became obsolete after parse_args() and load_config() got merged into get_config(). Added outline of the new conduit API. Added a bunch of function prototypes, having to do with the changes outlined above. * src/conduit.h: Settled on a conduit API. Moved a bunch of stuff into "coldsync.h", mainly structures and stuff that has to do with configuration; stuff that might be of interest to a bunch of files. A bunch of changes to the conduit API; this is currently in flux: up until now, I'd assumed that a conduit would be a dynamically-linked object module, but now I'm convinced that it's better if conduits are external programs. Naturally, this involves a lot of reorganization, so the code is currently a mess. Added declarations for new-API functions run_Fetch_conduits() and run_Dump_conduits(). * src/config.c: Beginning of massive reorganization in the way configuration is done. Now supports config files instead of just command-line arguments. Global configuration is now in the variable 'config'. Information about the Palm's owner is in 'userinfo' Moved parse_args() out of "coldsync.c" and into here, then promptly #if 0-ed it out, 'cos it's deprecated: parse_args() and load_config() have been merged into the new function get_config(), since the two are so closely related. get_config() populates 'config' with stuff from both the command line and the config file, as appropriate. Added new_config() and free_config() to manage configurations. Added new_listen_block() and free_listen_block(), for convenience. Added get_userinfo() to get information about the Palm's user. This also records the user's home directory, so that we can use either $HOME or the password file entry, as appropriate (up until now, this has been (and still is, in places) rather ad hoc). * src/lexer.l: Got rid of "mystring", which was just for testing anyway. The string code now allocates a new string and returns it. Added a bunch of stuff to make the compiler shut up under different configurations (flex, flex in compatibility mode). Added 'lineno', so error messages can include the line number. Took "\n" out of whitespace class for this. Comments no longer include the "\n" at the end of the line, for the same reason. Added keywords: "device" and conduit flavors. * src/parser.y: Changed the grammar around: "listen" block must now specify the type of connection; "conduit" block must now specify the conduit flavor. Went from "keyword: value;" style to "keyword value;", to make the parser easier to write (and also so I can ignore a lot of error-checking that I don't know whether I could detect :-) ). Got rid of the "args" directive for conduits, at least for now. Added some actual functionality: the parser now actually builds up a struct with all of the information contained in the config file, instead of just verifying the file's correctness. Currently only supports serial "listen" blocks. Moved the Yacc-specific stuff out of "parser.h" into here. Added a custom yyerror(). Added parse_config() function, for a friendlier API. Added magic Emacs lines. * src/parser.h: Moved 'listen_block' into "coldsync.h". Moved the stuff dealing with Yacc internals into "parser.y". Added declaration for 'lineno', maintained by the lexer. Got rid of 'handle_listen()'. Added magic Emacs lines. * src/conduit.c: Added first drafts of run_Fetch_conduits() and run_Dump_conduits(). * src/archive.c: Use the GNU-recommended code for including * libpdb/pdb.c: Added 'pdb_trace' for debugging. pdb_Read() now barfs if the file isn't seekable. * libpconn/slp.c: Added 'slp_trace' for debugging. * libpconn/padp.c: Added 'padp_trace' for debugging. * libpconn/dlp_cmd.c: Added 'dlpc_trace' for debugging. * libpconn/dlp.c: Added 'dlp_trace' for debugging. * libpconn/cmp.c: Added 'cmp_trace' for debugging. * include/pconn/pconn.h: Added declarations for the *_trace debugging variables. * include/pdb.h: Minor cleaning. Added pdb_trace for debugging. * TODO: Cleaned up the sample code for including 1999-11-03 Andrew Arensburger * libpdb/pdb.c: Replaced #include with the more portable GNU-recommended construct. 1999-11-01 Andrew Arensburger * configure.in: Make sure there's a working lex. * libpdb/pdb.c: Took out all references to add_to_log(), since it really doesn't belong here anyway. * src/Makefile.in: Make sure ${BINDIR} exists before installing. * libpdb/Makefile.in: Took out some useless junk. Make sure ${LIBDIR} exists before installing. Also, install library in ${LIBDIR}, not ${BINDIR}. Duh. * libpconn/Makefile.in: Make sure ${LIBDIR} exists before installing. Also, install library in ${LIBDIR}, not ${BINDIR}. Duh. * include/pconn/Makefile.in: Added escapes for multi-line rules. Duh. * include/Makefile.in: JFerg's patch: make sure install directory exists when installing. * doc/pdb.texi: Fixed documentation of dmHdrAttrCopyPrevention flag. * doc/coldsync.8: Added mention of -f option, and ~/.coldsyncrc. * doc/Makefile.in: Fixed 'install' target to create man* directories when installing. Added dependencies for .dvi files. * config.h.in: Added variables for Emacs at end, since can't have -*- magic at the top. * Makefile.in: Added ${PREFIX}. Make sure that it exists when installing. 1999-10-24 Andrew Arensburger * src/coldsync.h: Cleaned out some old crap. Added default location of site-wide config file. * src/Makefile.in: Took out the 'COMPAT' stuff, since it doesn't belong here and was making builds barf under Solaris. Split SRCS into C_SRCS and CXX_SRCS. Added parser.h. Fixed stupid typo. Fixed Yacc arguments and such. Made 'depend' target work with 'makedepend'. * libpdb/pdb.c: Hacked up add_to_log() so the library will compile. Plugged a memory leak. * configure.in: Make sure ${prefix} is set near the top of the script. Cleaned up LDFLAGS assignment. Added pedantic flags to CXXFLAGS, not just CFLAGS. Test for 'yacc' now makes sure that it finds a working 'yacc'. Fixed check for 'mkid' for systems that don't have it. Now works with 'mkdep' and 'makedepend'. Added ${sysconfdir} to C defines. * config.h.in: Added SYSCONFDIR (where to look for the master "coldsync.conf" file). Cleaned Justin's patch up a bit to shut egcs up under OpenLinux. * Makefile.in: Added a target for creating daily snapshot releases. 1999-10-23 Andrew Arensburger * src/Makefile.in: Fixed lex/yacc stuff: made it part of the distribution. Fixed libraries to work properly. * include/pconn/Makefile.in: Took out the recursive targets, since Sun's 'sh' can't deal with a for loop over an empty list. * config.h.in: Incorporated Justin's patch for making gcc shut up under Slackware 4.0. * src/parser.h: Definitions and such for config file parser. * src/lexer.l: First draft of lexer. 1999-10-21 Andrew Arensburger * src/Makefile.in: Cleaned up some old crap. Took Makefile.in out of ${DISTFILES}. Added lex/yacc stuff. Fixed CPPFLAGS to allow user additions. * libpdb/Makefile.in: Added Makefile.in * libpconn/Makefile.in: Added Makefile.in * include/pconn/Makefile.in: Added Makefile.in * include/Makefile.in: Added Makefile.in * configure.in: Took out conduits/memodump, 'cos it's broken. * configure.in: Added checks for lex and yacc. Added support for LEXARGS and YACCARGS, to allow user-specified arguments. Now creates Makefiles for the various libraries. * Makefile.in: Took out conduits/memodump, 'cos it's broken. * Makefile.in: Added conduits/memodump, an experimental conduit. Fixed messages in ${RECURSIVE_TARGETS} target. 1999-10-18 Andrew Arensburger * src/parser.y: First draft of parser. 1999-09-09 Andrew Arensburger * src/install.c: Changed syntax of InstallNewFiles(): now can specify directory from which to install, and whether or not to delete the files after installation. * configure.in: Bumped up version number. AC_INIT uses a different file to find the source, because of the source tree reorganization. * README: Added UCB notice for "cfmakeraw.c", per BSD license. Added compatibility notes. Major directory rearrangement: the functions that permit communication with the Palm are now in a separate library, libpconn. Functions dealing with PDBs are in another separate library: libpdb. These libraries should make it easier to create conduits. The .h files that go with the libraries have been moved to a new `include' directory. This is mainly to make installation and compilation simpler. At some later point (e.g., if the libraries become useful in their own right), it might make sense to move the .h files back into the library source directories. * Makefile.in: Added new subdirectories "include", "libpconn", "libpdb". * src/conduit.h: Rearranged #includes for the source tree reorganization. Added a big XXX comment on conduits. This should go when I pick a conduit API. * src/coldsync.h: Rearranged #includes for the source tree reorganization. Moved definition of CARD0 to include/pconn/pconn.h . Changed prototype for InstallNewFiles(); added prototype for append_dbentry(). * src/coldsync.c: Rearranged #includes for the source tree reorganization. Cleaned up some comments. Use new syntax for InstallNewFiles(). Added appen_dbentry() convenience function. * src/Makefile.in: Rearranged things to work with the source tree reorganization: moved a bunch of files out of $(SRCS), $(OBJS) and $(HEADERS), added stuff to link with the new libraries. * src/restore.c: Rearranged #includes for the source tree reorganization. * src/handledb.c: Rearranged #includes for the source tree reorganization. * src/config.c: Rearranged #includes for the source tree reorganization. * src/backup.c: Rearranged #includes for the source tree reorganization. * src/archive.h: Rearranged #includes for the source tree reorganization. * src/archive.c: Rearranged #includes for the source tree reorganization. * src/GenericConduit.hh: Rearranged #includes for the source tree reorganization. * src/GenericConduit.cc: Rearranged #includes for the source tree reorganization. * include/pconn/pconn.h: Created to simplify programs that use libpconn. * include/pconn/PConnection.h: Moved from src/. * include/pconn/cmp.h: Moved from src/. * include/pconn/dlp.h: Moved from src/. * include/pconn/dlp_cmd.h: Moved from src/. * include/pconn/padp.h: Moved from src/. * include/pconn/palm_errno.h: Moved from src/. * include/pconn/palm_types.h: Moved from src/. * include/pconn/slp.h: Moved from src/. * include/pconn/util.h: Moved from src/. * include/pdb.h: Moved from src/. * libpconn/PConnection.c: Moved from src/. * libpconn/cfmakeraw.c: Moved from src/. * libpconn/cmp.c: Moved from src/. * libpconn/dlp.c: Moved from src/. * libpconn/dlp_cmd.c: Moved from src/. * libpconn/padp.c: Moved from src/. * libpconn/palm_errno.c: Moved from src/. * libpconn/slp.c: Moved from src/. * libpconn/util.c: Moved from src/. * libpdb/pdb.c: Moved from src/. 1999-09-04 Andrew Arensburger ColdSync announced on freshmeat. Officially moves to beta stage. * src/log.c: Make add_to_log() less annoyingly verbose. * src/dlp_cmd.c: Fixed core dump with empty usernames. * src/PConnection.c: Added a clearer error message. * src/restore.c: Added copyright statement. #include where appropriate. * src/pdb.c: Added copyright statement. Now adds log messages when uploading a database. * src/install.c: Added "install.c", with function to upload new databases as necessary. * src/dlp_cmd.c: Added copyright statement. Changed "errno" to "error" where necessary. * src/dlp.c: Added copyright statement. Changed "errno" to "error" where necessary. * src/dlp.h: Added copyright statement. Renamed 'errno' to 'error' in struct dlp_resp_header, since 'errno' is a preprocessor function in some implementations. * src/config.c: Added copyright statement. Added 'atticdir' Print UIDs in a more portable format. Make sure that ~/.palm/backup/Attic exists. Early version of a test to reassure user in case egcs whines. Fixed casting problem. * src/conduit.h: Minor housecleaning. * src/coldsync.h: Added copyright statement. Added 'atticdir' and prototypes for new functions. Minor housecleaning. * src/coldsync.c: Added copyright statement. #include where necessary. Check for extraneous files in ~/.palm/backup that aren't on the Palm. Move those files to ~/.palm/backup/Attic. Now installs new databases in ~/.palm/install. Added find_dbinfo() convenience function. * src/archive.c: Added copyright statement. Fixed "Can't open " error message so it only appears when appropriate. * src/Makefile.in: Added copyright statement. Added "install.c" Commented out the "ignore this warning" thing for config.o, since it wasn't working properly. * configure.in: Bumped up version number. Added check for libnsl. Took out the ugly ad hoc "make gcc shut up" section. * config.h.in: Simplified the "make gcc shut up" part. 1999-08-26 Andrew Arensburger * Added copyright statement everywhere. 1999-08-25 Andrew Arensburger * src/Makefile.in: Print a message telling the user not to worry about a certain known warning. * src/log.c: Fixed a bug whereby the log wasn't initialized properly the first time. * src/util.c: "config.h" was being included twice. Fixed. * src/pack.c, src/coldsync.h, src/archive.h, src/PConnection.h: Include "config.h" at the top. * src/pdb.c: Fixed problem where pdb_DownloadRecords() tried to allocate 0 bytes for expunged records. * doc/Makefile.in: Added variables to actually make 'make install' work (oops!). Added variables for 'makeinfo', 'texi2dvi' and 'dvips', so that things will fail cleanly on systems that don't have those. * README: Added long-overdue README file. * INSTALL: Added installation instructions, from GNU `automake'. * configure.in: Added checks for 'makeinfo', 'texi2dvi' and 'dvips'. * Makefile.in: Took out the bit about separate distributions. * src/GenericConduit.cc: Fixed a memory problem (referencing a freed memory location). * configure.in: Added check for libnsl, for Solaris. Cleaned up ElectricFence code somewhat. * Makefile.in: Added 'aclocal.m4' to the list of files in a distribution. * aclocal.m4: Oops! Forgot to add this back when it was written. * Artistic: Added Artistic License file. * src/dlp_cmd.c: Added abortive punpack() call. * src/pack.c: Added support for PACK_TIME, for reading and writing 'struct dlp_time's. * src/pack.h: Added PACK_TIME, for reading and writing 'struct dlp_time's. 1999-08-23 Andrew Arensburger * src/dlp_cmd.c: Includes "config.h", to get configure-time variables. Started fixing a bunch of potential buffer overflows. * src/coldsync.c: Now can restore from a backup directory. Use str(n)casecmp() when possible, str(n)cmp() otherwise. Cast uid_t to 'long' before printing, to pacify pedantic compilers. Cleaned up a bit. Added "pdb" debugging facility. 'coldsync -v' now lists some configure-time options. * src/util.c: Took out remnants of an earlier fix. * src/pdb.c: Includes "config.h", to get all the configure-time stuff. Changed SYNC_TRACE() calls to PDB_TRACE() (i.e., "pdb" got its own debugging flag). Added the pdb_Upload() function. * src/pack.h: Added. Declares the ppack() and punpack() convenience functions. * src/pack.c: Added. Contains the ppack() and punpack() convenience functions. * src/PConnection.c: Now includes "coldsync.h", for completeness. * src/Makefile.in: Fixed up 'autoconf' style variables. Added 'install' target. Added pack.{c,h} to source file list. * configure.in: Bumped up version number. Add -L$prefix/lib instead of just -L/usr/local/lib . * Makefile.in, doc/Makefile.in: Added 'install' target. 1999-08-01 Andrew Arensburger * src/slp.c, src/palm_errno.c, src/log.c, src/handledb.c, src/dlp.c, src/config.c, src/conduit.c, src/cmp.c, src/cfmakeraw.c, src/backup.c, src/archive.c, src/PConnection.c, src/GenericConduit.cc: Made sure "config.h" is the first file included. * src/util.c: Moved #include "config.h" to the top. Commented out the #warning statement, since it's not doing anything useful at the moment, and just causes anal compilers to choke. * src/slp.c: Added braces to an 'if' statement, to make egcs happy. * src/restore.c: New file. This contains Restore(), the function to restore a directory full of databases (presumably created by Backup()), and implements the "-r " option. * src/pdb.h: Added prototype for pdb_Upload(). * src/dlp.c: In dlp_send_req(), made 'outbuf' dynamically-allocated, thereby fixing a buffer overrun. * src/config.c: Clarified a comment. * src/coldsync.h: Added "pdb" debugging facility. Added prototype for Restore(). * src/PConnection.c: Added a trace statement. * src/Makefile.in: Added explicit rules for compiling .c and .cc files, since not all 'make's use the same symbols and such. Removed "upload.c", added "restore.c". * src/GenericConduit.cc: Fixed a list-walking bug involving referencing freed memory. * doc/Makefile.in: Made it easier to take the big files (*.ps, *.info) out of the standard distribution. * configure.in: Bumped version number. Removed comments for some stuff that's been done. Added -L/usr/local/lib to LDFLAGS. Added --with-efence option. Added 'struct dirent' checks. Added some stuff to try to make things compile cleanly under Linux. * config.h.in: Added directory-related symbols, WITH_EFENCE for verbosity. Added first draft of #defines to make things compile cleanly under Linux and other exotic OSes. * Makefile.in: Added an XXX comment. * HACKING: Added some portability recommendations. 1999-07-24 Andrew Arensburger * Deleted upload.c. Its intended use was subsumed by pdb_Upload() in pdb.c. 1999-07-14 Andrew Arensburger * Merged changes from "portable" branch: coldsync now compiles under FreeBSD 3.x, Redhat 6.0, Solaris 2.5, DU 4.0, AIX 4.1. * src/padp.c: Made select() work under AIX. Moved `#include "config.h"' to the top, so it'll affect system filess (this may turn out to be a Bad Thing). Include , for AIX. Include , for AIX. * src/log.c: Renamed `log' to `synclog', to avoid conflict with math library. * src/dlp_cmd.c: Added a check for NULL pointer in a fprintf() call, and a reminder to do so for another. * src/config.c: Added emergency definition of MAXHOSTNAMELEN. This may just be necessary under UMIACS's screwy setup, though. * src/coldsync.c: Moved `#include "config.h"' to the top, so it'll affect system header files where necessary. Bumped down the sync speed to something that an Ultra 1 can handle. Renamed `log' to `synclog', to avoid conflict with the math library under Solaris. Solaris's printf() can't print NULL pointers as strings. Fixed the appropriate printf() statements. Trace statements now go to stderr instead of stdout. Cast a uid_t to 'unsigned int' instead of 'int', to make Solaris happy. Commented out declarations of getopt() auxiliary variables: they should be in the header file anyway. * src/Makefile.in: Added @LIBS@ to LDFLAGS (D'oh!) * configure.in: Added checks for AIX, , (needed under AIX). * config.h.in: Rearranged things a bit. Added a kludge to define __EXTENSIONS__ under gcc, so it won't fuss about functions not explicitly named in the ANSI standard. * Makefile.in: Added 'make' symbols TAR and GZIP. * src/coldsync.c: Cleaned up trace statements a bit. Allegedly better command-line option parsing. Fixed usage message. * src/backup.c: When doing a backup, just open databases read-only. This simplifies the code. * doc/coldsync.8: Added caveats about backups and restores. 1999-07-12 Andrew Arensburger * src/coldsync.c: Obsolete "-c" option is no longer accepted. * doc/coldsync.8: Brought list of options in sync with reality. Added various sections, and an explanation of conduits. * src/GenericConduit.cc: Decided that C and C++ aren't bitter enemies, and removed some paranoid XXX comments. Took out reference to obsolete C SyncRecord() function. Switched to new debugging/trace system. Added convenience functions for testing PDB records' flags. Added destructor. Added read_backup(), write_backup() methods. GenericConduit::run() and others now use these new methods for reading/writing backup file, instead of constructing filenames and reading file themselves. Can now force slow or fast sync (not that this necessarily always makes sense). Split up the monster run() method up into FirstSync(), SlowSync() and FastSync(). Got rid of (f)printf() calls and bogus NULLs. * src/coldsync.c: Got rid of remnants of old debugging/tracing flags, replaced with new, command-line-based system. Can now just do backup. Placeholder in place for restore. Now uses command-line flag to see whether to consider ROM databases when syncing. Use getopt() to parse command-line arguments instead of homegrown system. Added "-d" command-line option for debugging. Changed "-s" and "-f" flags to "-S" and "-F". Added sanity checks for command-line options. * src/coldsync.h: Got rid of do_clean option. If the user wants a clean slate, he can either delete all of the files in the backup directory, or hard-reset vis Palm, whichever is appropriate. Added placeholder for config file to be specified on command line. Added placeholder flag to consider ROM databases when syncing or backing up, and one to specify whether new databases should be installed before or after the main sync. Added 'struct debug_flags', as a place to put all of the debugging flags and trace levels. #defined some convenience macros. Cleaned out old prototypes from files that don't exist anymore. * src/conduit.c: Use debugging levels specified on the command line. * src/config.c: Use debugging levels specified on the command line. * src/handledb.c: Use debugging levels specified on the command line. * src/log.c: Use debugging levels specified on the command line. * src/upload.c: Commented everything out, preparatory to rewriting from scratch. * src/util.c: Fixed off-by-one-month error (Unix numbers months from Jan == 0, PalmOS numbers them from Jan == 1). * src/slp.c: Use debugging levels specified on the command line. * src/pdb.c: Use debugging levels specified on the command line. Fixed some comments. * src/padp.c: Use debugging levels specified on the command line. * src/dlp_cmd.c: Use debugging levels specified on the command line. * src/dlp.c: Use debugging levels specified on the command line. * src/cmp.c: Use debugging levels specified on the command line. * src/backup.c: Rewritten from scratch. Backup() now backups up everything on the Palm, instead of just one database. * src/archive.c: Changed some memcpy() calls to strcpy(). This should fix problems with dumping core on some machines. D'oh! * src/PConnection.c: Removed XXX comment. * src/Makefile.in: Fixed ${INCLUDES} for egcs. Added explicit CXX and CCC symbols, for non-GNU, non-Berkeley 'make's. Got rid of "sync.c". Added padp.h, palm_types.h to list of headers. Diddled with files-to-clean symbols a bit. Added 'depend' target. * src/GenericConduit.hh: Added destructor. Split up the different types of sync into their own methods. Added read_backup(), write_backup() methods to read and write the backup file; this should make it easier to subclass the conduit to make new conduits. * doc/Makefile.in: Diddled with the lists of files to clean, a bit. Simplified .texi->.info rule. Added a dummy "depend" target. * doc/coldsync.8: Added a man page. * configure.in: Added EXIT_STATUS variable; 'configure' now checks for mandatory components and exits with a non-zero status if they can't be found. Bumped up version number. Changed some comments from m4 comments to shell comments, so they'll make their way into the 'configure' script, for the benefit of the poor souls who have to read them. Added checks for 'mkdep', 'tar' and 'gzip'. Added check for . Added checks for select(), rename(), strncpy(), strcasecmp(), strncasecmp(). Took out checks for sizes of various types; replaced them with AC_TYPE_, to define types to sane values if they don't exist. Fixed workaround for systems without cfmakeraw(). Added reminder to "make depend" at the end. * config.h.in: Instead of checking for types' sizes (gid_t, mode_t, off_t, pid_t, size_t), use the 'autoconf' macros to define them to something sane if they don't exist. Added checks for strcasecmp(), strncasecmp(), getopt(), rename(), strncpy(), . Added workaround for systems that don't have strcasecmp() and strncasecmp(). * Makefile.in: Added 'depend' to the list of recursive targets. Added "configure.in" to the distribution. Fixed up the CLEAN, DISTCLEAN and SPOTLESS file lists. Added GZIP environment variable to 'tar'. * src/sync.c: deleted: everything in this file has now been moved to GenericConduit.cc. 1999-07-04 Andrew Arensburger * configure.in: Took out all of the automake dependencies. Removed check for Bourne shell. Simplified anal retentive CFLAGS code. Added checks for 'install', 'mkid', 'tar' and 'gzip'. Added checks for sizeof(uid_t), sizeof(off_t) (these need work, though). Removed check for snprintf(). Print warning if select() wasn't found. * doc/version.texi.in: Version strings for the TeXinfo documentation. * doc/pdb.texi: Redid the automake-dependent stuff on the title page. * doc/libpalm.texi: Redid the automake-dependent stuff on the title page. * doc/Makefile.in: Top-level Makefile template, now that we're not using automake anymore. * Reorganized the source directory: all of the source now goes in ./src, instead having stuff strewn around ./coldsync, ./pconn and ./palm. * config.h.in: Check for sizes of various types. Don't check for snprintf() anymore. Added check for * coldsync/log.c: Convenience functions for logging. * coldsync/GenericConduit.hh: Added prototypes for new methods. 1999-07-03 Andrew Arensburger * pconn/dlp_cmd.h: Clarified some comments. Added stuff for DLP 1.2 response to DlpReadSysInfo(). * pconn/dlp_cmd.c: DlpReadSysInfo() now deals with DLP 1.2 response. * pconn/Makefile.am: Added cfmakeraw.c to distribution. * palm/palm_types.h, doc/pdb.texi: Added RCS Id string. * coldsync/upload.c: Use CARD0 constant. * coldsync/sync.c: #ifdef-ed out SlowSync(), FastSync(), since these are now handled by the conduit. Ditto for archiving functions. * coldsync/pdb.c: Changed pdb_Read() and pdb_Write() to take open file descriptors rather than file names. Made corresponding adjustments. Caller is now responsible for opening and closing files and whatnot. * coldsync/pdb.h: Fixed declarations of pdb_Read() and pdb_Write() for new behavior. * coldsync/handledb.c: Took out the big unused part of HandleDB(), since that's now handled by individual conduits. HandleDB() now checks to see whether the database is a resource database (instead of the conduit), since record and resource databases really need to be handled differently. * coldsync/config.c: Took out unused arguments to load_config(). * coldsync/coldsync.h: Took out obsolete INSTALL_DIR constant. Added CARD0 constant. Added "namespace" struct for global options. Took out declaration for RecordSync(), since it's now part of the generic conduit. * coldsync/coldsync.c: Added command-line argument parsing (parse_args() and speeds[]). Added function to find maximum speed that the serial port will handle (find_max_speed()) Not sure how to do it right, though. Added logging; this needs to be redone without the global variables, though. Send an abort message to the Palm if a conduit barfs. Added some error-checking. Use CARD0 constant. Added usage(). Added print_version(). * coldsync/backup.c: Use CARD0 constant. Took out call to pdb_Write() temporarily, until it can be rewritten. * coldsync/Makefile.am: Added log.c. * coldsync/GenericConduit.cc: Added headers. Finished comment. Added logging on Palm. run() now officially refuses to deal with resource databases. 'bakfname' now an array, not a pointer, which simplifies stuff. Create the backup file at the top, to avoid downloading stuff when you don't need to. Checks global options to see whether to force a slow or fast sync. Fixed logic error in slow sync: now does one pass through remote database to find new remote records, and one pass through local database to find new local records. Not sure what it used to do. BUG: if a local record is clean and doesn't exist in the remote database, the local record gets deleted. This means that if you lose your Palm, get a replacement, and sync with it, you'll lose all of your old data, even if you were good about syncing regularly. Adjusted for new behavior of pdb_Read() and pdb_Write(): read and write file descriptors, not file names, and caller responsible for renaming staging file to the real one at the end. Fixed bug whereby some records got free()ed twice. Took out some overactive commenting: the "archived" flag for a record overlaps the category field, so a record really has to have the "deleted" flag to get archived. * configure.in: Bumped up version. Allow user to override CPPFLAGS. No hyphen in "anal retentive". * Makefile.am: Added the "HACKING" file to the distribution. 1999-06-29 Andrew Arensburger * configure.in: Bumped version, got rid of cfsetspeed() check. * config.h.in: Got rid of HAVE_CFSETSPEED. * pconn/PConnection.c: Just use cfsetispeed()/cfsetospeed(), for systems that don't have cfsetspeed(). Added strategic tcdrain(), so that the Palm gets the final ACK and doesn't hang at the end of the sync. 1999-06-27 Andrew Arensburger * coldsync/sync.c: Made SyncRecord() externally visible. Minor cleaning. * coldsync/pdb.h: Fixed some comments. Took out the XXX comments about merging pdb_record and pdb_resource, since they're really two entirely different data types, and need to be treated differently. Trying to merge them without duplicating code just isn't worth it. * coldsync/handledb.c: Added rudimentary conduit support. Added mkbakfname() function (for now), for generating backup file names. * coldsync/coldsync.c: Added conduit support. Added temporary cpp symbol that says whether to try to deal with ROM databases. Fixed a bunch of XXX comments. * coldsync/archive.h: Added block types for resource and sort block. 1999-06-23 Andrew Arensburger * coldsync/Makefile.am: Removed download.c, added conduit-related files. * coldsync/GenericConduit.hh: Definition of generic conduit class. * coldsync/GenericConduit.cc: Generic conduit methods. * coldsync/pdb.c: Fixed a comment. * coldsync/coldsync.h: Added mkbakfname() function, for now. * coldsync/conduit.h: Definitions and such pertaining to conduits. * coldsync/conduit.c: Conduit-related functions. * pconn/dlp_cmd.c: DlpWriteUserInfo() doesn't update user's full name unless it has changed.n * palm/palm_types.h: Capitalized booleans "True" and "False", so as not to cause problems with C++. * pconn/slp.c: Boolean values are now capitalized. * HACKING: Added section on priorities. * pconn/util.h, pconn/slp.h, pconn/palm_errno.h, pconn/palm_errno.c, pconn/padp.h, pconn/cmp.h, pconn/cmp.c, pconn/cfmakeraw.c, pconn/PConnection.c, coldsync/archive.c, coldsync/upload.c: Added magic Emacs lines. 1999-06-06 Andrew Arensburger * coldsync/download.c: Deleted, sinc it isn't used. * pconn/dlp_cmd.c: Initialize some otherwise potentially uninitialized variables. * configure.in: Added check for C++ compiler. Use CPPFLAGS to for "-ansi -pedantic", so it'll work with both. * pconn/PConnection.h: Removed unused 'header_inbuf' field in struct PConnection. 1999-06-05 Andrew Arensburger * pconn/slp.c: Took out some unused constants. 1999-06-03 Andrew Arensburger * pconn/dlp_cmd.c: Added function names to a bunch of otherwise identical error messages. 1999-06-01 Andrew Arensburger * coldsync/sync.c: Cleaned up. Fixed/modified some comments, implemented some XXX comments. Now handles identical dirty records correctly. 1999-05-31 Andrew Arensburger * coldsync/handledb.c: Cleaned up a bit. Added some XXX comments. Does either a slow or fast sync, as necessary. * coldsync/config.c: Early stab at doing the Right Thing for multiple users. Put the various sync directories in variables, rather than #defines; create them if they don't exist. Determine current user's name, home directory; current host's ID (currently its IP address). * coldsync/coldsync.c: Now automatically checks to see whether a slow or fast sync is required. Updates user info (user name, user ID, last sync host). Fixed some bogus identifiers. * coldsync/coldsync.h: The various per-user sync directories are now variables, rather than #defines. Now automatically checks to see whether a slow or fast sync is required. Updates user info (e.g., user name). * pconn/dlp_cmd.c, pconn/dlp_cmd.h: Fixed some bogus identifiers. * configure.in: Added stuff to check for a valid shell, so that the Makefiles will work with 'gmake'. 1999-03-28 Andrew Arensburger * coldsync/sync.c: Added support for archiving records. Found a bug with records that have been created and deleted since the last sync. FastSync() now handles the case where both the local and remote record have been modified and marked for archival. * coldsync/archive.h: Functions and such for dealing with archive files. * coldsync/archive.c: Functions for dealing with archive files. * coldsync/Makefile.am: Added archive.{c,h}. * configure.in: Bumped up version number. 1999-03-16 Andrew Arensburger * doc/Makefile.am: Added the pdb stuff to the distribution. * doc/pdb.texi: Description of Palm database file formats. * coldsync/upload.c, coldsync/sync.c, coldsync/pdb.h, coldsync/pdb.c: 'uniqueID' field in 'struct pdb' is now called 'id'. * pconn/dlp_cmd.h, pconn/dlp_cmd.c: Minor cleaning. 'dbid' is now 'handle' throughout. Tag ALPHA-6: * coldsync/upload.c: Added some XXX comments. * coldsync/sync.c: Added SYNC_TRACE macro, similar to the *_TRACE macros in the pconn library. Updated pdb record attribute flags to the clearer ones. Enabled DlpCleanUpDatabase() in all cases. Not entirely sure why it was taken out in the first place. Added FastSync(). Extracted record sync logic into SyncRecord(). * coldsync/pdb.c: Added pdb_FreeRecord(), pdb_FreeResource(), new_Record(), pdb_CopyRecord(), pdb_CopyResource(). Made "rsrc" the preferred abbreviation for "resource", instead of "res". Functions that add/delete records now increment/decrement db->numrecs; consequently, a lot of the more primitive functions, which know how many records the database is supposed to have, now have a "totalrecs" kludge so they don't get bitten by this. * coldsync/pdb.h: Rearranged, renamed, reexplained record attribute flags. Added prototypes for new functions. Minor cleaning. * coldsync/handledb.c: Minor cleaning. Use FastSync() instead of SlowSync(). * coldsync/coldsync.h: Added prototype for FastSync(). * pconn/dlp_cmd.c: Some cleaning. Got rid of some ugly structs. (ReadRecordByIndex) Fixed API. (DlpWriteRecord) Fixed API; removed useless XXX comment. (DlpWriteResource) Dynamic memory allocation is now official. * pconn/dlp_cmd.h: Got rid of some ugly structs. Fixed DlpWriteRecord() to take all the necessary information. * AUTHORS: Added Rob. * coldsync/coldsync.c: Minor cleaning. * pconn/PConnection.c: Minor cleaning. 1999-03-11 Andrew Arensburger * coldsync/upload.c, coldsync/pdb.h, coldsync/pdb.c: Renamed variables named "res" to "rsrc", for clarity and to help prevent typos. * coldsync/Makefile.am: "pdb.h" wasn't being included in distribution. * coldsync/upload.c, coldsync/sync.c, coldsync/pdb.h, coldsync/pdb.c, coldsync/download.c, configure.in: Made 'struct pdb' more rational: folded the two header sub-structs into 'struct pdb'. Replaced three arrays (record index, record length, record data) with a linked list of record/resource structs. * coldsync/pdb.c: Commented out some debug_dump()s. Added pdb_DeleteRecordByID(). * coldsync/pdb.h: Renamed record attribute flags for clarity. Added pdb_DeleteRecordByID(). Announce intention to revamp 'struct pdb'. * coldsync/sync.c: Almost finished phase 1 of slow sync. Renamed 'db' to 'remotedb' for clarity. 1999-03-10 Andrew Arensburger * coldsync/sync.c: Took out a big honkin' #if 0...#endif block. Cleaned up the DlpOpenDB() call. Fixed some error messages that had the wrong function name in them (oops!). * coldsync/pdb.h: Took out the last traces of the old uniqueID (3-char array, rather than udword). * coldsync/pdb.c: Took out the last traces of the old uniqueID (3-char array, rather than udword). * coldsync/handledb.c: Renamed all Cold_Foo() functions to just Foo(). * coldsync/coldsync.h: Renamed all Cold_Foo() functions to just Foo(). * coldsync/coldsync.c: Renamed all Cold_Foo() functions to just Foo(). * coldsync/backup.c: Renamed all Cold_Foo() functions to just Foo(). * pconn/padp.c: Made one of the write timeouts non-experimental. * coldsync/Makefile.am: Added the new files. * coldsync/backup.c: Condensed the two monster functions Cold_RecordBackup() and Cold_ResourceBackup() into the single, simpler Cold_Backup(). * configure.in: Bumped up version number. Added an XXX comment. Fixed the SHELL= assignment that causes problems under Solaris. * coldsync/coldsync.c: Reads some config file type stuff. Connection rate change code is no longer experimental. Now dumps a bunch of information. Added lots of XXX comments. * coldsync/coldsync.h: Renamed ColdPalm to Palm. Added various bits of useful information about a given Palm device. Added a bunch of prototypes. * coldsync/config.c: New file. Functions for dealing with loading config files. * coldsync/handledb.c: Cleaned up. No longer distinguishes between backing up record and resource databases. * coldsync/pdb.c: Greatly expanded. This is now more reminiscent of a "pdb" object than of a set of helper functions. Might warrant being made into its own library. * coldsync/download.c: New file. DownloadRecordDB() downloads a record database from the Palm. * coldsync/pdb.h: Moved here from "palm". * coldsync/sync.c: New file: SlowSync() performs a slow sync with the Palm, per the Pigeon Book. * coldsync/upload.c: New file: UploadDatabase() installs a database on the Palm. * palm/Makefile.am: Took out pdb.h; moved it to "coldsync". * pconn/dlp_cmd.c: Made some trace statments optional. Fixed API for DlpWriteAppBlock(), DlpReadSortBlock(), DlpWriteSortBlock(), DlpReadNextModifiedRec(), DlpWriteRecord(). Dynamic memory allocation in DlpWriteResource(). * pconn/dlp_cmd.h: Cleaned up. Added some useful cpp symbols. Cleaned up the API for several functions, and removed some useless and/or ugly structs. * pconn/padp.c: Added/cleaned up support for sending PADP messages longer than 1024 bytes (multi-fragment messages). * pconn/padp.h: Took out the hardcoded limitation on the length of PADP messages, even though it's part of the protocol, since the PADP layer now allocates memory dynamically. * pconn/slp.c: Made debugging levels more consistent. * pconn/util.c: Fixed header to get EPOCH_1904. 1999-02-24 Andrew Arensburger * palm/pdb.h: Took out obsolete field. * coldsync/pdb.c: Completed "struct pdb" destructor. Tag ALPHA-3: Can now sync at a rate other than the default 9600 bps (under FreeBSD, at least). * config.h.in: Added symbols for the existence of "struct tm" and whether it has time zone-related members. * configure.in: Updated version number. Added check for time zone information in "struct tm". Added stuff to build 'cfmakeraw()' if necessary. * coldsync/Makefile.am: Added dependency on libpconn.a, so 'coldsync' gets rebuilt correctly. Took "Makefile" out of the distribution list, since it's there already (though I think it shouldn't be). * coldsync/backup.c: Added some XXX comments, took some trace statements out. * coldsync/coldsync.c: Added code to switch the sync rate (under FreeBSD, at least). Finished taking out Cold_HandleDB(). Added listlocalfiles() for now. * coldsync/coldsync.h: Added INSTALL_DIR macro, for testing. Added prototype for Cold_ResourceBackup(). * coldsync/handledb.c: Added an #if block for systems that don't have snprintf(). Threw in some gratuitous calls to Cold_*Backup() for testing. * coldsync/pdb.c: Took out the monster read_pdb() function, replaced it with LoadDatabase() and a host of support functions. Hopefully this makes the whole thing more readable. * palm/pdb.h: struct pdb now includes information on the sizes of its components. Added some function prototypes. * pconn/Makefile.am: Added the @COMPAT@ symbol, for portability functions. * pconn/PConnection.c: Added some portability stuff. * pconn/cfmakeraw.c: This file longer tries to determine whether it's necessary. The Makefile does that now. * pconn/dlp.c: Added a header. * pconn/dlp_cmd.c: Took out a bunch of trace statements. DlpReadResourceByIndex now returns a pointer to the data, not a copy. * pconn/dlp_cmd.h: DlpReadResourceByIndex now returns a pointer to the data, not a copy. * pconn/padp.c: Made a bunch of trace statements conditional. Added some experimental stuff to wait for the tty to be writable, and time out if it isn't. * pconn/util.c: Attempt at portability: see if "struct tm" contains time zone information. 1999-02-22 Andrew Arensburger * coldsync/backup.c: Clear "database open" flag before writing. Added Cold_ResourceBackup(). * coldsync/backup.c: Took out old Cold_BackupDB(), finished Cold_RecordBackup(). * pconn/PConnection.h: Took out bogus 'next' pointer from PConnection, since it's no longer on a list. Tag ALPHA-2: Everything now uses PConnections instead of pseudo-sockets. PADP can now receive multi-fragment messages. DLP command functions now return the DLP status code. * pconn/Makefile.am: Took 'foo' out of the default list of targets. * pconn/util.h: Added prototypes for functions for converting between different time formats. * pconn/util.c: Added functions for converting between different time formats. * pconn/slp.c: When receiving a message, cleans out the remains of the previous one, so as not to pollute subsequent messages with bits of old data. * pconn/dlp_cmd.c: Fixed API for DlpReadAppBlock(), DlpReadSortBlock(), DlpReadRecordByID(), DlpReadRecordIDList(). These functions also now return pointers to the data, instead of copies of it. * pconn/dlp_cmd.h: Added struct dlp_recinfo to replace the butt-ugly recreqrec... things. Fixed API for DlpReadAppBlock(), DlpReadSortBlock(), DlpReadRecordByID(), DlpReadRecordIDList(). * pconn/PConnection.h: Added to the PADP layer a buffer for receiving multi-fragment messages. * doc/libpalm.texi: Took out my ugly edition number generator; now use 'automake'. * coldsync/handledb.c: Function to figure out what to do with a database. * coldsync/coldsync.h: Added a bogus BACKUP_DIR definition, for testing. Fleshed out struct ColdPalm: took out the PConnection that didn't belong there, put in (stubs for) everything else. Moved function prototypes here. * coldsync/coldsync.c: Moved function prototypes to "coldsync.h". Added an attempt to sync at a different speed. Rewrote Cold_GetMemInfo(). Rewrote Cold_ListDBs(). Wrote and rewrote Cold_HandleDB(), and moved it to a separate file. * coldsync/backup.c: Functions for backing up databases. * coldsync/Makefile.am: Added backup.c, handledb.c . * configure.in: Incremented version, added snprintf() to the list of functions to check for. * config.h.in: Added snprintf() to the list of required functions. 1999-02-21 Andrew Arensburger * coldsync/coldsync.c: Rewritten. It used to parse a database. Now it looks at the memory on a Palm and lists its databases. * coldsync/pdb.c: Fixed bug whereby record-type records weren't being read correctly. * coldsync/coldsync.h: Created. Data structures and such for 'coldsync'. * doc/libpalm.texi: Got rid of the DLP command subsections. Updated some filenames to reflect source tree reorganization. Other updates. Added documentation for a few functions. * pconn/PConnection.c: Added DLP to the protocol stack, so it needs to be initialized and cleaned up as well. * pconn/PConnection.h: PConnection now includes a dlp field for the DLP protocol stuff, as well as the version of the comm protocol that the other end understands. Added magic Emacs variables. * pconn/dlp.c: Added dlp_init(), dlp_tini(). dlp_recv_resp() now returns to the caller an array of response arguments, so that the caller can receive an arbitrary number of arguments. This array is kept in the PConnection, and grows as needed. Added some magic Emacs variables. * pconn/dlp.h: Added dlp_init() and dlp_tini(). Changed dlp_recv_resp() API: it now receives an array of dlp_args, so it can receive an arbitrary number of response arguments. Added some magic Emacs variables. * pconn/dlp_cmd.h: Reorganized by DLP function. Added DLPRET* macros. Many special structs that used to have pointers to strings now just have char arrays to hold them. Got rid of some overly-specialized structs. dlp_cardinfo now includes DLP 1.1 extension fields. * pconn/dlp_cmd.c: Renamed DLPCMD_* to DLPC_* in a lot of cases. Major reorganization of DLP command functions: all functions return a pointer to an array of response arguments, which allows the caller to get an arbitrary number of them. DLP command functions now walk the list of response arguments and process each one in turn. DlpReadStorageInfo() and DlpReadDBList() pretty much rewritten. DlpReadStorageInfo() now returns the data that it collects; extended card info is now in struct dlp_cardinfo, for easy access. DlpReadDBList() now returns the data that it collects. * pconn/foo.c: Various changes. * pconn/padp.c: Took out a bit of old crap. * pconn/palm_errno.c: Added an error code. * pconn/palm_errno.h: Added an error code. * pconn/slp.c: Added Emacs auto-variables. 1999-02-19 Andrew Arensburger * configure.in: Updated version number. Added pedanticity warning for non-gcc compilers. Check for more functions. Added template for warning people about missing prerequisites. * config.h.in: Auto-updated by autoheader. * pconn/cfmakeraw.c: Added, for systems that don't have cfmakeraw() (e.g., Solaris 2.5). The connection-related stuff got moved to subdirectory 'pconn'. Now uses 'automake' and 'autoconf'. * Makefile.am: for automake, from Mark's example. * AUTHORS: Added author list. * HACKING: Added guidelines for hackers. * config.h.in: Apparently automake really, really wants this. 1999-02-14 Andrew Arensburger All DLP commands now implemented, except ProcessRPC. The protocol-specific error codes have now been moved to a single place (palm_errno.[ch]). Took out bunches of obsolete code. Better error-checking. PADP now handles timeouts and retries (but not multi-fragment messages). SLP dynamically allocates memory for incoming packets and returns pointers into it, making it possible to read a packet of unknown size. * doc/libpalm.texi: Added menus, more index entries. Better cross-references, better formatting. Added documentation for SLP and PADP functions. * dlp_cmd.c: Added dlpcmd_gettime() and dlpcmd_puttime(), for reading and writing DLP-style dates. * dlp.c: dlp_send_req() automatically identifies and deals with tiny, small and long arguments. * dlp.h: dlp_recv_resp() now checks takes a request ID argument, for better error-checking (so it can make sure it's getting a response to the right request). * padp.c: Added padp_init() and padp_tini(). padp_read() now gives the caller a pointer to the data, rather than copying the packet data into a caller-supplied buffer. This allows reading arbitrary-length packets. Handles tickle and abort packets. * padp.h: padp_init() now initializes a new PConnection; padp_tini() cleans it up. padp_read() now gives back a pointer to the data (gotten from SLP) rather than copying the data to a caller-supplied buffer. * slp.c: Put CRC code in "util.c". slp_recv() and slp_send() are now slp_read() and slp_write(). Dynamically allocate memory for sending and receiving packets; removed arbitrary packet-length limitations. slp_init() now initializes the SLP layer of a PConnection; slp_tini() cleans up at the end. Data buffers are now in PConnection, rather than static. This should allow one to have multiple connections in progress. * slp.h: slp_init() and slp_tini() now used to initialize and clean up SLP layer. slp_read() and slp_write() now take const arguments. * palm_errno.c, palm_errno.h: New files, for unified error codes. * util.c: The get_*() and peek_*() functions now take 'const' arguments, as they should. debug_dump() now prints both raw hex and ASCII. * util.h: Made a bunch of arguments 'const' that should have been. * PConnection.c: new_PConnection() now initializes both SLP and PADP layers. PConnClose() now cleans up both SLP and PADP and (hopefully) doesn't leak memory anymore. * PConnection.h: Added timeout field for PADP, so it can time out if nothing comes in. SLP now has separate buffers for sending and receiving. SLP data buffers are now dynamically allocated and resized as needed. * Makefile: Added palm_errno stuff to library. Added tags targets. 1999-02-04 Andrew Arensburger * doc/.cvsignore: First draft. * doc/libpalm.texi: Fixed the magic edition number kludge. * cmp.c, cmp.h, dlp_cmd.c, dlp_cmd.h: made some function arguments `const'. * Makefile: Took out the remnants of references to the Palm headers. Added rules to build in subdirectories. * doc/libpalm.texi: Added a hack to have the Edition (RCS's Revision number) appear on the title page. * doc/Makefile: First draft. * doc/libpalm.texi: Fixed RCS keyword. * doc/libpalm.texi: First draft. 1999-01-31 Andrew Arensburger Rewrote the protocol stack from scratch. State information is now stored in a struct PConnection, rather than in (ugh!) global variables. Connection handles are now ints, in the hope that one day, the SLP and PADP layers will turn into kernel-level protocol layers that can be accessed through sockets. The API is also cleaner, and is based on read() and write() for recognizability. * util.c (added): Miscellaneous utility functions, including a CRC function written from scratch. * util.h (added): Declarations of miscellaneous utility functions. * dlp_cmd.h (added): Defines constants and data structures pertaining to DLP commands, rather than the protocol itself. * PConnection.c (added): struct PConnection encapsulates the state about a connection to a Palm device. * palm_types.h: Changed BSD-specific sized types to generic C ones, in the hope that there'll one day be a function to check them for sanity. * padp.c: Rewritten from scratch. Cleaner API. Added retries on send. * foo.c: Lots of changes: mainly tore out the old crap, put in the new functions, for testing. * Makefile: Combined the three protocol-specific libraries into one libpalm. 1999-01-23 Andrew Arensburger * dlp.c: Added an explanatory comment, error messages, dlp_free_arglist(). Fixed dlp_send_req() to not wait for a reply. Redid dlp_read_resp() completely. * dlp.h: Added dlp_time, dlp_sysinfo structs. Took out old protocol function prototypes; added some new ones. Added DlpReadSysInfo(). * dlp_cmd.c: Utility functions now use dlp_read_resp() parsed arguments. Fixed endianness problem in DlpEndOfSync(). Added DlpReadSysInfo(). * foo.c: Lots of messing around. * slp.c: Removed slp_crc() function, in favor of palm_crc(). * palm_crc.c: Took out bogus CRs, took out unused headers. * .cvsignore: Added FreeBSD core files to the list of things to ignore. 1999-01-22 Andrew Arensburger * Initial checkin of skeletal files.