"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "htmldoc/toc.cxx" between
htmldoc-1.9.12-source.tar.gz and htmldoc-1.9.13-source.tar.gz

About: HTMLDOC converts HTML and Markdown source files into indexed HTML, EPUB, PostScript, or PDF files (but doesn’t support CSS).

toc.cxx  (htmldoc-1.9.12-source):toc.cxx  (htmldoc-1.9.13-source)
skipping to change at line 119 skipping to change at line 119
{ {
tree_t *parent; /* Parent of toc entry (DD or LI) */ tree_t *parent; /* Parent of toc entry (DD or LI) */
tree_t *target, /* Link target */ tree_t *target, /* Link target */
*temp; /* Looping var */ *temp; /* Looping var */
uchar heading[255], /* Heading numbers */ uchar heading[255], /* Heading numbers */
link[255], /* Actual link */ link[255], /* Actual link */
baselink[255], /* Base link (numbered) */ baselink[255], /* Base link (numbered) */
*existing; /* Existing link string */ *existing; /* Existing link string */
int i, level; /* Header level */ int i, level; /* Header level */
uchar *var; /* Starting value/type for this level */ uchar *var; /* Starting value/type for this level */
static const char *ones[10] =
{
"", "i", "ii", "iii", "iv",
"v", "vi", "vii", "viii", "ix"
},
*tens[10] =
{
"", "x", "xx", "xxx", "xl",
"l", "lx", "lxx", "lxxx", "xc"
},
*hundreds[10] =
{
"", "c", "cc", "ccc", "cd",
"d", "dc", "dcc", "dccc", "cm"
},
*ONES[10] =
{
"", "I", "II", "III", "IV",
"V", "VI", "VII", "VIII", "IX"
},
*TENS[10] =
{
"", "X", "XX", "XXX", "XL",
"L", "LX", "LXX", "LXXX", "XC"
},
*HUNDREDS[10] =
{
"", "C", "CC", "CCC", "CD",
"D", "DC", "DCC", "DCCC", "CM"
};
while (t != NULL) while (t != NULL)
{ {
switch (t->markup) switch (t->markup)
{ {
case MARKUP_H1 : case MARKUP_H1 :
case MARKUP_H2 : case MARKUP_H2 :
case MARKUP_H3 : case MARKUP_H3 :
case MARKUP_H4 : case MARKUP_H4 :
case MARKUP_H5 : case MARKUP_H5 :
skipping to change at line 208 skipping to change at line 178
for (i = 0; i <= level; i ++) for (i = 0; i <= level; i ++)
{ {
uchar *baseptr = baselink + strlen((char *)baselink); uchar *baseptr = baselink + strlen((char *)baselink);
uchar *headptr = heading + strlen((char *)heading); uchar *headptr = heading + strlen((char *)heading);
if (i == 0) if (i == 0)
snprintf((char *)baseptr, sizeof(baselink) - (size_t)(baseptr - ba selink), "%d", TocDocCount); snprintf((char *)baseptr, sizeof(baselink) - (size_t)(baseptr - ba selink), "%d", TocDocCount);
else else
snprintf((char *)baseptr, sizeof(baselink) - (size_t)(baseptr - ba selink), "%d", heading_numbers[i]); snprintf((char *)baseptr, sizeof(baselink) - (size_t)(baseptr - ba selink), "%d", heading_numbers[i]);
switch (heading_types[i]) strlcpy((char *)headptr, format_number(heading_numbers[i], heading_t
{ ypes[i]), sizeof(heading) - (size_t)(headptr - heading));
case '1' :
snprintf((char *)headptr, sizeof(heading) - (size_t)(headptr -
heading), "%d", heading_numbers[i]);
break;
case 'a' :
if (heading_numbers[i] > 26)
snprintf((char *)headptr, sizeof(heading) - (size_t)(headptr
- heading), "%c%c", 'a' + (heading_numbers[i] / 26) - 1, 'a' + (heading_numbers
[i] % 26) - 1);
else
snprintf((char *)headptr, sizeof(heading) - (size_t)(headptr
- heading), "%c", 'a' + heading_numbers[i] - 1);
break;
case 'A' :
if (heading_numbers[i] > 26)
snprintf((char *)headptr, sizeof(heading) - (size_t)(headptr
- heading), "%c%c", 'A' + (heading_numbers[i] / 26) - 1, 'A' + (heading_numbers
[i] % 26) - 1);
else
snprintf((char *)headptr, sizeof(heading) - (size_t)(headptr
- heading), "%c", 'A' + heading_numbers[i] - 1);
break;
case 'i' :
snprintf((char *)headptr, sizeof(heading) - (size_t)(headptr -
heading), "%s%s%s", hundreds[heading_numbers[i] / 100], tens[(heading_numbers[i
] / 10) % 10], ones[heading_numbers[i] % 10]);
break;
case 'I' :
snprintf((char *)headptr, sizeof(heading) - (size_t)(headptr -
heading), "%s%s%s", HUNDREDS[heading_numbers[i] / 100], TENS[(heading_numbers[i
] / 10) % 10], ONES[heading_numbers[i] % 10]);
break;
}
if (i < level) if (i < level)
{ {
strlcat((char *)heading, ".", sizeof(heading)); strlcat((char *)heading, ".", sizeof(heading));
strlcat((char *)baselink, "_", sizeof(baselink)); strlcat((char *)baselink, "_", sizeof(baselink));
} }
} }
/* /*
* See if we have an existing <A NAME=...> or <A ID=...> for this * See if we have an existing <A NAME=...> or <A ID=...> for this
 End of changes. 2 change blocks. 
65 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)