/* -*-c-*-
*
- * $Id: sym.h,v 1.3 1999/05/05 18:50:31 mdw Exp $
+ * $Id: sym.h,v 1.7 1999/06/01 09:49:33 mdw Exp $
*
* Symbol table management
*
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
- * License along with mLib; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * License along with mLib; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
*/
/*----- Revision history --------------------------------------------------*
*
* $Log: sym.h,v $
+ * Revision 1.7 1999/06/01 09:49:33 mdw
+ * Allow things to be looked up by just their caller-supplied hashes. This
+ * actually needs to be thought through better.
+ *
+ * Revision 1.6 1999/05/26 21:08:31 mdw
+ * Rename symbols in line with newer conventions.
+ *
+ * Revision 1.5 1999/05/13 22:48:37 mdw
+ * Change `-ise' to `-ize' throughout.
+ *
+ * Revision 1.4 1999/05/06 19:51:35 mdw
+ * Reformatted the LGPL notice a little bit.
+ *
* Revision 1.3 1999/05/05 18:50:31 mdw
* Change licensing conditions to LGPL.
*
#include <stddef.h>
+#ifndef BITS_H
+# include "bits.h"
+#endif
+
/*----- Type definitions --------------------------------------------------*/
/* --- Symbol table --- *
typedef struct sym_base {
struct sym_base *next; /* Next symbol in hash bin */
- unsigned long hash; /* Hash value for symbol's name */
+ uint32 hash; /* Hash value for symbol's name */
union {
char *p; /* Pointer to name string */
char b[SYM_BUFSZ]; /* Buffer containing a short name */
/*----- External functions ------------------------------------------------*/
-/* --- @sym_createTable@ --- *
+/* --- @sym_create@ --- *
*
- * Arguments: @sym_table *t@ = symbol table to initialise
+ * Arguments: @sym_table *t@ = symbol table to initialize
*
* Returns: ---
*
- * Use: Initialises the given symbol table. Raises @EXC_NOMEM@ if
+ * Use: Initializes the given symbol table. Raises @EXC_NOMEM@ if
* there isn't enough memory.
*/
-extern void sym_createTable(sym_table */*t*/);
+extern void sym_create(sym_table */*t*/);
-/* --- @sym_destroyTable@ --- *
+/* --- @sym_destroy@ --- *
*
* Arguments: @sym_table *t@ = pointer to symbol table in question
*
* occupy.
*/
-extern void sym_destroyTable(sym_table */*t*/);
+extern void sym_destroy(sym_table */*t*/);
/* --- @sym_find@ --- *
*
* may be given, in which case the name may contain arbitrary
* binary data, or it may be given as a negative number, in
* which case the length of the name is calculated as
- * @strlen(n)@.
+ * @strlen(n) + 1@. The name pointer @n@ may also be zero; in
+ * this case, @l@ is taken to be a raw hash, and any element
+ * with a matching hash is taken to be the one wanted.
*
* The return value is the address of a pointer to a @sym_base@
* block (which may have other things on the end, as above). If
extern void sym_remove(sym_table */*t*/, void */*b*/);
-/* --- @sym_createIter@ --- *
+/* --- @sym_mkiter@ --- *
*
* Arguments: @sym_iter *i@ = pointer to an iterator object
* @sym_table *t@ = pointer to a symbol table object
* iterate through a symbol table.
*/
-extern void sym_createIter(sym_iter */*i*/, sym_table */*t*/);
+extern void sym_mkiter(sym_iter */*i*/, sym_table */*t*/);
/* --- @sym_next@ --- *
*