/* * Include the basic standard libc headers. */ #include #include #include #include #include /* INT_MIN, MAX ... */ #include /* DBL_EPSILON */ #include #ifdef WIN32 #define NEED_STRLCPY #define NEED_STRSEP #define NEED_GETOPT #define M_PI 3.14159265358979323846 #define inline __inline #define vsnprintf _vsnprintf #endif #include #ifndef WIN32 #include #endif #include /* O_RDONLY & co */ /* not supposed to be here, but printf debugging sorta needs it */ #include /* * Extras! Extras! Get them while they're hot! */ #ifdef NEED_STRLCPY extern int strlcpy(char *dst, const char *src, int n); extern int strlcat(char *dst, const char *src, int n); #endif #ifdef NEED_STRSEP extern char *strsep(char **stringp, const char *delim); #endif #ifdef NEED_GETOPT extern int getopt(int nargc, char * const * nargv, const char *ostr); extern int opterr, optind, optopt; extern char *optarg; #endif