+static char * filenames[256];
+static int filenum;
+static char * destfilename = "output.swf";
+int all=0;
+int verbose=0;
+
+struct options_t options[] =
+{
+ {"o","output"},
+ {"v","verbose"},
+ {"V","version"},
+ {0,0}
+};
+int args_callback_option(char*name,char*val)
+{
+ if(!strcmp(name, "V")) {
+ printf("font2swf - part of %s %s\n", PACKAGE, VERSION);
+ exit(0);
+ }
+ else if(!strcmp(name, "o")) {
+ destfilename = val;
+ return 1;
+ }
+ else if(!strcmp(name, "v")) {
+ verbose ++;
+ return 0;
+ }
+ else {
+ printf("Unknown option: -%s\n", name);
+ exit(1);
+ }
+ return 0;
+}
+int args_callback_longoption(char*name,char*val)
+{
+ return args_long2shortoption(options, name, val);
+}
+void args_callback_usage(char*name)
+{
+ printf("Usage: %s file.afm [...]\n", name);
+ printf(" OR: %s all\n", name);
+ printf("\n");
+ printf("\tIf \"all\" is given instead of font names, all standard fonts\n");
+ printf("\t(Courier, Arial etc.) will be created\n");
+ printf("\n");
+ printf("Options:\n");
+ printf("\n");
+ printf("\t-h , --help\t\t Print help and exit\n");
+ printf("\t-o , --output filename\t set output filename\n");
+ printf("\t-v , --verbose\t\t Be more verbose\n");
+ printf("\t-V , --version\t\t Print program version and exit\n");
+}
+int args_callback_command(char*name,char*val)
+{
+ if(!strcmp(name, "all"))
+ all = 1;
+ else {
+ filenames[filenum++] = strdup(name);
+ }
+ return 0;
+}
+
+