I think the followings are very needed and useful.
- Sangchol
============================================
User defined data
From: Matthew Carey <matthew@ss...> - 2006-05-12 15:47
I need to put a piece of data into the callback function from the main
server routine.
Is there any sensible way of doing this apart from actually extending
the csoap code. Like below.
So
void soap_router_register_service(SoapRouter *router,
SoapServiceFunc func,
const char* method,
const char* urn,
void * user_data);
slightly enlarge the Service structure
typedef struct _SoapService
{
char *urn;
char *method;
SoapServiceFunc func;
void *user_data;
}SoapService;
add to the parameters of a SoapServiceFunc
typedef herror_t (*SoapServiceFunc)(SoapCtx*, SoapCtx*, void *);
Thus where the SoapServiceFunc is called in the code add the extra
parameter.
/*===================================== */
/* CALL SERVICE FUNCTION */
/*===================================== */
err = service->func(ctx, ctxres,service->user_data);
Of course it is up to the user to clear up the user_data if they have
allocated it.