Wild Life: def_macro.h File Reference

Wild Life 2.30

- Main Page
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Macros
Macros
def_macro.h File Reference

macros More...

Go to the source code of this file.

## Macros
#define | WFProve(A)
#define | NOTQUIET (!quietflag || verbose) /* 21.1 */
#define | HEAP_ALLOC(A) (A *)heap_alloc(sizeof(A))
#define | STACK_ALLOC(A) (A *)stack_alloc(sizeof(A))
#define | UN_CODED (CODE)0L
#define | FUNC_ARG(t) ((t)<match_date || (GENERIC)(t)>=heap_pointer)
#define | DIGIT(C) (C>='0' && C<='9')
#define | UPPER(C) ((C>='A' && C<='Z') || C=='_')
#define | LOWER(C) (C>='a' && C<='z')
#define | ISALPHA(C) (DIGIT(C) || UPPER(C) || LOWER(C))
#define | SINGLE(C)
#define | SYMBOL(C)
#define | equ_tok(A, B) (!strcmp(A.type->keyword->symbol,B))
#define | equ_tok3(A, B, Q) (Q?FALSE:equ_tok(A,B))
#define | equ_tokch(A, B) (A.type->keyword->symbol[0]==B && A.type->keyword->symbol[1]==0)
#define | equ_tokch3(A, B, Q) (Q?FALSE:equ_tokch(A,B))
#define | equ_tokc(A, B) (B?equ_tokch(A,B):A.type->keyword->symbol[0]==0)
#define | equ_tokc3(A, B, Q) (Q?FALSE:equ_tokc(A,B))
#define | cut_to(C)
#define | deref_ptr(P) while(P->coref) P=P->coref
#define | noneval(T) (T->type==quote || T->type==listingsym || T->type==loadsym)
#define | wl_const_1(S) ((S).value_1 ==NULL && (S).type!=variable)
#define | wl_const_2(S) ((S).value_2 ==NULL && (S).type!=variable)
#define | wl_const_3(S) ((S).value_3 ==NULL && (S).type!=variable)
#define | equal_types(A, B) ((A)==(B))
#define | is_top(T) ((T)!=NULL && (T)->type==top && (T)->attr_list==NULL)
#define | VALID_RANGE(A) ((GENERIC)A>=mem_base && (GENERIC)A<mem_limit)
#define | VALID_ADDRESS(A)
#define | stack_empty_list() stack_nil() /* RM: Dec 14 1992 */
#define | deref(P) {deref_ptr(P);if (deref_eval(P)) return TRUE;}
#define | deref_void(P) {deref_ptr(P);deref_eval(P);}
#define | deref_rec(P) {deref_ptr(P);if (deref_rec_eval(P)) return TRUE;}
#define | deref_args(P, S) {deref_ptr(P);if (deref_args_eval(P,S)) return TRUE;}
#define | deref_args_void(P) {deref_ptr(P);deref_args_eval(P);}
#define | List_First(header) ((header)->First)
#define | List_Last(header) ((header)->Last)
#define | List_Next(header, RefAtom) ((*(header)->GetLinks)(RefAtom)->Next)
#define | List_Prev(header, RefAtom) ((*(header)->GetLinks)(RefAtom)->Prev)
#define | List_IsEmpty(header) (List_First(header)==NULL)
#define | SETARG(args, i, the_feature, the_type, the_options)
#define | NARGS(args) (sizeof(args)/sizeof(psi_arg))
#define | XPART(argi, vali, numi) if (FALSE) ;
#define | include_var_builtin(NBARGS)
#define | begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
#define | end_builtin()
#define | ARGS(args) args
#define | PERUNIF(X) X,100.0*((double)X/(double)Aunif)
#define | PERMERGE(X) X,100.0*((double)X/(double)Amerge)
#define | HASH(A) (((long) A + ((long) A >> 3)) & (HASHSIZE-1))
#define | ONHEAP(R) ((GENERIC)R>=heap_pointer)
#define | NEW(A, TYPE)
#define | HEAPDONE(R) (to_heap && ONHEAP(R))
#define | ALIGNUP(X) { (X) = (GENERIC)( ((long) (X) + (ALIGN-1)) & ~(ALIGN-1) ); }

## Detailed Description

macros

Definition in file def_macro.h.

## Macro Definition Documentation

#define ALIGNUP | ( |  | X | ) | { (X) = (GENERIC)( ((long) (X) + (ALIGN-1)) & ~(ALIGN-1) ); }

Definition at line 299 of file def_macro.h.

#define ARGS | ( |  | args | ) | args

Definition at line 270 of file def_macro.h.

#define begin_builtin | ( |  | FUNCNAME,
|  |  | NBARGS,
|  |  | NBARGSIN,
|  |  | TYPES
| ) |  |

Definition at line 203 of file def_macro.h.

#define cut_to | ( |  | C | ) |

Value:
{ ptr_choice_point cp=choice_stack; \
while ((GENERIC)cp>(GENERIC)(C)) cp=cp->next; \
choice_stack=cp; \
}
wl_choice_point
Definition: def_struct.h:246
hashbucket::next
long next
Definition: def_struct.h:388
GENERIC
unsigned long * GENERIC
unsigned long *GENERIC
Definition: def_struct.h:35
choice_stack
ptr_choice_point choice_stack
Definition: def_glob.h:1026

