2 #ifndef _PXPRPC_SERVER_H
3 #define _PXPRPC_SERVER_H
13 typedef void *pxprpc_server_context
;
18 uint32_t (*addRef
)(struct pxprpc_object
*self
);
19 uint32_t (*release
)(struct pxprpc_object
*self
);
22 struct pxprpc_request
{
23 struct pxprpc_abstract_io
*io1
;
24 struct pxprpc_object
**ref_slots
;
27 struct pxprpc_callable
*callable
;
29 void *server_context_data
;
30 struct pxprpc_object
*result
;
34 struct pxprpc_callable
{
35 void (*readParameter
)(struct pxprpc_callable
*self
,struct pxprpc_request
*r
,void (*doneCallback
)(struct pxprpc_request
*r
));
36 void (*call
)(struct pxprpc_callable
*self
,struct pxprpc_request
*r
,void (*onResult
)(struct pxprpc_request
*r
,struct pxprpc_object
*result
));
37 void (*writeResult
)(struct pxprpc_callable
*self
,struct pxprpc_request
*r
);
41 struct pxprpc_namedfunc
{
43 struct pxprpc_callable
*callable
;
46 typedef struct pxprpc_server_api
{
47 int (*context_new
)(pxprpc_server_context
*server_context
,struct pxprpc_abstract_io
*io1
,
48 struct pxprpc_namedfunc
*namedfuncs
,int len_namedfuncs
);
49 int (*context_start
)(pxprpc_server_context
);
50 int (*context_closed
)(pxprpc_server_context
);
51 int (*context_close
)(pxprpc_server_context
);
52 int (*context_delete
)(pxprpc_server_context
*);
53 struct pxprpc_object
*(*new_object
)(void *obj
);
54 struct pxprpc_object
*(*new_bytes_object
)(uint32_t size
);
57 extern int pxprpc_server_query_interface(pxprpc_server_api
**outapi
);