00001 /*******************************************************************\ 00002 00003 SESAME project software license 00004 00005 Copyright (C) 2002 University of Amsterdam 00006 00007 This program is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License 00009 as published by the Free Software Foundation; either version 2 00010 of the License, or (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00020 02111-1307, USA. 00021 00022 For information regarding the SESAME software project see 00023 http://sesamesim.sourceforge.net or email 00024 jcofflan@users.sourceforge.net 00025 00026 \*******************************************************************/ 00027 00028 /* 00029 * Symbol table structures 00030 * 00031 * Uses flexible typing. 00032 * The symboltable contains records with several fields, the size 00033 * of the record must be given at the creation of the new symboltable 00034 * addelement adds an element to the symboltable, it has two parameters, 00035 * the symboltable and a pointer to the record. 00036 * searchelement returns a number of the record with a matching name. 00037 * getstruct gives the structure given a integer 00038 * 00039 * Stolen from pl 00040 */ 00041 00042 #ifndef SYMBOL_H 00043 00044 #define SYMBOL_H 00045 00046 typedef struct { 00047 int len ; 00048 int fill ; 00049 int size ; 00050 char **cont ; 00051 } symboltable ; 00052 00053 #define getstruct( a,num ) (a->cont[num]) 00054 #define setstruct( a,num ) (getval(a,num)) 00055 #define tablelength( a ) ( a->fill ) 00056 00057 symboltable *newsymboltable() ; 00058 int addsymbol() ; 00059 int searchsymbol() ; 00060 00061 #endif // SYMBOL_H