/home/dko/Projects/mobilec/src/mxml-2.2.2/mxml-file.c File Reference

#include "mxml.h"
#include <unistd.h>
#include "config.h"

Go to the source code of this file.

Data Structures

struct  mxml_fdbuf_s

Defines

#define ENCODE_UTF8   0
#define ENCODE_UTF16BE   1
#define ENCODE_UTF16LE   2
#define mxml_bad_char(ch)   ((ch) < ' ' && (ch) != '\n' && (ch) != '\r' && (ch) != '\t')

Typedefs

typedef struct mxml_fdbuf_s mxml_fdbuf_t

Functions

static int mxml_add_char (int ch, char **ptr, char **buffer, int *bufsize)
static int mxml_fd_getc (void *p, int *encoding)
static int mxml_fd_putc (int ch, void *p)
static int mxml_fd_read (mxml_fdbuf_t *buf)
static int mxml_fd_write (mxml_fdbuf_t *buf)
static int mxml_file_getc (void *p, int *encoding)
static int mxml_file_putc (int ch, void *p)
static int mxml_get_entity (mxml_node_t *parent, void *p, int *encoding, int(*getc_cb)(void *, int *))
static mxml_node_tmxml_load_data (mxml_node_t *top, void *p, mxml_type_t(*cb)(mxml_node_t *), int(*getc_cb)(void *, int *))
static int mxml_parse_element (mxml_node_t *node, void *p, int *encoding, int(*getc_cb)(void *, int *))
static int mxml_string_getc (void *p, int *encoding)
static int mxml_string_putc (int ch, void *p)
static int mxml_write_name (const char *s, void *p, int(*putc_cb)(int, void *))
static int mxml_write_node (mxml_node_t *node, void *p, const char *(*cb)(mxml_node_t *, int), int col, int(*putc_cb)(int, void *))
static int mxml_write_string (const char *s, void *p, int(*putc_cb)(int, void *))
static int mxml_write_ws (mxml_node_t *node, void *p, const char *(*cb)(mxml_node_t *, int), int ws, int col, int(*putc_cb)(int, void *))
mxml_node_tmxmlLoadFd (mxml_node_t *top, int fd, mxml_type_t(*cb)(mxml_node_t *node))
mxml_node_tmxmlLoadFile (mxml_node_t *top, FILE *fp, mxml_type_t(*cb)(mxml_node_t *node))
mxml_node_tmxmlLoadString (mxml_node_t *top, const char *s, mxml_type_t(*cb)(mxml_node_t *node))
char * mxmlSaveAllocString (mxml_node_t *node, const char *(*cb)(mxml_node_t *node, int ws))
int mxmlSaveFd (mxml_node_t *node, int fd, const char *(*cb)(mxml_node_t *node, int ws))
int mxmlSaveFile (mxml_node_t *node, FILE *fp, const char *(*cb)(mxml_node_t *node, int ws))
int mxmlSaveString (mxml_node_t *node, char *buffer, int bufsize, const char *(*cb)(mxml_node_t *node, int ws))
void mxmlSetCustomHandlers (mxml_custom_load_cb_t load, mxml_custom_save_cb_t save)
void mxmlSetErrorCallback (void(*cb)(const char *))

Variables

void(* mxml_error_cb )(const char *)
static mxml_custom_load_cb_t mxml_custom_load_cb = NULL
static mxml_custom_save_cb_t mxml_custom_save_cb = NULL

Define Documentation

#define ENCODE_UTF16BE   1

Definition at line 69 of file mxml-file.c.

Referenced by mxml_fd_getc(), mxml_file_getc(), and mxml_string_getc().

#define ENCODE_UTF16LE   2

Definition at line 70 of file mxml-file.c.

Referenced by mxml_fd_getc(), mxml_file_getc(), and mxml_string_getc().

#define ENCODE_UTF8   0

Definition at line 68 of file mxml-file.c.

Referenced by mxml_fd_getc(), mxml_file_getc(), mxml_load_data(), and mxml_string_getc().

#define mxml_bad_char ( ch   )     ((ch) < ' ' && (ch) != '\n' && (ch) != '\r' && (ch) != '\t')

Definition at line 77 of file mxml-file.c.

Referenced by mxml_fd_getc(), mxml_file_getc(), mxml_get_entity(), and mxml_string_getc().


Typedef Documentation

typedef struct mxml_fdbuf_s mxml_fdbuf_t

Function Documentation

static int mxml_add_char ( int  ch,
char **  ptr,
char **  buffer,
int bufsize 
) [static]

Definition at line 484 of file mxml-file.c.

References mxml_error().

Referenced by mxml_load_data(), and mxml_parse_element().

static int mxml_fd_getc ( void *  p,
int encoding 
) [static]
static int mxml_fd_putc ( int  ch,
void *  p 
) [static]

Definition at line 851 of file mxml-file.c.

References buf, mxml_fdbuf_s::current, mxml_fdbuf_s::end, and mxml_fd_write().

Referenced by mxmlSaveFd().

static int mxml_fd_read ( mxml_fdbuf_t buf  )  [static]

Definition at line 920 of file mxml-file.c.

References mxml_fdbuf_s::buffer, mxml_fdbuf_s::current, mxml_fdbuf_s::end, and mxml_fdbuf_s::fd.

Referenced by mxml_fd_getc().

