#include <stdlib.h>
#include <memory.h>
#include <netdb.h>
+#include <pthread.h>
#include "rmr_symtab.h"
return (int ) (t % size);
}
-/*
+/*
Delete element pointed to by eptr which is assumed to be
a member of the list at symtab[i].
*/
sym_tab[hv]->prev = NULL; // new head
}
eptr->next = NULL; // take no chances
-
+
if( eptr->class && eptr->name ) { // class 0 entries are numeric, so name is NOT a pointer
free( (void *) eptr->name );
}
much the same.
*/
static int putin( Sym_tab *table, const char *name, unsigned int class, void *val ) {
- Sym_ele *eptr; /* pointer into hash table */
- Sym_ele **sym_tab; /* pointer into hash table */
+ Sym_ele *eptr; /* pointer into hash table */
+ Sym_ele **sym_tab; /* pointer into hash table */
int hv; /* hash value */
int rc = 0; /* assume it existed */
uint64_t nkey = 0; // numeric key if class == 0
for( eptr=sym_tab[hv]; eptr && eptr->nkey != nkey; eptr=eptr->next );
}
- if( ! eptr ) { // not found above, so add
+ if( ! eptr ) { // not found above, so add
rc++;
table->inhabitants++;
Sym_ele **list;
Sym_ele *se;
Sym_ele *next; /* allows user to delete the node(s) we return */
- int i;
+ int i;
st = (Sym_tab *) vst;
if( st && (list = st->symlist) != NULL && user_fun != NULL ) {
for( i = 0; i < st->size; i++ ) {
- se = list[i];
+ se = list[i];
while( se ) {
next = se->next; // allow callback to delete from the list w/o borking us
if( class == se->class ) {