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

# DlpReadAppPreference(3)

read/write PalmOS application preference

## NAME

**DlpReadAppPreference**, **DlpWriteAppPreference** – read/write PalmOS application preference

## LIBRARY

*libpconn*

## SYNOPSIS

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

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

*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*);

## DESCRIPTION

Palm applications have preferences associated with them. These are typically user options. The Mail application also stores the signature for outgoing messages in a preference. Preferences are stored in the *Saved* *Preferences* and *Unsaved* *Preferences* resource databases.

**DlpReadAppPreference** reads an application preference from the Palm.

*creator* specifies the four-letter application identifier.

*id* specifies the preference ID.

*len* specifies the maximum number of bytes to return in *data*.

*flags* specifies flags: if DLPC\_READAPPFL\_BACKEDUP is set, **DlpReadAppPreference** reads from *Saved* *Preferences*. Otherwise, it reads from *Unsaved* *Preferences*.

*pref* is filled in with information about the preference. The *dlp\_apppref* structure is defined as

```
struct dlp_apppref
{
	uword version;
	uword size;
	uword len;
};
```

where *size* gives the actual size of the preference, and *len* gives the number of bytes returned in *data*. It is not clear what *version* is.

*data* is filled in with the preference data.

**DlpWriteAppPreference** writes an application preference to the Palm. The arguments are similar to those for **DlpReadAppPreference**.

## RETURN VALUE

These functions return 0 if successful, or a negative value otherwise.

## SEE ALSO

[libpconn(3)](/libpconn/3.md), [new\_PConnection(3)](/new_PConnection/3.md).
