diff options
Diffstat (limited to 'debian/pilot-link/pilot-link-0.12.5-dfsg/include')
49 files changed, 7646 insertions, 0 deletions
diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/Makefile.am b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/Makefile.am new file mode 100644 index 00000000..aa36df69 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/Makefile.am @@ -0,0 +1,59 @@ +# 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) + diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/Makefile.in b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/Makefile.in new file mode 100644 index 00000000..82238fb2 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/Makefile.in @@ -0,0 +1,551 @@ +# 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: diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-address.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-address.h new file mode 100644 index 00000000..809a7fbd --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-address.h @@ -0,0 +1,91 @@ +/* + * $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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-appinfo.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-appinfo.h new file mode 100644 index 00000000..418edff1 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-appinfo.h @@ -0,0 +1,51 @@ +/* + * $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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-args.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-args.h new file mode 100644 index 00000000..afe9237c --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-args.h @@ -0,0 +1,36 @@ +/* + * $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 diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-blob.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-blob.h new file mode 100644 index 00000000..c5fe584d --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-blob.h @@ -0,0 +1,75 @@ +/* + * $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 <stdint.h> + +#include <pi-appinfo.h> +#include <pi-buffer.h> + +/* 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: */ + diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-bluetooth.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-bluetooth.h new file mode 100644 index 00000000..be319a9d --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-bluetooth.h @@ -0,0 +1,77 @@ +/* + * 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 <bluetooth/sdp.h> +#include <bluetooth/sdp_lib.h> +#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 diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-buffer.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-buffer.h new file mode 100644 index 00000000..67f2a855 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-buffer.h @@ -0,0 +1,143 @@ +/* + * $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 diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-calendar.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-calendar.h new file mode 100644 index 00000000..f849dabe --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-calendar.h @@ -0,0 +1,137 @@ +/* + * $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 <time.h> + +#include <stdint.h> + +#include <pi-appinfo.h> +#include <pi-buffer.h> +#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: */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-cmp.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-cmp.h new file mode 100644 index 00000000..e64a695e --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-cmp.h @@ -0,0 +1,104 @@ +/* + * $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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-contact.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-contact.h new file mode 100644 index 00000000..6f4adb42 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-contact.h @@ -0,0 +1,191 @@ +/******************************************************************************* + * + * $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 <pi-args.h> +#include <pi-appinfo.h> +#include <pi-buffer.h> +#include <time.h> + +#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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-datebook.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-datebook.h new file mode 100644 index 00000000..07afe3cd --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-datebook.h @@ -0,0 +1,114 @@ +/* + * $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 <time.h> +#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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-debug.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-debug.h new file mode 100644 index 00000000..660df990 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-debug.h @@ -0,0 +1,97 @@ +/* + * $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 diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-dlp.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-dlp.h new file mode 100644 index 00000000..dfa516fe --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-dlp.h @@ -0,0 +1,1856 @@ +/* + * $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 <unistd.h> + +#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_*/ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-error.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-error.h new file mode 100644 index 00000000..0a99fdf0 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-error.h @@ -0,0 +1,95 @@ +/* + * $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 diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-expense.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-expense.h new file mode 100644 index 00000000..acc38b7b --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-expense.h @@ -0,0 +1,124 @@ +/* + * $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 <time.h> +#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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-file.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-file.h new file mode 100644 index 00000000..530997de --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-file.h @@ -0,0 +1,435 @@ +/* + * $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 diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-foto.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-foto.h new file mode 100644 index 00000000..2157a40c --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-foto.h @@ -0,0 +1,46 @@ +/* + * $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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-header.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-header.h new file mode 100644 index 00000000..2bb9e81d --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-header.h @@ -0,0 +1,34 @@ +/* + * $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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-hinote.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-hinote.h new file mode 100644 index 00000000..a2967297 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-hinote.h @@ -0,0 +1,56 @@ +/* + * $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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-inet.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-inet.h new file mode 100644 index 00000000..ac8a5a62 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-inet.h @@ -0,0 +1,50 @@ +/* + * $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 diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-location.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-location.h new file mode 100644 index 00000000..6aa1a18a --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-location.h @@ -0,0 +1,128 @@ +/* + * $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 <stdint.h> + +#include <pi-appinfo.h> +#include <pi-buffer.h> + +#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: */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-macros.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-macros.h new file mode 100644 index 00000000..e23eaebc --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-macros.h @@ -0,0 +1,290 @@ +/* + * $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 <time.h> +#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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-mail.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-mail.h new file mode 100644 index 00000000..a9022480 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-mail.h @@ -0,0 +1,140 @@ +/* + * $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 <time.h> +#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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-md5.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-md5.h new file mode 100644 index 00000000..7978f09a --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-md5.h @@ -0,0 +1,47 @@ +/* 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 <inttypes.h> +#endif +#if HAVE_STDINT_H +#include <stdint.h> +#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 */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-md5.h.in b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-md5.h.in new file mode 100644 index 00000000..ad428db4 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-md5.h.in @@ -0,0 +1,46 @@ +/* + * $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 <inttypes.h> +#endif +#if HAVE_STDINT_H +#include <stdint.h> +#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 */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-memo.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-memo.h new file mode 100644 index 00000000..d1caa50b --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-memo.h @@ -0,0 +1,65 @@ +/* + * $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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-money.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-money.h new file mode 100644 index 00000000..4db6b95d --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-money.h @@ -0,0 +1,73 @@ +/* + * $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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-net.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-net.h new file mode 100644 index 00000000..dcdf043f --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-net.h @@ -0,0 +1,73 @@ +/* + * $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 diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-notepad.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-notepad.h new file mode 100644 index 00000000..27b50181 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-notepad.h @@ -0,0 +1,118 @@ +/* + * $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 diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-padp.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-padp.h new file mode 100644 index 00000000..ff020a5d --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-padp.h @@ -0,0 +1,89 @@ +/* + * $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_ */ + diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-palmpix.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-palmpix.h new file mode 100644 index 00000000..8fbddebe --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-palmpix.h @@ -0,0 +1,103 @@ +/* + * $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 diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-serial.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-serial.h new file mode 100644 index 00000000..59f40714 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-serial.h @@ -0,0 +1,87 @@ +/* + * $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 diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-slp.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-slp.h new file mode 100644 index 00000000..bfe269db --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-slp.h @@ -0,0 +1,100 @@ +/* + * $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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-sockaddr.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-sockaddr.h new file mode 100644 index 00000000..6a47fa41 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-sockaddr.h @@ -0,0 +1,29 @@ +/* + * $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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-socket.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-socket.h new file mode 100644 index 00000000..1694aed5 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-socket.h @@ -0,0 +1,579 @@ +/* + * $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 <unistd.h> + +#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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-source.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-source.h new file mode 100644 index 00000000..034fe8f5 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-source.h @@ -0,0 +1,157 @@ +/* + * $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 <sys/ioctl.h> +# include <sys/time.h> +# include <sys/errno.h> +# include <time.h> +# include <fcntl.h> +# include <unistd.h> +# include <string.h> +# include <stdlib.h> +# include <dirent.h> +# include <errno.h> +# include <assert.h> + +#ifdef NeXT +# include <sys/types.h> +# include <sys/socket.h> +#endif + +#ifdef __EMX__ +# define OS2 +# include <sys/types.h> +# include <sys/socket.h> +# include <sys/param.h> /* 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 <sgtty.h> +#else +# include <termios.h> +#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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-sync.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-sync.h new file mode 100644 index 00000000..4b4fd4cb --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-sync.h @@ -0,0 +1,107 @@ +/* + * $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 <jpr@helixcode.com> + * + * 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 diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-sys.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-sys.h new file mode 100644 index 00000000..c3be60df --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-sys.h @@ -0,0 +1,56 @@ +/* + * $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_*/ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-syspkt.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-syspkt.h new file mode 100644 index 00000000..4eb0c986 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-syspkt.h @@ -0,0 +1,153 @@ +/* + * $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_*/ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-threadsafe.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-threadsafe.h new file mode 100644 index 00000000..b1933cf9 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-threadsafe.h @@ -0,0 +1,59 @@ +/* + * $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 <pthread.h> + + #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 diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-todo.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-todo.h new file mode 100644 index 00000000..16051dcd --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-todo.h @@ -0,0 +1,67 @@ +/* + * $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 <time.h> +#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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-usb.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-usb.h new file mode 100644 index 00000000..ff56557d --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-usb.h @@ -0,0 +1,151 @@ +/* + * $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 diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-userland.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-userland.h new file mode 100644 index 00000000..8bc34fc7 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-userland.h @@ -0,0 +1,186 @@ +/* + * $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 <groot@kde.org> + * + * 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 <popt.h> +#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: */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-util.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-util.h new file mode 100644 index 00000000..499aecc3 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-util.h @@ -0,0 +1,112 @@ +/* + * $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 <jpr@helixcode.com> + * + * 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 diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-veo.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-veo.h new file mode 100644 index 00000000..07cdcebb --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-veo.h @@ -0,0 +1,74 @@ +/* + * $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 diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-versamail.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-versamail.h new file mode 100644 index 00000000..9c940e0d --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-versamail.h @@ -0,0 +1,81 @@ +/* + * $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 <time.h> +#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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-version.h b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-version.h new file mode 100644 index 00000000..6e779210 --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-version.h @@ -0,0 +1,27 @@ +#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_ */ diff --git a/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-version.h.in b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-version.h.in new file mode 100644 index 00000000..4a06266d --- /dev/null +++ b/debian/pilot-link/pilot-link-0.12.5-dfsg/include/pi-version.h.in @@ -0,0 +1,27 @@ +#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_ */ |