*****************************************************************************/
void die(const char* msgfmt, ...);
-//static char* estrdup(const char *s) {
-// char* ns = (char*)emalloc(strlen(s) + 1);
-// strcpy(ns,s);
-// return ns;
-//}
-
/* Option Parsing
*
* This following macros implement a simple POSIX-style option parsing strategy.
-#define UTF_MAX 6u /* maximum number of bytes that make up a rune */
-#define RUNE_SELF 0x80 /* byte values larger than this are *not* ascii */
-#define RUNE_ERR 0xFFFD /* rune value representing an error */
-#define RUNE_MAX 0x10FFFF /* Maximum decodable rune value */
-#define RUNE_EOF UINT32_MAX /* rune value representing end of file */
-#define RUNE_CRLF UINT32_MAX-1 /* rune value representing a \r\n sequence */
+enum {
+ UTF_MAX = 6u, /* maximum number of bytes that make up a rune */
+ RUNE_SELF = 0x80, /* byte values larger than this are *not* ascii */
+ RUNE_ERR = 0xFFFD, /* rune value representing an error */
+ RUNE_MAX = 0x10FFFF, /* Maximum decodable rune value */
+ RUNE_EOF = UINT32_MAX, /* rune value representing end of file */
+ RUNE_CRLF = UINT32_MAX-1, /* rune value representing a \r\n sequence */
+};
/* Represents a unicode code point */
typedef uint32_t Rune;