#ifndef _MISC_H_
#define _MISC_H_

/* PURPOSE:
 *    MISC.H: Miscellaneous things of use to many C programs.
 * HISTORY:
 *    Ian D. Allen   idallen@freenet.carleton.ca
 */

#include "mem.h"

/*************************************************************************/
/* defines and macros */

#define EQ(s1,s2) (strcmp(s1,s2) == 0)  /* string equality macro */
#define MAX(a,b) ((a)>(b)?(a):(b))	/* numeric maximum macro */
#define NEL(x) (sizeof(x)/sizeof(x[0]))	/* number of elements */

#ifndef NULL
#define NULL 0
#endif

/*************************************************************************/
/* enum, typedef, structures, data types */

typedef enum { FALSE, TRUE } Boolean;

#ifndef EXIT_SUCCESS
enum OsReturn {
	EXIT_SUCCESS=0,	/* O/S success return value */
	EXIT_FAILURE=1	/* O/S failure return value */
};
#endif

#endif /*_MISC_H_*/
