Revision: 350104c2e009 Branch: default Author: John Boyer <john.boyer@xxxxxxxxxxxxxxxxx> Date: Wed Nov 28 18:35:30 2012 Log: some work on file2brl http://code.google.com/p/liblouisutdml/source/detail?r=350104c2e009 Modified: /tools/file2brl.c ======================================= --- /tools/file2brl.c Wed Mar 21 20:29:33 2012 +++ /tools/file2brl.c Wed Nov 28 18:35:30 2012 @@ -44,6 +44,7 @@ {"text", no_argument, NULL, 'T'}, {"log-file", no_argument, NULL, 'l'}, {"config-setting", required_argument, NULL, 'C'}, + {"writeable-path", required_argument, NULL, 'w'}, {NULL, 0, NULL, 0} }; @@ -80,7 +81,9 @@ -C, --config-setting specify particular configuration settings\n\They override any settings that are specified in a\n\
config file\n\- -l, --log-file write errors to file2brl.log instead of stderr\n", stdout);
+ -w --writeable-path path for temp files and log file\n\+ -l, --log-file write errors to file2brl.log instead of stderr\n",
+ stdout); printf ("\n"); printf ("\ @@ -95,7 +98,7 @@ char *inputFileName = "stdin"; char *outputFileName = "stdout"; char tempFileName[MAXNAMELEN]; - char *logFileName = NULL; + char logFileName[MAXNAMELEN]; char whichProc = 0; char *configSettings = NULL; FILE *inputFile = NULL; @@ -109,9 +112,10 @@ int optc; set_program_name (argv[0]); - + logFileName[0] = 0; + while ((optc = - getopt_long (argc, argv, "hvf:brptlTC:", longopts, NULL)) != + getopt_long (argc, argv, "hvf:brptlwTC:", longopts, NULL)) != -1) switch (optc) { @@ -126,7 +130,7 @@ exit (EXIT_SUCCESS); break; case 'l': - logFileName = "file2brl.log"; + strcpy (logFileName, "file2brl.log"); break; case 't': mode |= htmlDoc; @@ -150,6 +154,9 @@ strcat (configSettings, optarg); strcat (configSettings, "\n"); break; + case 'w': + lbu_setWriteablePath (optarg); + break; default: fprintf (stderr, "Try `%s --help' for more information.\n", program_name); @@ -181,6 +188,11 @@ if (whichProc == 0) whichProc = '0'; + if (logFileName[0] != 0) + { + strcpy (logFileName, lbu_getWriteablePath()); + strcat (logFileName, "file2brl.log"); + } if (configSettings != NULL) for (k = 0; configSettings[k]; k++) if (configSettings[k] == '=' && configSettings[k - 1] != ' ') For a description of the software, to download it and links to project pages go to http://www.abilitiessoft.com