|
@@ -28,71 +28,7 @@
|
|
|
#ifndef _mi_h_
|
|
|
#define _mi_h_
|
|
|
|
|
|
-#include "../str.h"
|
|
|
-
|
|
|
-#define MI_DUP_NAME (1<<0)
|
|
|
-#define MI_DUP_VALUE (1<<1)
|
|
|
-
|
|
|
-#define MI_OK_S "OK"
|
|
|
-#define MI_OK_LEN (sizeof(MI_OK_S)-1)
|
|
|
-#define MI_INTERNAL_ERR_S "Server Internal Error"
|
|
|
-#define MI_INTERNAL_ERR_LEN (sizeof(MI_INTERNAL_ERR_S)-1)
|
|
|
-#define MI_MISSING_PARM_S "Too few or too many arguments"
|
|
|
-#define MI_MISSING_PARM_LEN (sizeof(MI_MISSING_PARM_S)-1)
|
|
|
-#define MI_BAD_PARM_S "Bad parameter"
|
|
|
-#define MI_BAD_PARM_LEN (sizeof(MI_BAD_PARM_S)-1)
|
|
|
-
|
|
|
-#define MI_SSTR(_s) _s,(sizeof(_s)-1)
|
|
|
-#define MI_OK MI_OK_S
|
|
|
-#define MI_INTERNAL_ERR MI_INTERNAL_ERR_S
|
|
|
-#define MI_MISSING_PARM MI_MISSING_PARM_S
|
|
|
-#define MI_BAD_PARM MI_BAD_PARM_S
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-struct mi_attr{
|
|
|
- str name;
|
|
|
- str value;
|
|
|
- struct mi_attr *next;
|
|
|
-};
|
|
|
-
|
|
|
-
|
|
|
-struct mi_node {
|
|
|
- str value;
|
|
|
- str name;
|
|
|
- struct mi_node *kids;
|
|
|
- struct mi_node *next;
|
|
|
- struct mi_node *last;
|
|
|
- struct mi_attr *attributes;
|
|
|
-};
|
|
|
-
|
|
|
-
|
|
|
-struct mi_root {
|
|
|
- unsigned int code;
|
|
|
- str reason;
|
|
|
- struct mi_handler *async_hdl;
|
|
|
- struct mi_node node;
|
|
|
-};
|
|
|
-
|
|
|
-typedef struct mi_root* (mi_cmd_f)(struct mi_root*, void *param);
|
|
|
-typedef int (mi_child_init_f)(void);
|
|
|
-
|
|
|
-
|
|
|
-typedef struct mi_export_ {
|
|
|
- char *name;
|
|
|
- mi_cmd_f *cmd;
|
|
|
- unsigned int flags;
|
|
|
- void *param;
|
|
|
- mi_child_init_f *init_f;
|
|
|
-}mi_export_t;
|
|
|
-
|
|
|
-
|
|
|
-#define init_mi_tree(code, reason, reason_len) 0
|
|
|
-#define free_mi_tree(parent)
|
|
|
-#define add_mi_node_sibling(node, flags, name, name_len, val, val_len) 0
|
|
|
-#define add_mi_node_child(node, flags, name, name_len, val, val_len) 0
|
|
|
-#define addf_mi_node_child(node, flags, name, name_len, fmt, ...) 0
|
|
|
-
|
|
|
+#include "../lib/kmi/mi.h"
|
|
|
|
|
|
#endif /* _mi_h_ */
|
|
|
|