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 #ifndef XCAP_FUNC_H
00030 #define XCAP_FUNC_H
00031
00032 #include "xcap_callbacks.h"
00033
00034 #define USERS_TYPE 1
00035 #define GLOBAL_TYPE 2
00036
00037 #define IF_MATCH 1
00038 #define IF_NONE_MATCH 2
00039
00040
00041
00042
00043 #define INTEGRATED_SERVER 0
00044 #define XCAP_CL_MOD 1
00045
00046
00047 typedef struct xcap_doc_sel
00048 {
00049 str auid;
00050 int doc_type;
00051 int type;
00052 str xid;
00053 str filename;
00054 }xcap_doc_sel_t;
00055
00056 typedef struct ns_list
00057 {
00058 int name;
00059 str value;
00060 struct ns_list* next;
00061 }ns_list_t;
00062
00063 typedef struct step
00064 {
00065 str val;
00066 struct step* next;
00067 }step_t;
00068
00069 typedef struct xcap_node_sel
00070 {
00071 step_t* steps;
00072 step_t* last_step;
00073 int size;
00074 ns_list_t* ns_list;
00075 ns_list_t* last_ns;
00076 int ns_no;
00077
00078 }xcap_node_sel_t;
00079
00080 typedef struct att_test
00081 {
00082 str name;
00083 str value;
00084 }attr_test_t;
00085
00086 typedef struct xcap_get_req
00087 {
00088 char* xcap_root;
00089 unsigned int port;
00090 xcap_doc_sel_t doc_sel;
00091 xcap_node_sel_t* node_sel;
00092 char* etag;
00093 int match_type;
00094 }xcap_get_req_t;
00095
00096 xcap_node_sel_t* xcapInitNodeSel(void);
00097 typedef xcap_node_sel_t* (*xcap_nodeSel_init_t )(void);
00098
00099 xcap_node_sel_t* xcapNodeSelAddStep(xcap_node_sel_t* curr_sel, str* name,
00100 str* namespace, int pos, attr_test_t* attr_test, str* extra_sel);
00101
00102 typedef xcap_node_sel_t* (*xcap_nodeSel_add_step_t)(xcap_node_sel_t* curr_sel,
00103 str* name,str* namespace,int pos,attr_test_t* attr_test,str* extra_sel);
00104
00105 xcap_node_sel_t* xcapNodeSelAddTerminal(xcap_node_sel_t* curr_sel,
00106 char* attr_sel, char* namespace_sel, char* extra_sel );
00107
00108 typedef xcap_node_sel_t* (*xcap_nodeSel_add_terminal_t)(xcap_node_sel_t* curr_sel,
00109 char* attr_sel, char* namespace_sel, char* extra_sel );
00110
00111
00112 char* xcapGetElem(xcap_get_req_t req, char** etag);
00113
00114 typedef char* (*xcap_get_elem_t)(xcap_get_req_t req, char** etag);
00115
00116 void xcapFreeNodeSel(xcap_node_sel_t* node);
00117
00118 typedef void (*xcap_nodeSel_free_t)(xcap_node_sel_t* node);
00119
00120
00121
00122 char* xcapGetNewDoc(xcap_get_req_t req, str user, str domain);
00123 typedef char* (*xcapGetNewDoc_t)(xcap_get_req_t req, str user, str domain);
00124
00125 typedef struct xcap_api {
00126 xcap_get_elem_t get_elem;
00127 xcap_nodeSel_init_t int_node_sel;
00128 xcap_nodeSel_add_step_t add_step;
00129 xcap_nodeSel_add_terminal_t add_terminal;
00130 xcap_nodeSel_free_t free_node_sel;
00131 xcapGetNewDoc_t getNewDoc;
00132 register_xcapcb_t register_xcb;
00133 }xcap_api_t;
00134
00135 int bind_xcap(xcap_api_t* api);
00136
00137 typedef int (*bind_xcap_t)(xcap_api_t* api);
00138
00139 char* send_http_get(char* path, unsigned int xcap_port, char* match_etag,
00140 int match_type, char** etag);
00141 #endif