1 /* This file is part of GNU Radius. 2 Copyright (C) 2000,2001,2002,2003,2004,2007 Free Software Foundation, Inc. 3 4 Written by Sergey Poznyakoff 5 6 GNU Radius is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 3 of the License, or 9 (at your option) any later version. 10 11 GNU Radius is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with GNU Radius; if not, write to the Free Software Foundation, 18 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 19 20 #ifndef _gnu_radius_symtab_h 21 #define _gnu_radius_symtab_h 22 23 typedef struct symbol grad_symbol_t; 24 struct symbol { 25 grad_symbol_t *next; 26 char *name; 27 } ; 28 29 typedef struct { 30 int elsize; 31 int elcnt; 32 int hash_num; 33 grad_symbol_t **sym; 34 int (*elfree)(); 35 } grad_symtab_t; 36 37 grad_symtab_t * grad_symtab_create(unsigned esize, int (*)()); 38 void grad_symtab_free(grad_symtab_t **symtab); 39 void grad_symtab_clear(grad_symtab_t *symtab); 40 41 void *grad_sym_install(grad_symtab_t *symtab, const char *name); 42 void *grad_sym_lookup(grad_symtab_t *symtab, const char *name); 43 void *grad_sym_lookup_or_install(grad_symtab_t *symtab, 44 const char *name, int install); 45 void *grad_sym_next(grad_symbol_t *sym); 46 47 void grad_symtab_iterate(grad_symtab_t *symtab, 48 int (*fn)(void *, grad_symbol_t *), 49 void *closure); 50 51 int grad_symtab_delete(grad_symtab_t *symtab, grad_symbol_t *sym); 52 53 void grad_sym_free(grad_symbol_t *); 54 55 #endif /* !_gnu_radius_symtab_h */ 56