12345678910111213141516171819202122232425262728293031323334 |
- #ifndef __SHMTABLE_H__
- #define __SHMTABLE_H__
- #pragma once
- #include "config.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- typedef struct shm_table_t shm_table_t;
- TOOLKIT_API int shm_table_create(shm_table_t **p_table);
- TOOLKIT_API int shm_table_open(void *core, shm_table_t **p_table);
- TOOLKIT_API int shm_table_destroy(shm_table_t *table);
- TOOLKIT_API void *shm_table_get_core_mem(shm_table_t *table);
- TOOLKIT_API int shm_table_lock(shm_table_t *table, int timeout);
- TOOLKIT_API int shm_table_unlock(shm_table_t *table);
- TOOLKIT_API int shm_table_set(shm_table_t *table, const char *key, const char *buf, int n);
- TOOLKIT_API int shm_table_get(shm_table_t *table, const char *key, char *buf, int *n);
- TOOLKIT_API int shm_table_set_int(shm_table_t *table, const char *key, int val);
- TOOLKIT_API int shm_table_get_int(shm_table_t *table, const char *key, int* val);
- TOOLKIT_API int shm_table_incr_int(shm_table_t *table, const char *key, int *newvalue);
- TOOLKIT_API int shm_table_decr_int(shm_table_t *table, const char *key, int *newvalue);
- #ifdef __cplusplus
- } // extern "C" {
- #endif
- #endif //__SHMTABLE_H__
|