Beispiel #1
0
static void InitPools() {
  if (pools_initialized)
    return;
  CreatePool();			/* Create initial pool */
  pools_initialized = 1;
  DohNone = NewVoid(0, 0);	/* Create the None object */
  DohIntern(DohNone);
}
Beispiel #2
0
/* -----------------------------------------------------------------------------
 * brackets_push()
 *
 * Increases the depth of brackets.
 * Usually called when '(' is found.
 * ----------------------------------------------------------------------------- */
static void brackets_push(Scanner *s) {
  int *newInt = (int *)malloc(sizeof(int));
  *newInt = 0;
  Push(s->brackets, NewVoid(newInt, free));
}
Beispiel #3
0
void DohEncoding(char *name, DOH *(*fn) (DOH *s)) {
    if (!encodings)
        encodings = NewHash();
    Setattr(encodings, (void *) name, NewVoid((void *) fn, 0));
}
void DohSetVoid(DOH *obj, const DOH *name, void *value) {
  Setattr(obj, (DOH *) name, NewVoid(value, 0));
}
Beispiel #5
0
static DOH *Void_copy(DOH *vo) {
  VoidObj *v = (VoidObj *) ObjData(vo);
  return NewVoid(v->ptr, 0);
}