sizeof.c

MudOSa4DGD/mudlib/dgd/lib/sys/kfun/sizeof.c · 384 B

From the archive MudOSa4DGD-30.06.98.tar.gz

Download the archive   « Back to the archive contents

/*
 * sizeof.c
 *
 * MudOS sizeof() emulation
 *
 * (C) Frank Schmidt, Jesus@NorseMUD
 *
 */


#ifdef MUDOS_LIBERAL_SIZEOF

/* do sizeof() correctly no matter what type */
static int sizeof(mixed arr) {
  switch (typeof(arr)) {
  case T_ARRAY: return ::sizeof(arr);
  case T_STRING: return ::strlen(arr);
  case T_MAPPING: return ::map_sizeof(arr);
  default: return 0;
  }
}

#endif

Site Stats

Snippets: 1791
Codebases: 571