* Copyright (c) 1983 The Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* @(#)defs.h 5.3 (Berkeley) %G%
* Public definitions, common to all.
# define double long float
#define new(type) ((type) malloc(sizeof(struct type)))
#define newarr(type, n) ((type *) malloc((unsigned) (n) * sizeof(type)))
#define dispose(ptr) { free((char *) ptr); ptr = 0; }
#define ord(enumcon) ((unsigned int) enumcon)
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
panic("assertion failed at line %d in file %s", __LINE__, __FILE__); \
#define badcaseval(v) { \
panic("unexpected value %d at line %d in file %s", v, __LINE__, __FILE__); \
panic("reference through nil pointer at line %d in file %s", \
typedef enum { false, true } Boolean
;
#define strdup(s) strcpy(malloc((unsigned) strlen(s) + 1), s)
#define streq(s1, s2) (strcmp(s1, s2) == 0)
#define get(f, var) fread((char *) &(var), sizeof(var), 1, f)
#define put(f, var) fwrite((char *) &(var), sizeof(var), 1, f)
extern String
strcpy(), index(), rindex();
extern String errfilename
;