/*
- $Id: cache.c,v 1.4 2010-04-23 05:54:54 franklahm Exp $
+ $Id: cache.c,v 1.5 2010-04-23 10:31:40 franklahm Exp $
Copyright (c) 2008,2009 Frank Lahm <franklahm@gmail.com>
This program is free software; you can redistribute it and/or modify
cacheduser_t *entry;
unsigned char hash;
+#ifdef DEBUG
+ dumpcache();
+#endif
+
/* allocate mem and copy values */
name = malloc(strlen(inname)+1);
if (!name) {
if (cacheduser)
free(cacheduser);
}
+
+#ifdef DEBUG
+ dumpcache();
+#endif
+
return ret;
}
cacheduser_t *entry;
time_t tim;
+#ifdef DEBUG
+ dumpcache();
+#endif
+
hash = hashstring((unsigned char *)name);
if (! namecache[hash])
free(entry->name);
free(entry->uuid);
free(entry);
+#ifdef DEBUG
+ dumpcache();
+#endif
return -1;
} else {
memcpy(uuid, entry->uuid, UUID_BINSIZE);
+#ifdef DEBUG
+ dumpcache();
+#endif
return 0;
}
}
entry = entry->next;
}
+#ifdef DEBUG
+ dumpcache();
+#endif
return -1;
}
cacheduser_t *entry;
time_t tim;
+#ifdef DEBUG
+ dumpcache();
+#endif
+
hash = hashuuid(uuidp);
if (! uuidcache[hash])
free(entry->name);
free(entry->uuid);
free(entry);
+#ifdef DEBUG
+ dumpcache();
+#endif
return -1;
} else {
*name = malloc(strlen(entry->name)+1);
strcpy(*name, entry->name);
*type = entry->type;
+#ifdef DEBUG
+ dumpcache();
+#endif
return 0;
}
}
entry = entry->next;
}
+#ifdef DEBUG
+ dumpcache();
+#endif
+
return -1;
}
cacheduser_t *entry;
unsigned char hash;
+#ifdef DEBUG
+ dumpcache();
+#endif
+
/* allocate mem and copy values */
name = malloc(strlen(inname)+1);
if (!name) {
if (cacheduser)
free(cacheduser);
}
+
+#ifdef DEBUG
+ dumpcache();
+#endif
+
return ret;
}