00001 00006 /* 00007 * Copyright 2009 Red Hat Inc., Durham, North Carolina. 00008 * All Rights Reserved. 00009 * 00010 * This library is free software; you can redistribute it and/or 00011 * modify it under the terms of the GNU Lesser General Public 00012 * License as published by the Free Software Foundation; either 00013 * version 2.1 of the License, or (at your option) any later version. 00014 * 00015 * This library is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 * Lesser General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU Lesser General Public 00021 * License along with this library; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 * 00024 * Authors: 00025 * "Daniel Kopecek" <dkopecek@redhat.com> 00026 */ 00027 00028 #pragma once 00029 #ifndef PROBE_CACHE_H 00030 #define PROBE_CACHE_H 00031 00032 #include <stdbool.h> 00033 #include <pthread.h> 00034 #include <sexp-types.h> 00035 #include <../../common/util.h> 00036 #include "SEAP/generic/rbt/rbt.h" 00037 00041 typedef struct { 00042 rbt_t *tree; 00043 } pcache_t; 00044 00049 pcache_t *pcache_new(void); 00050 00056 void pcache_free(pcache_t * cache); 00057 00066 int pcache_sexp_add(pcache_t * cache, const SEXP_t * id, SEXP_t * item); 00067 00076 int pcache_cstr_add(pcache_t * cache, const char *id, SEXP_t * item); 00077 00078 00087 int pcache_sexp_del(pcache_t * cache, const SEXP_t * id); 00088 00089 00098 int pcache_cstr_del(pcache_t * cache, const char *id); 00099 00107 SEXP_t *pcache_sexp_get(pcache_t * cache, const SEXP_t * id); 00108 00116 SEXP_t *pcache_cstr_get(pcache_t * cache, const char *id); 00117 00118 #endif /* PROBE_CACHE_H */