static int mxml_fd_write ( mxml_fdbuf_t buf  )  [static]

Definition at line 959 of file mxml-file.c.

References mxml_fdbuf_s::buffer, mxml_fdbuf_s::current, and mxml_fdbuf_s::fd.

Referenced by mxml_fd_putc(), and mxmlSaveFd().

static int mxml_file_getc ( void *  p,
int encoding 
) [static]

Definition at line 1002 of file mxml-file.c.

References ENCODE_UTF16BE, ENCODE_UTF16LE, ENCODE_UTF8, mxml_bad_char, and mxml_error().

Referenced by mxmlLoadFile().

static int mxml_file_putc ( int  ch,
void *  p 
) [static]

Definition at line 1201 of file mxml-file.c.

Referenced by mxmlSaveFile().

static int mxml_get_entity ( mxml_node_t parent,
void *  p,
int encoding,
int(*)(void *, int *)  getc_cb 
) [static]
static mxml_node_t * mxml_load_data ( mxml_node_t top,
void *  p,
mxml_type_t(*)(mxml_node_t *)  cb,
int(*)(void *, int *)  getc_cb 
) [static]
static int mxml_parse_element ( mxml_node_t node,
void *  p,
int encoding,
int(*)(void *, int *)  getc_cb 
) [static]
static int mxml_string_getc ( void *  p,
int encoding 
) [static]

Definition at line 2103 of file mxml-file.c.

References ENCODE_UTF16BE, ENCODE_UTF16LE, ENCODE_UTF8, mxml_bad_char, and mxml_error().

Referenced by mxmlLoadString().

static int mxml_string_putc ( int  ch,
void *  p 
) [static]

Definition at line 2339 of file mxml-file.c.

Referenced by mxmlSaveString().

static int mxml_write_name ( const char *  s,
void *  p,
int(*)(int, void *)  putc_cb 
) [static]

Definition at line 2413 of file mxml-file.c.

References mxmlEntityGetName().

Referenced by mxml_write_node().

static int mxml_write_node ( mxml_node_t node,
void *  p,
const char *(*)(mxml_node_t *, int cb,
int  col,
int(*)(int, void *)  putc_cb 
) [static]
static int mxml_write_string ( const char *  s,
void *  p,
int(*)(int, void *)  putc_cb 
) [static]

Definition at line 2769 of file mxml-file.c.

References mxmlEntityGetName().

Referenced by mxml_write_node().

static int mxml_write_ws ( mxml_node_t node,
void *  p,
const char *(*)(mxml_node_t *, int cb,
int  ws,
int  col,
int(*)(int, void *)  putc_cb 
) [static]

Definition at line 2809 of file mxml-file.c.

References MXML_TAB.

Referenced by mxml_write_node().

mxml_node_t* mxmlLoadFd ( mxml_node_t top,
int  fd,
mxml_type_t(*)(mxml_node_t *node cb 
)
mxml_node_t* mxmlLoadFile ( mxml_node_t top,
FILE *  fp,
mxml_type_t(*)(mxml_node_t *node cb 
)

Definition at line 200 of file mxml-file.c.

References mxml_file_getc(), and mxml_load_data().

Referenced by main().

mxml_node_t* mxmlLoadString ( mxml_node_t top,
const char *  s,
mxml_type_t(*)(mxml_node_t *node cb 
)
char* mxmlSaveAllocString ( mxml_node_t node,
const char *(*)(mxml_node_t *node, int ws)  cb 
)

Definition at line 259 of file mxml-file.c.

References mxmlSaveString(), and strdup.

Referenced by fipa_envelope_Compose(), MC_GetAgentXMLString(), and message_InitializeFromAgent().

int mxmlSaveFd ( mxml_node_t node,
int  fd,
const char *(*)(mxml_node_t *node, int ws)  cb 
)
int mxmlSaveFile ( mxml_node_t node,
FILE *  fp,
const char *(*)(mxml_node_t *node, int ws)  cb 
)

Definition at line 363 of file mxml-file.c.

References mxml_file_putc(), and mxml_write_node().

Referenced by main().

int mxmlSaveString ( mxml_node_t node,
char *  buffer,
int  bufsize,
const char *(*)(mxml_node_t *node, int ws)  cb 
)

Definition at line 405 of file mxml-file.c.

References mxml_string_putc(), and mxml_write_node().

Referenced by main(), and mxmlSaveAllocString().

void mxmlSetCustomHandlers ( mxml_custom_load_cb_t  load,
mxml_custom_save_cb_t  save 
)

Definition at line 457 of file mxml-file.c.

References mxml_custom_load_cb, and mxml_custom_save_cb.

void mxmlSetErrorCallback ( void(*)(const char *)  cb  ) 

Definition at line 472 of file mxml-file.c.

References mxml_error_cb.


Variable Documentation

Definition at line 104 of file mxml-file.c.

Referenced by mxml_load_data(), and mxmlSetCustomHandlers().

Definition at line 105 of file mxml-file.c.

Referenced by mxml_write_node(), and mxmlSetCustomHandlers().

void(* mxml_error_cb)(const char *)

Definition at line 45 of file mxml-private.c.

Referenced by mxml_error(), and mxmlSetErrorCallback().

Generated on Tue Dec 28 15:15:28 2010 for Mobile-C by  doxygen 1.6.3