2 #ifndef _PXPRPC_SERVER_H
3 #define _PXPRPC_SERVER_H
13 typedef void *pxprpc_server_context
;
17 uint16_t size_of_struct
;
19 uint32_t (*addRef
)(struct pxprpc_object
*ref
);
20 uint32_t (*release
)(struct pxprpc_object
*ref
);
23 struct pxprpc_request
{
24 struct pxprpc_abstract_io
*io1
;
25 struct pxprpc_object
**ref_slots
;
28 struct pxprpc_callable
*callable
;
30 void *server_context_data
;
31 struct pxprpc_object
*result
;
35 struct pxprpc_callable
{
36 void (*readParameter
)(struct pxprpc_callable
*self
,struct pxprpc_request
*r
,void (*doneCallback
)(struct pxprpc_request
*r
));
37 void (*call
)(struct pxprpc_callable
*self
,struct pxprpc_request
*r
,void (*onResult
)(struct pxprpc_request
*r
,struct pxprpc_object
*result
));
38 void (*writeResult
)(struct pxprpc_callable
*self
,struct pxprpc_request
*r
);
41 struct pxprpc_namedfunc
{
43 struct pxprpc_callable
*callable
;
46 extern void pxprpc_close(pxprpc_server_context server_context
);
47 extern struct pxprpc_object
*pxprpc_new_object(void *obj
);
48 extern struct pxprpc_object
*pxprpc_new_bytes_object(uint32_t size
);
49 extern int pxprpc_new_server_context(pxprpc_server_context
*server_context
,struct pxprpc_abstract_io
*io1
,
50 struct pxprpc_namedfunc
*namedfuncs
,int len_namedfuncs
);
51 extern int pxprpc_start_serve(pxprpc_server_context server_context
);
52 extern int pxprpc_free_context(pxprpc_server_context
*server_context
);