---
name: "libpconn"
section: "3"
platform: "linux"
package: "coldsync"
version: "3.0+pre3-3"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/libpconn"
---

# libpconn(3)

library for communicating with PalmOS devices

## NAME

**libpconn** – library for communicating with PalmOS devices

## SYNOPSIS

**#include \<palm.h\>**

**#include \<pconn/pconn.h\>**

Function prototypes are given in their respective man pages.

If

**libpconn** was built with I18N support, you may need to link with *-lintl*

## DESCRIPTION

The **libpconn** library provides functions for communicating with PalmOS devices. It supports serial, USB (under FreeBSD), and TCP connections, though the latter are still greatly experimental.

## VARIABLES

**libpconn** defines the following variables:

- int palm\_errno

  Very similar to errno, int palm\_errno is set whenever an error occurs in a **libpconn** function. The value indicates the error. Possible values are the PALMERR\_\* values defined in *\<pconn/palm\_errno.h\>*.

- const char \*palm\_errlist\[\]

  An array of strings giving error messages corresponding to the PALMERR\_\* values.

- const int palm\_numerrs

  The number of entries in palm\_errlist.

## FUNCTIONS

**libpconn** includes the following functions, which are described in their respective manual pages:

*PConnection* *\** **new\_PConnection**(*char \*fname*, *int listenType*, *const unsigned short flags*)

*int* **PConnClose**(*PConnection \*pconn*)

*int* **PConn\_bind**(*PConnection \*pconn*, *const void \*addr*, *const int addrlen*)

*int* **DlpReadUserInfo**(*PConnection \*pconn*, *struct dlp\_userinfo \*userinfo*)

*int* **DlpWriteUserInfo**(*PConnection \*pconn*, *const struct dlp\_setuserinfo \*userinfo*)

*int* **DlpReadSysInfo**(*PConnection \*pconn*, *struct dlp\_sysinfo \*sysinfo*)

*int* **DlpGetSysDateTime**(*PConnection \*pconn*, *struct dlp\_time \*ptime*)

*int* **DlpSetSysDateTime**(*PConnection \*pconn*, *const struct dlp\_time \*ptime*)

*int* **DlpReadStorageInfo**(*PConnection \*pconn*, *const ubyte card*, *ubyte \*last\_card*, *ubyte \*more*, *struct dlp\_cardinfo \*cinfo*)

*int* **DlpReadDBList**(*PConnection \*pconn*, *const ubyte iflags*, *const int card*, *const uword start*, *uword \*last\_index*, *ubyte \*oflags*, *ubyte \*num*, *struct dlp\_dbinfo \*dbs*)

*int* **DlpOpenDB**(*PConnection \*pconn*, *int card*, *const char \*name*, *ubyte mode*, *ubyte \*dbhandle*)

*int* **DlpCreateDB**(*PConnection \*pconn*, *const struct dlp\_createdbreq \*newdb*, *ubyte \*dbhandle*)

*int* **DlpCloseDB**(*PConnection \*pconn*, *ubyte dbhandle*)

*int* **DlpDeleteDB**(*PConnection \*pconn*, *const int card*, *const char \*name*)

*int* **DlpReadAppBlock**(*PConnection \*pconn*, *const ubyte handle*, *const uword offset*, *const uword len*, *uword \*size*, *const ubyte \*\*data*)

*int* **DlpWriteAppBlock**(*PConnection \*pconn*, *const ubyte handle*, *const uword len*, *const ubyte \*data*)

*int* **DlpReadSortBlock**(*PConnection \*pconn*, *const ubyte handle*, *const uword offset*, *const uword len*, *uword \*size*, *const ubyte \*\*data*)

*int* **DlpWriteSortBlock**(*PConnection \*pconn*, *const ubyte handle*, *const uword len*, *const ubyte \*data*)

*int* **DlpReadNextModifiedRec**(*PConnection \*pconn*, *const ubyte handle*, *struct dlp\_recinfo \*recinfo*, *const ubyte \*\*data*)

*int* **DlpReadRecordByID**(*PConnection \*pconn*, *const ubyte handle*, *const udword id*, *const uword offset*, *const uword len*, *struct dlp\_recinfo \*recinfo*, *const ubyte \*\*data*)

*int* **DlpReadRecordByIndex**(*PConnection \*pconn*, *const ubyte handle*, *const uword index*, *struct dlp\_recinfo \*recinfo*)

*int* **DlpWriteRecord**(*PConnection \*pconn*, *const ubyte handle*, *const ubyte flags*, *const udword id*, *const ubyte attributes*, *const ubyte category*, *const udword len*, *const ubyte \*data*, *udword \*recid*)

*int* **DlpDeleteRecord**(*PConnection \*pconn*, *const ubyte handle*, *const ubyte flags*, *const udword recid*)

*int* **DlpReadResourceByIndex**(*PConnection \*pconn*, *const ubyte handle*, *const uword index*, *const uword offset*, *const uword len*, *struct dlp\_resource \*value*, *const ubyte \*\*data*)