Definition at line 85 of file def_macro.h.

#define deref | ( |  | P | ) | {deref_ptr(P);if (deref_eval(P)) return TRUE;}

Definition at line 147 of file def_macro.h.

#define deref_args | ( |  | P,
|  |  | S
| ) |  | {deref_ptr(P);if (deref_args_eval(P,S)) return TRUE;}

Definition at line 150 of file def_macro.h.

#define deref_args_void | ( |  | P | ) | {deref_ptr(P);deref_args_eval(P);}

Definition at line 151 of file def_macro.h.

#define deref_ptr | ( |  | P | ) | while(P->coref) P=P->coref

Definition at line 100 of file def_macro.h.

#define deref_rec | ( |  | P | ) | {deref_ptr(P);if (deref_rec_eval(P)) return TRUE;}

Definition at line 149 of file def_macro.h.

#define deref_void | ( |  | P | ) | {deref_ptr(P);deref_eval(P);}

Definition at line 148 of file def_macro.h.

#define DIGIT | ( |  | C | ) | (C>='0' && C<='9')

Definition at line 42 of file def_macro.h.

#define end_builtin | ( |  | ) |

Value:
} \
} \
else \
Errorline ("bad arguments in %P.\n", g); \
} \
else \
Errorline ("missing arguments in %P.\n", g); \
\
return success;
Errorline
void Errorline(char *format,...)
Errorline.
Definition: error.c:465

Definition at line 259 of file def_macro.h.

#define equ_tok | ( |  | A,
|  |  | B
| ) |  | (!strcmp(A.type->keyword->symbol,B))

Definition at line 67 of file def_macro.h.

#define equ_tok3 | ( |  | A,
|  |  | B,
|  |  | Q
| ) |  | (Q?FALSE:equ_tok(A,B))

Definition at line 68 of file def_macro.h.

#define equ_tokc | ( |  | A,
|  |  | B
| ) |  | (B?equ_tokch(A,B):A.type->keyword->symbol[0]==0)

Definition at line 76 of file def_macro.h.

#define equ_tokc3 | ( |  | A,
|  |  | B,
|  |  | Q
| ) |  | (Q?FALSE:equ_tokc(A,B))

Definition at line 77 of file def_macro.h.

#define equ_tokch | ( |  | A,
|  |  | B
| ) |  | (A.type->keyword->symbol[0]==B && A.type->keyword->symbol[1]==0)

Definition at line 71 of file def_macro.h.

#define equ_tokch3 | ( |  | A,
|  |  | B,
|  |  | Q
| ) |  | (Q?FALSE:equ_tokch(A,B))

Definition at line 72 of file def_macro.h.

#define equal_types | ( |  | A,
|  |  | B
| ) |  | ((A)==(B))

Definition at line 111 of file def_macro.h.

#define FUNC_ARG | ( |  | t | ) | ((t)<match_date || (GENERIC)(t)>=heap_pointer)

Definition at line 31 of file def_macro.h.

#define HASH | ( |  | A | ) | (((long) A + ((long) A >> 3)) & (HASHSIZE-1))

Definition at line 278 of file def_macro.h.

#define HEAP_ALLOC | ( |  | A | ) | (A *)heap_alloc(sizeof(A))

Definition at line 20 of file def_macro.h.

#define HEAPDONE | ( |  | R | ) | (to_heap && ONHEAP(R))

Definition at line 296 of file def_macro.h.

#define include_var_builtin | ( |  | NBARGS | ) |

Value:
ptr_psi_term g, args[NBARGS]; \
long num[NBARGS]; \
long val[NBARGS]; \
long ii, success=TRUE, resi=FALSE
wl_psi_term
Definition: def_struct.h:177
TRUE
#define TRUE
Standard boolean.
Definition: def_const.h:268
FALSE
#define FALSE
Standard boolean.
Definition: def_const.h:275

Definition at line 196 of file def_macro.h.

#define is_top | ( |  | T | ) | ((T)!=NULL && (T)->type==top && (T)->attr_list==NULL)

Definition at line 113 of file def_macro.h.

#define ISALPHA | ( |  | C | ) | (DIGIT(C) || UPPER(C) || LOWER(C))

Definition at line 48 of file def_macro.h.

#define List_First | ( |  | header | ) | ((header)->First)

Definition at line 159 of file def_macro.h.

#define List_IsEmpty | ( |  | header | ) | (List_First(header)==NULL)

Definition at line 163 of file def_macro.h.

#define List_Last | ( |  | header | ) | ((header)->Last)

Definition at line 160 of file def_macro.h.

#define List_Next | ( |  | header,
|  |  | RefAtom
| ) |  | ((*(header)->GetLinks)(RefAtom)->Next)

Definition at line 161 of file def_macro.h.

#define List_Prev | ( |  | header,
|  |  | RefAtom
| ) |  | ((*(header)->GetLinks)(RefAtom)->Prev)

