shm_table.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef __SHMTABLE_H__
  2. #define __SHMTABLE_H__
  3. #pragma once
  4. #include "config.h"
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. typedef struct shm_table_t shm_table_t;
  9. TOOLKIT_API int shm_table_create(shm_table_t **p_table);
  10. TOOLKIT_API int shm_table_open(void *core, shm_table_t **p_table);
  11. TOOLKIT_API int shm_table_destroy(shm_table_t *table);
  12. TOOLKIT_API void *shm_table_get_core_mem(shm_table_t *table);
  13. TOOLKIT_API int shm_table_lock(shm_table_t *table, int timeout);
  14. TOOLKIT_API int shm_table_unlock(shm_table_t *table);
  15. TOOLKIT_API int shm_table_set(shm_table_t *table, const char *key, const char *buf, int n);
  16. TOOLKIT_API int shm_table_get(shm_table_t *table, const char *key, char *buf, int *n);
  17. TOOLKIT_API int shm_table_set_int(shm_table_t *table, const char *key, int val);
  18. TOOLKIT_API int shm_table_get_int(shm_table_t *table, const char *key, int* val);
  19. TOOLKIT_API int shm_table_incr_int(shm_table_t *table, const char *key, int *newvalue);
  20. TOOLKIT_API int shm_table_decr_int(shm_table_t *table, const char *key, int *newvalue);
  21. #ifdef __cplusplus
  22. } // extern "C" {
  23. #endif
  24. #endif //__SHMTABLE_H__