[Mplayer-cvslog] CVS: main/TOOLS/subfont-c subfont.c,1.10,1.11

Alex Beregszaszi alex at mplayer.dev.hu
Sun Mar 3 20:18:46 CET 2002


Update of /cvsroot/mplayer/main/TOOLS/subfont-c
In directory mplayer:/var/tmp.root/cvs-serv27347

Modified Files:
	subfont.c 
Log Message:
--outdir added

Index: subfont.c
===================================================================
RCS file: /cvsroot/mplayer/main/TOOLS/subfont-c/subfont.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- subfont.c	24 Aug 2001 10:46:31 -0000	1.10
+++ subfont.c	3 Mar 2002 19:18:42 -0000	1.11
@@ -46,6 +46,8 @@
 char*		font_desc = "font.desc";
 //char*		font_desc = "/dev/stdout";
 
+char		*outdir = ".";
+
 //// constants
 int const	colors = 256;
 int const	maxcolor = 255;
@@ -122,7 +124,7 @@
     int const max_name = 128;
     char name[max_name];
 
-    snprintf(name, max_name, "%s-%c.raw", encoding_name, type);
+    snprintf(name, max_name, "%s/%s-%c.raw", outdir, encoding_name, type);
     f = fopen(name, "wb");
     if (f==NULL) ERROR("fopen failed.");
     write_header(f);
@@ -228,7 +230,13 @@
 
 
     /* create font.desc */
-    f = fopen(font_desc, append_mode ? "a":"w");
+{
+    int const max_name = 128;
+    char name[max_name];
+
+    snprintf(name, max_name, "%s/%s", outdir, font_desc);
+    f = fopen(name, append_mode ? "a":"w");
+}
     if (f==NULL) ERROR("fopen failed.");
 
 
@@ -668,10 +676,11 @@
 
 
 void usage() {
-    printf("Usage: %s [--append] [--unicode] [--blur b] [--outline o] encoding ppem font\n", command);
+    printf("Usage: %s [--outdir dir] [--append] [--unicode] [--blur b] [--outline o] encoding ppem font\n", command);
     printf("\n"
 	    "  Program creates 3 files: font.desc, <encoding>-a.raw, <encoding>-b.raw.\n"
 	    "\n"
+	    "  --outdir         output directory to place files.\n"
 	    "  --append         append results to existing font.desc, suppress info header.\n"
 	    "  --unicode        use Unicode in font.desc. This will work with -utf8 option of mplayer.\n"
 	    "  --blur b         specify blur radius, float.\n"
@@ -693,6 +702,14 @@
     if (command==NULL) command = argv[a];
     else ++command;
     ++a; --argc;
+
+    if (argc>=1 && strcmp(argv[a], "--outdir")==0) {
+	++a; --argc;
+	if (argc==0) usage();
+
+	outdir = strdup(argv[a]);
+	++a; --argc;
+    }
 
     if (argc>=1 && strcmp(argv[a], "--append")==0) {
 	append_mode = 1;




More information about the MPlayer-cvslog mailing list