4a3f3df9cab079354e8a9f4cf6c56f616f1ea0ab kent Fri Apr 6 16:29:22 2012 -0700 Removing MySQL linking dependency. diff --git src/utils/autoSql/commonSh.c src/utils/autoSql/commonSh.c new file mode 100644 index 0000000..9243461 --- /dev/null +++ src/utils/autoSql/commonSh.c @@ -0,0 +1,39 @@ +/* Short short form of common.c. */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + + +#include "psLayHit.h" + +#define sqlUnsigned atoi +/* String to unsigned. */ + +#define sqlSigned atoi +/* String to signed. */ + +#define cloneString strdup +/* Duplicate string onto heap. */ + +#define AllocVar(pt) (pt = malloc(sizeof(*pt))) +/* Shortcut to allocating a single variable on the heap and + * assigning pointer to it. */ + + +static void freeMem(void *vpt) +/* Default deallocator. */ +{ +if (vpt != NULL) + free(vpt); +} + +static void freez(void *vpt) +/* Pass address of pointer. Will free pointer and set it + * to NULL. */ +{ +void **ppt = (void **)vpt; +freeMem(*ppt); +*ppt = NULL; +} + +