PalmLsnProcess method

Processes a message according to the records in a configuration database.

Syntax
palm_lsn_ret PalmLsnProcess(
    struct a_palm_msg * msg,
    Char const * configPDBName,
    UInt16 * const problematicRecNum,
    Boolean * handled
)
Parameters
  • msg   A pointer to an a_palm_msg instance.

  • configPDBName   A character array containing the name of the configuration database. Use the PalmLsnGetConfigFileName method to obtain the configuration database name. See PalmLsnGetConfigFileName method.

  • problematicRecNum   An output parameter identifying the index of a problematic or malformed record in the configuration database.

  • handled   An output parameter indicating if PalmLsnProcess successfully processed the message.

Returns

Return codes defined in the palm_lsn_ret enumeration. See palm_lsn_ret enumeration.

Remarks

PalmLsnProcess determines the appropriate action to take in response to an incoming message. It compares the message's fields to filters stored in a configuration database.

For more information about creating the Listener configuration database, see Listener configuration utility for Palm devices.

The records contained in the configuration database store information about message filters and what actions should result from an accepted message.

A configuration record has the following format:

[subject=<string>;] [content=<string>;]
[message|message_start=<string>;] [sender=<string>;]
action=run <app name> [arguments]

arguments is an application dependent string which may contain action variables.

See also
Example

The following is a partial listing used to handle a message. The example allocates the message structure, initializes fields, and processes the message using PalmLsnProcess:

a_palm_msg * ulMsg;
Boolean * handled 
Char configDb[dmDBNameLength];
...

// Allocate the message structure
ulMsg = PalmLsnAllocate();
...

// Fill the message fields
ret = PalmLsnDupMessage(ulMsg, msgBody);
...

// Get the configuration database name
PalmLsnGetConfigFileName(configDb);

// Process the message
ret = PalmLsnProcess(ulMsg, configDb, NULL, handled);
...

// Free the message
PalmLsnFree(ulMsg);