Main Page   File List   Globals   Related Pages  

cardparser.c File Reference


Detailed Description

Implements a vCard/vCal parser.

Definition in file cardparser.c.

#include "cardparser.h"
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdio.h>

Go to the source code of this file.

Functions

CARD_Parser CARD_ParserCreate (CARD_Char *encoding)
 Creates a card parser handle. Allocates a handle for a card parser. Free with CARD_ParserFree().

void CARD_ParserFree (CARD_Parser p)
 Deallocates the card parser object. Frees the memory associated with a card parser objetc created by CARD_ParserCreate().

int CARD_Parse (CARD_Parser p, const char *s, int len, int isFinal)
 Parses a block of memory. Parses the block of memory, the memory does not need to be zero-terminated. isFinal should be set to TRUE (non-zero) for the final call so that internal structures can be flushed to the output.

void CARD_SetUserData (CARD_Parser p, void *userData)
 sets the user data value for the callbacks (::CARD_PropHandler, ::CARD_DataHandler) This value will be passed to the specified callbacks

void * CARD_GetUserData (CARD_Parser p)
 returns the user data value for the callbacks (::CARD_PropHandler, ::CARD_DataHandler)

void CARD_SetPropHandler (CARD_Parser p, CARD_PropHandler cardProp)
 Set the callback for vcard properties.

void CARD_SetDataHandler (CARD_Parser p, CARD_DataHandler cardData)
 Set the callback for vcard data.


Function Documentation

CARD_Parser CARD_ParserCreate CARD_Char *    encoding
 

Creates a card parser handle. Allocates a handle for a card parser. Free with CARD_ParserFree().

Parameters:
encoding encoding of the card, currentl not used
Returns:
CARD_Parser handle or NULL on error
Return values:
NULL An error ocurred

Definition at line 160 of file cardparser.c.

void CARD_ParserFree CARD_Parser    p
 

Deallocates the card parser object. Frees the memory associated with a card parser objetc created by CARD_ParserCreate().

Parameters:
p Card parser object
Returns:
nothing

Definition at line 185 of file cardparser.c.

int CARD_Parse CARD_Parser    p,
const char *    s,
int    len,
int    isFinal
 

Parses a block of memory. Parses the block of memory, the memory does not need to be zero-terminated. isFinal should be set to TRUE (non-zero) for the final call so that internal structures can be flushed to the output.

Parameters:
p Card parser object
s pointer to binary data, can be null, does not need to be null terminated
len length of data
isFinal wether this is the final chunk of data
Returns:
success/failure
Return values:
0 a parse error occurred
non-zero success

Note:
 CARD_Parse(p, NULL, 0, TRUE);
is an acceptable way of terminating input.

Definition at line 621 of file cardparser.c.

void CARD_SetUserData CARD_Parser    p,
void *    userData
 

sets the user data value for the callbacks (::CARD_PropHandler, ::CARD_DataHandler) This value will be passed to the specified callbacks

Parameters:
p Card parser object
userData value to be set
Returns:
nothing

Definition at line 688 of file cardparser.c.

void * CARD_GetUserData CARD_Parser    p
 

returns the user data value for the callbacks (::CARD_PropHandler, ::CARD_DataHandler)

Parameters:
p Card parser object
Returns:
current useData value

Definition at line 700 of file cardparser.c.

void CARD_SetPropHandler CARD_Parser    p,
CARD_PropHandler    cardProp
 

Set the callback for vcard properties.

Parameters:
p Card parser object
cardProp function pointer for prop event handler
Returns:
nothing

Definition at line 713 of file cardparser.c.

void CARD_SetDataHandler CARD_Parser    p,
CARD_DataHandler    cardData
 

Set the callback for vcard data.

Parameters:
p Card parser object
cardData function pointer for data event handler
Returns:
nothing

Definition at line 726 of file cardparser.c.


Generated on Fri Apr 25 15:56:55 2003 for ccard by doxygen1.3-rc3