fixed "startdepth" white background bug.
[swftools.git] / pdf2swf / ttf2pt1 / win_missing.h
blobc4940998ffdfe85115c19bf107f4d5acf2675f16
1 /*
2 * Implementation of things missing in Windows
3 */
5 #ifndef M_PI
6 #define M_PI 3.14159265358979323846
7 #endif
9 #undef ntohs
10 #undef ntohl
11 #undef htonl
13 #ifdef WINDOWS_FUNCTIONS
14 /* byte order */
16 char *optarg;
17 int optind=1;
19 char getopt(int argc, char **argv, char *args) {
20 int n,nlen=strlen(args),nLen=0;
21 char nCmd;
23 if (argv[optind] && *argv[optind]=='-') {
24 nCmd=*((argv[optind]+1));
26 for (n=0;n<nlen;n++) {
27 if (args[n] == ':') continue;
28 if (args[n] == nCmd) {
29 if (args[n+1]==':') {
30 char retVal;
31 retVal=*(argv[optind]+1);
32 optarg=argv[optind+1];
33 if (!optarg) optarg="";
34 optind+=2;
35 return retVal;
36 } else {
37 char retVal;
38 retVal=*(argv[optind]+1);
39 optarg=NULL;
40 optind+=1;
41 return retVal;
46 return -1;
49 #else
51 unsigned short ntohs(unsigned short inv);
52 unsigned long ntohl(unsigned long inv);
53 unsigned long htonl(unsigned long inv);
55 extern char *optarg;
56 extern int optind;
58 char getopt(int argc, char **argv, char *args);
59 #endif