Go to the documentation of this file.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
00038 #ifndef _MI_TREE_H
00039 #define _MI_TREE_H
00040
00041 #include <stdarg.h>
00042 #include "../../str.h"
00043 #include "../../mi/mi_types.h"
00044
00045 struct mi_node;
00046 struct mi_handler;
00047
00048 #include "attr.h"
00049
00050 #define MI_DUP_NAME (1<<0)
00051 #define MI_DUP_VALUE (1<<1)
00052
00053 #define MI_OK_S "OK"
00054 #define MI_OK_LEN (sizeof(MI_OK_S)-1)
00055 #define MI_INTERNAL_ERR_S "Server Internal Error"
00056 #define MI_INTERNAL_ERR_LEN (sizeof(MI_INTERNAL_ERR_S)-1)
00057 #define MI_MISSING_PARM_S "Too few or too many arguments"
00058 #define MI_MISSING_PARM_LEN (sizeof(MI_MISSING_PARM_S)-1)
00059 #define MI_BAD_PARM_S "Bad parameter"
00060 #define MI_BAD_PARM_LEN (sizeof(MI_BAD_PARM_S)-1)
00061
00062 #define MI_SSTR(_s) _s,(sizeof(_s)-1)
00063 #define MI_OK MI_OK_S
00064 #define MI_INTERNAL_ERR MI_INTERNAL_ERR_S
00065 #define MI_MISSING_PARM MI_MISSING_PARM_S
00066 #define MI_BAD_PARM MI_BAD_PARM_S
00067
00068
00069
00070 struct mi_root *init_mi_tree(unsigned int code, char *reason, int reason_len);
00071
00072 void free_mi_tree(struct mi_root *parent);
00073
00074 struct mi_node *add_mi_node_sibling(struct mi_node *brother, int flags,
00075 char *name, int name_len, char *value, int value_len);
00076
00077 struct mi_node *addf_mi_node_sibling(struct mi_node *brother, int flags,
00078 char *name, int name_len, char *fmt_val, ...);
00079
00080 struct mi_node *add_mi_node_child(struct mi_node *parent, int flags,
00081 char *name, int name_len, char *value, int value_len);
00082
00083 struct mi_node *addf_mi_node_child(struct mi_node *parent, int flags,
00084 char *name, int name_len, char *fmt_val, ...);
00085
00086 struct mi_root* clone_mi_tree(struct mi_root *org, int shm);
00087
00088 void free_shm_mi_tree(struct mi_root *parent);
00089
00090 #endif
00091