160 lines
6.0 KiB
Plaintext
160 lines
6.0 KiB
Plaintext
$NetBSD: patch-ab,v 1.2 2004/03/30 18:23:46 ben Exp $
|
|
|
|
--- htmlutil.cpp.orig Fri Jun 7 11:01:36 2002
|
|
+++ htmlutil.cpp
|
|
@@ -1,4 +1,4 @@
|
|
-/////////////////////////////////////////////////////////////////////////////
|
|
+////////////////////////////////////////////////////////////////////////////
|
|
// Name: htmlutil.cpp
|
|
// Purpose: Converts Latex to HTML
|
|
// Author: Julian Smart
|
|
@@ -191,7 +191,7 @@ void ReopenFile(FILE **fd, char **fileNa
|
|
else
|
|
sprintf(buf, "%s%d.html", FileRoot, fileId);
|
|
if (*fileName) delete[] *fileName;
|
|
- *fileName = copystring(FileNameFromPath(buf));
|
|
+ *fileName = copystring(wxFileNameFromPath(buf));
|
|
*fd = fopen(buf, "w");
|
|
fprintf(*fd, "<HTML>\n");
|
|
}
|
|
@@ -426,13 +426,13 @@ void AddBrowseButtons(char *upLabel, cha
|
|
if (truncateFilenames)
|
|
{
|
|
char buf1[80];
|
|
- strcpy(buf1, ConvertCase(FileNameFromPath(FileRoot)));
|
|
+ strcpy(buf1, ConvertCase(wxFileNameFromPath(FileRoot)));
|
|
sprintf(buf, "\n<A HREF=\"%s.%s\">%s</A> ", buf1, ConvertCase("htm"), contentsReference);
|
|
}
|
|
else
|
|
{
|
|
char buf1[80];
|
|
- strcpy(buf1, ConvertCase(FileNameFromPath(FileRoot)));
|
|
+ strcpy(buf1, ConvertCase(wxFileNameFromPath(FileRoot)));
|
|
sprintf(buf, "\n<A HREF=\"%s%s\">%s</A> ", buf1, ConvertCase("_contents.html"), contentsReference);
|
|
}
|
|
// TexOutput("<NOFRAMES>");
|
|
@@ -708,9 +708,9 @@ void HTMLOnMacro(int macroId, int no_arg
|
|
|
|
char titleBuf[200];
|
|
if (truncateFilenames)
|
|
- sprintf(titleBuf, "%s.htm", FileNameFromPath(FileRoot));
|
|
+ sprintf(titleBuf, "%s.htm", wxFileNameFromPath(FileRoot));
|
|
else
|
|
- sprintf(titleBuf, "%s_contents.html", FileNameFromPath(FileRoot));
|
|
+ sprintf(titleBuf, "%s_contents.html", wxFileNameFromPath(FileRoot));
|
|
|
|
fprintf(Chapters, "<A NAME=\"%s\"></A>", topicName);
|
|
|
|
@@ -2708,9 +2708,9 @@ bool HTMLOnArgument(int macroId, int arg
|
|
|
|
char titleBuf[150];
|
|
if (truncateFilenames)
|
|
- sprintf(titleBuf, "%s.htm", FileNameFromPath(FileRoot));
|
|
+ sprintf(titleBuf, "%s.htm", wxFileNameFromPath(FileRoot));
|
|
else
|
|
- sprintf(titleBuf, "%s_contents.html", FileNameFromPath(FileRoot));
|
|
+ sprintf(titleBuf, "%s_contents.html", wxFileNameFromPath(FileRoot));
|
|
|
|
HTMLHead();
|
|
TexOutput("<title>");
|
|
@@ -2919,7 +2919,7 @@ bool HTMLGo(void)
|
|
OnError("Cannot open output file!");
|
|
return FALSE;
|
|
}
|
|
- AddTexRef("contents", FileNameFromPath(TitlepageName), ContentsNameString);
|
|
+ AddTexRef("contents", wxFileNameFromPath(TitlepageName), ContentsNameString);
|
|
|
|
fprintf(Contents, "<P><P><H2>%s</H2><P><P>\n", ContentsNameString);
|
|
|
|
@@ -3003,7 +3003,7 @@ bool HTMLGo(void)
|
|
if (contentsString)
|
|
fprintf(tmpTitle, "<TITLE>%s</TITLE></HEAD>\n\n", contentsString);
|
|
else
|
|
- fprintf(tmpTitle, "<TITLE>%s</TITLE></HEAD>\n\n", FileNameFromPath(FileRoot));
|
|
+ fprintf(tmpTitle, "<TITLE>%s</TITLE></HEAD>\n\n", wxFileNameFromPath(FileRoot));
|
|
}
|
|
|
|
// Output frame information
|
|
@@ -3017,8 +3017,8 @@ bool HTMLGo(void)
|
|
|
|
fprintf(tmpTitle, "<FRAMESET COLS=\"30%%,70%%\">\n");
|
|
|
|
- fprintf(tmpTitle, "<FRAME SRC=\"%s\">\n", ConvertCase(FileNameFromPath(contentsFrameName)));
|
|
- fprintf(tmpTitle, "<FRAME SRC=\"%s\" NAME=\"mainwindow\">\n", ConvertCase(FileNameFromPath(firstFileName)));
|
|
+ fprintf(tmpTitle, "<FRAME SRC=\"%s\">\n", ConvertCase(wxFileNameFromPath(contentsFrameName)));
|
|
+ fprintf(tmpTitle, "<FRAME SRC=\"%s\" NAME=\"mainwindow\">\n", ConvertCase(wxFileNameFromPath(firstFileName)));
|
|
fprintf(tmpTitle, "</FRAMESET>\n");
|
|
|
|
fprintf(tmpTitle, "<NOFRAMES>\n");
|
|
@@ -3049,7 +3049,7 @@ bool HTMLGo(void)
|
|
fprintf(tmpTitle, "\n</HTML>\n");
|
|
|
|
fclose(tmpTitle);
|
|
- if (FileExists(TitlepageName)) wxRemoveFile(TitlepageName);
|
|
+ if (wxFileExists(TitlepageName)) wxRemoveFile(TitlepageName);
|
|
if (!wxRenameFile("title.tmp", TitlepageName))
|
|
{
|
|
wxCopyFile("title.tmp", TitlepageName);
|
|
@@ -3062,7 +3062,7 @@ bool HTMLGo(void)
|
|
if (lastTopic) delete[] lastTopic;
|
|
lastTopic = NULL;
|
|
|
|
- if (FileExists(ContentsName)) wxRemoveFile(ContentsName);
|
|
+ if (wxFileExists(ContentsName)) wxRemoveFile(ContentsName);
|
|
|
|
if (!wxRenameFile(TmpContentsName, ContentsName))
|
|
{
|
|
@@ -3147,11 +3147,11 @@ void GenerateHTMLWorkshopFiles(char *fna
|
|
"Default topic=%s\n"
|
|
"Index file=%s.hhk\n"
|
|
"Title=",
|
|
- FileNameFromPath(fname),
|
|
- FileNameFromPath(fname),
|
|
- FileNameFromPath(fname),
|
|
- FileNameFromPath(TitlepageName),
|
|
- FileNameFromPath(fname)
|
|
+ wxFileNameFromPath(fname),
|
|
+ wxFileNameFromPath(fname),
|
|
+ wxFileNameFromPath(fname),
|
|
+ wxFileNameFromPath(TitlepageName),
|
|
+ wxFileNameFromPath(fname)
|
|
);
|
|
|
|
if (DocumentTitle) {
|
|
@@ -3162,19 +3162,19 @@ void GenerateHTMLWorkshopFiles(char *fna
|
|
|
|
fprintf(f, "\n\n[WINDOWS]\n"
|
|
"%sHelp=,\"%s.hhc\",\"%s.hhk\",\"%s\",,,,,,0x2420,,0x380e,,,,,0,,,",
|
|
- FileNameFromPath(fname),
|
|
- FileNameFromPath(fname),
|
|
- FileNameFromPath(fname),
|
|
- FileNameFromPath(TitlepageName));
|
|
+ wxFileNameFromPath(fname),
|
|
+ wxFileNameFromPath(fname),
|
|
+ wxFileNameFromPath(fname),
|
|
+ wxFileNameFromPath(TitlepageName));
|
|
|
|
|
|
fprintf(f, "\n\n[FILES]\n");
|
|
- fprintf(f, "%s\n", FileNameFromPath(TitlepageName));
|
|
+ fprintf(f, "%s\n", wxFileNameFromPath(TitlepageName));
|
|
for (int i = 1; i <= fileId; i++) {
|
|
if (truncateFilenames)
|
|
- sprintf(buf, "%s%d.htm", FileNameFromPath(FileRoot), i);
|
|
+ sprintf(buf, "%s%d.htm", wxFileNameFromPath(FileRoot), i);
|
|
else
|
|
- sprintf(buf, "%s%d.html", FileNameFromPath(FileRoot), i);
|
|
+ sprintf(buf, "%s%d.html", wxFileNameFromPath(FileRoot), i);
|
|
fprintf(f, "%s\n", buf);
|
|
}
|
|
fclose(f);
|
|
@@ -3278,7 +3278,7 @@ void HTMLWorkshopStartContents()
|
|
"<LI> <OBJECT type=\"text/sitemap\">\n"
|
|
"<param name=\"Local\" value=\"%s\">\n"
|
|
"<param name=\"Name\" value=\"Contents\">\n</OBJECT>\n",
|
|
- FileNameFromPath(TitlepageName)
|
|
+ wxFileNameFromPath(TitlepageName)
|
|
);
|
|
|
|
}
|