3 new revisions: Revision: 18a14ce66464 Branch: default Author: Michael Whapples Date: Tue Jun 10 12:45:31 2014 UTC Log: Changed logging levels for some function call information http://code.google.com/p/liblouisutdml/source/detail?r=18a14ce66464 Revision: 8af98f1b9e9e Branch: default Author: Michael Whapples Date: Wed Jun 18 09:23:57 2014 UTC Log: Removed unused boxline semantic action code. http://code.google.com/p/liblouisutdml/source/detail?r=8af98f1b9e9e Revision: bd31b439edc3 Branch: default Author: Michael Whapples Date: Wed Jun 18 09:29:21 2014 UTC Log: More unused code removal. http://code.google.com/p/liblouisutdml/source/detail?r=bd31b439edc3 ============================================================================== Revision: 18a14ce66464 Branch: default Author: Michael Whapples Date: Tue Jun 10 12:45:31 2014 UTC Log: Changed logging levels for some function call information http://code.google.com/p/liblouisutdml/source/detail?r=18a14ce66464 Modified: /liblouisutdml/transcriber.c /tools/file2brl.c ======================================= --- /liblouisutdml/transcriber.c Mon Jun 9 13:03:18 2014 UTC +++ /liblouisutdml/transcriber.c Tue Jun 10 12:45:31 2014 UTC @@ -417,8 +417,8 @@ int numBytes; unsigned int utf32; int k;- logMessage(LOG_INFO, "Begin wc_string_to_utf8: inSize=%d, outSize=%d", *inSize, *outSize);
- logWidecharBuf(LOG_INFO, "inStr=", inStr, *inSize);+ logMessage(LOG_DEBUG, "Begin wc_string_to_utf8: inSize=%d, outSize=%d", *inSize, *outSize);
+ logWidecharBuf(LOG_DEBUG, "inStr=", inStr, *inSize); logMessage(LOG_DEBUG, "inStr=%d, outstr=%d", inStr, outstr); while (in < *inSize) { @@ -446,7 +446,7 @@ { *inSize = in; *outSize = out;- logMessage(LOG_INFO, "Finish wc_string_to_utf8 due to not enough memory in outstr"); + logMessage(LOG_DEBUG, "Finish wc_string_to_utf8 due to not enough memory in outstr");
return 1; } } @@ -463,7 +463,7 @@ outstr[out++] = 0; *inSize = in; *outSize = out;- logMessage(LOG_INFO, "Finish wc_string_to_utf8: outstr=%s, outSize=%d", outstr, *outSize); + logMessage(LOG_DEBUG, "Finish wc_string_to_utf8: outstr=%s, outSize=%d", outstr, *outSize);
return 1; } @@ -716,7 +716,7 @@ int translationLength; int translatedLength; int k; - logMessage(LOG_INFO, "Begin insert_translation"); + logMessage(LOG_DEBUG, "Begin insert_translation"); if (style->translation_table != NULL) table = style->translation_table; if (table == NULL) @@ -1094,7 +1094,7 @@ int length = strlen ((char *) node->content); int k; // int stripSpace = 0;- logMessage(LOG_INFO, "Begin insert_text: node->content=%s", node->content); + logMessage(LOG_DEBUG, "Begin insert_text: node->content=%s", node->content);
// for (k = length; k > 0 && node->content[k - 1] <= 32; k--); // We want to track if the node only contains space 0x20 characters // if (node->content[k - 1] != 32) @@ -2985,7 +2985,7 @@ write_paragraph (sem_act action, xmlNode * node) { StyleType *holdStyle; - logMessage(LOG_INFO, "Begin write_paragraph"); + logMessage(LOG_DEBUG, "Begin write_paragraph"); if (!((ud->text_length > 0 || ud->translated_length > 0) && ud->style_top >= 0)) return 1; @@ -3024,7 +3024,7 @@ styleBody (); end_style (); ud->needs_editing = 0; - logMessage(LOG_INFO, "Finish write_paragraph"); + logMessage(LOG_DEBUG, "Finish write_paragraph"); return 1; } @@ -3053,7 +3053,7 @@ int charactersWritten = 0; int pieceStart; int k; - logMessage(LOG_INFO, "Begin makeParagraph"); + logMessage(LOG_DEBUG, "Begin makeParagraph"); while (ud->text_length > 0 && ud->text_buffer[ud->text_length - 1] <= 32 && ud->text_buffer[ud->text_length - 1] != escapeChar) ud->text_length--; @@ -3173,7 +3173,7 @@ return 0; writeOutbuf (); ud->text_length = 0; - logMessage(LOG_INFO, "Finish makeParagraph"); + logMessage(LOG_DEBUG, "Finish makeParagraph"); return 1; } @@ -3248,7 +3248,7 @@ int newPage = 0; char *htmlStart = "<html><head><title>No Title</title></head><body>"; char *htmlEnd = "</body></html>"; - logMessage(LOG_INFO, "Begin back_translate_braille_string"); + logMessage(LOG_DEBUG, "Begin back_translate_braille_string"); if (ud->format_for == utd) return utd_back_translate_braille_string (); if (!start_document ()) @@ -3319,7 +3319,7 @@ writeOutbuf (); ud->output_encoding = ascii8; } - logMessage(LOG_INFO, "Finish back_translate_braille_string"); + logMessage(LOG_DEBUG, "Finish back_translate_braille_string"); return 1; } @@ -3478,6 +3478,8 @@ int k; int start = ud->text_length; int availableCells; + logMessage(LOG_DEBUG, "Begin doBoxline"); + logMessage(LOG_DEBUG, "start=%d", start); insert_code (node, 0); if (!(ud->text_length - start)) return 0; @@ -3496,6 +3498,7 @@ return 0; cellsWritten = ud->cells_per_line; finishLine (); + logMessage(LOG_DEBUG, "Finished doBoxline"); return 1; } @@ -3573,7 +3576,7 @@ int start_style (StyleType * curStyle, xmlNode * node) { - logMessage(LOG_INFO, "Begin start_style"); + logMessage(LOG_DEBUG, "Begin start_style"); if (curStyle == NULL) curStyle = lookup_style ("para"); if (prevStyle == NULL) @@ -3623,14 +3626,14 @@ return 1; startStyle (); styleSpec->status = startBody; - logMessage(LOG_INFO, "Finish start_style"); + logMessage(LOG_DEBUG, "Finish start_style"); return 1; } int end_style () { - logMessage(LOG_INFO, "Begin end_style"); + logMessage(LOG_DEBUG, "Begin end_style"); styleSpec = &ud->style_stack[ud->style_top]; style = styleSpec->style; ud->brl_page_num_format = styleSpec->curBrlNumFormat; @@ -3660,7 +3663,7 @@ ud->style_right_margin = styleSpec->curRightMargin; ud->style_first_line_indent = styleSpec->curFirstLineIndent; ud->needs_editing = 0; - logMessage(LOG_INFO, "Finish end_style"); + logMessage(LOG_DEBUG, "Finish end_style"); return 1; } @@ -3958,7 +3961,7 @@ int goodTrans; int pos; int k, kk; - logMessage(LOG_INFO, "Begin backTranslateBlock"); + logMessage(LOG_DEBUG, "Begin backTranslateBlock"); if (curBlock == NULL || curBrl == NULL) return 1; ud->text_length = 0; @@ -4020,7 +4023,7 @@ utilStringBuf[--kk] = 0; xmlNewProp (addBrl, (xmlChar *) "index", (xmlChar *) utilStringBuf); } - logMessage(LOG_INFO, "Finish backTranslateBlock"); + logMessage(LOG_DEBUG, "Finish backTranslateBlock"); return 1; } @@ -4030,7 +4033,7 @@ { xmlNode *textNode; int inlen, outlen; - logMessage(LOG_INFO, "Begin makeDotsTextNode"); + logMessage(LOG_DEBUG, "Begin makeDotsTextNode"); if (length <= 0) return 1; if (ud->mode & notUC) @@ -4067,10 +4070,10 @@ } outlen = maxContent; wc_string_to_utf8 (ud->text_buffer, &inlen, brlContent, &outlen); - logMessage(LOG_INFO, "brlContent=%s", brlContent); + logMessage(LOG_DEBUG, "brlContent=%s", brlContent); textNode = xmlNewText (brlContent); xmlAddChild (node, textNode); - logMessage(LOG_INFO, "Finished makeDotsTextNode"); + logMessage(LOG_DEBUG, "Finished makeDotsTextNode"); return 1; } @@ -4082,7 +4085,7 @@ xmlNode *newBlock; xmlNode *curBrl; int k; - logMessage(LOG_INFO, "Begin formatBackBlock"); + logMessage(LOG_DEBUG, "Begin formatBackBlock"); if (ud->translated_length <= 0) return 1; newBlock = xmlNewNode (NULL, (xmlChar *) "p"); @@ -4091,7 +4094,7 @@ ud->translated_length = ud->sync_text_length = 0; ud->in_sync = 1; backTranslateBlock (xmlAddChild (addBlock, newBlock), curBrl); - logMessage(LOG_INFO, "Finish formatBackBlock"); + logMessage(LOG_DEBUG, "Finish formatBackBlock"); return 1; } @@ -4153,7 +4156,7 @@ int pch = 0; int leadingBlanks = 0; int k; - logMessage(LOG_INFO, "Begin utd_back_trranslate_braille_string"); + logMessage(LOG_DEBUG, "Begin utd_back_trranslate_braille_string"); ud->main_braille_table = ud->contracted_table_name; if (!lou_getTable (ud->main_braille_table)) return 0; @@ -4193,7 +4196,7 @@ ud->in_sync = ud->hyphenate; utd_finish (); freeDaisyDoc (); - logMessage(LOG_INFO, "Finish utd_back_translate_braille_string"); + logMessage(LOG_DEBUG, "Finish utd_back_translate_braille_string"); return 1; } @@ -4243,7 +4246,7 @@ static int insertTextFragment (widechar * content, int length) { - logMessage(LOG_INFO, "Inserting text fragment"); + logMessage(LOG_DEBUG, "Begin insertTextFragment"); if (length <= 0) return 1; checkTextFragment (content, length); @@ -4264,30 +4267,30 @@ checkPageStatus () { int remaining; - logMessage(LOG_INFO, "Begin checkPageStatus"); + logMessage(LOG_DEBUG, "Begin checkPageStatus"); if (ud->vert_line_pos == ud->page_top || ud->lines_on_page == 0) { - logMessage(LOG_INFO, "Finish checkPageStatus: return=topOfPage"); + logMessage(LOG_DEBUG, "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"); + logMessage(LOG_DEBUG, "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"); + logMessage(LOG_DEBUG, "Finish checkPageStatus: return=lastLine"); return lastLine; }if (remaining > (2 * ud->normal_line) && remaining < (3 * ud->normal_line))
{ - logMessage(LOG_INFO, "Finish checkPageStatus: return=nearBottom"); + logMessage(LOG_DEBUG, "Finish checkPageStatus: return=nearBottom"); return nearBottom; } - logMessage(LOG_INFO, "Finish checkPageStatus: return=midPage"); + logMessage(LOG_DEBUG, "Finish checkPageStatus: return=midPage"); return midPage; } @@ -4651,12 +4654,12 @@ { char number[MAXNUMLEN]; xmlNode *newNode = xmlNewNode (NULL, (xmlChar *) "newpage"); - logMessage(LOG_INFO, "Begin makeNewpage"); + logMessage(LOG_DEBUG, "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"); + logMessage(LOG_DEBUG, "Finish makeNewpage"); return 1; } @@ -4684,7 +4687,7 @@ int firstIndex; int curPos = startPos; xmlNode *curBrlNode; - logMessage(LOG_INFO, "Begin assignIndices"); + logMessage(LOG_DEBUG, "Begin assignIndices"); if (indices == NULL) return 1; if (startNode == NULL) @@ -4711,9 +4714,9 @@ kk += posLen; indexPos++; } - logMessage(LOG_INFO, "indexPos=%d", indexPos); + logMessage(LOG_DEBUG, "indexPos=%d", indexPos); utilStringBuf[--kk] = 0; - logMessage(LOG_INFO, "utilStringBuf=%s", utilStringBuf); + logMessage(LOG_DEBUG, "utilStringBuf=%s", utilStringBuf);if (xmlGetProp (curBrlNode, (xmlChar *) "index") == NULL && indexPos > 0)
xmlNewProp (curBrlNode, (xmlChar *) "index", (xmlChar *) utilStringBuf); @@ -4723,7 +4726,7 @@ } nextSegment = curPos + 1; } - logMessage(LOG_INFO, "Finish assignIndices"); + logMessage(LOG_DEBUG, "Finish assignIndices"); return 1; } @@ -4735,7 +4738,7 @@ int oldUdTranslatedLength = ud->translated_length; int k; int *setIndices; - logMessage(LOG_INFO, "Begin utd_insert_translation"); + logMessage(LOG_DEBUG, "Begin utd_insert_translation"); if (table != currentTable) { for (k = strlen (table); k >= 0; k--) @@ -4774,7 +4777,7 @@ else ud->translated_length = MAX_TRANS_LENGTH; assignIndices (startNode, oldUdTranslatedLength); - logMessage(LOG_INFO, "Finish utd_insert_translation"); + logMessage(LOG_DEBUG, "Finish utd_insert_translation"); return 1; } @@ -4897,7 +4900,7 @@ { PageStatus curPageStatus; int availableCells = 0; - logMessage(LOG_INFO, "Begin utd_startLine"); + logMessage(LOG_DEBUG, "Begin utd_startLine"); if (firstPage) { firstPage = 0; @@ -4938,7 +4941,7 @@ else availableCells = ud->cells_per_line; } - logMessage(LOG_INFO, "Begin utd_startLine"); + logMessage(LOG_DEBUG, "Begin utd_startLine"); return availableCells; } @@ -4951,7 +4954,7 @@ int k; int leaveBlank; int horizLinePos = ud->page_left + leadingBlanks * ud->cell_width; - logMessage(LOG_INFO, "Begin utd_finishLine"); + logMessage(LOG_DEBUG, "Begin utd_finishLine"); cellsOnLine = leadingBlanks + length; for (leaveBlank = -1; leaveBlank < ud->line_spacing; leaveBlank++) { @@ -5022,7 +5025,7 @@ ud->vert_line_pos = ud->page_top; makeNewpage (brlNode); } - logMessage(LOG_INFO, "Finish utd_finishLine"); + logMessage(LOG_DEBUG, "Finish utd_finishLine"); return 1; } @@ -5038,7 +5041,7 @@ int charactersWritten = 0; int newLineNeeded = 1; brlNode = firstBrlNode; - logMessage(LOG_INFO, "Begin utd_doOrdinaryText"); + logMessage(LOG_DEBUG, "Begin utd_doOrdinaryText"); while (brlNode) { logMessage(LOG_DEBUG, "Finding brlNode content"); @@ -5106,7 +5109,7 @@ prevBrlNode->_private = NULL; } brlNode = prevBrlNode; /*for utd_finishStyle */ - logMessage(LOG_INFO, "Finish utd_doOrdinaryText"); + logMessage(LOG_DEBUG, "Finish utd_doOrdinaryText"); return 1; } static int @@ -5136,7 +5139,7 @@ utd_fillPage () { PageStatus curPageStatus = checkPageStatus (); - logMessage(LOG_INFO, "Begin utd_fillPage"); + logMessage(LOG_DEBUG, "Begin utd_fillPage"); if (curPageStatus == topOfPage) { utd_startLine (); @@ -5145,7 +5148,7 @@ ud->vert_line_pos = ud->page_bottom - ud->normal_line; utd_startLine (); utd_finishLine (0, 0); - logMessage(LOG_INFO, "Finish utd_fillPage"); + logMessage(LOG_DEBUG, "Finish utd_fillPage"); return 1; } @@ -5156,7 +5159,7 @@ int cellsToWrite = 0; int availableCells = 0; int k; - logMessage(LOG_INFO, "Doing computer code"); + logMessage(LOG_DEBUG, "Begin utd_doComputerCode"); while (translatedBuffer[charactersWritten] == CR) charactersWritten++; while (charactersWritten < translatedLength) @@ -5211,7 +5214,7 @@ int k; unsigned int ch; int rowEnd = 0; - logMessage(LOG_INFO, "Begin utd_doAlignColumns"); + logMessage(LOG_DEBUG, "Begin utd_doAlignColumns"); for (bufPos = 0; bufPos < translatedLength; bufPos++) if (translatedBuffer[bufPos] == ESCAPE) break; @@ -5373,7 +5376,7 @@ utd_finishLine (0, cellsToWrite); } } - logMessage(LOG_INFO, "Finish utd_doAlignColumns"); + logMessage(LOG_DEBUG, "Finish utd_doAlignColumns"); return 1; } @@ -5442,7 +5445,7 @@ utd_styleBody () { sem_act action; - logMessage(LOG_INFO, "Begin utd_styleBody"); + logMessage(LOG_DEBUG, "Begin utd_styleBody"); if (!utd_editTrans ()) return 0; if (!ud->paragraphs) @@ -5497,7 +5500,7 @@ ud->sync_text_length = 0; ud->in_sync = ud->hyphenate; firstBrlNode = NULL; - logMessage(LOG_INFO, "Finish utd_styleBody"); + logMessage(LOG_DEBUG, "Finish utd_styleBody"); return 1; } @@ -5505,7 +5508,7 @@ utd_finishStyle () { PageStatus curPageStatus = checkPageStatus (); - logMessage(LOG_INFO, "Begin utd_finishStyle"); + logMessage(LOG_DEBUG, "Begin utd_finishStyle"); if (!ud->paragraphs) return 1; if (style->newpage_after) @@ -5521,7 +5524,7 @@ } } brlNode = firstBrlNode = NULL; - logMessage(LOG_INFO, "Finish utd_finishStyle"); + logMessage(LOG_DEBUG, "Finish utd_finishStyle"); return 1; } @@ -5602,7 +5605,7 @@ utd_finish () { xmlNode *newNode; - logMessage(LOG_INFO, "Begin utd_finish"); + logMessage(LOG_DEBUG, "Begin utd_finish"); if (ud->paragraphs) { newNode = xmlNewNode (NULL, (xmlChar *) "brl"); @@ -5637,6 +5640,6 @@ convert_utd (); else output_xml (ud->doc); - logMessage(LOG_INFO, "Finish utd_finish"); + logMessage(LOG_DEBUG, "Finish utd_finish"); return 1; } ======================================= --- /tools/file2brl.c Mon May 26 08:51:33 2014 UTC +++ /tools/file2brl.c Tue Jun 10 12:45:31 2014 UTC @@ -115,6 +115,7 @@ UserData *ud; int optc; + lbu_setLogLevel(LOG_DEBUG); lou_setLogLevel(LOG_DEBUG); set_program_name (argv[0]); logFileName[0] = 0; ============================================================================== Revision: 8af98f1b9e9e Branch: default Author: Michael Whapples Date: Wed Jun 18 09:23:57 2014 UTC Log: Removed unused boxline semantic action code. http://code.google.com/p/liblouisutdml/source/detail?r=8af98f1b9e9e Modified: /liblouisutdml/louisutdml.h /liblouisutdml/readconfig.c /liblouisutdml/sem_enum.h /liblouisutdml/sem_names.h /liblouisutdml/semantics.c /liblouisutdml/transcribe_chemistry.c /liblouisutdml/transcribe_computerCode.c /liblouisutdml/transcribe_document.c /liblouisutdml/transcribe_graphic.c /liblouisutdml/transcribe_music.c /liblouisutdml/transcribe_paragraph.c /liblouisutdml/transcriber.c ======================================= --- /liblouisutdml/louisutdml.h Mon May 26 13:10:29 2014 UTC +++ /liblouisutdml/louisutdml.h Wed Jun 18 09:23:57 2014 UTC @@ -87,6 +87,8 @@ int newline_after; int runningHead; sem_act emphasis; + const char topBoxline[1]; + const char bottomBoxline[1]; char name[1]; } StyleType; ======================================= --- /liblouisutdml/readconfig.c Thu Jun 5 16:25:54 2014 UTC +++ /liblouisutdml/readconfig.c Wed Jun 18 09:23:57 2014 UTC @@ -1118,6 +1118,10 @@ "18", "emphasis", "19", + "topBoxline", + "20", + "bottomBoxline", + "21", NULL }; static const char *formats[] = { @@ -1248,6 +1252,12 @@ nested->value); } break; + case 20: + memcpy(style->topBoxline, nested->value, 1); + break; + case 21: + memcpy(style->bottomBoxline, nested->value, 1); + break; default: configureError (nested, "Program error in readconfig.c"); continue; ======================================= --- /liblouisutdml/sem_enum.h Thu May 30 02:32:45 2013 UTC +++ /liblouisutdml/sem_enum.h Wed Jun 18 09:23:57 2014 UTC @@ -82,7 +82,6 @@ attrtotext, runninghead, footer, - boxline, italicx, boldx, underlinex, ======================================= --- /liblouisutdml/sem_names.h Thu May 30 02:32:45 2013 UTC +++ /liblouisutdml/sem_names.h Wed Jun 18 09:23:57 2014 UTC @@ -46,7 +46,6 @@ "attrtotext", "runninghead", "footer", - "boxline", "italicx", "boldx", "underlinex", ======================================= --- /liblouisutdml/semantics.c Mon Jun 2 08:45:16 2014 UTC +++ /liblouisutdml/semantics.c Wed Jun 18 09:23:57 2014 UTC @@ -1633,9 +1633,6 @@ break; insert_linkOrTarget (macroNode, 1); break; - case boxline: - do_boxline (macroNode); - break; case blankline: do_blankline (); break; ======================================= --- /liblouisutdml/transcribe_chemistry.c Wed Apr 6 19:57:47 2011 UTC +++ /liblouisutdml/transcribe_chemistry.c Wed Jun 18 09:23:57 2014 UTC @@ -131,8 +131,6 @@ case softreturn: insert_code (node, 0); break; - case boxline: - break; case blankline: break; case newpage: ======================================= --- /liblouisutdml/transcribe_computerCode.c Mon Nov 11 18:34:05 2013 UTC +++ /liblouisutdml/transcribe_computerCode.c Wed Jun 18 09:23:57 2014 UTC @@ -114,8 +114,6 @@ { case softreturn: break; - case boxline: - break; case blankline: break; case newpage: ======================================= --- /liblouisutdml/transcribe_document.c Mon Oct 21 01:52:56 2013 UTC +++ /liblouisutdml/transcribe_document.c Wed Jun 18 09:23:57 2014 UTC @@ -39,6 +39,7 @@ StyleType *style; xmlNode *child; int childrenDone = 0; + logMessage(LOG_DEBUG, "Begin transcribe_document"); ud->top = -1; ud->style_top = -1; ud->text_length = 0; @@ -143,5 +144,6 @@ end_style (); end_document (); pop_sem_stack (); + logMessage(LOG_DEBUG, "Finished transcribe_document"); return 1; } ======================================= --- /liblouisutdml/transcribe_graphic.c Wed Apr 6 19:57:47 2011 UTC +++ /liblouisutdml/transcribe_graphic.c Wed Jun 18 09:23:57 2014 UTC @@ -115,8 +115,6 @@ case softreturn: insert_code (node, 0); break; - case boxline: - break; case blankline: break; case newpage: ======================================= --- /liblouisutdml/transcribe_music.c Wed Apr 6 19:57:47 2011 UTC +++ /liblouisutdml/transcribe_music.c Wed Jun 18 09:23:57 2014 UTC @@ -115,8 +115,6 @@ case softreturn: insert_code (node, 0); break; - case boxline: - break; case blankline: break; case newpage: ======================================= --- /liblouisutdml/transcribe_paragraph.c Mon May 26 08:51:33 2014 UTC +++ /liblouisutdml/transcribe_paragraph.c Wed Jun 18 09:23:57 2014 UTC @@ -194,6 +194,7 @@ xmlNode *child; int branchCount = 0; int i; + logMessage(LOG_DEBUG, "Begin transcribe_paragraph"); if (node == NULL) return 0; if (ud->top == 0) @@ -242,11 +243,6 @@ if (action != 0) pop_sem_stack (); return 1; - case boxline: - do_boxline (node); - if (node->children == NULL) - return 1; - break; case pagebreak: do_pagebreak (node); return 1; @@ -325,6 +321,7 @@ if (is_macro (node)) { haveMacro = 1; + logMessage(LOG_DEBUG, "Node has macro"); start_macro (node); } else if ((style = is_style (node)) != NULL) @@ -335,6 +332,7 @@ pop_sem_stack (); return 0; } + logMessage(LOG_DEBUG, "Node has style"); start_style (style, node); } child = node->children; @@ -569,5 +567,6 @@ insert_translation (ud->main_braille_table); write_paragraph (para, NULL); } + logMessage(LOG_DEBUG, "Finished transcribe_paragraph"); return 1; } ======================================= --- /liblouisutdml/transcriber.c Tue Jun 10 12:45:31 2014 UTC +++ /liblouisutdml/transcriber.c Wed Jun 18 09:23:57 2014 UTC @@ -40,6 +40,7 @@ static StyleType *style; static StyleType *prevStyle; static int styleBody (); +static int addBoxline(const char *boxChar); int fineFormat () @@ -723,20 +724,28 @@ { memset (ud->typeform, 0, sizeof (ud->typeform)); ud->text_length = 0;+ logMessage(LOG_DEBUG, "Finished insert_translation, table not defined");
return 0; } if (ud->text_length == 0) + {+ logMessage(LOG_DEBUG, "Finished insert_translation, no text to translate");
return 1; + } for (k = 0; k < ud->text_length && ud->text_buffer[k] <= 32; k++); if (k == ud->text_length) { ud->text_length = 0;+ logMessage(LOG_DEBUG, "Finished insert_translation, only whitespace");
return 1; } if (styleSpec != NULL && styleSpec->status == resumeBody) styleSpec->status = bodyInterrupted; if (ud->format_for == utd) + {+ logMessage(LOG_DEBUG, "Finished insert_translation, delegating to utd_insert_translation");
return (utd_insert_translation (table)); + } if (ud->translated_length > 0 && ud->translated_length < MAX_TRANS_LENGTH && ud->translated_buffer[ud->translated_length - 1] > 32) @@ -787,8 +796,12 @@ { ud->translated_length = MAX_TRANS_LENGTH; if (!write_paragraph (para, NULL)) + {+ logMessage(LOG_DEBUG, "Finished insert_translation, issue with write_paragraph");
return 0; + } } + logMessage(LOG_DEBUG, "Finished insert_translation"); return 1; } @@ -1110,6 +1123,7 @@ if (ud->format_for == utd) { utd_insert_text (node, length); + logMessage(LOG_DEBUG, "Finished insert_text"); return; } switch (ud->stack[ud->top]) @@ -1131,9 +1145,11 @@ } ud->translated_length += ud->text_length; ud->text_length = 0;+ logMessage(LOG_DEBUG, "Finished insert_text, notranslate action used");
return; case pagenum: handlePagenum (node->content, length); + logMessage(LOG_DEBUG, "Finished insert_text, pagenum action used"); return; default: break; @@ -1141,6 +1157,7 @@ ud->old_text_length = ud->text_length; insert_utf8 (node->content); setEmphasis (); + logMessage(LOG_DEBUG, "Finished insert_text"); } static int @@ -2848,6 +2865,10 @@ else if (style->newpage_before) fillPage (); } + if (style->topBoxline[0]) + { + addBoxline(style->topBoxline); + } writeOutbuf (); ud->blank_lines = maximum (ud->blank_lines, style->lines_before); @@ -2971,6 +2992,10 @@ /*Skip lines or pages after body*/ if (ud->format_for == utd) return utd_finishStyle (); + if (style->bottomBoxline[0]) + { + addBoxline(style->bottomBoxline); + } if (ud->braille_pages) { if (style->newpage_after) @@ -2988,7 +3013,10 @@ logMessage(LOG_DEBUG, "Begin write_paragraph"); if (!((ud->text_length > 0 || ud->translated_length > 0) && ud->style_top >= 0)) + { + logMessage(LOG_DEBUG, "Finished write_paragraph, no text translated"); return 1; + } holdStyle = action_to_style (action); if (holdStyle == NULL) holdStyle = lookup_style ("para"); @@ -3470,6 +3498,29 @@ return 1; } +static int +addBoxline(const char *boxChar) +{ + int k; + int availableCells = 0; + widechar wTmpBuf = (widechar)boxChar[0]; + logMessage(LOG_DEBUG, "Begin addBoxline"); + while (availableCells != ud->cells_per_line) + { + finishLine(); + availableCells = startLine(); + } + logMessage(LOG_DEBUG, "availableCells=%d", availableCells); + for (k = 0; k < availableCells; k++) + { + ud->outbuf1[k+ud->outbuf1_len_so_far] = wTmpBuf; + } + ud->outbuf1_len_so_far += availableCells; + cellsWritten += availableCells; + finishLine(); + logMessage(LOG_DEBUG, "Finished addBoxline"); + return 1; +} int doBoxline (xmlNode * node) { @@ -3501,13 +3552,6 @@ logMessage(LOG_DEBUG, "Finished doBoxline"); return 1; } - -int -do_boxline (xmlNode * node) -{ - fineFormat (); - return doBoxline (node); -} int do_newpage () ============================================================================== Revision: bd31b439edc3 Branch: default Author: Michael Whapples Date: Wed Jun 18 09:29:21 2014 UTC Log: More unused code removal. http://code.google.com/p/liblouisutdml/source/detail?r=bd31b439edc3 Modified: /liblouisutdml/transcriber.c ======================================= --- /liblouisutdml/transcriber.c Wed Jun 18 09:23:57 2014 UTC +++ /liblouisutdml/transcriber.c Wed Jun 18 09:29:21 2014 UTC @@ -3521,37 +3521,6 @@ logMessage(LOG_DEBUG, "Finished addBoxline"); return 1; } -int -doBoxline (xmlNode * node) -{ - widechar boxChar; - widechar boxLine[MAXNAMELEN]; - int k; - int start = ud->text_length; - int availableCells; - logMessage(LOG_DEBUG, "Begin doBoxline"); - logMessage(LOG_DEBUG, "start=%d", start); - insert_code (node, 0); - if (!(ud->text_length - start)) - return 0; - boxChar = ud->text_buffer[start]; - ud->text_length = start; - cellsWritten = 0; - availableCells = startLine (); - while (availableCells != ud->cells_per_line) - { - finishLine (); - availableCells = startLine (); - } - for (k = 0; k < availableCells; k++) - boxLine[k] = boxChar; - if (!insertWidechars (boxLine, availableCells)) - return 0; - cellsWritten = ud->cells_per_line; - finishLine (); - logMessage(LOG_DEBUG, "Finished doBoxline"); - return 1; -} int do_newpage () For a description of the software, to download it and links to project pages go to http://www.abilitiessoft.com