00001
00002
00003
00004
00005
00006
00007
00008
00009 #if !defined(__antiword_h)
00010 #define __antiword_h 1
00011
00012 #if defined(DEBUG) == defined(NDEBUG)
00013 #error Exactly one of the DEBUG and NDEBUG flags MUST be set
00014 #endif
00015
00016 #include <stdio.h>
00017 #include <limits.h>
00018 #if defined(__riscos)
00019 #include "DeskLib:Font.h"
00020 #include "DeskLib:Wimp.h"
00021 #include "Desklib:Window.h"
00022 #include "drawfile.h"
00023 #define window_ANY event_ANY
00024 #define icon_ANY event_ANY
00025 #else
00026 #include <sys/types.h>
00027 #endif
00028 #include "wordconst.h"
00029 #include "wordtypes.h"
00030 #include "fail.h"
00031 #include "debug.h"
00032
00033
00034 #if !defined(PATH_MAX)
00035 #if defined(__riscos)
00036 #define PATH_MAX 255
00037 #else
00038 #if defined(MAXPATHLEN)
00039 #define PATH_MAX MAXPATHLEN
00040 #else
00041 #define PATH_MAX 255
00042 #endif
00043 #endif
00044 #endif
00045
00046 #if !defined(CHAR_BIT)
00047 #define CHAR_BIT 8
00048 #endif
00049
00050 #if !defined(TIME_T_MIN)
00051 #define TIME_T_MIN ((time_t)0 < (time_t)-1 ?\
00052 (time_t)0 :\
00053 (time_t)1 << (sizeof(time_t) * CHAR_BIT - 1))
00054 #endif
00055
00056 #if !defined(TIME_T_MAX)
00057 #if defined(__TURBOC__)
00058 #define TIME_T_MAX (LONG_MAX)
00059 #else
00060 #define TIME_T_MAX (~(time_t)0 - TIME_T_MIN)
00061 #endif
00062 #endif
00063
00064 #if !defined(SIZE_T_MAX)
00065 #define SIZE_T_MAX (~(size_t)0)
00066 #endif
00067
00068 #if defined(__riscos)
00069 #define FILE_SEPARATOR "."
00070 #elif defined(__dos) || defined(__CYGMING__)
00071 #define FILE_SEPARATOR "\\"
00072 #else
00073 #define FILE_SEPARATOR "/"
00074 #endif
00075
00076
00077 #define PNG_CN_IDAT 0x49444154
00078 #define PNG_CN_IEND 0x49454e44
00079 #define PNG_CN_IHDR 0x49484452
00080 #define PNG_CN_PLTE 0x504c5445
00081
00082
00083 #define MIN_SCREEN_WIDTH 45
00084 #define DEFAULT_SCREEN_WIDTH 76
00085 #define MAX_SCREEN_WIDTH 145
00086
00087 #if defined(__riscos)
00088
00089 #define MIN_SCALE_FACTOR 25
00090 #define DEFAULT_SCALE_FACTOR 100
00091 #define MAX_SCALE_FACTOR 400
00092
00093
00094 #define FILETYPE_MSWORD 0xae6
00095 #define FILETYPE_DRAW 0xaff
00096 #define FILETYPE_JPEG 0xc85
00097 #define FILETYPE_POSCRIPT 0xff5
00098 #define FILETYPE_SPRITE 0xff9
00099 #define FILETYPE_TEXT 0xfff
00100
00101
00102 #define CHOICES_DEFAULT_BUTTON 3
00103 #define CHOICES_SAVE_BUTTON 2
00104 #define CHOICES_CANCEL_BUTTON 1
00105 #define CHOICES_APPLY_BUTTON 0
00106 #define CHOICES_BREAK_BUTTON 6
00107 #define CHOICES_BREAK_WRITEABLE 7
00108 #define CHOICES_BREAK_UP_BUTTON 8
00109 #define CHOICES_BREAK_DOWN_BUTTON 9
00110 #define CHOICES_NO_BREAK_BUTTON 11
00111 #define CHOICES_AUTOFILETYPE_BUTTON 14
00112 #define CHOICES_HIDDEN_TEXT_BUTTON 22
00113 #define CHOICES_WITH_IMAGES_BUTTON 17
00114 #define CHOICES_NO_IMAGES_BUTTON 18
00115 #define CHOICES_TEXTONLY_BUTTON 19
00116 #define CHOICES_SCALE_WRITEABLE 25
00117 #define CHOICES_SCALE_UP_BUTTON 26
00118 #define CHOICES_SCALE_DOWN_BUTTON 27
00119
00120
00121 #define SCALE_CANCEL_BUTTON 1
00122 #define SCALE_SCALE_BUTTON 0
00123 #define SCALE_SCALE_WRITEABLE 3
00124 #define SCALE_50_PCT 5
00125 #define SCALE_75_PCT 6
00126 #define SCALE_100_PCT 7
00127 #define SCALE_150_PCT 8
00128
00129
00130 #define SAVEMENU_SCALEVIEW 0
00131 #define SAVEMENU_SAVEDRAW 1
00132 #define SAVEMENU_SAVETEXT 2
00133 #else
00134
00135 #define PS_LEFT_MARGIN (72 * 640L)
00136 #define PS_RIGHT_MARGIN (48 * 640L)
00137 #define PS_TOP_MARGIN (72 * 640L)
00138 #define PS_BOTTOM_MARGIN (72 * 640L)
00139 #endif
00140
00141
00142 #define STREQ(x,y) (*(x) == *(y) && strcmp(x,y) == 0)
00143 #define STRNEQ(x,y,n) (*(x) == *(y) && strncmp(x,y,n) == 0)
00144 #if defined(__dos) || defined(__EMX__)
00145 #define STRCEQ(x,y) (stricmp(x,y) == 0)
00146 #else
00147 #define STRCEQ(x,y) (strcasecmp(x,y) == 0)
00148 #endif
00149 #define elementsof(a) (sizeof(a) / sizeof(a[0]))
00150 #define odd(x) (((x)&0x01)!=0)
00151 #define ROUND4(x) (((x)+3)&~0x03)
00152 #define ROUND128(x) (((x)+127)&~0x7f)
00153 #define BIT(x) (1UL << (x))
00154 #if !defined(max)
00155 #define max(x,y) ((x)>(y)?(x):(y))
00156 #endif
00157 #if !defined(min)
00158 #define min(x,y) ((x)<(y)?(x):(y))
00159 #endif
00160
00161 #if defined(__riscos)
00162
00163 #define TABLE_FONT "Corpus.Medium"
00164
00165 #define FONT_MONOSPACED_PLAIN "Corpus.Medium"
00166 #define FONT_MONOSPACED_BOLD "Corpus.Bold"
00167 #define FONT_MONOSPACED_ITALIC "Corpus.Medium.Oblique"
00168 #define FONT_MONOSPACED_BOLDITALIC "Corpus.Bold.Oblique"
00169 #define FONT_SERIF_PLAIN "Trinity.Medium"
00170 #define FONT_SERIF_BOLD "Trinity.Bold"
00171 #define FONT_SERIF_ITALIC "Trinity.Medium.Italic"
00172 #define FONT_SERIF_BOLDITALIC "Trinity.Bold.Italic"
00173 #define FONT_SANS_SERIF_PLAIN "Homerton.Medium"
00174 #define FONT_SANS_SERIF_BOLD "Homerton.Bold"
00175 #define FONT_SANS_SERIF_ITALIC "Homerton.Medium.Oblique"
00176 #define FONT_SANS_SERIF_BOLDITALIC "Homerton.Bold.Oblique"
00177 #else
00178
00179 #define TABLE_FONT "Courier"
00180
00181 #define FONT_MONOSPACED_PLAIN "Courier"
00182 #define FONT_MONOSPACED_BOLD "Courier-Bold"
00183 #define FONT_MONOSPACED_ITALIC "Courier-Oblique"
00184 #define FONT_MONOSPACED_BOLDITALIC "Courier-BoldOblique"
00185 #define FONT_SERIF_PLAIN "Times-Roman"
00186 #define FONT_SERIF_BOLD "Times-Bold"
00187 #define FONT_SERIF_ITALIC "Times-Italic"
00188 #define FONT_SERIF_BOLDITALIC "Times-BoldItalic"
00189 #define FONT_SANS_SERIF_PLAIN "Helvetica"
00190 #define FONT_SANS_SERIF_BOLD "Helvetica-Bold"
00191 #define FONT_SANS_SERIF_ITALIC "Helvetica-Oblique"
00192 #define FONT_SANS_SERIF_BOLDITALIC "Helvetica-BoldOblique"
00193
00194 #if defined(__dos)
00195 #define GLOBAL_ANTIWORD_DIR "C:\\antiword"
00196 #define ANTIWORD_DIR "antiword"
00197 #define FONTNAMES_FILE "fontname.txt"
00198 #elif defined(__amigaos)
00199 #define GLOBAL_ANTIWORD_DIR "SYS:.antiword"
00200 #define ANTIWORD_DIR ".antiword"
00201 #define FONTNAMES_FILE "fontnames"
00202 #elif defined(N_PLAT_NLM)
00203 #define GLOBAL_ANTIWORD_DIR "SYS:/antiword"
00204 #define ANTIWORD_DIR "antiword"
00205 #define FONTNAMES_FILE "fontname.txt"
00206 #elif defined(__vms)
00207 #define GLOBAL_ANTIWORD_DIR "/usr/share/antiword"
00208 #define ANTIWORD_DIR "antiword"
00209 #define FONTNAMES_FILE "fontnames"
00210 #elif defined(__BEOS__)
00211 #define GLOBAL_ANTIWORD_DIR "/boot/home/config/apps/antiword"
00212 #define ANTIWORD_DIR "antiword"
00213 #define FONTNAMES_FILE "fontnames"
00214 #elif defined(__CYGMING__)
00215 #define GLOBAL_ANTIWORD_DIR "C:\\antiword"
00216 #define ANTIWORD_DIR "antiword"
00217 #define FONTNAMES_FILE "fontnames"
00218 #elif defined(__Plan9__)
00219 #define GLOBAL_ANTIWORD_DIR "/sys/lib/antiword"
00220 #define ANTIWORD_DIR "lib/antiword"
00221 #define FONTNAMES_FILE "fontnames"
00222 #elif defined(__sun__)
00223 #define GLOBAL_ANTIWORD_DIR "/usr/local/share/antiword"
00224 #define ANTIWORD_DIR
00225 #define FONTNAMES_FILE "fontnames"
00226 #else
00227 #define GLOBAL_ANTIWORD_DIR "/usr/share/antiword"
00228 #define ANTIWORD_DIR ".antiword"
00229 #define FONTNAMES_FILE "fontnames"
00230 #endif
00231
00232
00233 #define MAPPING_FILE_CP437 "cp437.txt"
00234
00235 #define MAPPING_FILE_8859_1 "8859-1.txt"
00236
00237 #define MAPPING_FILE_8859_2 "8859-2.txt"
00238 #define MAPPING_FILE_CP852 "cp852.txt"
00239 #define MAPPING_FILE_CP1250 "cp1250.txt"
00240
00241 #define MAPPING_FILE_8859_5 "8859-5.txt"
00242 #define MAPPING_FILE_KOI8_R "koi8-r.txt"
00243 #define MAPPING_FILE_KOI8_U "koi8-u.txt"
00244 #define MAPPING_FILE_CP866 "cp866.txt"
00245 #define MAPPING_FILE_CP1251 "cp1251.txt"
00246
00247 #define MAPPING_FILE_8859_15 "8859-15.txt"
00248
00249 #define MAPPING_FILE_UTF_8 "UTF-8.txt"
00250 #endif
00251
00252
00253
00254
00255 extern void vASCII85EncodeByte(FILE *, int);
00256 extern void vASCII85EncodeArray(FILE *, FILE *, size_t);
00257 extern void vASCII85EncodeFile(FILE *, FILE *, size_t);
00258
00259 extern void vDestroyTextBlockList(void);
00260 extern BOOL bAdd2TextBlockList(const text_block_type *);
00261 extern void vSplitBlockList(FILE *, ULONG, ULONG, ULONG, ULONG, ULONG,
00262 ULONG, ULONG, ULONG, BOOL);
00263 extern BOOL bExistsHdrFtr(void);
00264 extern BOOL bExistsTextBox(void);
00265 extern BOOL bExistsHdrTextBox(void);
00266 extern USHORT usNextChar(FILE *, list_id_enum, ULONG *, ULONG *, USHORT *);
00267 extern USHORT usToHdrFtrPosition(FILE *, ULONG);
00268 extern USHORT usToFootnotePosition(FILE *, ULONG);
00269 extern ULONG ulCharPos2FileOffsetX(ULONG, list_id_enum *);
00270 extern ULONG ulCharPos2FileOffset(ULONG);
00271 extern ULONG ulHdrFtrOffset2CharPos(ULONG);
00272 extern ULONG ulGetSeqNumber(ULONG);
00273 #if defined(__riscos)
00274 extern ULONG ulGetDocumentLength(void);
00275 #endif
00276
00277 extern UCHAR ucGetBulletCharacter(conversion_type, encoding_type);
00278 extern UCHAR ucGetNbspCharacter(void);
00279 extern BOOL bReadCharacterMappingTable(FILE *);
00280 extern ULONG ulTranslateCharacters(USHORT, ULONG, int, conversion_type,
00281 encoding_type, BOOL);
00282 extern ULONG ulToUpper(ULONG);
00283
00284 extern void vDestroyDataBlockList(void);
00285 extern BOOL bAdd2DataBlockList(const data_block_type *);
00286 extern ULONG ulGetDataOffset(FILE *);
00287 extern BOOL bSetDataOffset(FILE *, ULONG);
00288 extern int iNextByte(FILE *);
00289 extern USHORT usNextWord(FILE *);
00290 extern ULONG ulNextLong(FILE *);
00291 extern USHORT usNextWordBE(FILE *);
00292 extern ULONG ulNextLongBE(FILE *);
00293 extern size_t tSkipBytes(FILE *, size_t);
00294 extern ULONG ulDataPos2FileOffset(ULONG);
00295
00296 extern void vDestroySmallBlockList(void);
00297 extern BOOL bCreateSmallBlockList(ULONG, const ULONG *, size_t);
00298 extern ULONG ulDepotOffset(ULONG, size_t);
00299
00300 extern BOOL bTranslateDIB(diagram_type *,
00301 FILE *, ULONG, const imagedata_type *);
00302 #if defined(__dos)
00303
00304 extern int iGetCodepage(void);
00305 #endif
00306
00307 extern void vDestroyDocumentInfoList(void);
00308 extern void vCreateDocumentInfoList(const document_block_type *);
00309 extern UCHAR ucGetDopHdrFtrSpecification(void);
00310
00311 extern BOOL bAddDummyImage(diagram_type *, const imagedata_type *);
00312 extern diagram_type *pCreateDiagram(const char *, const char *, FILE *);
00313 extern void vPrologue2(diagram_type *, int);
00314 extern void vMove2NextLine(diagram_type *, drawfile_fontref, USHORT);
00315 extern void vSubstring2Diagram(diagram_type *,
00316 char *, size_t, long, UCHAR, USHORT,
00317 drawfile_fontref, USHORT, USHORT);
00318 extern void vStartOfParagraph1(diagram_type *, long);
00319 extern void vStartOfParagraph2(diagram_type *);
00320 extern void vEndOfParagraph(diagram_type *, drawfile_fontref, USHORT, long);
00321 extern void vEndOfPage(diagram_type *, long, BOOL);
00322 extern void vSetHeaders(diagram_type *, USHORT);
00323 extern void vStartOfList(diagram_type *, UCHAR, BOOL);
00324 extern void vEndOfList(diagram_type *);
00325 extern void vStartOfListItem(diagram_type *, BOOL);
00326 extern void vEndOfTable(diagram_type *);
00327 extern BOOL bAddTableRow(diagram_type *, char **, int,
00328 const short *, UCHAR);
00329 #if defined(__riscos)
00330 extern BOOL bDestroyDiagram(event_pollblock *, void *);
00331 #if 0
00332 extern void vImage2Diagram(diagram_type *, const imagedata_type *,
00333 UCHAR *, size_t);
00334 #endif //0
00335 extern BOOL bVerifyDiagram(diagram_type *);
00336 extern void vShowDiagram(diagram_type *);
00337 extern void vMainButtonClick(mouse_block *);
00338 extern BOOL bMainKeyPressed(event_pollblock *, void *);
00339 extern BOOL bMainEventHandler(event_pollblock *, void *);
00340 extern BOOL bRedrawMainWindow(event_pollblock *, void *);
00341 extern BOOL bScaleOpenAction(event_pollblock *, void *);
00342 extern void vSetTitle(diagram_type *);
00343 extern void vScaleButtonClick(mouse_block *, diagram_type *);
00344 extern BOOL bScaleKeyPressed(event_pollblock *, void *);
00345 extern BOOL bScaleEventHandler(event_pollblock *, void *);
00346 #else
00347 extern void vImagePrologue(diagram_type *, const imagedata_type *);
00348 extern void vImageEpilogue(diagram_type *);
00349 extern void vDestroyDiagram(diagram_type *);
00350 #endif
00351
00352 extern BOOL bAddDataBlocks(ULONG , ULONG, ULONG, const ULONG *, size_t);
00353 extern BOOL bGet6DocumentData(FILE *, ULONG,
00354 const ULONG *, size_t, const UCHAR *);
00355
00356 extern BOOL bAddTextBlocks(ULONG , ULONG, BOOL,
00357 USHORT, ULONG, const ULONG *, size_t);
00358 extern BOOL bGet6DocumentText(FILE *, BOOL, ULONG,
00359 const ULONG *, size_t, const UCHAR *);
00360 extern BOOL bGet8DocumentText(FILE *, const pps_info_type *,
00361 const ULONG *, size_t, const ULONG *, size_t,
00362 const UCHAR *);
00363
00364 extern void vPrologueFMT(diagram_type *, const options_type *);
00365 extern void vSubstringFMT(diagram_type *, const char *, size_t, long,
00366 USHORT);
00367
00368 extern void vDestroyFontInfoList(void);
00369 extern void vCorrectFontValues(font_block_type *);
00370 extern void vAdd2FontInfoList(const font_block_type *);
00371 extern const font_block_type *pGetNextFontInfoListItem(
00372 const font_block_type *);
00373
00374 extern int iGetFontByNumber(UCHAR, USHORT);
00375 extern const char *szGetOurFontname(int);
00376 extern int iFontname2Fontnumber(const char *, USHORT);
00377 extern void vCreate0FontTable(void);
00378 extern void vCreate2FontTable(FILE *, int, const UCHAR *);
00379 extern void vCreate6FontTable(FILE *, ULONG,
00380 const ULONG *, size_t, const UCHAR *);
00381 extern void vCreate8FontTable(FILE *, const pps_info_type *,
00382 const ULONG *, size_t, const ULONG *, size_t,
00383 const UCHAR *);
00384 extern void vDestroyFontTable(void);
00385 extern const font_table_type *pGetNextFontTableRecord(
00386 const font_table_type *);
00387 extern size_t tGetFontTableLength(void);
00388 extern void vCorrectFontTable(conversion_type, encoding_type);
00389 extern long lComputeSpaceWidth(drawfile_fontref, USHORT);
00390
00391 extern FILE *pOpenFontTableFile(void);
00392 extern void vCloseFont(void);
00393 extern drawfile_fontref tOpenFont(UCHAR, USHORT, USHORT);
00394 extern drawfile_fontref tOpenTableFont(USHORT);
00395 extern long lComputeStringWidth(const char *, size_t, drawfile_fontref, USHORT);
00396 extern size_t tCountColumns(const char *, size_t);
00397 extern size_t tGetCharacterLength(const char *);
00398
00399 #if !defined(__riscos)
00400 extern const char *szGetFontname(drawfile_fontref);
00401 #endif
00402
00403 extern void vDestroyHdrFtrInfoList(void);
00404 extern void vCreat8HdrFtrInfoList(const ULONG *, size_t);
00405 extern void vCreat6HdrFtrInfoList(const ULONG *, size_t);
00406 extern void vCreat2HdrFtrInfoList(const ULONG *, size_t);
00407 extern const hdrftr_block_type *pGetHdrFtrInfo(int, BOOL, BOOL, BOOL);
00408 extern void vPrepareHdrFtrText(FILE *);
00409 #if defined(__riscos)
00410
00411 extern void vUpdateIcon(window_handle, icon_block *);
00412 extern void vUpdateRadioButton(window_handle, icon_handle, BOOL);
00413 extern void vUpdateWriteable(window_handle, icon_handle, const char *);
00414 extern void vUpdateWriteableNumber(window_handle, icon_handle, int);
00415 #endif
00416
00417 extern image_info_enum eExamineImage(FILE *, ULONG, imagedata_type *);
00418
00419 extern BOOL bTranslateImage(diagram_type *,
00420 FILE *, BOOL, ULONG, const imagedata_type *);
00421
00422 extern BOOL bTranslateJPEG(diagram_type *,
00423 FILE *, ULONG, size_t, const imagedata_type *);
00424
00425 extern void vDestroyListInfoList(void);
00426 extern void vBuildLfoList(const UCHAR *, size_t);
00427 extern void vAdd2ListInfoList(ULONG, USHORT, UCHAR,
00428 const list_block_type *);
00429 extern const list_block_type *pGetListInfo(USHORT, UCHAR);
00430 extern USHORT usGetListValue(int, int, const style_block_type *);
00431
00432 #if !defined(__riscos)
00433 extern const char *szGetHomeDirectory(void);
00434 extern const char *szGetAntiwordDirectory(void);
00435 #endif
00436 extern long lGetFilesize(const char *);
00437 #if defined(DEBUG)
00438 extern void vPrintBlock(const char *, int, const UCHAR *, size_t);
00439 extern void vPrintUnicode(const char *, int, const UCHAR *, size_t);
00440 extern BOOL bCheckDoubleLinkedList(output_type *);
00441 #endif
00442 extern BOOL bReadBytes(UCHAR *, size_t, ULONG, FILE *);
00443 extern BOOL bReadBuffer(FILE *, ULONG, const ULONG *, size_t, size_t,
00444 UCHAR *, ULONG, size_t);
00445 extern ULONG ulColor2Color(UCHAR);
00446 extern output_type *pSplitList(output_type *);
00447 extern size_t tNumber2Roman(UINT, BOOL, char *);
00448 extern size_t tNumber2Alpha(UINT, BOOL, char *);
00449 extern char *unincpy(char *, const UCHAR *, size_t);
00450 extern size_t unilen(const UCHAR *);
00451 extern const char *szBasename(const char *);
00452 extern long lComputeLeading(USHORT);
00453 extern size_t tUcs2Utf8(ULONG, char *, size_t);
00454 extern void vGetBulletValue(conversion_type, encoding_type, char *, size_t);
00455 extern BOOL bAllZero(const UCHAR *, size_t);
00456 extern BOOL bGetNormalizedCodeset(char *, size_t, BOOL *);
00457 extern const char *szGetDefaultMappingFile(void);
00458 extern time_t tConvertDTTM(ULONG);
00459
00460 extern void vDestroyNotesInfoLists(void);
00461 extern void vGetNotesInfo(FILE *, const pps_info_type *,
00462 const ULONG *, size_t, const ULONG *, size_t,
00463 const UCHAR *, int);
00464 extern void vPrepareFootnoteText(FILE *);
00465 extern const char *szGetFootnootText(UINT);
00466 extern notetype_enum eGetNotetype(ULONG);
00467
00468 extern int iReadOptions(int, char **);
00469 extern void vGetOptions(options_type *);
00470 #if defined(__riscos)
00471 extern void vChoicesOpenAction(window_handle);
00472 extern BOOL bChoicesMouseClick(event_pollblock *, void *);
00473 extern BOOL bChoicesKeyPressed(event_pollblock *, void *);
00474 #endif
00475
00476 extern void vSetLeftIndentation(diagram_type *, long);
00477 extern void vAlign2Window(diagram_type *, output_type *,
00478 long, UCHAR);
00479 extern void vJustify2Window(diagram_type *, output_type *,
00480 long, long, UCHAR);
00481 extern void vResetStyles(void);
00482 extern size_t tStyle2Window(char *, size_t, const style_block_type *,
00483 const section_block_type *);
00484 extern void vTableRow2Window(diagram_type *, output_type *,
00485 const row_block_type *, conversion_type, int);
00486
00487 extern void vCreateInfoDictionary(diagram_type *, int);
00488 extern void vProloguePDF(diagram_type *,
00489 const char *, const options_type *);
00490 extern void vEpiloguePDF(diagram_type *);
00491 extern void vImageProloguePDF(diagram_type *, const imagedata_type *);
00492 extern void vImageEpiloguePDF(diagram_type *);
00493 extern BOOL bAddDummyImagePDF(diagram_type *, const imagedata_type *);
00494 extern void vAddFontsPDF(diagram_type *);
00495 extern void vMove2NextLinePDF(diagram_type *, USHORT);
00496 extern void vSubstringPDF(diagram_type *,
00497 char *, size_t, long, UCHAR, USHORT,
00498 drawfile_fontref, USHORT, USHORT);
00499 extern void vStartOfParagraphPDF(diagram_type *, long);
00500 extern void vEndOfParagraphPDF(diagram_type *, USHORT, long);
00501 extern void vEndOfPagePDF(diagram_type *, BOOL);
00502
00503 extern void vDestroyPictInfoList(void);
00504 extern void vAdd2PictInfoList(const picture_block_type *);
00505 extern ULONG ulGetPictInfoListItem(ULONG);
00506
00507 extern BOOL bTranslatePNG(diagram_type *,
00508 FILE *, ULONG, size_t, const imagedata_type *);
00509
00510 extern void vProloguePS(diagram_type *,
00511 const char *, const char *, const options_type *);
00512 extern void vEpiloguePS(diagram_type *);
00513 extern void vImageProloguePS(diagram_type *, const imagedata_type *);
00514 extern void vImageEpiloguePS(diagram_type *);
00515 extern BOOL bAddDummyImagePS(diagram_type *, const imagedata_type *);
00516 extern void vAddFontsPS(diagram_type *);
00517 extern void vMove2NextLinePS(diagram_type *, USHORT);
00518 extern void vSubstringPS(diagram_type *,
00519 char *, size_t, long, UCHAR, USHORT,
00520 drawfile_fontref, USHORT, USHORT);
00521 extern void vStartOfParagraphPS(diagram_type *, long);
00522 extern void vEndOfParagraphPS(diagram_type *, USHORT, long);
00523 extern void vEndOfPagePS(diagram_type *, BOOL);
00524
00525 extern void vGet0DopInfo(FILE *, const UCHAR *);
00526 extern void vGet0SepInfo(FILE *, const UCHAR *);
00527 extern void vGet0PapInfo(FILE *, const UCHAR *);
00528 extern void vGet0ChrInfo(FILE *, const UCHAR *);
00529
00530 extern void vGet2DopInfo(FILE *, const UCHAR *);
00531 extern void vGet2SepInfo(FILE *, const UCHAR *);
00532 extern void vGet2HdrFtrInfo(FILE *, const UCHAR *);
00533 extern row_info_enum eGet2RowInfo(int,
00534 const UCHAR *, int, row_block_type *);
00535 extern void vGet2StyleInfo(int,
00536 const UCHAR *, int, style_block_type *);
00537 extern void vGet2PapInfo(FILE *, const UCHAR *);
00538 extern void vGet1FontInfo(int,
00539 const UCHAR *, size_t, font_block_type *);
00540 extern void vGet2FontInfo(int,
00541 const UCHAR *, size_t, font_block_type *);
00542 extern void vGet2ChrInfo(FILE *, int, const UCHAR *);
00543
00544 extern void vGet6DopInfo(FILE *, ULONG, const ULONG *, size_t,
00545 const UCHAR *);
00546 extern void vGet6SepInfo(FILE *, ULONG, const ULONG *, size_t,
00547 const UCHAR *);
00548 extern void vGet6HdrFtrInfo(FILE *, ULONG, const ULONG *, size_t,
00549 const UCHAR *);
00550 extern row_info_enum eGet6RowInfo(int,
00551 const UCHAR *, int, row_block_type *);
00552 extern void vGet6StyleInfo(int,
00553 const UCHAR *, int, style_block_type *);
00554 extern void vGet6PapInfo(FILE *, ULONG, const ULONG *, size_t,
00555 const UCHAR *);
00556 extern void vGet6FontInfo(int, USHORT,
00557 const UCHAR *, int, font_block_type *);
00558 extern void vGet6ChrInfo(FILE *, ULONG, const ULONG *, size_t,
00559 const UCHAR *);
00560
00561 extern void vGet8DopInfo(FILE *, const pps_type *,
00562 const ULONG *, size_t, const ULONG *, size_t,
00563 const UCHAR *);
00564 extern void vGet8SepInfo(FILE *, const pps_info_type *,
00565 const ULONG *, size_t, const ULONG *, size_t,
00566 const UCHAR *);
00567 extern void vGet8HdrFtrInfo(FILE *, const pps_type *,
00568 const ULONG *, size_t, const ULONG *, size_t,
00569 const UCHAR *);
00570 extern row_info_enum eGet8RowInfo(int,
00571 const UCHAR *, int, row_block_type *);
00572 extern void vGet8StyleInfo(int,
00573 const UCHAR *, int, style_block_type *);
00574 extern void vGet8LstInfo(FILE *, const pps_info_type *,
00575 const ULONG *, size_t, const ULONG *, size_t,
00576 const UCHAR *);
00577 extern void vGet8PapInfo(FILE *, const pps_info_type *,
00578 const ULONG *, size_t, const ULONG *, size_t,
00579 const UCHAR *);
00580 extern void vGet8FontInfo(int, USHORT,
00581 const UCHAR *, int, font_block_type *);
00582 extern void vGet8ChrInfo(FILE *, const pps_info_type *,
00583 const ULONG *, size_t, const ULONG *, size_t,
00584 const UCHAR *);
00585
00586 extern void vGetPropertyInfo(FILE *, const pps_info_type *,
00587 const ULONG *, size_t, const ULONG *, size_t,
00588 const UCHAR *, int);
00589 extern row_info_enum ePropMod2RowInfo(USHORT, int);
00590
00591 extern void vDestroyPropModList(void);
00592 extern void vAdd2PropModList(const UCHAR *);
00593 extern const UCHAR *aucReadPropModListItem(USHORT);
00594
00595 extern void vDestroyRowInfoList(void);
00596 extern void vAdd2RowInfoList(const row_block_type *);
00597 extern const row_block_type *pGetNextRowInfoListItem(void);
00598
00599 #if defined(__riscos)
00600 extern int iGetFiletype(const char *);
00601 extern void vSetFiletype(const char *, int);
00602 extern BOOL bMakeDirectory(const char *);
00603 extern int iReadCurrentAlphabetNumber(void);
00604 extern int iGetRiscOsVersion(void);
00605 extern BOOL bDrawRenderDiag360(void *, size_t,
00606 window_redrawblock *, double, os_error *);
00607 #if defined(DEBUG)
00608 extern BOOL bGetJpegInfo(UCHAR *, size_t);
00609 #endif
00610 #endif
00611
00612 #if defined(__riscos)
00613 extern BOOL bSaveTextfile(event_pollblock *, void *);
00614 extern BOOL bSaveDrawfile(event_pollblock *, void *);
00615 #endif
00616
00617 extern void vDestroySectionInfoList(void);
00618 extern void vAdd2SectionInfoList(const section_block_type *, ULONG);
00619 extern void vGetDefaultSection(section_block_type *);
00620 extern void vDefault2SectionInfoList(ULONG);
00621 extern const section_block_type *
00622 pGetSectionInfo(const section_block_type *, ULONG);
00623 extern size_t tGetNumberOfSections(void);
00624 extern UCHAR ucGetSepHdrFtrSpecification(size_t);
00625
00626 extern void vDestroyStyleInfoList(void);
00627 extern level_type_enum eGetNumType(UCHAR);
00628 extern void vCorrectStyleValues(style_block_type *);
00629 extern void vAdd2StyleInfoList(const style_block_type *);
00630 extern const style_block_type *pGetNextStyleInfoListItem(
00631 const style_block_type *);
00632 extern const style_block_type *pGetNextTextStyle(const style_block_type *);
00633 extern USHORT usGetIstd(ULONG);
00634 extern BOOL bStyleImpliesList(const style_block_type *, int);
00635
00636 extern void vDestroyStylesheetList(void);
00637 extern USHORT usStc2istd(UCHAR);
00638 extern void vGet2Stylesheet(FILE *, int, const UCHAR *);
00639 extern void vGet6Stylesheet(FILE *, ULONG, const ULONG *, size_t,
00640 const UCHAR *);
00641 extern void vGet8Stylesheet(FILE *, const pps_info_type *,
00642 const ULONG *, size_t, const ULONG *, size_t,
00643 const UCHAR *);
00644 extern void vFillStyleFromStylesheet(USHORT, style_block_type *);
00645 extern void vFillFontFromStylesheet(USHORT, font_block_type *);
00646
00647 extern void vDestroySummaryInfo(void);
00648 extern void vSet0SummaryInfo(FILE *, const UCHAR *);
00649 extern void vSet2SummaryInfo(FILE *, int, const UCHAR *);
00650 extern void vSet6SummaryInfo(FILE *, const pps_info_type *,
00651 const ULONG *, size_t, const ULONG *, size_t,
00652 const UCHAR *);
00653 extern void vSet8SummaryInfo(FILE *, const pps_info_type *,
00654 const ULONG *, size_t, const ULONG *, size_t,
00655 const UCHAR *);
00656 extern const char *szGetTitle(void);
00657 extern const char *szGetSubject(void);
00658 extern const char *szGetAuthor(void);
00659 extern const char *szGetLastSaveDtm(void);
00660 extern const char *szGetModDate(void);
00661 extern const char *szGetCreationDate(void);
00662 extern const char *szGetCompany(void);
00663 extern const char *szGetLanguage(void);
00664
00665 extern void vSetDefaultTabWidth(FILE *, const pps_info_type *,
00666 const ULONG *, size_t, const ULONG *, size_t,
00667 const UCHAR *, int);
00668 extern long lGetDefaultTabWidth(void);
00669
00670 extern void vPrologueTXT(diagram_type *, const options_type *);
00671 extern void vEpilogueTXT(FILE *);
00672 extern void vMove2NextLineTXT(diagram_type *);
00673 extern void vSubstringTXT(diagram_type *, const char *, size_t, long);
00674 extern void vStartOfParagraphTXT(diagram_type *, long);
00675 extern void vEndOfParagraphTXT(diagram_type *, long);
00676 extern void vEndOfPageTXT(diagram_type *, long);
00677
00678 extern void werr(int, const char *, ...);
00679 #if !defined(__riscos)
00680 extern void Hourglass_On(void);
00681 extern void Hourglass_Off(void);
00682 #endif
00683
00684 #if !defined(__riscos)
00685 extern long utf8_strwidth(const char *, size_t);
00686 extern int utf8_chrlength(const char *);
00687 extern BOOL is_locale_utf8(void);
00688 #endif
00689
00690 extern BOOL bOutputContainsText(const output_type *);
00691 extern BOOL bWordDecryptor(FILE *, long, diagram_type *);
00692 extern output_type *pHdrFtrDecryptor(FILE *, ULONG, ULONG);
00693 extern char *szFootnoteDecryptor(FILE *, ULONG, ULONG);
00694
00695 extern int iInitDocumentDOS(FILE *, long);
00696
00697 extern BOOL bIsWordForDosFile(FILE *, long);
00698 extern BOOL bIsRtfFile(FILE *);
00699 extern BOOL bIsWordPerfectFile(FILE *);
00700 extern BOOL bIsWinWord12File(FILE *, long);
00701 extern BOOL bIsMacWord45File(FILE *);
00702 extern int iGuessVersionNumber(FILE *, long);
00703 extern int iGetVersionNumber(const UCHAR *);
00704 extern BOOL bIsOldMacFile(void);
00705 extern int iInitDocument(FILE *, long);
00706 extern void vFreeDocument(void);
00707
00708 extern int iInitDocumentMAC(FILE *, long);
00709
00710 extern int iInitDocumentOLE(FILE *, long);
00711
00712 extern int iInitDocumentWIN(FILE *, long);
00713
00714 extern void *xmalloc(size_t);
00715 extern void *xcalloc(size_t, size_t);
00716 extern void *xrealloc(void *, size_t);
00717 extern char *xstrdup(const char *);
00718 extern void *xfree(void *);
00719
00720 extern void vCreateBookIntro(diagram_type *, int);
00721 extern void vPrologueXML(diagram_type *, const options_type *);
00722 extern void vEpilogueXML(diagram_type *);
00723 extern void vMove2NextLineXML(diagram_type *);
00724 extern void vSubstringXML(diagram_type *,
00725 const char *, size_t, long, USHORT);
00726 extern void vStartOfParagraphXML(diagram_type *, UINT);
00727 extern void vEndOfParagraphXML(diagram_type *, UINT);
00728 extern void vEndOfPageXML(diagram_type *);
00729 extern void vSetHeadersXML(diagram_type *, USHORT);
00730 extern void vStartOfListXML(diagram_type *, UCHAR, BOOL);
00731 extern void vEndOfListXML(diagram_type *);
00732 extern void vStartOfListItemXML(diagram_type *, BOOL);
00733 extern void vEndOfTableXML(diagram_type *);
00734 extern void vAddTableRowXML(diagram_type *, char **, int,
00735 const short *, UCHAR);
00736
00737 #endif