1 /* 2 ** Copyright (C) 1998-2009 Sourcefire, Inc. 3 ** 4 ** This program is free software; you can redistribute it and/or modify 5 ** it under the terms of the GNU General Public License Version 2 as 6 ** published by the Free Software Foundation. You may not use, modify or 7 ** distribute this program under any other version of the GNU General 8 ** Public License. 9 ** 10 ** This program is distributed in the hope that it will be useful, 11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 ** GNU General Public License for more details. 14 ** 15 ** You should have received a copy of the GNU General Public License 16 ** along with this program; if not, write to the Free Software 17 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 */ 19 20 /* 21 * Adam Keeton 22 * sf_vartable.h 23 * 11/17/06 24 * 25 * Library for implementing a variable table. 26 * All API calls have the prefix "sfvt". 27 */ 28 29 #ifndef SF_VARTABLE_H 30 #define SF_VARTABLE_H 31 32 #include "ipv6_port.h" 33 #include "sf_ipvar.h" 34 35 /* Allocates new variable table */ 36 vartable_t * sfvt_alloc_table(void); 37 void sfvt_free_table(vartable_t *table); 38 39 /* Adds the variable described by "str" to the table "table" */ 40 SFIP_RET sfvt_add_str(vartable_t *table, char *str); 41 SFIP_RET sfvt_define(vartable_t *table, char *name, char *value); 42 43 /* Adds the variable described by "str" to the variable "dst", 44 * using the vartable for looking variables used within "str" */ 45 SFIP_RET sfvt_add_to_var(vartable_t *table, sfip_var_t *dst, char *src); 46 47 /* Looks up a variable from the table using the name as the key */ 48 sfip_var_t *sfvt_lookup_var(vartable_t *table, char *name); 49 50 /* Prints a table's contents */ 51 void sfvt_print(FILE *f, vartable_t *table); 52 53 #endif 54