Definition at line 162 of file def_macro.h.

#define LOWER | ( |  | C | ) | (C>='a' && C<='z')

Definition at line 46 of file def_macro.h.

#define NARGS | ( |  | args | ) | (sizeof(args)/sizeof(psi_arg))

Definition at line 174 of file def_macro.h.

#define NEW | ( |  | A,
|  |  | TYPE
| ) |  |

Value:
(heap_flag==HEAP \
? (to_heap \
? (ONHEAP(A) \
? A \
: HEAP_ALLOC(TYPE) \
) \
: HEAP_ALLOC(TYPE) \
) \
: STACK_ALLOC(TYPE) \
)
HEAP
#define HEAP
Flag to indicate heap allocation.
Definition: def_const.h:324
ONHEAP
#define ONHEAP(R)
Definition: def_macro.h:281
to_heap
long to_heap
Definition: def_glob.h:905
STACK_ALLOC
#define STACK_ALLOC(A)
Definition: def_macro.h:21
HEAP_ALLOC
#define HEAP_ALLOC(A)
Definition: def_macro.h:20

Definition at line 284 of file def_macro.h.

#define noneval | ( |  | T | ) | (T->type==quote || T->type==listingsym || T->type==loadsym)

Definition at line 103 of file def_macro.h.

#define NOTQUIET (!quietflag || verbose) /* 21.1 */

Definition at line 15 of file def_macro.h.

#define ONHEAP | ( |  | R | ) | ((GENERIC)R>=heap_pointer)

Definition at line 281 of file def_macro.h.

#define PERMERGE | ( |  | X | ) | X,100.0*((double)X/(double)Amerge)

Definition at line 274 of file def_macro.h.

#define PERUNIF | ( |  | X | ) | X,100.0*((double)X/(double)Aunif)

Definition at line 273 of file def_macro.h.

#define SETARG | ( |  | args,
|  |  | i,
|  |  | the_feature,
|  |  | the_type,
|  |  | the_options
| ) |  |

Value:
{ int j = i; \
args[j].feature = the_feature; \
args[j].type = the_type; \
args[j].options = the_options; }

Definition at line 168 of file def_macro.h.

#define SINGLE | ( |  | C | ) |

Value:
(C=='(' || C==')' || C=='[' || C==']' || C=='{' || C=='`' || \
C=='}' || C==',' || C=='.' || C==';' || C=='@' || \
C=='!') /* RM: Jul 7 1993 */

Definition at line 52 of file def_macro.h.

#define STACK_ALLOC | ( |  | A | ) | (A *)stack_alloc(sizeof(A))

Definition at line 21 of file def_macro.h.

#define stack_empty_list | ( |  | ) | stack_nil() /* RM: Dec 14 1992 */

Definition at line 142 of file def_macro.h.

#define SYMBOL | ( |  | C | ) |

Value:
(C=='#' || C=='$' || C=='%' || C=='&' || \
C=='*' || C=='+' || C=='-' || C=='>' || C=='/' || \
C==':' || C=='<' || C=='=' || \
C=='~' || C=='^' || C=='|' || C=='\\' || \
C=='.' || C=='?' /* RM: Jul 7 1993 */ \
)

Definition at line 57 of file def_macro.h.

#define UN_CODED (CODE)0L

Definition at line 23 of file def_macro.h.

#define UPPER | ( |  | C | ) | ((C>='A' && C<='Z') || C=='_')

Definition at line 44 of file def_macro.h.

#define VALID_ADDRESS | ( |  | A | ) |

Value:
( VALID_RANGE(A) \
|| (GENERIC)A==(GENERIC)&var_tree \
)
VALID_RANGE
#define VALID_RANGE(A)
Definition: def_macro.h:127
var_tree
ptr_node var_tree
Definition: def_glob.h:1005
GENERIC
unsigned long * GENERIC
unsigned long *GENERIC
Definition: def_struct.h:35

Definition at line 137 of file def_macro.h.

#define VALID_RANGE | ( |  | A | ) | ((GENERIC)A>=mem_base && (GENERIC)A<mem_limit)

Definition at line 127 of file def_macro.h.

#define WFProve | ( |  | A | ) |

Value:
{ char *c=(A);if(!WFInput(c)) \
fprintf(stderr,"%s failed (%s, line %d)\n",c,__FILE__,__LINE__); }
WFInput
int WFInput(char *query)
WFInput.
Definition: lib.c:215

Definition at line 10 of file def_macro.h.

#define wl_const_1 | ( |  | S | ) | ((S).value_1 ==NULL && (S).type!=variable)

Definition at line 107 of file def_macro.h.

#define wl_const_2 | ( |  | S | ) | ((S).value_2 ==NULL && (S).type!=variable)

Definition at line 108 of file def_macro.h.

#define wl_const_3 | ( |  | S | ) | ((S).value_3 ==NULL && (S).type!=variable)

Definition at line 109 of file def_macro.h.

#define XPART | ( |  | argi,
|  |  | vali,
|  |  | numi
| ) |  | if (FALSE) ;

Definition at line 188 of file def_macro.h.