#endif /*! _MSC_VER */
#define GMQCC_VERSION_MAJOR 0
-#define GMQCC_VERSION_MINOR 3
-#define GMQCC_VERSION_PATCH 0
+#define GMQCC_VERSION_MINOR 2
+#define GMQCC_VERSION_PATCH 9
#define GMQCC_VERSION_BUILD(J,N,P) (((J)<<16)|((N)<<8)|(P))
#define GMQCC_VERSION \
GMQCC_VERSION_BUILD(GMQCC_VERSION_MAJOR, GMQCC_VERSION_MINOR, GMQCC_VERSION_PATCH)
bool util_filexists (const char *);
bool util_strupper (const char *);
bool util_strdigit (const char *);
-char *_util_Estrdup (const char *, const char *, size_t);
+char *_util_Estrdup (const char *, const char *, size_t);
+char *_util_Estrdup_empty(const char *, const char *, size_t);
void util_debug (const char *, const char *, ...);
void util_endianswap (void *, size_t, unsigned int);
#endif /*! NOTRACK */
#define util_strdup(X) _util_Estrdup((X), __FILE__, __LINE__)
+#define util_strdupe(X) _util_Estrdup_empty((X), __FILE__, __LINE__)
/*
* A flexible vector implementation: all vector pointers contain some
* this data is represented in the structure below. Doing this allows
* us to use the array [] to access individual elements from the vector
* opposed to using set/get methods.
- */
+ */
typedef struct {
size_t allocated;
size_t used;
struct hash_node_t **table;
} hash_table_t, *ht;
-typedef struct hash_set_t {
- size_t bits;
- size_t mask;
- size_t capacity;
- size_t *items;
- size_t total;
-} hash_set_t, *hs;
-
/*
* hashtable implementation:
*
void *util_htget (hash_table_t *ht, const char *key);
void *util_htgeth(hash_table_t *ht, const char *key, size_t hash);
-
-/*
- * hashset implementation:
- * This was designed for pointers: you manage the life of the object yourself
- * if you do use this for non-pointers please be warned that the object may not
- * be valid if the duration of it exceeds (i.e on stack). So you need to allocate
- * yourself, or put those in global scope to ensure duration is for the whole
- * runtime.
- *
- * util_hsnew() -- to make a new hashset
- * util_hsadd(set, key) -- to add something in the set
- * util_hshas(set, key) -- to check if something is in the set
- * util_hsrem(set, key) -- to remove something in the set
- * util_hsdel(set) -- to delete the set
- *
- * example of use:
- *
- * hs foo = util_hsnew();
- * char *bar = "hello blub\n";
- * char *baz = "hello dale\n";
- *
- * util_hsadd(foo, bar);
- * util_hsadd(foo, baz);
- * util_hsrem(foo, baz);
- *
- * printf("bar %d | baz %d\n",
- * util_hshas(foo, bar),
- * util_hshad(foo, baz)
- * );
- *
- * util_hsdel(foo);
- */
-
-hash_set_t *util_hsnew(void);
-int util_hsadd(hash_set_t *, void *);
-int util_hshas(hash_set_t *, void *);
-int util_hsrem(hash_set_t *, void *);
-void util_hsdel(hash_set_t *);
/*===================================================================*/
/*============================ file.c ===============================*/