// plugin.h : // #if !defined(AGD_PLUGIN_H__98AA983E_C855_424B_ADEE_D6A881108474__INCLUDED_) #define AGD_PLUGIN_H__98AA983E_C855_424B_ADEE_D6A881108474__INCLUDED_ #include #include #include #ifndef _LIBBUILD #include #else // _LIBBUILD #include "common/uuid.h" #endif // _LIBBUILD #ifdef __cplusplus extern "C" { #endif // __cplusplus #include ///////////////////////////////////////////////////////////////////////////// // plugin.h - Declarations: typedef struct _REST_REQUEST_HANDLER { const char *pszHandlerName; const char *pszHttpMethod; const char *pszVirtPath; const char *pszContentType; const char *pszFunctionName; }REST_REQUEST_HANDLER, *PREST_REQUEST_HANDLER; typedef const REST_REQUEST_HANDLER *PCREST_REQUEST_HANDLER; typedef struct _REST_PLUGIN_INFO { uuid_t signature; // must be {0x75ed2211, 0x0a25, 0x4a55, 0x96, 0x2b, 0x31, 0xd3, 0xb0, 0xe6, 0x12, 0x3a} const char *pszPluginName; size_t nHandlerCnt; REST_REQUEST_HANDLER handler[1]; }REST_PLUGIN_INFO, *PREST_PLUGIN_INFO; typedef const REST_PLUGIN_INFO *PCREST_PLUGIN_INFO; ///////////////////////////////////////////////////////////////////////////// typedef struct _REST_PLUGIN_REQUEST_CONTEXT { uuid_t uuidShm; HSHM hShm; void *pShm; void (*pfnLockSHM)(HSHM); void (*pfnUnlockSHM)(HSHM); }REST_PLUGIN_REQUEST_CONTEXT, *PREST_PLUGIN_REQUEST_CONTEXT; typedef const REST_PLUGIN_REQUEST_CONTEXT *PCREST_PLUGIN_REQUEST_CONTEXT; ///////////////////////////////////////////////////////////////////////////// #define _HTTP_METHOD_GET "GET" #define _HTTP_METHOD_POST "POST" ///////////////////////////////////////////////////////////////////////////// typedef PCREST_PLUGIN_INFO (*PFN_GETPLUGININFO)(void); /* Prototype example: extern "C" int PluginRequestHandler(const struct _u_request *pRequ, struct _u_response *pResp, PCREST_PLUGIN_REQUEST_CONTEXT prc) { ... ... return U_CALLBACK_CONTINUE; } */ ///////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif // __cplusplus #endif // !defined(AGD_PLUGIN_H__98AA983E_C855_424B_ADEE_D6A881108474__INCLUDED_)