]> git.saurik.com Git - wxWidgets.git/blob - utils/tex2rtf/src/rtfutils.h
glibc's vswprintf doesn't nul terminate on truncation.
[wxWidgets.git] / utils / tex2rtf / src / rtfutils.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: rtfutils.h
3 // Purpose: RTF-specific code
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 7.9.93
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 /*
13 * Write a suitable RTF header.
14 *
15 */
16
17 void WriteRTFHeader(FILE *fd);
18
19 /*
20 * Given a TexChunk with a string value, scans through the string
21 * converting Latex-isms into RTF-isms, such as 2 newlines -> \par,
22 * and inserting spaces at the start of lines since in Latex, a newline
23 * implies a space, but not in RTF.
24 *
25 */
26
27 void ProcessText2RTF(TexChunk *chunk);
28
29 /*
30 * Scan through all chunks starting from the given one,
31 * calling ProcessText2RTF to convert Latex-isms to RTF-isms.
32 * This should be called after Tex2Any has parsed the file,
33 * and before TraverseDocument is called.
34 *
35 */
36
37 void Text2RTF(TexChunk *chunk);
38
39
40 /*
41 * Keeping track of environments to restore the styles after \pard.
42 * Push strings like "\qc" onto stack.
43 *
44 */
45
46 void PushEnvironmentStyle(wxChar *style);
47
48 void PopEnvironmentStyle(void);
49
50 // Write out the styles, most recent first.
51 void WriteEnvironmentStyles(void);
52
53 // Called on start/end of macro examination
54 void DefaultRtfOnMacro(wxChar *name, int no_args, bool start);
55
56 // Called on start/end of argument examination
57 bool DefaultRtfOnArgument(wxChar *macro_name, int arg_no, bool start);
58
59 // Reset memory of which levels have 'books' (for WinHelp 4 contents file)
60 void ResetContentsLevels(int level);