1998-11-15 02:03:33 +08:00
|
|
|
#ifndef __PNODE_H__
|
|
|
|
#define __PNODE_H__
|
1998-10-24 17:10:07 +08:00
|
|
|
#include <glib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
typedef struct _PNode PNode;
|
|
|
|
typedef struct _PRoot PRoot;
|
1998-11-15 02:03:33 +08:00
|
|
|
typedef const gconstpointer Tag;
|
|
|
|
extern PNode* p_nil;
|
1998-10-24 17:10:07 +08:00
|
|
|
|
|
|
|
typedef void (*PNodeTraverseFunc) (PNode* n, gpointer user_data);
|
|
|
|
typedef PNode* (*PNodeCreateFunc) ();
|
|
|
|
|
|
|
|
void p_ref(PNode* node);
|
|
|
|
void p_unref(PNode* node);
|
|
|
|
PNode* p_str(const gchar* str);
|
|
|
|
PNode* p_prf(const gchar* format, ...) G_GNUC_PRINTF(1, 2);
|
|
|
|
PNode* p_fmt(const gchar* f, ...);
|
|
|
|
PNode* p_lst(PNode* n, ...);
|
|
|
|
PNode* p_for(GSList* l, PNodeCreateFunc func, gpointer user_data);
|
1998-11-20 06:36:44 +08:00
|
|
|
PNode* p_col(const gchar* tag, PNodeCreateFunc func);
|
1998-11-21 07:21:40 +08:00
|
|
|
void p_write(PNode* node, FILE* f, PRoot* r);
|
|
|
|
gchar* p_to_str(PNode* n, PRoot* pr);
|
|
|
|
|
|
|
|
|
1998-10-24 17:10:07 +08:00
|
|
|
|
|
|
|
PRoot* pr_new(void);
|
1998-11-20 06:36:44 +08:00
|
|
|
void pr_put(PRoot* pr, const gchar* tag, gpointer datum);
|
|
|
|
void pr_write(PRoot* pr, FILE* stream, const gchar* tag);
|
1998-10-24 17:10:07 +08:00
|
|
|
void pr_free(PRoot* root);
|
1998-11-20 06:36:44 +08:00
|
|
|
|
1998-10-24 17:10:07 +08:00
|
|
|
|
1998-11-15 02:03:33 +08:00
|
|
|
|
|
|
|
#endif
|