00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #pragma once
00025 #ifndef PROBE_CACHE_H
00026 #define PROBE_CACHE_H
00027
00028 #include <stdbool.h>
00029 #include <pthread.h>
00030 #include <sexp-types.h>
00031 #include <../../common/util.h>
00032 #include "SEAP/generic/rbt/rbt.h"
00033
00034 typedef struct {
00035 rbt_t *tree;
00036 } pcache_t;
00037
00038 pcache_t *pcache_new(void);
00039 void pcache_free(pcache_t * cache);
00040
00041 int pcache_sexp_add(pcache_t * cache, const SEXP_t * id, SEXP_t * item);
00042 int pcache_cstr_add(pcache_t * cache, const char *id, SEXP_t * item);
00043
00044 int pcache_sexp_del(pcache_t * cache, const SEXP_t * id);
00045 int pcache_cstr_del(pcache_t * cache, const char *id);
00046
00047 SEXP_t *pcache_sexp_get(pcache_t * cache, const SEXP_t * id);
00048 SEXP_t *pcache_cstr_get(pcache_t * cache, const char *id);
00049
00050 #endif