d8feabb353b3c2650facea4afd08c86bb56e5549 kent Fri Apr 6 16:51:54 2012 -0700 Moving autoSql and autoDtd and autoXml back to just under hg. A little autoSql -django fix. diff --git src/hg/autoSql/commonSh.c src/hg/autoSql/commonSh.c new file mode 100644 index 0000000..9243461 --- /dev/null +++ src/hg/autoSql/commonSh.c @@ -0,0 +1,39 @@ +/* Short short form of common.c. */ +#include +#include +#include + + +#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; +} + +