datanode.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00040 #ifndef FX_DATANODE_H
00041 #define FX_DATANODE_H
00042
00043 #include "fastlib/base/common.h"
00044
00045 EXTERN_C_BEGIN
00046
00071 struct datanode {
00073 int mod_type;
00075 int val_type;
00077 const char *meta;
00079 char *key;
00081 char *val;
00083 struct datanode *first_child;
00085 struct datanode *last_child;
00087 struct datanode *next;
00089 struct datanode *parent;
00090 };
00091
00100 void datanode_init(struct datanode *node, const char *key);
00108 void datanode_destroy(struct datanode *node);
00109
00121 struct datanode *datanode_lookup_expert(struct datanode *node, char *path,
00122 int create);
00144 struct datanode *datanode_lookup(struct datanode *node, const char *path,
00145 int create);
00160 int datanode_exists(struct datanode *node, const char *path);
00179 void datanode_copy(struct datanode *dest, struct datanode *src,
00180 int overwrite);
00181
00207 void datanode_write(struct datanode *node, FILE *stream,
00208 const char *type_char);
00225 void datanode_read(struct datanode *node, FILE *stream,
00226 const char *type_char, int overwrite);
00227
00228 EXTERN_C_END
00229
00230 #endif