5 /* -------------------------------------------------------------------------- */
7 typedef struct n_object{
12 typedef struct n_event {
17 typedef int (*n_handles_object)(char*);
18 typedef void (*n_view_event)(n_object*, n_object*);
19 typedef void (*n_cast_event)(n_object*, n_object*);
20 typedef void (*n_sync_object)(n_object*);
22 PUBLIC void n_register_driver(char* name,
23 n_handles_object handles_object,
24 n_view_event view_event,
25 n_cast_event cast_event,
26 n_sync_object sync_object );
28 PUBLIC n_object* n_object_new(char* s);
29 PUBLIC void n_commit(n_object* o);
30 PUBLIC n_object* n_view(n_object* o, char* uid);
31 PUBLIC void n_open(n_object* o, char* uid, char* options);
32 PUBLIC char* n_to_string(n_object* o);
33 PUBLIC char* n_uid(n_object* o);
34 PUBLIC int n_uid_is(n_object* o, char* uid);
35 PUBLIC char* n_header(n_object* o, char* name);
36 PUBLIC k_hashtable* n_headers(n_object* o);
37 PUBLIC k_hashtable* n_content(n_object* o);
38 PUBLIC void n_dispatch(n_event*);
40 /* -------------------------------------------------------------------------- */
42 PUBLIC char* ni_hostname(void);
43 PUBLIC void ni_hostname_set(char* name);
45 /* -------------------------------------------------------------------------- */
47 typedef struct ni_resource{
49 k_hashtable* ent_head;
53 PUBLIC ni_resource* ni_resource_new(char* uri,
54 k_hashtable* ent_head,
56 PUBLIC ni_resource* ni_resource_dup( ni_resource* res);
57 PUBLIC void ni_resource_delete(ni_resource* res);
58 PUBLIC void ni_resource_show( ni_resource* res, char* text);
59 PUBLIC ni_resource* ni_resource_get(char* uri);
61 /* -------------------------------------------------------------------------- */
63 typedef struct ni_event{
65 k_hashtable* evt_head;
66 k_hashtable* ent_head;
70 PUBLIC ni_event* ni_event_new(char* uri,
71 k_hashtable* evt_head,
72 k_hashtable* ent_head,
74 PUBLIC ni_event* ni_event_dup( ni_event* res);
75 PUBLIC void ni_event_delete(ni_event* res);
76 PUBLIC void ni_event_show( ni_event* res, char* text);
78 /* -------------------------------------------------------------------------- */
80 PUBLIC ni_event* ni_res_to_evt(ni_resource* res);
82 /* -------------------------------------------------------------------------- */
84 typedef int (*ni_handles_resource)(char*);
85 typedef void (*ni_sync_resource )(ni_resource*);
87 PUBLIC void ni_register_driver(char* name,
88 ni_handles_resource handles_resource,
89 ni_sync_resource sync_resource);
91 /* -------------------------------------------------------------------------- */
93 PUBLIC ni_event* ni_get_request_headers( char* header);
94 PUBLIC ni_event* ni_get_response_headers(char* header);
95 PUBLIC char* ni_get_headers( char* header, k_hashtable*, k_hashtable*);
96 PUBLIC void ni_fix_http_headers(k_hashtable* ent_head);
97 PUBLIC void ni_fix_ni_headers(k_hashtable* ent_head, int methead);
98 PUBLIC void ni_response(ni_event* evt,
104 PUBLIC void ni_request(ni_event* evt,
109 /* -------------------------------------------------------------------------- */