diff options
Diffstat (limited to 'lib/libkeynote/Misc')
-rw-r--r-- | lib/libkeynote/Misc/getopt.c | 83 | ||||
-rw-r--r-- | lib/libkeynote/Misc/getopt.h | 6 | ||||
-rw-r--r-- | lib/libkeynote/Misc/keynote.btm | 14 | ||||
-rw-r--r-- | lib/libkeynote/Misc/keynote.gif | bin | 0 -> 128 bytes |
4 files changed, 103 insertions, 0 deletions
diff --git a/lib/libkeynote/Misc/getopt.c b/lib/libkeynote/Misc/getopt.c new file mode 100644 index 00000000000..4e12b012775 --- /dev/null +++ b/lib/libkeynote/Misc/getopt.c @@ -0,0 +1,83 @@ +/* $OpenBSD: getopt.c,v 1.1 1999/05/23 22:11:07 angelos Exp $ */ + +#include <stdio.h> +#include <string.h> +#include <ctype.h> + +/*** getopt + * + * This function is the public domain version of getopt, the command + * line argument processor, and hence is NOT copyrighted by Microsoft, + * IBM, or AT&T. + */ + +#define ERR(s, c) if(opterr){\ + (void) fputs(argv[0], stderr);\ + (void) fputs(s, stderr);\ + (void) fputc(c, stderr);\ + (void) fputc('\n', stderr);} + +int opterr = 1; /* flag:error message on unrecognzed options */ +int optind = 1; /* last touched cmdline argument */ +int optopt; /* last returned option */ +char *optarg; /* argument to optopt */ +int getopt(int argc, char **argv, char *opts); + +/* int argc is the number of arguments on cmdline */ +/* char **argv is the pointer to array of cmdline arguments */ +/* char *opts is the string of all valid options */ +/* each char case must be given; options taking an arg are followed by = +':' */ +int getopt(int argc, char **argv, char *opts) +{ + static int sp = 1; + register int c; + register char *cp; + if(sp == 1) + /* check for end of options */ + if(optind >= argc || + (argv[optind][0] != '/' && + argv[optind][0] != '-') || + argv[optind][1] == '\0') + return(EOF); + else if(!strcmp(argv[optind], "--")) { + optind++; + return(EOF); + } + optopt = c = argv[optind][sp]; + if(c == ':' || (cp=strchr(opts, c)) == NULL) { + /* if arg sentinel as option or other invalid option, + handle the error and return '?' */ + ERR(": illegal option -- ", (char)c); + if(argv[optind][++sp] == '\0') { + optind++; + sp = 1; + } + return('?'); + } + if(*++cp == ':') { + /* if option is given an argument... */ + if(argv[optind][sp+1] != '\0') + /* and the OptArg is in that CmdLineArg, return it... */ + optarg = &argv[optind++][sp+1]; + else if(++optind >= argc) { + /* but if the OptArg isn't there and the next CmdLineArg + isn't either, handle the error... */ + ERR(": option requires an argument -- ", (char)c); + sp = 1; + return('?'); + } else + /* but if there is another CmdLineArg there, return that */ + optarg = argv[optind++]; + /* and set up for the next CmdLineArg */ + sp = 1; + } else { + /* no arg for this opt, so null arg and set up for next option */ + if(argv[optind][++sp] == '\0') { + sp = 1; + optind++; + } + optarg = NULL; + } + return(c); +} diff --git a/lib/libkeynote/Misc/getopt.h b/lib/libkeynote/Misc/getopt.h new file mode 100644 index 00000000000..17211043f1f --- /dev/null +++ b/lib/libkeynote/Misc/getopt.h @@ -0,0 +1,6 @@ +/* $OpenBSD: getopt.h,v 1.1 1999/05/23 22:11:07 angelos Exp $ */ + +extern int opterr; /* flag:error message on unrecognzed options */ +extern int optind; /* last touched cmdline argument */ +extern char *optarg; /* argument to optopt */ +int getopt(int argc, char **argv, char *opts); diff --git a/lib/libkeynote/Misc/keynote.btm b/lib/libkeynote/Misc/keynote.btm new file mode 100644 index 00000000000..434c5286420 --- /dev/null +++ b/lib/libkeynote/Misc/keynote.btm @@ -0,0 +1,14 @@ +#define keynote1_width 32 +#define keynote1_height 32 +static unsigned char keynote1_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, + 0xec, 0xff, 0x01, 0x00, 0xc4, 0xff, 0x01, 0x00, 0xec, 0xff, 0x00, 0x00, + 0xfc, 0x90, 0x00, 0x00, 0x78, 0xd0, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0x10, 0x00, 0x10, 0x00, + 0xd0, 0xff, 0x3f, 0x00, 0x50, 0x00, 0x20, 0x00, 0x50, 0xff, 0x2f, 0x00, + 0x50, 0x00, 0x20, 0x00, 0x50, 0xff, 0x23, 0x00, 0x50, 0x00, 0x20, 0x00, + 0x50, 0xff, 0x2f, 0x00, 0x50, 0x00, 0x20, 0x00, 0x50, 0xff, 0x27, 0x00, + 0x50, 0x00, 0x20, 0x00, 0x50, 0x7f, 0x20, 0x00, 0x50, 0x00, 0x20, 0x00, + 0x50, 0x00, 0x20, 0x00, 0x50, 0x00, 0x20, 0x00, 0x50, 0x00, 0x20, 0x00, + 0x50, 0x00, 0x20, 0x00, 0x50, 0x00, 0x20, 0x00, 0x70, 0x00, 0x20, 0x00, + 0xc0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/lib/libkeynote/Misc/keynote.gif b/lib/libkeynote/Misc/keynote.gif Binary files differnew file mode 100644 index 00000000000..577ca8c5f3e --- /dev/null +++ b/lib/libkeynote/Misc/keynote.gif |