[liblouis-liblouisxml] [liblouisutdml] push by john.bo...@xxxxxxxxxxxxxxxxx - Fixed cannot open log file problem on 2012-06-30 04:55 GMT

  • From: liblouisutdml@xxxxxxxxxxxxxx
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Sat, 30 Jun 2012 04:55:59 +0000

Revision: ae08321daefc
Author:   John Boyer <john.boyer@xxxxxxxxxxxxxxxxx>
Date:     Fri Jun 29 21:54:56 2012
Log:      Fixed cannot open log file problem
http://code.google.com/p/liblouisutdml/source/detail?r=ae08321daefc

Modified:
 /liblouisutdml/readconfig.c
 /liblouisutdml/utd2bible.c

=======================================
--- /liblouisutdml/readconfig.c Tue Jun 26 13:54:10 2012
+++ /liblouisutdml/readconfig.c Fri Jun 29 21:54:56 2012
@@ -56,6 +56,7 @@
 }
 FileInfo;

+static char pathEnd[2];
 static double paperWidth;
 static double paperHeight;
 static double leftMargin;
@@ -130,9 +131,6 @@
   int k;
   int currentListPos = 0;
   int pathLength;
-  char pathEnd[2];
-  pathEnd[0] = ud->file_separator;
-  pathEnd[1] = 0;
   filePath[0] = 0;
   for (commaPos = 0; fileList[commaPos] && fileList[commaPos] != ',';
        commaPos++);
@@ -1262,11 +1260,19 @@
 #else
   ud->file_separator = '/';
 #endif
+  pathEnd[0] = ud->file_separator;
+  pathEnd[1] = 0;

 /*Process file list*/
   if (configFileList == NULL)
     {
       set_paths (NULL);
+  if (logFileName)
+    {
+      strcpy ((char *) ud->typeform, lbu_getWriteablePath ());
+      strcat ((char *) ud->typeform, logFileName);
+      lou_logFile ((char *) ud->typeform);
+    }
       if (!(config_compileSettings ("liblouisutdml.ini")))
        return 0;
     }
=======================================
--- /liblouisutdml/utd2bible.c  Wed Jun 27 10:36:26 2012
+++ /liblouisutdml/utd2bible.c  Fri Jun 29 21:54:56 2012
@@ -79,7 +79,7 @@
   kk = 1;
   else kk = 0;
   for (k = 0; k < numberLength; k++)
-  if (number[k] == 16)
+  if (number[k] == 48)
     line[kk++] = number[k] + 58;
     else
     line[kk++] = number[k] + 48;
@@ -95,6 +95,27 @@
     }
   return length;
 }
+
+static void
+makeFooter ()
+{
+  int translationLength;
+  int translatedLength;
+  int k;
+  int kk;
+  firstVerse[firstVerseLength++] = ud->lit_hyphen[0];
+  for (k = 0; k < lastVerseLength; k++)
+    firstVerse[firstVerseLength++] = lastVerse[k];
+  translationLength = firstVerseLength;
+  translatedLength = MAXNUMLEN;
+  lou_translate (ud->main_braille_table, firstVerse, &translationLength,
+                lastVerse, &translatedLength, NULL, NULL,
+                NULL, NULL, NULL, 0);
+  firstVerseLength = 0;
+  kk = startOfLastLine + ((ud->cells_per_line - translatedLength) / 2);
+  for (k = 0; k < translatedLength; k++)
+  ud->outbuf1[kk++] = lastVerse[k];
+}

 int
 utd2bible (xmlNode * node)
@@ -252,6 +273,7 @@
 static int
 doUtdnewpage (xmlNode * node)
 {
+  static int prevBrlPageNum = 1;
   lastLinepos = ud->page_top;
   firstLineOnPage = 1;
   if (firstPage)
@@ -259,10 +281,12 @@
       firstPage = 0;
       return 1;
     }
-  write_buffer (1, 0);
-  ud->outbuf1_len_so_far = 0;
+  if ((prevBrlPageNum & 1))
+    makeFooter ();
   insertCharacters (ud->lineEnd, strlen (ud->lineEnd));
   insertCharacters (ud->pageEnd, strlen (ud->pageEnd));
+  write_buffer (1, 0);
+  prevBrlPageNum = atoi (xmlGetProp (node, (xmlChar *) "brlnumber"));
   return 1;
 }

For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts:

  • » [liblouis-liblouisxml] [liblouisutdml] push by john.bo...@xxxxxxxxxxxxxxxxx - Fixed cannot open log file problem on 2012-06-30 04:55 GMT - liblouisutdml