plugin.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // plugin.h :
  2. //
  3. #if !defined(AGD_PLUGIN_H__98AA983E_C855_424B_ADEE_D6A881108474__INCLUDED_)
  4. #define AGD_PLUGIN_H__98AA983E_C855_424B_ADEE_D6A881108474__INCLUDED_
  5. #include <stdint.h>
  6. #include <stdbool.h>
  7. #ifndef _LIBBUILD
  8. #include <gfa/svc/common/uuid.h>
  9. #else // _LIBBUILD
  10. #include "common/uuid.h"
  11. #endif // _LIBBUILD
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif // __cplusplus
  15. #include <ulfius.h>
  16. #include <gfa/gfaipc.h>
  17. /////////////////////////////////////////////////////////////////////////////
  18. // plugin.h - Declarations:
  19. typedef struct _REST_REQUEST_HANDLER
  20. {
  21. const char *pszHandlerName;
  22. const char *pszMethod;
  23. const char *pszVUrl;
  24. const char *pszMime;
  25. const char *pszFunctionName;
  26. }REST_REQUEST_HANDLER, *LPREST_REQUEST_HANDLER;
  27. typedef const REST_REQUEST_HANDLER *LPCREST_REQUEST_HANDLER;
  28. typedef struct _REST_PLUGIN_INFO
  29. {
  30. uuid_t signature;
  31. const char *pszPluginName;
  32. size_t nHandlerCnt;
  33. REST_REQUEST_HANDLER handler[1];
  34. }REST_PLUGIN_INFO, *LPREST_PLUGIN_INFO;
  35. typedef const REST_PLUGIN_INFO *LPCREST_PLUGIN_INFO;
  36. typedef struct _REST_PLUGIN_REQUEST_HANDLER_PARAMS
  37. {
  38. uuid_t uuidShm;
  39. HSHM hShm;
  40. void *pShm;
  41. void *pParam;
  42. }REST_PLUGIN_REQUEST_HANDLER_PARAMS, *LPREST_PLUGIN_REQUEST_HANDLER_PARAMS;
  43. typedef const REST_PLUGIN_REQUEST_HANDLER_PARAMS *LPCREST_PLUGIN_REQUEST_HANDLER_PARAMS;
  44. DECLARE_UUID(UUID_REST_PLUGIN);
  45. /////////////////////////////////////////////////////////////////////////////
  46. typedef const REST_PLUGIN_INFO* (*PFN_GETPLUGININFO)(void);
  47. typedef int (*PFN_REST_REQUEST_HANDLER)(const struct _u_request*, struct _u_response*, void*);
  48. /*
  49. Prototype example:
  50. extern "C" int PluginRequestHandler(const struct _u_request *request, struct _u_response *response, void *user_data)
  51. {
  52. ...
  53. }
  54. */
  55. /////////////////////////////////////////////////////////////////////////////
  56. #ifdef __cplusplus
  57. }
  58. #endif // __cplusplus
  59. #endif // !defined(AGD_PLUGIN_H__98AA983E_C855_424B_ADEE_D6A881108474__INCLUDED_)