5 /* -------------------------------------------------------------------------- */
7 typedef struct n_object{
12 PUBLIC n_object* n_object_new(char* s);
13 PUBLIC void n_commit(n_object* o);
14 PUBLIC n_object* n_see(n_object* o, char* uid);
15 PUBLIC char* n_to_string(n_object* o);
16 PUBLIC char* n_uid(n_object* o);
17 PUBLIC char* n_header(n_object* o, char* name);
18 PUBLIC k_hashtable* n_headers(n_object* o);
19 PUBLIC k_hashtable* n_content(n_object* o);
21 /* -------------------------------------------------------------------------- */
23 PUBLIC char* ni_hostname(void);
24 PUBLIC void ni_hostname_set(char* name);
26 /* -------------------------------------------------------------------------- */
28 typedef struct ni_resource{
30 k_hashtable* ent_head;
34 PUBLIC ni_resource* ni_resource_new(char* uri,
35 k_hashtable* ent_head,
37 PUBLIC ni_resource* ni_resource_dup( ni_resource* res);
38 PUBLIC void ni_resource_delete(ni_resource* res);
39 PUBLIC void ni_resource_show( ni_resource* res, char* text);
40 PUBLIC ni_resource* ni_resource_get(char* uri);
42 /* -------------------------------------------------------------------------- */
44 typedef struct ni_event{
46 k_hashtable* evt_head;
47 k_hashtable* ent_head;
51 PUBLIC ni_event* ni_event_new(char* uri,
52 k_hashtable* evt_head,
53 k_hashtable* ent_head,
55 PUBLIC ni_event* ni_event_dup( ni_event* res);
56 PUBLIC void ni_event_delete(ni_event* res);
57 PUBLIC void ni_event_show( ni_event* res, char* text);
59 /* -------------------------------------------------------------------------- */
61 PUBLIC ni_event* ni_res_to_evt(ni_resource* res);
63 /* -------------------------------------------------------------------------- */
65 typedef int (*ni_handles_resource)(char*);
66 typedef void (*ni_sync_resource )(ni_resource*);
68 PUBLIC void ni_register_driver(char* name,
69 ni_handles_resource handles_resource,
70 ni_sync_resource sync_resource);
72 /* -------------------------------------------------------------------------- */
74 PUBLIC ni_event* ni_get_request_headers( char* header);
75 PUBLIC ni_event* ni_get_response_headers(char* header);
76 PUBLIC char* ni_get_headers( char* header, k_hashtable*, k_hashtable*);
77 PUBLIC void ni_fix_http_headers(k_hashtable* ent_head);
78 PUBLIC void ni_fix_ni_headers(k_hashtable* ent_head, int methead);
79 PUBLIC void ni_response(ni_event* evt,
85 PUBLIC void ni_request(ni_event* evt,
90 /* -------------------------------------------------------------------------- */