mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 04:33:05 +00:00
add some lua library
This commit is contained in:
33
lua-protobuf/map.h
Normal file
33
lua-protobuf/map.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef PROTOBUF_C_MAP_H
|
||||
#define PROTOBUF_C_MAP_H
|
||||
|
||||
#include "alloc.h"
|
||||
|
||||
struct map_ip;
|
||||
struct map_si;
|
||||
struct map_sp;
|
||||
|
||||
struct map_kv {
|
||||
int id;
|
||||
void *pointer;
|
||||
};
|
||||
|
||||
struct map_si * _pbcM_si_new(struct map_kv * table, int size);
|
||||
int _pbcM_si_query(struct map_si *map, const char *key, int *result);
|
||||
void _pbcM_si_delete(struct map_si *map);
|
||||
|
||||
struct map_ip * _pbcM_ip_new(struct map_kv * table, int size);
|
||||
struct map_ip * _pbcM_ip_combine(struct map_ip * a, struct map_ip * b);
|
||||
void * _pbcM_ip_query(struct map_ip * map, int id);
|
||||
void _pbcM_ip_delete(struct map_ip *map);
|
||||
|
||||
struct map_sp * _pbcM_sp_new(int max, struct heap *h);
|
||||
void _pbcM_sp_insert(struct map_sp *map, const char *key, void * value);
|
||||
void * _pbcM_sp_query(struct map_sp *map, const char *key);
|
||||
void ** _pbcM_sp_query_insert(struct map_sp *map, const char *key);
|
||||
void _pbcM_sp_delete(struct map_sp *map);
|
||||
void _pbcM_sp_foreach(struct map_sp *map, void (*func)(void *p));
|
||||
void _pbcM_sp_foreach_ud(struct map_sp *map, void (*func)(void *p, void *ud), void *ud);
|
||||
void * _pbcM_sp_next(struct map_sp *map, const char ** key);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user