123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- // plugin.h :
- //
- #if !defined(AGD_PLUGIN_H__98AA983E_C855_424B_ADEE_D6A881108474__INCLUDED_)
- #define AGD_PLUGIN_H__98AA983E_C855_424B_ADEE_D6A881108474__INCLUDED_
- #include <stdint.h>
- #include <stdbool.h>
- #include <gfa/gfaipc.h>
- #ifndef _LIBBUILD
- #include <gfa/svc/common/uuid.h>
- #else // _LIBBUILD
- #include "common/uuid.h"
- #endif // _LIBBUILD
- #ifdef __cplusplus
- extern "C" {
- #endif // __cplusplus
- #include <ulfius.h>
- /////////////////////////////////////////////////////////////////////////////
- // 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_)
|