Go to the source code of this file.
Defines | |
#define | SRANDOM(seed) srandom(seed) |
#define | RANDOM() random() |
#define | REMALLOC(ptr, ptrtype, oldsize, newsize, block_size) |
#define | REALLOC(ptr, ptrtype, oldsize, newsize, block_size) |
#define | READ_INT_DESC(desc) |
#define | READ_CHAR_ARRAY_WITH_SIZE(cptr, cnum, maxcnum) |
#define | READ_STR_LIST(snum, ssize, cptr, sptr) |
#define | READPAR_ERROR(x) |
#define | READ_INT_PAR(par) |
#define | READ_STR_PAR(par) |
#define | READ_DBL_PAR(par) |
#define | READ_STRINT_PAR(par, str_array, array_size, value) |
#define | COPY_DBL_ARRAY_DESC(newad, oldad) |
#define | COPY_STAT(newad, oldad) |
#define | COPY_ARRAY_DESC(newad, oldad) |
#define | CALL_USER_FUNCTION(f) |
#define | CALL_WRAPPER_FUNCTION(f) |
#define | FREE(p) if (p) {(void)free((char *)(p)); p = NULL;} |
#define | MAX(a, b) ((a) > (b) ? (a) : (b)) |
#define | LOG_OF_BITS_PER_BYTE 3 |
#define | BITS_PER_BYTE_LESS_ONE 7 |
#define | isset(a, i) |
#define | isclr(a, i) (! isset(a, i)) |
#define | setbit(a, i) |
#define SRANDOM | ( | seed | ) | srandom(seed) |
Definition at line 25 of file sym_macros.h.
#define RANDOM | ( | ) | random() |
Definition at line 26 of file sym_macros.h.
#define REMALLOC | ( | ptr, | |||
ptrtype, | |||||
oldsize, | |||||
newsize, | |||||
block_size | ) |
{ \ if (!ptr || (oldsize < newsize)){ \ FREE(ptr); \ oldsize = (newsize) + (block_size); \ ptr = (ptrtype *) malloc((oldsize) * sizeof(ptrtype)); \ } \ }
Definition at line 34 of file sym_macros.h.
#define REALLOC | ( | ptr, | |||
ptrtype, | |||||
oldsize, | |||||
newsize, | |||||
block_size | ) |
{ \ if (!ptr || (oldsize < newsize)){ \ oldsize = (newsize) + (block_size); \ ptr = (ptrtype *) realloc((char *)ptr, ((oldsize) * sizeof(ptrtype))); \ } \ }
Definition at line 46 of file sym_macros.h.
#define READ_INT_DESC | ( | desc | ) |
{ \ receive_int_array(&(desc).size, 1); \ if ((desc).size > 0){ \ REMALLOC((desc).list, int, (desc).maxsize, (desc).size, BB_BUNCH); \ receive_int_array((desc).list, (desc).size); \ } \ }
Definition at line 56 of file sym_macros.h.
#define READ_CHAR_ARRAY_WITH_SIZE | ( | cptr, | |||
cnum, | |||||
maxcnum | ) |
{ \ receive_int_array(&cnum, 1); \ if (cnum > 0){ \ REMALLOC(cptr, char, maxcnum, cnum, BB_BUNCH); \ receive_char_array(cptr, cnum); \ } \ }
Definition at line 65 of file sym_macros.h.
#define READ_STR_LIST | ( | snum, | |||
ssize, | |||||
cptr, | |||||
sptr | ) |
{ \ if (snum > 0){ \ sptr = (char **) malloc(snum * sizeof(char *)); \ cptr = (char *) malloc(ssize * snum * CSIZE); \ receive_char_array(cptr, snum * ssize); \ for (i = 0; i < snum; i++) \ sptr[i] = cptr + i * ssize; \ } \ }
Definition at line 74 of file sym_macros.h.
#define READPAR_ERROR | ( | x | ) |
{ \ (void) fprintf(stderr, "\nio: error reading parameter %s\n\n", x); \ exit(1); \ }
Definition at line 88 of file sym_macros.h.
#define READ_INT_PAR | ( | par | ) |
if (sscanf(value, "%i", &(par)) != 1){ \ (void) fprintf(stderr, "\nio: error reading parameter %s\n\n", key); \ exit(1); \ }
Definition at line 94 of file sym_macros.h.
#define READ_STR_PAR | ( | par | ) |
if (sscanf(value, "%s", par) != 1){ \ (void) fprintf(stderr, "\nio: error reading parameter %s\n\n", key); \ exit(1); \ }
Definition at line 100 of file sym_macros.h.
#define READ_DBL_PAR | ( | par | ) |
if (sscanf(value, "%lf", &(par)) != 1){ \ (void) fprintf(stderr, "\nio: error reading parameter %s\n\n", key); \ exit(1); \ }
Definition at line 106 of file sym_macros.h.
#define READ_STRINT_PAR | ( | par, | |||
str_array, | |||||
array_size, | |||||
value | ) |
{ \ for (i = array_size-1; i >= 0; i--){ \ if (! strcmp(str_array[i].str, value)){ \ par |= str_array[i].code; \ break; \ } \ } \ if (i < 0){ \ (void) fprintf(stderr, "\nio: error reading parameter %s\n\n", key); \ exit(1); \ } \ }
Definition at line 112 of file sym_macros.h.
#define COPY_DBL_ARRAY_DESC | ( | newad, | |||
oldad | ) |
if (newad.size > 0){ \ newad.stat = (int *) malloc(newad.size*ISIZE); \ memcpy((char *)newad.stat, (char *)oldad.stat, oldad.size*ISIZE); \ if (newad.type == WRT_PARENT){ \ newad.list = (int *) malloc(oldad.size*ISIZE); \ memcpy((char *)newad.list, (char *)oldad.list, oldad.size*ISIZE); \ } \ }
Definition at line 128 of file sym_macros.h.
#define COPY_STAT | ( | newad, | |||
oldad | ) |
if (newad.size > 0){ \ newad.stat = (int *) malloc(newad.size*ISIZE); \ memcpy((char *)newad.stat, (char *)oldad.stat, oldad.size*ISIZE); \ }
Definition at line 138 of file sym_macros.h.
#define COPY_ARRAY_DESC | ( | newad, | |||
oldad | ) |
newad = oldad; \ if (newad.size > 0){ \ newad.list = (int *) malloc(oldad.size*ISIZE); \ memcpy((char *)newad.list, (char *)oldad.list, oldad.size*ISIZE); \ }
Definition at line 144 of file sym_macros.h.
#define CALL_USER_FUNCTION | ( | f | ) |
switch (f){ \ case USER_ERROR: \ printf("\n\n*********User error detected -- aborting***********\n\n"); \ return(ERROR__USER); \ default: \ break; \ }
Definition at line 153 of file sym_macros.h.
#define CALL_WRAPPER_FUNCTION | ( | f | ) |
if ((termcode = f) < 0) \ return(termcode);
Definition at line 164 of file sym_macros.h.
#define FREE | ( | p | ) | if (p) {(void)free((char *)(p)); p = NULL;} |
Definition at line 173 of file sym_macros.h.
#define MAX | ( | a, | |||
b | ) | ((a) > (b) ? (a) : (b)) |
Definition at line 183 of file sym_macros.h.
#define LOG_OF_BITS_PER_BYTE 3 |
Definition at line 196 of file sym_macros.h.
#define BITS_PER_BYTE_LESS_ONE 7 |
Definition at line 197 of file sym_macros.h.
#define isset | ( | a, | |||
i | ) |
(((a)[(i) >> LOG_OF_BITS_PER_BYTE] >> \ ((i) & BITS_PER_BYTE_LESS_ONE)) & 1)
Definition at line 198 of file sym_macros.h.
#define isclr | ( | a, | |||
i | ) | (! isset(a, i)) |
Definition at line 201 of file sym_macros.h.
#define setbit | ( | a, | |||
i | ) |
((a)[(i) >> LOG_OF_BITS_PER_BYTE] |= \ (1 << ((i) & BITS_PER_BYTE_LESS_ONE)))
Definition at line 216 of file sym_macros.h.