*int* **DlpReadResourceByType**(*PConnection \*pconn*, *const ubyte handle*, *const udword type*, *const uword id*, *const uword offset*, *const uword len*, *struct dlp\_resource \*value*, *ubyte \*data*)

*int* **DlpWriteResource**(*PConnection \*pconn*, *const ubyte handle*, *const udword type*, *const uword id*, *const uword size*, *const ubyte \*data*)

*int* **DlpDeleteResource**(*PConnection \*pconn*, *const ubyte handle*, *const ubyte flags*, *const udword type*, *const uword id*)

*int* **DlpCleanUpDatabase**(*PConnection \*pconn*, *const ubyte handle*)

*int* **DlpResetSyncFlags**(*PConnection \*pconn*, *const ubyte handle*)

*int* **DlpCallApplication**(*PConnection \*pconn*, *const udword version*, *const struct dlp\_appcall \*appcall*, *const udword paramsize*, *const ubyte \*param*, *struct dlp\_appresult \*appresult*)

*int* **DlpResetSystem**(*PConnection \*pconn*)

*int* **DlpAddSyncLogEntry**(*PConnection \*pconn*, *const char \*msg*)

*int* **DlpReadOpenDBInfo**(*PConnection \*pconn*, *ubyte handle*, *struct dlp\_opendbinfo \*dbinfo*)

*int* **DlpMoveCategory**(*PConnection \*pconn*, *const ubyte handle*, *const ubyte from*, *const ubyte to*)

*int* **DlpOpenConduit**(*PConnection \*pconn*)

*int* **DlpEndOfSync**(*PConnection \*pconn*, *const ubyte status*)

*int* **DlpResetRecordIndex**(*PConnection \*pconn*, *const ubyte handle*)

*int* **DlpReadRecordIDList**(*PConnection \*pconn*, *const ubyte handle*, *const ubyte flags*, *const uword start*, *const uword max*, *uword \*numread*, *udword recids\[\]*)

*int* **DlpReadNextRecInCategory**(*PConnection \*pconn*, *const ubyte handle*, *const ubyte category*, *struct dlp\_recinfo \*recinfo*, *const ubyte \*\*data*)

*int* **DlpReadNextModifiedRecInCategory**(*PConnection \*pconn*, *const ubyte handle*, *const ubyte category*, *struct dlp\_recinfo \*recinfo*, *const ubyte \*\*data*)

*int* **DlpReadAppPreference**(*PConnection \*pconn*, *const udword creator*, *const uword id*, *const uword len*, *const ubyte flags*, *struct dlp\_apppref \*pref*, *ubyte \*data*)

*int* **DlpWriteAppPreference**(*PConnection \*pconn*, *const udword creator*, *const uword id*, *const ubyte flags*, *const struct dlp\_apppref \*pref*, *const ubyte \*data*)

*int* **DlpReadNetSyncInfo**(*PConnection \*pconn*, *struct dlp\_netsyncinfo \*netsyncinfo*)

*int* **DlpWriteNetSyncInfo**(*PConnection \*pconn*, *const ubyte modflags*, *const struct dlp\_netsyncinfo \*newinfo*)

*int* **DlpReadFeature**(*PConnection \*pconn*, *const udword creator*, *const word featurenum*, *udword \*value*)

*int* **DlpRPC**(*PConnection \*pconn*, *uword trap*, *udword \*D0*, *udword \*A0*, *int argc*, *struct DLPRPC\_param \*argv*)

*int* **RDLP\_Backlight**(*PConnection \*pconn*, *Bool set*, *Bool newState*)

*int* **RDLP\_BatteryLevel**(*PConnection \*pconn*)

*int* **RDLP\_PluggedIn**(*PConnection \*pconn*)

*int* **RDLP\_ROMToken**(*PConnection \*pconn*, *uword cardno*, *udword token*, *udword \*data\_ptr*, *uword \*data\_len*)

*int* **RDLP\_MemHandleNew**(*PConnection \*pconn*, *udword size*)

*int* **RDLP\_GetOSVersionString**(*PConnection \*pconn*)

*int* **RDLP\_BatteryDialog**(*PConnection \*pconn*)

*int* **RDLP\_MemMove**(*PConnection \*pconn*, *ubyte \*dst*, *const udword src*, *const udword len*)

*int* **RDLP\_MemReadable**(*PConnection \*pconn*, *udword addr*)

*time\_t* **time\_dlp2time\_t**(*const struct dlp\_time \*dlpt*)

*udword* **time\_dlp2palmtime**(*const struct dlp\_time \*dlpt*)

*void* **time\_time\_t2dlp**(*const time\_t t*, *struct dlp\_time \*dlpt*)

*void* **time\_palmtime2dlp**(*const udword palmt*, *struct dlp\_time \*dlpt*)

## RETURN VALUES

When a **libpconn** function encounters an error, it sets palm\_errno to one of the PALMERR\_\* values defined in *\<pconn/palm\_errno.h\>*.

## AUTHORS

Andrew Arensburger ⟨arensb@ooblick.com⟩
