[liblouis-liblouisxml] [liblouisutdml] push by mwhapples - Some more logging, including a message to show which semantic action f... on 2014-06-02 08:38 GMT

  • From: liblouisutdml@xxxxxxxxxxxxxx
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Mon, 02 Jun 2014 08:38:34 +0000

Revision: 50b0a363e9d1
Branch:   default
Author:   Michael Whapples
Date:     Mon Jun  2 08:45:16 2014 UTC
Log: Some more logging, including a message to show which semantic action file is loaded.
http://code.google.com/p/liblouisutdml/source/detail?r=50b0a363e9d1

Modified:
 /liblouisutdml/semantics.c
 /liblouisutdml/transcriber.c

=======================================
--- /liblouisutdml/semantics.c  Mon May 26 08:51:33 2014 UTC
+++ /liblouisutdml/semantics.c  Mon Jun  2 08:45:16 2014 UTC
@@ -868,6 +868,7 @@
   FileInfo nested;
   char completePath[MAXNAMELEN];
   int haveAppended = 0;
+  logMessage(LOG_INFO, "Begin sem_compileFile: fileName=%s", fileName);
   if (!*fileName)
     return 1;                  /*Probably run with defaults */
   if (strncmp (fileName, "appended_", 9) == 0)
@@ -889,6 +890,7 @@
   memset (&nested, 0, sizeof (nested));
   nested.fileName = fileName;
   nested.unedited = 1;
+  logMessage(LOG_INFO, "Loading semantic action file: %s", completePath);
   if ((nested.in = fopen ((char *) completePath, "rb")))
     {
       while (getALine (&nested))
@@ -908,6 +910,7 @@
       return 0;
     }
   numEntries += nested.numEntries;
+  logMessage(LOG_INFO, "Finish sem_compileFile");
   return 1;
 }

=======================================
--- /liblouisutdml/transcriber.c        Wed May 28 22:09:22 2014 UTC
+++ /liblouisutdml/transcriber.c        Mon Jun  2 08:45:16 2014 UTC
@@ -3958,6 +3958,7 @@
   int goodTrans;
   int pos;
   int k, kk;
+  logMessage(LOG_INFO, "Begin backTranslateBlock");
   if (curBlock == NULL || curBrl == NULL)
     return 1;
   ud->text_length = 0;
@@ -4019,6 +4020,7 @@
       utilStringBuf[--kk] = 0;
       xmlNewProp (addBrl, (xmlChar *) "index", (xmlChar *) utilStringBuf);
     }
+  logMessage(LOG_INFO, "Finish backTranslateBlock");
   return 1;
 }

@@ -4080,6 +4082,7 @@
   xmlNode *newBlock;
   xmlNode *curBrl;
   int k;
+  logMessage(LOG_INFO, "Begin formatBackBlock");
   if (ud->translated_length <= 0)
     return 1;
   newBlock = xmlNewNode (NULL, (xmlChar *) "p");
@@ -4088,6 +4091,7 @@
   ud->translated_length = ud->sync_text_length = 0;
   ud->in_sync = 1;
   backTranslateBlock (xmlAddChild (addBlock, newBlock), curBrl);
+  logMessage(LOG_INFO, "Finish formatBackBlock");
   return 1;
 }

@@ -4260,16 +4264,30 @@
 checkPageStatus ()
 {
   int remaining;
+  logMessage(LOG_INFO, "Begin checkPageStatus");
   if (ud->vert_line_pos == ud->page_top || ud->lines_on_page == 0)
+  {
+    logMessage(LOG_INFO, "Finish checkPageStatus: return=topOfPage");
     return topOfPage;
+  }
   remaining = ud->page_bottom - ud->vert_line_pos;
if (remaining < ud->normal_line || ud->lines_on_page >= ud->lines_per_page)
+  {
+    logMessage(LOG_INFO, "Finish checkPageStatus: return=bottomOfPage");
     return bottomOfPage;
+  }
   if ((ud->lines_on_page + 1) >= ud->lines_per_page || remaining ==
       ud->normal_line)
+  {
+    logMessage(LOG_INFO, "Finish checkPageStatus: return=lastLine");
     return lastLine;
+  }
if (remaining > (2 * ud->normal_line) && remaining < (3 * ud->normal_line))
+  {
+    logMessage(LOG_INFO, "Finish checkPageStatus: return=nearBottom");
     return nearBottom;
+  }
+  logMessage(LOG_INFO, "Finish checkPageStatus: return=midPage");
   return midPage;
 }

@@ -4633,10 +4651,12 @@
 {
   char number[MAXNUMLEN];
   xmlNode *newNode = xmlNewNode (NULL, (xmlChar *) "newpage");
+  logMessage(LOG_INFO, "Begin makeNewpage");
   sprintf (number, "%d", ud->braille_page_number);
   xmlNewProp (newNode, (xmlChar *) "brlnumber", (xmlChar *) number);
   newpageNode = xmlAddChild (parent, newNode);
   ud->lines_on_page = 0;
+  logMessage(LOG_INFO, "Finish makeNewpage");
   return 1;
 }

@@ -4877,6 +4897,7 @@
 {
   PageStatus curPageStatus;
   int availableCells = 0;
+  logMessage(LOG_INFO, "Begin utd_startLine");
   if (firstPage)
     {
       firstPage = 0;
@@ -4917,6 +4938,7 @@
       else
        availableCells = ud->cells_per_line;
     }
+  logMessage(LOG_INFO, "Begin utd_startLine");
   return availableCells;
 }

@@ -4929,6 +4951,7 @@
   int k;
   int leaveBlank;
   int horizLinePos = ud->page_left + leadingBlanks * ud->cell_width;
+  logMessage(LOG_INFO, "Begin utd_finishLine");
   cellsOnLine = leadingBlanks + length;
   for (leaveBlank = -1; leaveBlank < ud->line_spacing; leaveBlank++)
     {
@@ -4999,6 +5022,7 @@
       ud->vert_line_pos = ud->page_top;
       makeNewpage (brlNode);
     }
+  logMessage(LOG_INFO, "Finish utd_finishLine");
   return 1;
 }

@@ -5112,6 +5136,7 @@
 utd_fillPage ()
 {
   PageStatus curPageStatus = checkPageStatus ();
+  logMessage(LOG_INFO, "Begin utd_fillPage");
   if (curPageStatus == topOfPage)
     {
       utd_startLine ();
@@ -5120,6 +5145,7 @@
   ud->vert_line_pos = ud->page_bottom - ud->normal_line;
   utd_startLine ();
   utd_finishLine (0, 0);
+  logMessage(LOG_INFO, "Finish utd_fillPage");
   return 1;
 }

@@ -5576,6 +5602,7 @@
 utd_finish ()
 {
   xmlNode *newNode;
+  logMessage(LOG_INFO, "Begin utd_finish");
   if (ud->paragraphs)
     {
       newNode = xmlNewNode (NULL, (xmlChar *) "brl");
@@ -5610,5 +5637,6 @@
     convert_utd ();
   else
     output_xml (ud->doc);
+  logMessage(LOG_INFO, "Finish utd_finish");
   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 mwhapples - Some more logging, including a message to show which semantic action f... on 2014-06-02 08:38 GMT - liblouisutdml